From 818b309ebf9133e49ada6174d6a06c892efb82bb Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 2 Feb 2019 21:20:23 +0100 Subject: [PATCH] eliminate warnings from cppcheck --- src/kernel/save.test.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/kernel/save.test.c b/src/kernel/save.test.c index e069d7ebf..565ac8354 100644 --- a/src/kernel/save.test.c +++ b/src/kernel/save.test.c @@ -278,13 +278,11 @@ static void test_readwrite_dead_faction_group(CuTest *tc) { CuAssertPtrEquals(tc, f2, factions); write_game(&data); free_gamedata(); - f = f2 = NULL; data.strm.api->rewind(data.strm.handle); read_game(&data); CuAssertPtrEquals(tc, NULL, findfaction(fno)); - f2 = factions; - CuAssertPtrNotNull(tc, f2); - u = f2->units; + CuAssertPtrNotNull(tc, factions); + u = factions->units; CuAssertPtrNotNull(tc, u); g = get_group(u); CuAssertPtrNotNull(tc, g); @@ -313,13 +311,11 @@ static void test_readwrite_dead_faction_regionowner(CuTest *tc) { remove_empty_units(); write_game(&data); free_gamedata(); - f = NULL; data.strm.api->rewind(data.strm.handle); read_game(&data); mstream_done(&data.strm); gamedata_done(&data); - f = factions; - CuAssertPtrEquals(tc, NULL, f); + CuAssertPtrEquals(tc, NULL, factions); r = regions; CuAssertPtrNotNull(tc, r); CuAssertPtrEquals(tc, NULL, region_get_owner(r));