re-enable test_peasant_luck_effect, add testing for adjust_coordinates

This commit is contained in:
Enno Rehling 2015-05-20 08:15:12 +02:00
parent 32298bd50d
commit 5af69f1821
2 changed files with 9 additions and 1 deletions

View File

@ -113,9 +113,11 @@ static void test_get_monsters(CuTest *tc) {
static void test_set_origin(CuTest *tc) { static void test_set_origin(CuTest *tc) {
faction *f; faction *f;
int x = 0, y = 0; int x = 0, y = 0;
plane *pl;
test_cleanup(); test_cleanup();
test_create_world(); test_create_world();
pl = create_new_plane(0, "", 0, 19, 0, 19, 0);
f = test_create_faction(0); f = test_create_faction(0);
CuAssertPtrEquals(tc, 0, f->ursprung); CuAssertPtrEquals(tc, 0, f->ursprung);
faction_setorigin(f, 0, 1, 1); faction_setorigin(f, 0, 1, 1);
@ -125,6 +127,12 @@ static void test_set_origin(CuTest *tc) {
faction_getorigin(f, 0, &x, &y); faction_getorigin(f, 0, &x, &y);
CuAssertIntEquals(tc, 1, x); CuAssertIntEquals(tc, 1, x);
CuAssertIntEquals(tc, 1, y); 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(); test_cleanup();
} }

View File

@ -780,7 +780,7 @@ CuSuite *get_laws_suite(void)
SUITE_ADD_TEST(suite, test_force_leave_buildings); SUITE_ADD_TEST(suite, test_force_leave_buildings);
SUITE_ADD_TEST(suite, test_force_leave_ships); SUITE_ADD_TEST(suite, test_force_leave_ships);
SUITE_ADD_TEST(suite, test_force_leave_ships_on_ocean); 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); SUITE_ADD_TEST(suite, test_luck_message);
return suite; return suite;