Next: TEST_PASS, Previous: Test Macros, Up: Test Macros
test an expression against a value
#include <testlib.h> TEST(desc, expr, res ) TEST_LINE(line, desc, expr, res )
- line
- the line number to output
- desc
- a short description of the test being performed
- expr
- an expression to evaluate
- res
- the expected result of the expression
TEST
is called to perform a test of an expression against an
expected result. It essentially performs the test expr ==
res .
TEST( "+= operator, length", hh.get_length(), ff.get_length() + gg.get_length() - 1 );