From: brarcher Date: Mon, 23 Jun 2014 04:13:21 +0000 (+0000) Subject: Case void* to goal container after using Check's lists X-Git-Tag: 0.10.0~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=05c6ef2cd81443b3b3f37d454db6906bf459c8e6;p=check Case void* to goal container after using Check's lists These changes were necessary to get Check to compile with a c++ compiler. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1157 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/src/check.c b/src/check.c index 7310846..367477b 100644 --- a/src/check.c +++ b/src/check.c @@ -80,7 +80,7 @@ int suite_tcase(Suite * s, const char *tcname) l = s->tclst; for(check_list_front(l); !check_list_at_end(l); check_list_advance(l)) { - tc = check_list_val(l); + tc = (TCase *)check_list_val(l); if(strcmp(tcname, tc->name) == 0) return 1; } @@ -97,7 +97,7 @@ static void suite_free(Suite * s) l = s->tclst; for(check_list_front(l); !check_list_at_end(l); check_list_advance(l)) { - tcase_free(check_list_val(l)); + tcase_free((TCase *)check_list_val(l)); } check_list_free(s->tclst); free(s); @@ -359,14 +359,14 @@ void srunner_free(SRunner * sr) l = sr->slst; for(check_list_front(l); !check_list_at_end(l); check_list_advance(l)) { - suite_free(check_list_val(l)); + suite_free((Suite *)check_list_val(l)); } check_list_free(sr->slst); l = sr->resultlst; for(check_list_front(l); !check_list_at_end(l); check_list_advance(l)) { - tr = check_list_val(l); + tr = (TestResult *)check_list_val(l); tr_free(tr); } check_list_free(sr->resultlst); @@ -396,7 +396,7 @@ TestResult **srunner_failures(SRunner * sr) for(check_list_front(rlst); !check_list_at_end(rlst); check_list_advance(rlst)) { - TestResult *tr = check_list_val(rlst); + TestResult *tr = (TestResult *)check_list_val(rlst); if(non_pass(tr->rtype)) trarray[i++] = tr; @@ -417,7 +417,7 @@ TestResult **srunner_results(SRunner * sr) for(check_list_front(rlst); !check_list_at_end(rlst); check_list_advance(rlst)) { - trarray[i++] = check_list_val(rlst); + trarray[i++] = (TestResult *)check_list_val(rlst); } return trarray; } diff --git a/src/check_log.c b/src/check_log.c index a1967e4..74548b9 100644 --- a/src/check_log.c +++ b/src/check_log.c @@ -169,7 +169,7 @@ static void srunner_send_evt(SRunner * sr, void *obj, enum cl_event evt) l = sr->loglst; for(check_list_front(l); !check_list_at_end(l); check_list_advance(l)) { - lg = check_list_val(l); + lg = (Log *)check_list_val(l); fflush(lg->lfile); lg->lfun(sr, lg->lfile, lg->mode, obj, evt); fflush(lg->lfile); @@ -539,7 +539,7 @@ void srunner_end_logging(SRunner * sr) l = sr->loglst; for(check_list_front(l); !check_list_at_end(l); check_list_advance(l)) { - Log *lg = check_list_val(l); + Log *lg = (Log *)check_list_val(l); if(lg->close) { diff --git a/src/check_print.c b/src/check_print.c index e640013..02762e5 100644 --- a/src/check_print.c +++ b/src/check_print.c @@ -86,7 +86,7 @@ static void srunner_fprint_results(FILE * file, SRunner * sr, for(check_list_front(resultlst); !check_list_at_end(resultlst); check_list_advance(resultlst)) { - TestResult *tr = check_list_val(resultlst); + TestResult *tr = (TestResult *)check_list_val(resultlst); tr_fprint(file, tr, print_mode); } diff --git a/src/check_run.c b/src/check_run.c index 5d8ca3c..94486bc 100644 --- a/src/check_run.c +++ b/src/check_run.c @@ -145,7 +145,7 @@ static void srunner_iterate_suites(SRunner * sr, for(check_list_front(slst); !check_list_at_end(slst); check_list_advance(slst)) { - Suite *s = check_list_val(slst); + Suite *s = (Suite *)check_list_val(slst); if(((sname != NULL) && (strcmp(sname, s->name) != 0)) || ((tcname != NULL) && (!suite_tcase(s, tcname)))) @@ -158,7 +158,7 @@ static void srunner_iterate_suites(SRunner * sr, for(check_list_front(tcl); !check_list_at_end(tcl); check_list_advance(tcl)) { - tc = check_list_val(tcl); + tc = (TCase *)check_list_val(tcl); if((tcname != NULL) && (strcmp(tcname, tc->name) != 0)) { @@ -185,7 +185,7 @@ static void srunner_iterate_tcase_tfuns(SRunner * sr, TCase * tc) { int i; - tfun = check_list_val(tfl); + tfun = (TF *)check_list_val(tfl); for(i = tfun->loop_start; i < tfun->loop_end; i++) { @@ -242,7 +242,7 @@ static TestResult * srunner_run_setup(List * fixture_list, enum fork_status fork for(check_list_front(fixture_list); !check_list_at_end(fixture_list); check_list_advance(fixture_list)) { - setup_fixture = check_list_val(fixture_list); + setup_fixture = (Fixture *)check_list_val(fixture_list); if(fork_usage == CK_NOFORK) { @@ -307,7 +307,7 @@ static void srunner_run_teardown(List * fixture_list, enum fork_status fork_usag for(check_list_front(fixture_list); !check_list_at_end(fixture_list); check_list_advance(fixture_list)) { - fixture = check_list_val(fixture_list); + fixture = (Fixture *)check_list_val(fixture_list); send_ctx_info(CK_CTX_TEARDOWN); if(fork_usage == CK_NOFORK) diff --git a/tests/check_check_log_internal.c b/tests/check_check_log_internal.c index 96556df..d14fcbf 100644 --- a/tests/check_check_log_internal.c +++ b/tests/check_check_log_internal.c @@ -24,7 +24,7 @@ START_TEST(test_init_logging_subunit) srunner_init_logging(sr, CK_SUBUNIT); check_list_front (sr->loglst); ck_assert_msg (!check_list_at_end(sr->loglst), "No entries in log list"); - first_log = check_list_val(sr->loglst); + first_log = (Log *)check_list_val(sr->loglst); ck_assert_msg (first_log != NULL, "log is NULL"); check_list_advance(sr->loglst); ck_assert_msg(check_list_at_end(sr->loglst), "More than one entry in log list"); diff --git a/tests/check_list.c b/tests/check_list.c index 0dafc6a..9dfe2d7 100644 --- a/tests/check_list.c +++ b/tests/check_list.c @@ -82,12 +82,12 @@ START_TEST(test_add_end_and_next) check_list_add_end (lp, tval1); check_list_add_end (lp, tval2); check_list_front(lp); - ck_assert_msg (strcmp (tval1, check_list_val (lp)) == 0, + ck_assert_msg (strcmp (tval1, (char *)check_list_val (lp)) == 0, "List head val should equal first inserted val"); check_list_advance (lp); ck_assert_msg (!check_list_at_end (lp), "List should not be at end after two adds and one next"); - ck_assert_msg (strcmp (tval2, check_list_val (lp)) == 0, + ck_assert_msg (strcmp (tval2, (char *)check_list_val (lp)) == 0, "List val should equal second inserted val"); check_list_advance(lp); ck_assert_msg (check_list_at_end (lp), @@ -106,12 +106,12 @@ START_TEST(test_add_front_and_next) check_list_add_front (lp, tval1); check_list_add_front (lp, tval2); check_list_front(lp); - ck_assert_msg (strcmp (tval2, check_list_val (lp)) == 0, + ck_assert_msg (strcmp (tval2, (char *)check_list_val (lp)) == 0, "List head val should equal last inserted val"); check_list_advance (lp); ck_assert_msg (!check_list_at_end (lp), "List should not be at end after two adds and one next"); - ck_assert_msg (strcmp (tval1, check_list_val (lp)) == 0, + ck_assert_msg (strcmp (tval1, (char *)check_list_val (lp)) == 0, "List val should equal first inserted val"); check_list_advance(lp); ck_assert_msg (check_list_at_end (lp),