*/
extern jmp_buf _ccunit_runTest_env;
+extern CCUnitTestFailure* _ccunit_testFailure;
void ccunit_assert (const char* file, unsigned int line,
bool cond, const char* condstr)
{
- CCUnitTestFailure* f;
if (cond)
return;
- f = ccunit_newTestFailure (file, line, condstr, NULL, NULL);
- longjmp (_ccunit_runTest_env, (int)f);
+ _ccunit_testFailure = ccunit_newTestFailure (file, line, condstr, NULL, NULL);
+ longjmp (_ccunit_runTest_env, 1);
}
/**
{ \
const char* ex = TYP ## _to_string (expect); \
const char* ac = TYP ## _to_string (actual); \
- CCUnitTestFailure* f; \
- f = ccunit_newTestFailure (file, line, condstr, ex, ac); \
- safe_free ((char*)ex); \
- safe_free ((char*)ac); \
- assert (f != NULL); \
- longjmp (_ccunit_runTest_env, (int)f); \
+ _ccunit_testFailure = ccunit_newTestFailure (file, line, condstr, ex, ac); \
+ safe_free (ex); \
+ safe_free (ac); \
+ assert (_ccunit_testFailure != NULL); \
+ longjmp (_ccunit_runTest_env, 1); \
} \
}
: to_string (expect));
char* ac = (!to_string ? _ccunit_ptr_t_to_string (actual)
: to_string (actual));
- CCUnitTestFailure* f;
- f = ccunit_newTestFailure (file, line, condstr, ex, ac);
+ _ccunit_testFailure = ccunit_newTestFailure (file, line, condstr, ex, ac);
safe_free (ex);
safe_free (ac);
- assert (f != NULL);
- longjmp (_ccunit_runTest_env, (int)f);
+ assert (_ccunit_testFailure != NULL);
+ longjmp (_ccunit_runTest_env, 1);
}
}