mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
tests/lib/strutil/parse_integer.c: use macros, fix comments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
e1461bcfd3
commit
acc0bbdfbf
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user