]> granicus.if.org Git - check/commitdiff
replace usage of fail_if(expr, msg) with ck_assert_msg(!expr, msg)
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sun, 4 Nov 2012 03:27:43 +0000 (03:27 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sun, 4 Nov 2012 03:27:43 +0000 (03:27 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@654 64e312b2-a51f-0410-8e61-82d0ca0eb02a

tests/check_check_log_internal.c
tests/check_check_master.c
tests/check_check_selective.c

index 5f30cb78a7d9c2310e7dfa2d53d00090d0b8253e..d8de21875a193e19d1d16cee31aa3c5617beb104 100644 (file)
@@ -23,9 +23,9 @@ START_TEST(test_init_logging_subunit)
   SRunner *sr = srunner_create(s);
   srunner_init_logging(sr, CK_SUBUNIT);
   list_front (sr->loglst);
-  fail_if (list_at_end(sr->loglst), "No entries in log list");
+  ck_assert_msg (!list_at_end(sr->loglst), "No entries in log list");
   first_log = list_val(sr->loglst);
-  fail_if (first_log == NULL, "log is NULL");
+  ck_assert_msg (first_log != NULL, "log is NULL");
   list_advance(sr->loglst);
   ck_assert_msg(list_at_end(sr->loglst), "More than one entry in log list");
   ck_assert_msg(first_log->lfun == subunit_lfun,
index 2a6fc96e9ae31ae6d17084a48c8a6bd1e3c92020..5e7c1c946be560d2bc78ab9d0c30fed0735bfb7c 100644 (file)
@@ -160,7 +160,7 @@ START_TEST(test_check_failure_msgs)
       continue;
     }
 
-    fail_if(i - passed > sub_nfailed, NULL);
+    ck_assert_msg(i - passed <= sub_nfailed, NULL);
     tr = tr_fail_array[i - passed];
     ck_assert_msg(tr != NULL, NULL);
     got_msg = tr_msg(tr);
@@ -189,7 +189,7 @@ START_TEST(test_check_failure_lnos)
       continue;
     }
 
-    fail_if(i - passed > sub_nfailed, NULL);
+    ck_assert_msg(i - passed <= sub_nfailed, NULL);
     tr = tr_fail_array[i - passed];
     ck_assert_msg(tr != NULL, NULL);
     line_no = master_tests_lineno[i];
@@ -216,7 +216,7 @@ START_TEST(test_check_failure_ftypes)
       continue;
     }
 
-    fail_if(i - passed > sub_nfailed, NULL);
+    ck_assert_msg(i - passed <= sub_nfailed, NULL);
     tr = tr_fail_array[i - passed];
     ck_assert_msg(tr != NULL, NULL);
     ck_assert_msg(master_tests[i].failure_type == tr_rtype(tr),
index 90a5e43d4ef29cecb1fb3c9aedebdc9af3691a99..643733833b747420bf43fa027be06fb75b73f228 100644 (file)
@@ -116,9 +116,9 @@ START_TEST(test_srunner_run_no_suite)
                NULL, /* NULL tcase name. */
                CK_VERBOSE);
   
-  fail_if (test_tc11_executed
+  ck_assert_msg (!(test_tc11_executed
            || test_tc12_executed
-           || test_tc21_executed,
+           || test_tc21_executed),
            "An unexpected test was executed.");
 
   reset_executed ();
@@ -152,9 +152,9 @@ START_TEST(test_srunner_no_tcase)
                "non-existant-test-case",
                CK_VERBOSE);
 
-  fail_if (test_tc11_executed
+  ck_assert_msg (!(test_tc11_executed
            || test_tc12_executed
-           || test_tc21_executed,
+           || test_tc21_executed),
            "An unexpected test was executed.");
 
   reset_executed ();
@@ -188,9 +188,9 @@ START_TEST(test_srunner_suite_no_tcase)
                "non-existant-test-case",
                CK_VERBOSE);
 
-  fail_if (test_tc11_executed
+  ck_assert_msg (!(test_tc11_executed
            || test_tc12_executed
-           || test_tc21_executed,
+           || test_tc21_executed),
            "An unexpected test was executed.");
 
   reset_executed ();
@@ -222,9 +222,9 @@ START_TEST(test_srunner_run_no_suite_env)
   setenv ("CK_RUN_SUITE", "non-existing-suite", 1);
   srunner_run_all (sr, CK_VERBOSE);
   
-  fail_if (test_tc11_executed
+  ck_assert_msg (!(test_tc11_executed
            || test_tc12_executed
-           || test_tc21_executed,
+           || test_tc21_executed),
            "An unexpected test was executed.");
 
   reset_executed ();
@@ -256,9 +256,9 @@ START_TEST(test_srunner_no_tcase_env)
   setenv ("CK_RUN_CASE", "non-existant-test-case", 1);
   srunner_run_all (sr, CK_VERBOSE);
 
-  fail_if (test_tc11_executed
+  ck_assert_msg (!(test_tc11_executed
            || test_tc12_executed
-           || test_tc21_executed,
+           || test_tc21_executed),
            "An unexpected test was executed.");
 
   reset_executed ();
@@ -293,9 +293,9 @@ START_TEST(test_srunner_suite_no_tcase_env)
   setenv ("CK_RUN_CASE", "non-existant-test-case", 1);
   srunner_run_all (sr, CK_VERBOSE);
 
-  fail_if (test_tc11_executed
+  ck_assert_msg (!(test_tc11_executed
            || test_tc12_executed
-           || test_tc21_executed,
+           || test_tc21_executed),
            "An unexpected test was executed.");
 
   reset_executed ();