Next: , Previous: Test Macros, Up: Test Macros


3.2.1 TEST

test an expression against a value

Synopsis

     #include <testlib.h>
     
     TEST(desc, expr, res )
     TEST_LINE(line, desc, expr, res )

Parameters

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

Description

TEST is called to perform a test of an expression against an expected result. It essentially performs the test expr == res .

Example

     TEST( "+= operator, length",
             hh.get_length(), ff.get_length() + gg.get_length() - 1 );