From: David Llewellyn-Jones Date: Sun, 19 Apr 2020 16:58:50 +0000 (+0300) Subject: Use internal count for tests X-Git-Url: https://www.flypig.org.uk/git/?p=libcontrac.git;a=commitdiff_plain;h=318742af26883e2539f07df8f243bd7b5702edb6 Use internal count for tests --- diff --git a/tests/test_contrac.c b/tests/test_contrac.c index ffa09c1..b697a94 100644 --- a/tests/test_contrac.c +++ b/tests/test_contrac.c @@ -272,7 +272,6 @@ START_TEST (check_match) { Dtk * dtk; MatchList * matches; MatchListItem const * match; - int match_count; // Generate some keys, check the results Contrac * contrac; @@ -321,7 +320,6 @@ START_TEST (check_match) { match = match_list_first(matches); - match_count = 0; while (match) { result = false; for (pos = 0; pos < 4; ++pos) { @@ -332,10 +330,9 @@ START_TEST (check_match) { ck_assert(result); - match_count++; match = match_list_next(match); } - ck_assert_int_eq(match_count, 4); + ck_assert_int_eq(match_list_count(matches), 4); // Clean up match_list_delete(matches);