Previous: TESTSTRING, Up: Test Macros
Execute a statement, then test an expression against a value
#include <testlib.h> TEST_RUN(desc, stmt, expr, res ) TEST_RUN_LINE(line, desc, stmt, expr, res )
- line
- the line number to output
- desc
- a short description of the test being performed
- stmt
- a statement to be executed, independent of the expression. the statement may be arbitrarily complex.
- expr
- an expression to evaluate
- res
- the expected result of the expression
TEST_RUN
is called to determine the equivalence of an
expression with an expected result. The supplied stmt is
first executed.
TEST_RUN( "equiv", foo(&x), 33 * x, 36 );