forked from github/server
check seen_neighbour
This commit is contained in:
parent
dfbc520203
commit
2b9e5ffff9
|
@ -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,13 +237,21 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue