1 # Functions to assert that a condition is true or false in C tests
3 # Macros to pass file name and line number (in user files [TOFIX])
4 #define ASSERT_TRUE(x,y) assertTrue(__FILE__,__LINE__,x,y)
5 #define ASSERT_FALSE(x,y) assertFalse(__FILE__,__LINE__,x,y)
11 // Functions to assert that a condition is true or false [to be extended]
12 void assertTrue(char* fileName, int lineNumber, int condition, char* message) {
14 printf(">>> Failure in file %s at line %i: %s\\n", fileName, lineNumber, message);
18 void assertFalse(char* fileName, int lineNumber, int condition, char* message) {
19 assertTrue(fileName, lineNumber, !condition, message);