From 31d15550edf19c1ada2df196ceb524551aa698a0 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 6 Nov 2017 20:38:28 +0100 Subject: [PATCH] Add test coverage for NAME ALLIANCE. --- src/kernel/alliance.test.c | 1 - src/laws.test.c | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/kernel/alliance.test.c b/src/kernel/alliance.test.c index 885bc8413..e76a11ba2 100644 --- a/src/kernel/alliance.test.c +++ b/src/kernel/alliance.test.c @@ -216,7 +216,6 @@ static void test_alliance_cmd_transfer(CuTest *tc) { test_cleanup(); } - CuSuite *get_alliance_suite(void) { CuSuite *suite = CuSuiteNew(); diff --git a/src/laws.test.c b/src/laws.test.c index a4630332a..787f69715 100644 --- a/src/laws.test.c +++ b/src/laws.test.c @@ -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(); }