 |
MeshLib C++ Docs
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
9#define RUN_TEST( func ) \
10 printf( "%s ...\n", #func ); \
12 struct timespec ts1 = timespec_now(); \
14 struct timespec ts2 = timespec_now(); \
15 struct timespec duration = timespec_get_duration( &ts1, &ts2 ); \
16 printf( "%s done (%.3f s)\n", #func, timespec_to_seconds( &duration ) ); \
19#define TEST_ASSERT( ... ) \
20 if ( !( __VA_ARGS__ ) ) \
22 fprintf( stderr, "%s:%d: check failed: %s\n", __func__, __LINE__, ( #__VA_ARGS__ ) ); \
26#define TEST_ASSERT_INT_EQUAL( val, exp ) \
27 if ( !( val == exp ) ) \
29 fprintf( stderr, "%s:%d: check failed: expected %d, got %d\n", __func__, __LINE__, exp, val ); \
33#define TEST_ASSERT_FLOAT_EQUAL_APPROX( val, exp, eps ) \
34 if ( !( fabs( val - exp ) <= eps ) ) \
36 fprintf( stderr, "%s:%d: check failed: expected %f (delta %f), got %f (delta %f)\n", __func__, __LINE__, exp, eps, val, fabs( val - exp ) ); \