reproduce bug 2313.

recruiting breaks f->num_units.
This commit is contained in:
Enno Rehling 2017-03-12 12:53:10 +01:00
parent 39ec03b2af
commit 720c41c1bf
1 changed files with 4 additions and 0 deletions

View File

@ -316,8 +316,12 @@ static void test_recruit(CuTest *tc) {
f = test_create_faction(0); f = test_create_faction(0);
u = test_create_unit(f, test_create_region(0, 0, 0)); u = test_create_unit(f, test_create_region(0, 0, 0));
CuAssertIntEquals(tc, 1, u->number); CuAssertIntEquals(tc, 1, u->number);
CuAssertIntEquals(tc, 1, f->num_people);
CuAssertIntEquals(tc, 1, f->num_units);
add_recruits(u, 1, 1); add_recruits(u, 1, 1);
CuAssertIntEquals(tc, 2, u->number); CuAssertIntEquals(tc, 2, u->number);
CuAssertIntEquals(tc, 2, f->num_people);
CuAssertIntEquals(tc, 1, f->num_units);
CuAssertPtrEquals(tc, u, f->units); CuAssertPtrEquals(tc, u, f->units);
CuAssertPtrEquals(tc, NULL, u->nextF); CuAssertPtrEquals(tc, NULL, u->nextF);
CuAssertPtrEquals(tc, NULL, u->prevF); CuAssertPtrEquals(tc, NULL, u->prevF);