From: Tobias Brunner Date: Wed, 27 Mar 2013 12:21:52 +0000 (+0100) Subject: Improved test for linked_list_t.insert_before() X-Git-Tag: 5.1.0dr1~129^2~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc90b3dd0ac8916120ace239367ffc9736220fa4;p=thirdparty%2Fstrongswan.git Improved test for linked_list_t.insert_before() --- diff --git a/src/libstrongswan/tests/test_linked_list_enumerator.c b/src/libstrongswan/tests/test_linked_list_enumerator.c index fd55eaad12..724aba09e9 100644 --- a/src/libstrongswan/tests/test_linked_list_enumerator.c +++ b/src/libstrongswan/tests/test_linked_list_enumerator.c @@ -124,7 +124,7 @@ START_TEST(test_insert_before) { ck_assert_int_eq(round, x); round++; - if (x == 2) + if (x == _i) { list->insert_before(list, enumerator, (void*)6); } @@ -134,7 +134,7 @@ START_TEST(test_insert_before) round = 1; while (enumerator->enumerate(enumerator, &x)) { - if (round == 2 && x != 2) + if (round == _i && x != _i) { ck_assert_int_eq(6, x); } @@ -296,7 +296,7 @@ Suite *linked_list_enumerator_suite_create() tc = tcase_create("insert_before()"); tcase_add_checked_fixture(tc, setup_list, teardown_list); - tcase_add_test(tc, test_insert_before); + tcase_add_loop_test(tc, test_insert_before, 1, 5); tcase_add_test(tc, test_insert_before_ends); tcase_add_test(tc, test_insert_before_empty); suite_add_tcase(s, tc);