From 5af69f182183daf00e6bc929becdd328757d2d77 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 20 May 2015 08:15:12 +0200 Subject: [PATCH] re-enable test_peasant_luck_effect, add testing for adjust_coordinates --- src/kernel/faction.test.c | 8 ++++++++ src/laws.test.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/kernel/faction.test.c b/src/kernel/faction.test.c index 42e76d1a8..4b872f6bf 100644 --- a/src/kernel/faction.test.c +++ b/src/kernel/faction.test.c @@ -113,9 +113,11 @@ static void test_get_monsters(CuTest *tc) { static void test_set_origin(CuTest *tc) { faction *f; int x = 0, y = 0; + plane *pl; test_cleanup(); test_create_world(); + pl = create_new_plane(0, "", 0, 19, 0, 19, 0); f = test_create_faction(0); CuAssertPtrEquals(tc, 0, f->ursprung); faction_setorigin(f, 0, 1, 1); @@ -125,6 +127,12 @@ static void test_set_origin(CuTest *tc) { faction_getorigin(f, 0, &x, &y); CuAssertIntEquals(tc, 1, x); CuAssertIntEquals(tc, 1, y); + adjust_coordinates(f, &x, &y, pl); + CuAssertIntEquals(tc, -9, x); + CuAssertIntEquals(tc, -9, y); + adjust_coordinates(f, &x, &y, 0); + CuAssertIntEquals(tc, -10, x); + CuAssertIntEquals(tc, -10, y); test_cleanup(); } diff --git a/src/laws.test.c b/src/laws.test.c index 9391ad06f..a70f79b38 100644 --- a/src/laws.test.c +++ b/src/laws.test.c @@ -780,7 +780,7 @@ CuSuite *get_laws_suite(void) SUITE_ADD_TEST(suite, test_force_leave_buildings); SUITE_ADD_TEST(suite, test_force_leave_ships); SUITE_ADD_TEST(suite, test_force_leave_ships_on_ocean); - DISABLE_TEST(suite, test_peasant_luck_effect); + SUITE_ADD_TEST(suite, test_peasant_luck_effect); SUITE_ADD_TEST(suite, test_luck_message); return suite;