RITestingMacros.h
Go to the documentation of this file.00001
00002 #define TEST_ASSERT(condition) \
00003 if(!(condition)) \
00004 { \
00005 std::cerr << "Assertion failed in " << __FILE__ << \
00006 " at " << __LINE__ << std::endl; \
00007 std::cerr << #condition << std::endl; \
00008 return EXIT_FAILURE; \
00009 }
00010
00011 #define TEST_ASSERT_EQUALS_VEC_3(vec, x, y, z) \
00012 if((vec)[0] != (x) || \
00013 (vec)[1] != (y) || \
00014 (vec)[2] != (z)) \
00015 { \
00016 std::cerr << "Assertion failed in " << __FILE__ << \
00017 " at " << __LINE__ << std::endl; \
00018 std::cerr << #vec << " was " << (vec) << std::endl; \
00019 std::cerr << "expected: " << (x) << ", " << \
00020 (y) << ", " << (z) << std::endl; \
00021 return EXIT_FAILURE; \
00022 }
00023