FUNCTION
This module consists of a number of assertion functions. You use these functions to create testcases. A testcase will consist of a number of assertions. Each assertion must be true for a testcase to succeed. Currently the following assertions are supported: o RBT_Assert -- assert an expression is non-zero.
TODO
Implement RBT_AssertEqual -- assert two interger values are equal RBT_AssertSEqual -- assert two strings are equal RBT_AssertFEqual -- assert two floats are equal
FUNCTION
Assert that an experssion is non-zero. This function should not be called directly, but the macro RBT_Assert should be used instead.
INPUTS
o line_number -- the line number the assertion is made o file_name -- the name of the file in which the assertion is made. o experssion -- the expression as an ascii string. o value -- the value of the expression.
SOURCE
void RBT_Assert_Func( int line_number, char* file_name, char* expression, long value ) { if ( value ) { printf( "OK: %s\n", expression ); } else { printf( "FAIL: %s(%d) %s\n", file_name, line_number, expression ); } }