diff --git a/src/kernel/faction.test.c b/src/kernel/faction.test.c index 31747bd6c..b59a46f63 100644 --- a/src/kernel/faction.test.c +++ b/src/kernel/faction.test.c @@ -47,6 +47,7 @@ static void test_remove_empty_factions(CuTest *tc) { static void test_remove_dead_factions(CuTest *tc) { faction *f, *fm; region *r; + int fno; test_cleanup(); r = test_create_region(0, 0, 0); @@ -60,8 +61,9 @@ static void test_remove_dead_factions(CuTest *tc) { CuAssertPtrNotNull(tc, get_monsters()); fm->alive = 0; f->alive = 0; + fno = f->no; remove_empty_factions(); - CuAssertPtrEquals(tc, 0, findfaction(f->no)); + CuAssertPtrEquals(tc, 0, findfaction(fno)); CuAssertPtrEquals(tc, fm, get_monsters()); test_cleanup(); }