|
CPPUNIT_ASSERT_EQUAL(expected,actual) //expected预期结果,actual实际结果,不相等时失败
CPPUNIT_ASSERT_EQUAL_MESSAGE(message, expected,actual) // 失败的同时打印message
CPPUNIT_ASSERT(condition) // condition 为假时失败
CPPUNIT_ASSERT_MESSAGE(message, condition ) // 当condition为假时失败, 并打印message
CPPUNIT_FAIL(message) // 测试失败, 并打印message
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected,actual, delta) // expected,actual之差大于delta时失败
可以去看看与断言相关的部分源码:
Asserter.h,Asserter.cpp
TestAssert.h,TestAssert.cpp |
|