From acc0bbdfbf3d05fc129d602e9afb5e41dc46611d Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 24 Feb 2019 13:35:19 +0300 Subject: [PATCH] tests/lib/strutil/parse_integer.c: use macros, fix comments. Signed-off-by: Andrew Borodin --- tests/lib/strutil/parse_integer.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/lib/strutil/parse_integer.c b/tests/lib/strutil/parse_integer.c index 5a847a755..b2fd630f8 100644 --- a/tests/lib/strutil/parse_integer.c +++ b/tests/lib/strutil/parse_integer.c @@ -49,7 +49,7 @@ teardown (void) /* --------------------------------------------------------------------------------------------- */ -/* @DataSource("str_replace_all_test_ds") */ +/* @DataSource("parse_integer_test_ds") */ /* *INDENT-OFF* */ static const struct parse_integer_test_ds { @@ -117,15 +117,14 @@ static const struct parse_integer_test_ds }; /* *INDENT-ON* */ -/* @Test(dataSource = "str_replace_all_test_ds") */ +/* @Test(dataSource = "parse_integer_test_ds") */ /* *INDENT-OFF* */ -START_TEST (parse_integer_test) +START_PARAMETRIZED_TEST (parse_integer_test, parse_integer_test_ds) /* *INDENT-ON* */ { /* given */ uintmax_t actual_result; gboolean invalid = FALSE; - const struct parse_integer_test_ds *data = &parse_integer_test_ds[_i]; /* when */ actual_result = parse_integer (data->haystack, &invalid); @@ -136,7 +135,7 @@ START_TEST (parse_integer_test) actual_result, data->expected_result); } /* *INDENT-OFF* */ -END_TEST +END_PARAMETRIZED_TEST /* *INDENT-ON* */ /* --------------------------------------------------------------------------------------------- */ @@ -153,7 +152,7 @@ main (void) tcase_add_checked_fixture (tc_core, setup, teardown); /* Add new tests here: *************** */ - tcase_add_loop_test (tc_core, parse_integer_test, 0, G_N_ELEMENTS (parse_integer_test_ds)); + mctest_add_parameterized_test (tc_core, parse_integer_test, parse_integer_test_ds); /* *********************************** */ suite_add_tcase (s, tc_core);