From 720c41c1bf35be39be6c6bf6539d03ed194a5c66 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 12 Mar 2017 12:53:10 +0100 Subject: [PATCH] reproduce bug 2313. recruiting breaks f->num_units. --- src/economy.test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/economy.test.c b/src/economy.test.c index 7163da7e1..1fca4d194 100644 --- a/src/economy.test.c +++ b/src/economy.test.c @@ -316,8 +316,12 @@ static void test_recruit(CuTest *tc) { f = test_create_faction(0); u = test_create_unit(f, test_create_region(0, 0, 0)); CuAssertIntEquals(tc, 1, u->number); + CuAssertIntEquals(tc, 1, f->num_people); + CuAssertIntEquals(tc, 1, f->num_units); add_recruits(u, 1, 1); CuAssertIntEquals(tc, 2, u->number); + CuAssertIntEquals(tc, 2, f->num_people); + CuAssertIntEquals(tc, 1, f->num_units); CuAssertPtrEquals(tc, u, f->units); CuAssertPtrEquals(tc, NULL, u->nextF); CuAssertPtrEquals(tc, NULL, u->prevF);