fix segmentation fault in test.

This commit is contained in:
Enno Rehling 2014-10-31 22:10:41 +01:00
parent 78db167802
commit af616b5b09
1 changed files with 3 additions and 1 deletions

View File

@ -47,6 +47,7 @@ static void test_remove_empty_factions(CuTest *tc) {
static void test_remove_dead_factions(CuTest *tc) { static void test_remove_dead_factions(CuTest *tc) {
faction *f, *fm; faction *f, *fm;
region *r; region *r;
int fno;
test_cleanup(); test_cleanup();
r = test_create_region(0, 0, 0); r = test_create_region(0, 0, 0);
@ -60,8 +61,9 @@ static void test_remove_dead_factions(CuTest *tc) {
CuAssertPtrNotNull(tc, get_monsters()); CuAssertPtrNotNull(tc, get_monsters());
fm->alive = 0; fm->alive = 0;
f->alive = 0; f->alive = 0;
fno = f->no;
remove_empty_factions(); remove_empty_factions();
CuAssertPtrEquals(tc, 0, findfaction(f->no)); CuAssertPtrEquals(tc, 0, findfaction(fno));
CuAssertPtrEquals(tc, fm, get_monsters()); CuAssertPtrEquals(tc, fm, get_monsters());
test_cleanup(); test_cleanup();
} }