From b2b9b9eae4e26db8996c6f4d91766cece485622d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 4 Sep 2016 21:52:09 +0100 Subject: [PATCH] test having more than one name per direction. use test_setup. --- src/direction.test.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/direction.test.c b/src/direction.test.c index c2feebd3f..b7516a8e6 100644 --- a/src/direction.test.c +++ b/src/direction.test.c @@ -10,7 +10,7 @@ static void test_init_directions(CuTest *tc) { struct locale *lang; - test_cleanup(); + test_setup(); lang = get_or_create_locale("de"); locale_setstring(lang, "dir_nw", "NW"); init_directions(lang); @@ -20,19 +20,23 @@ static void test_init_directions(CuTest *tc) { static void test_init_direction(CuTest *tc) { struct locale *lang; - test_cleanup(); + test_setup(); lang = get_or_create_locale("de"); init_direction(lang, D_NORTHWEST, "NW"); + init_direction(lang, D_NORTHWEST, "northwest"); init_direction(lang, D_EAST, "OST"); + init_direction(lang, D_EAST, "O"); CuAssertIntEquals(tc, D_NORTHWEST, get_direction("nw", lang)); + CuAssertIntEquals(tc, D_NORTHWEST, get_direction("northwest", lang)); CuAssertIntEquals(tc, D_EAST, get_direction("ost", lang)); + CuAssertIntEquals(tc, D_EAST, get_direction("O", lang)); CuAssertIntEquals(tc, NODIRECTION, get_direction("east", lang)); test_cleanup(); } static void test_finddirection(CuTest *tc) { - test_cleanup(); + test_setup(); CuAssertIntEquals(tc, D_SOUTHWEST, finddirection("southwest")); CuAssertIntEquals(tc, D_SOUTHEAST, finddirection("southeast")); CuAssertIntEquals(tc, D_NORTHWEST, finddirection("northwest")); @@ -42,6 +46,7 @@ static void test_finddirection(CuTest *tc) { CuAssertIntEquals(tc, D_PAUSE, finddirection("pause")); CuAssertIntEquals(tc, NODIRECTION, finddirection("")); CuAssertIntEquals(tc, NODIRECTION, finddirection("potato")); + test_cleanup(); } CuSuite *get_direction_suite(void)