check seen_neighbour

This commit is contained in:
Enno Rehling 2016-09-15 10:02:49 +02:00
parent dfbc520203
commit 2b9e5ffff9
1 changed files with 10 additions and 3 deletions

View File

@ -226,7 +226,6 @@ static void test_prepare_report(CuTest *tc) {
report_context ctx; report_context ctx;
faction *f; faction *f;
region *r; region *r;
unit *u;
test_setup(); test_setup();
f = test_create_faction(0); f = test_create_faction(0);
@ -238,14 +237,22 @@ static void test_prepare_report(CuTest *tc) {
CuAssertIntEquals(tc, seen_none, r->seen.mode); CuAssertIntEquals(tc, seen_none, r->seen.mode);
finish_reports(&ctx); finish_reports(&ctx);
u = test_create_unit(f, r); test_create_unit(f, r);
prepare_report(&ctx, f); prepare_report(&ctx, f);
CuAssertPtrEquals(tc, r, ctx.first); CuAssertPtrEquals(tc, r, ctx.first);
CuAssertPtrEquals(tc, 0, ctx.last); CuAssertPtrEquals(tc, 0, ctx.last);
CuAssertIntEquals(tc, seen_unit, r->seen.mode); CuAssertIntEquals(tc, seen_unit, r->seen.mode);
finish_reports(&ctx); finish_reports(&ctx);
CuAssertIntEquals(tc, seen_none, r->seen.mode); CuAssertIntEquals(tc, seen_none, r->seen.mode);
finish_reports(&ctx);
r = test_create_region(1, 0, 0);
CuAssertPtrEquals(tc, r, regions->next);
prepare_report(&ctx, f);
CuAssertPtrEquals(tc, regions, ctx.first);
CuAssertPtrEquals(tc, r, ctx.last);
CuAssertIntEquals(tc, seen_neighbour, r->seen.mode);
test_cleanup(); test_cleanup();
} }