forked from github/server
test that ship and building cannot be named poorly.
This commit is contained in:
parent
dea1020983
commit
64f80274a0
|
@ -1055,11 +1055,20 @@ static void test_name_cmd(CuTest *tc) {
|
||||||
CuAssertStrEquals(tc, "Hodor", f->name);
|
CuAssertStrEquals(tc, "Hodor", f->name);
|
||||||
free_order(ord);
|
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);
|
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);
|
u->building = test_create_building(u->region, 0);
|
||||||
name_cmd(u, ord);
|
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);
|
CuAssertStrEquals(tc, "Hodor", u->region->land->name);
|
||||||
free_order(ord);
|
free_order(ord);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue