fix test for get_monsters(), nobody needs the function to ever return NULL.

This commit is contained in:
Enno Rehling 2014-11-07 21:28:58 +01:00
parent c8f2f33eab
commit d1f7fb571c
1 changed files with 5 additions and 7 deletions

View File

@ -91,20 +91,18 @@ static void test_addfaction(CuTest *tc) {
CuAssertIntEquals(tc, M_GRAY, f->magiegebiet); CuAssertIntEquals(tc, M_GRAY, f->magiegebiet);
CuAssertIntEquals(tc, turn, f->lastorders); CuAssertIntEquals(tc, turn, f->lastorders);
CuAssertPtrEquals(tc, f, findfaction(f->no)); CuAssertPtrEquals(tc, f, findfaction(f->no));
test_cleanup();
} }
static void test_get_monsters(CuTest *tc) { static void test_get_monsters(CuTest *tc) {
faction *f; faction *f;
CuAssertPtrEquals(tc, NULL, get_monsters());
f = get_or_create_monsters(); free_gamedata();
CuAssertPtrNotNull(tc, (f = get_monsters()));
CuAssertPtrEquals(tc, f, get_monsters()); CuAssertPtrEquals(tc, f, get_monsters());
CuAssertIntEquals(tc, 666, f->no); CuAssertIntEquals(tc, 666, f->no);
CuAssertStrEquals(tc, "Monster", f->name); CuAssertStrEquals(tc, "Monster", f->name);
free_gamedata(); test_cleanup();
CuAssertPtrEquals(tc, NULL, get_monsters());
f = get_or_create_monsters();
CuAssertPtrEquals(tc, f, get_monsters());
CuAssertIntEquals(tc, 666, f->no);
} }
CuSuite *get_faction_suite(void) CuSuite *get_faction_suite(void)