The main test method is to write a part of the call according to the object to be tested.CodeAnd check the code. Check the code first to generate the expected value, and then call the assert macro check provided by cppunit. The macro provided by cppunit is as following
A) cppunit_assert (condition): determines whether the value of condition is true. If it is false, an error message is generated.
B)
C) cppunit_assert_message (message, condition): similar to cppunit_assert, but the messsage information is reported when the result is false.
D)
E) cppunit_fail (Message): directly reports the messsage error message.
F)
G) cppunit_assert_equal (expected, actual): determines whether the values of expected and actual are equal, if not, the output error message.
H)
I) cppunit_assert_cmd_message (message, expected, actual): similar to cppunit_assert_equal, but the message is output when the assertion fails.
J)
K) cppunit_assert_doubles_equal (expected, actual, Delta): determines whether the deviation between expected and actual is less than delta, used for floating point comparison.
L)
M) cppunit_assert_throw (expression, exceptiontype): determines whether to throw the exceptiontype exception after executing expression.
N)
O) cppunit_assert_no_throw (expression): No exception is thrown after the expression is executed by the assertion.