From d1f7fb571c7ab39059b2f3592e154c8a5ce88c75 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 7 Nov 2014 21:28:58 +0100 Subject: [PATCH] fix test for get_monsters(), nobody needs the function to ever return NULL. --- src/kernel/faction.test.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/kernel/faction.test.c b/src/kernel/faction.test.c index 34adf3ea0..644fb83e0 100644 --- a/src/kernel/faction.test.c +++ b/src/kernel/faction.test.c @@ -91,20 +91,18 @@ static void test_addfaction(CuTest *tc) { CuAssertIntEquals(tc, M_GRAY, f->magiegebiet); CuAssertIntEquals(tc, turn, f->lastorders); CuAssertPtrEquals(tc, f, findfaction(f->no)); + test_cleanup(); } static void test_get_monsters(CuTest *tc) { faction *f; - CuAssertPtrEquals(tc, NULL, get_monsters()); - f = get_or_create_monsters(); + + free_gamedata(); + CuAssertPtrNotNull(tc, (f = get_monsters())); CuAssertPtrEquals(tc, f, get_monsters()); CuAssertIntEquals(tc, 666, f->no); CuAssertStrEquals(tc, "Monster", f->name); - free_gamedata(); - CuAssertPtrEquals(tc, NULL, get_monsters()); - f = get_or_create_monsters(); - CuAssertPtrEquals(tc, f, get_monsters()); - CuAssertIntEquals(tc, 666, f->no); + test_cleanup(); } CuSuite *get_faction_suite(void)