From 1f1850dafc6536f86c8988e128686e400c2bcb00 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 13 Oct 2015 22:11:45 +0200 Subject: [PATCH] memory leak: always cleanup at the end of a test that creates game data. --- src/reports.test.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/reports.test.c b/src/reports.test.c index 892c5ea62..ecb053c14 100644 --- a/src/reports.test.c +++ b/src/reports.test.c @@ -66,6 +66,7 @@ static void test_reorder_units(CuTest * tc) CuAssertPtrEquals(tc, u1, u2->next); CuAssertPtrEquals(tc, u0, u1->next); CuAssertPtrEquals(tc, 0, u0->next); + test_cleanup(); } static void test_regionid(CuTest * tc) { @@ -88,11 +89,15 @@ static void test_regionid(CuTest * tc) { CuAssertIntEquals(tc, 10, (int)len); CuAssertStrEquals(tc, "plain (0,0", buffer); CuAssertIntEquals(tc, 0x7d, buffer[11]); + test_cleanup(); } static void test_seen_faction(CuTest *tc) { faction *f1, *f2; - race *rc = test_create_race("human"); + race *rc; + + test_cleanup(); + rc = test_create_race("human"); f1 = test_create_faction(rc); f2 = test_create_faction(rc); add_seen_faction(f1, f2); @@ -105,6 +110,7 @@ static void test_seen_faction(CuTest *tc) { f2 = (faction *)ql_get(f1->seen_factions, 1); f1 = (faction *)ql_get(f1->seen_factions, 0); CuAssertTrue(tc, f1->no < f2->no); + test_cleanup(); } static void test_write_spaces(CuTest *tc) {