memory leak: castorders

when you test_create_castorder, you must free_castorder
This commit is contained in:
Enno Rehling 2016-03-10 22:33:53 +01:00
parent c9e524d161
commit c21d5290ef
1 changed files with 4 additions and 2 deletions

View File

@ -44,19 +44,21 @@ static void test_flyingship(CuTest * tc)
sh1 = test_create_ship(r, shipType1);
par_data.data.sh = sh1;
test_create_castorder(&co, u, 10, 10.0, 0, &par);
test_create_castorder(&co, u, 10, 10.0, 0, &par);
CuAssertTrue(tc, !flying_ship(sh1));
CuAssertIntEquals(tc, 10, sp_flying_ship(&co));
CuAssertTrue(tc, flying_ship(sh1));
free_castorder(&co);
sh2 = test_create_ship(r, shipType2);
par_data.data.sh = sh2;
test_create_castorder(&co, u, 10, 10.0, 0, &par);
test_create_castorder(&co, u, 10, 10.0, 0, &par);
CuAssertTrue(tc, !flying_ship(sh2));
CuAssertIntEquals(tc, 0, sp_flying_ship(&co));
CuAssertTrue(tc, !flying_ship(sh2));
free_castorder(&co);
test_cleanup();
}