eliminate warnings from cppcheck

This commit is contained in:
Enno Rehling 2019-02-02 21:20:23 +01:00
parent 88dd9203dd
commit 818b309ebf

View file

@ -278,13 +278,11 @@ static void test_readwrite_dead_faction_group(CuTest *tc) {
CuAssertPtrEquals(tc, f2, factions); CuAssertPtrEquals(tc, f2, factions);
write_game(&data); write_game(&data);
free_gamedata(); free_gamedata();
f = f2 = NULL;
data.strm.api->rewind(data.strm.handle); data.strm.api->rewind(data.strm.handle);
read_game(&data); read_game(&data);
CuAssertPtrEquals(tc, NULL, findfaction(fno)); CuAssertPtrEquals(tc, NULL, findfaction(fno));
f2 = factions; CuAssertPtrNotNull(tc, factions);
CuAssertPtrNotNull(tc, f2); u = factions->units;
u = f2->units;
CuAssertPtrNotNull(tc, u); CuAssertPtrNotNull(tc, u);
g = get_group(u); g = get_group(u);
CuAssertPtrNotNull(tc, g); CuAssertPtrNotNull(tc, g);
@ -313,13 +311,11 @@ static void test_readwrite_dead_faction_regionowner(CuTest *tc) {
remove_empty_units(); remove_empty_units();
write_game(&data); write_game(&data);
free_gamedata(); free_gamedata();
f = NULL;
data.strm.api->rewind(data.strm.handle); data.strm.api->rewind(data.strm.handle);
read_game(&data); read_game(&data);
mstream_done(&data.strm); mstream_done(&data.strm);
gamedata_done(&data); gamedata_done(&data);
f = factions; CuAssertPtrEquals(tc, NULL, factions);
CuAssertPtrEquals(tc, NULL, f);
r = regions; r = regions;
CuAssertPtrNotNull(tc, r); CuAssertPtrNotNull(tc, r);
CuAssertPtrEquals(tc, NULL, region_get_owner(r)); CuAssertPtrEquals(tc, NULL, region_get_owner(r));