Add test coverage for NAME ALLIANCE.

This commit is contained in:
Enno Rehling 2017-11-06 20:38:28 +01:00
parent 7196f799e6
commit 31d15550ed
2 changed files with 7 additions and 1 deletions

View file

@ -216,7 +216,6 @@ static void test_alliance_cmd_transfer(CuTest *tc) {
test_cleanup();
}
CuSuite *get_alliance_suite(void)
{
CuSuite *suite = CuSuiteNew();

View file

@ -1164,10 +1164,12 @@ static void test_ally_cmd_errors(CuTest *tc) {
static void test_name_cmd(CuTest *tc) {
unit *u;
faction *f;
alliance *al;
order *ord;
test_setup();
u = test_create_unit(f = test_create_faction(0), test_create_region(0, 0, 0));
setalliance(f, al = makealliance(42, ""));
ord = create_order(K_NAME, f->locale, "%s ' Ho\tdor '", LOC(f->locale, parameters[P_UNIT]));
name_cmd(u, ord);
@ -1196,6 +1198,11 @@ static void test_name_cmd(CuTest *tc) {
CuAssertStrEquals(tc, "Hodor", u->region->land->name);
free_order(ord);
ord = create_order(K_NAME, f->locale, "%s ' Ho\tdor '", LOC(f->locale, parameters[P_ALLIANCE]));
name_cmd(u, ord);
CuAssertStrEquals(tc, "Hodor", al->name);
free_order(ord);
test_cleanup();
}