Skip to content

Instantly share code, notes, and snippets.

Ctest assert
#define REQUIRE( ... ) \
do { \
if( !( __VA_ARGS__ ) ) { \
std::stringstream ss; \
ss << "Unit test assert [ " \
<< ( #__VA_ARGS__ ) \
<< " ] failed in line [ " \
<< __LINE__ \
<< " ] file [ " \
<< __FILE__ << " ]" \
<< std::endl; \
throw std::runtime_error(ss.str()); \
} \
} while( false )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment