void CuTestInit(CuTest *t, const char *name, TestFunction function) { t->name = CuStrCopy(name); t->failed = 0; t->ran = 0; t->message = NULL; t->function = function; t->jumpBuf = NULL; }
void CuTestInit(CuTest* t, const char* name, TestFunction function, TestSetupFunction setup, TestTeardownFunction teardown) { t->name = CuStrCopy(name); t->failed = 0; t->ran = 0; t->message = NULL; t->function = function; t->jumpBuf = NULL; t->TestSetup = setup; t->TestTeardown = teardown; }
void TestCuStrCopy(CuTest* tc) { const char* old = "hello world"; const char* newStr = CuStrCopy(old); CuAssert(tc, "old is new", strcmp(old, newStr) == 0); }