From d6ce1d9cfeeda100e10c9ac3cb429ac874a7786e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 5 Mar 2017 17:26:00 +0100 Subject: [PATCH] Add a test for singular resources. --- src/report.test.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/report.test.c b/src/report.test.c index 92bfe3d9e..0bfea3c69 100644 --- a/src/report.test.c +++ b/src/report.test.c @@ -125,6 +125,19 @@ static void test_report_region(CuTest *tc) { buf[len] = '\0'; CuAssertStrEquals(tc, "Hodor (0,0), Ebene, 3/2 Blumen, 135 Steine/1, 5 Bauern, 2 Silber, 7 Pferde.\n", buf); + r->resources->amount = 1; + r->land->peasants = 1; + r->land->horses = 1; + r->land->money = 1; + + r->seen.mode = seen_unit; + out.api->rewind(out.handle); + report_region(&out, r, f); + out.api->rewind(out.handle); + len = out.api->read(out.handle, buf, sizeof(buf)); + buf[len] = '\0'; + CuAssertStrEquals(tc, "Hodor (0,0), Ebene, 3/2 Blumen, 1 Stein/1, 1 Bauer, 1 Silber, 1 Pferd.\n", buf); + mstream_done(&out); test_cleanup(); }