diff --git a/src/kernel/item.test.c b/src/kernel/item.test.c index 47b32b537..231b45d00 100644 --- a/src/kernel/item.test.c +++ b/src/kernel/item.test.c @@ -74,7 +74,7 @@ void test_change_item(CuTest * tc) test_create_itemtype("iron"); init_resources(); - u = test_create_unit(test_create_faction(0), 0); + u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); test_uchange(tc, u, get_resourcetype(R_IRON)); test_cleanup(); } diff --git a/src/reports.test.c b/src/reports.test.c index f368e63e1..c27a0f6f9 100644 --- a/src/reports.test.c +++ b/src/reports.test.c @@ -220,7 +220,7 @@ static void test_write_travelthru(CuTest *tc) { r->flags |= RF_TRAVELUNIT; f = test_create_faction(0); f->locale = lang; - u = test_create_unit(f, 0); + u = test_create_unit(f, test_create_region(0, 1, 0)); unit_setname(u, "Hodor"); unit_setid(u, 1); diff --git a/src/study.test.c b/src/study.test.c index f12fc25df..0ecd7ae2e 100644 --- a/src/study.test.c +++ b/src/study.test.c @@ -295,7 +295,7 @@ static void test_demon_skillchanges(CuTest *tc) { test_setup(); rc = test_create_race("demon"); CuAssertPtrEquals(tc, rc, get_race(RC_DAEMON)); - u = test_create_unit(test_create_faction(rc), 0); + u = test_create_unit(test_create_faction(rc), test_create_region(0, 0, 0)); CuAssertPtrNotNull(tc, u); set_level(u, SK_CROSSBOW, 1); demon_skillchange(u); diff --git a/src/tests.c b/src/tests.c index 13400ebd4..b9336bb25 100644 --- a/src/tests.c +++ b/src/tests.c @@ -119,7 +119,7 @@ struct faction *test_create_faction(const struct race *rc) struct unit *test_create_unit(struct faction *f, struct region *r) { const struct race * rc = f ? f->race : 0; - assert(f || !r); + assert(f && r); if (!rc) rc = rc_get_or_create("human"); return create_unit(r, f, 1, rc ? rc : rc_get_or_create("human"), 0, 0, 0); }