我的代码如下所示:
#include <CUnit/CUnit.h>
int maxi(int i1, int i2)
{
return (i1 > i2) ? i1 : i2;
}
void test_maxi(void)
{
CU_ASSERT(maxi(0,2) == 2);
}
int main() {
test_maxi();
return 0;
}
gcc test.c -o test -lcunit
我在 Ubuntu 上使用它编译它。
尝试启动它时出现此错误:
测试:TestRun.c:159:CU_assertImplementation:断言“((void *)0)!= f_pCurSuite”失败。中止(核心转储)
这是什么意思?我在互联网上一无所获。