test that ship and building cannot be named poorly.

This commit is contained in:
Enno Rehling 2016-11-11 14:00:04 +01:00
parent dea1020983
commit 64f80274a0
1 changed files with 11 additions and 2 deletions

View File

@ -1055,11 +1055,20 @@ static void test_name_cmd(CuTest *tc) {
CuAssertStrEquals(tc, "Hodor", f->name);
free_order(ord);
ord = create_order(K_NAME, f->locale, "%s ' Ho\tdor '", LOC(f->locale, parameters[P_REGION]));
ord = create_order(K_NAME, f->locale, "%s ' Ho\tdor '", LOC(f->locale, parameters[P_SHIP]));
u->ship = test_create_ship(u->region, 0);
name_cmd(u, ord);
CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "error145"));
CuAssertStrEquals(tc, "Hodor", u->ship->name);
free_order(ord);
ord = create_order(K_NAME, f->locale, "%s ' Ho\tdor '", LOC(f->locale, parameters[P_BUILDING]));
u->building = test_create_building(u->region, 0);
name_cmd(u, ord);
CuAssertStrEquals(tc, "Hodor", u->building->name);
free_order(ord);
ord = create_order(K_NAME, f->locale, "%s ' Ho\tdor '", LOC(f->locale, parameters[P_REGION]));
name_cmd(u, ord);
CuAssertStrEquals(tc, "Hodor", u->region->land->name);
free_order(ord);