Merge branch 'master' of ssh://box/var/lib/git/libucore

This commit is contained in:
Nils O. Selåsdal
2014-02-19 00:40:33 +01:00
2 changed files with 8 additions and 3 deletions
+3 -3
View File
@@ -32,7 +32,7 @@ START_TEST (test_dstr_basics)
ck_assert_str_eq(uc_dstr_str(&str), ""); ck_assert_str_eq(uc_dstr_str(&str), "");
uc_dstr_reset(&str); uc_dstr_reset(&str);
ck_assert_int_gt(uc_dstr_available(&str), 0); fail_if(uc_dstr_available(&str) <= 0);
s = uc_dstr_put(&str, 2); s = uc_dstr_put(&str, 2);
fail_if(s == NULL); fail_if(s == NULL);
@@ -130,11 +130,11 @@ START_TEST (test_dstr_sprintf)
uc_dstr_init(&str); uc_dstr_init(&str);
rc = uc_dstr_sprintf(&str, "%d-%d-%d", 1, 2, 3); rc = uc_dstr_sprintf(&str, "%d-%d-%d", 1, 2, 3);
ck_assert_int_gt(rc, 0); fail_if(rc <= 0);
ck_assert_str_eq(uc_dstr_str(&str), "1-2-3"); ck_assert_str_eq(uc_dstr_str(&str), "1-2-3");
rc = uc_dstr_sprintf(&str, " Another, bigger %s.", "string"); rc = uc_dstr_sprintf(&str, " Another, bigger %s.", "string");
ck_assert_int_gt(rc, 0); fail_if(rc <= 0);
ck_assert_str_eq(uc_dstr_str(&str), "1-2-3 Another, bigger string."); ck_assert_str_eq(uc_dstr_str(&str), "1-2-3 Another, bigger string.");
uc_dstr_destroy(&str); uc_dstr_destroy(&str);
+5
View File
@@ -94,8 +94,13 @@ main (int argc, char *argv[])
if (test_case == NULL) { if (test_case == NULL) {
srunner_run_all (sr, CK_VERBOSE); srunner_run_all (sr, CK_VERBOSE);
} else { } else {
#if CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION == 9 && CHECK_MICRO_VERSION <= 8
printf("Sorry, this libcheck version does not support running individual test cases");
return 3;
#else
printf("Running %s only\n", test_case); printf("Running %s only\n", test_case);
srunner_run(sr, NULL, test_case, CK_VERBOSE); srunner_run(sr, NULL, test_case, CK_VERBOSE);
#endif
} }
number_failed = srunner_ntests_failed (sr); number_failed = srunner_ntests_failed (sr);
srunner_free (sr); srunner_free (sr);