@ -92,7 +92,7 @@ static const char* arg_extension(const char* basename) {
result = basename + strlen(basename);
/* special case: empty extensions (eg "foo.","foo..") are not considered as true extensions */
if (basename && result && result[1] == '\0')
if (basename && result && strlen(result) == 1)
return result;
@ -273,6 +273,7 @@ void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2) {
CuTest* testCase = testSuite2->list[i];
CuSuiteAdd(testSuite, testCase);
}
free(testSuite2);
void CuSuiteRun(CuSuite* testSuite) {
@ -67,8 +67,12 @@ int RunAllTests(void) {
CuSuiteSummary(suite, output);
CuSuiteDetails(suite, output);
printf("%s\n", output->buffer);
CuStringDelete(output);
return suite->failCount;
int failCount = suite->failCount;
CuSuiteDelete(suite);
return failCount;
int main(void) {
@ -78,6 +78,7 @@ void test_argcmd_basic_001(CuTest* tc) {
CuAssertIntEquals(tc, 1, err);
CuAssertTrue(tc, strcmp(arg_dstr_cstr(res), "cmd1 fail") == 0);
arg_dstr_destroy(res);
arg_cmd_uninit();