From 0616549ea5e892dd3c16bc49bd53eaf97b9c349f Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 18 May 2012 19:29:35 -0700 Subject: [PATCH] new gcc spouts more warnings, fix them. --- src/kernel/building_test.c | 5 +++++ src/kernel/move_test.c | 1 + src/tests.c | 3 +-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/kernel/building_test.c b/src/kernel/building_test.c index 0e09aa1c8..07f433e41 100644 --- a/src/kernel/building_test.c +++ b/src/kernel/building_test.c @@ -308,6 +308,10 @@ static void test_buildingowner_resets_when_dead(CuTest * tc) CuAssertPtrEquals(tc, 0, building_owner(bld)); } +void test_buildingowner_goes_to_empty_unit_if_no_other(CuTest * tc) +{ +} + CuSuite *get_building_suite(void) { CuSuite *suite = CuSuiteNew(); @@ -320,5 +324,6 @@ CuSuite *get_building_suite(void) SUITE_ADD_TEST(suite, test_buildingowner_goes_to_next_after_leave); SUITE_ADD_TEST(suite, test_buildingowner_goes_to_other_after_leave); SUITE_ADD_TEST(suite, test_buildingowner_goes_to_same_faction_after_leave); + SUITE_ADD_TEST(suite, test_buildingowner_goes_to_empty_unit_if_no_other); return suite; } diff --git a/src/kernel/move_test.c b/src/kernel/move_test.c index 766366e59..8b7bf4408 100644 --- a/src/kernel/move_test.c +++ b/src/kernel/move_test.c @@ -25,6 +25,7 @@ static void test_building_type_exists(CuTest * tc) r = findregion(-1, 0); b = new_building(btype, r, default_locale); + CuAssertPtrNotNull(tc, b); CuAssertTrue(tc, buildingtype_exists(r, NULL, true) == false); CuAssertTrue(tc, buildingtype_exists(r, btype, true) == true); CuAssertTrue(tc, buildingtype_exists(r, btype2, true) == false); diff --git a/src/tests.c b/src/tests.c index 5219f9983..193f3553a 100644 --- a/src/tests.c +++ b/src/tests.c @@ -151,7 +151,6 @@ void test_create_world(void) { terrain_type *t_plain, *t_ocean; region *island[2]; - race *rc_human; int i; building_type *btype; ship_type *stype; @@ -179,7 +178,7 @@ void test_create_world(void) } } - rc_human = test_create_race("human"); + test_create_race("human"); btype = (building_type*)calloc(sizeof(building_type), 1); btype->flags = BTF_NAMECHANGE;