Browse Source

Merge branch 'master' of https://github.com/argtable/argtable3

pull/59/head
Tom G. Huang 5 years ago
parent
commit
de1ee340f7
  1. 2
      src/arg_file.c
  2. 1
      tests/CuTest.c
  3. 6
      tests/testall.c
  4. 1
      tests/testargcmd.c

2
src/arg_file.c

@ -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)
result = basename + strlen(basename);
return result;

1
tests/CuTest.c

@ -273,6 +273,7 @@ void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2) {
CuTest* testCase = testSuite2->list[i];
CuSuiteAdd(testSuite, testCase);
}
free(testSuite2);
}
void CuSuiteRun(CuSuite* testSuite) {

6
tests/testall.c

@ -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) {

1
tests/testargcmd.c

@ -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();
}

Loading…
Cancel
Save