test: lighhouse size reduction reduces effectiveness

This commit is contained in:
Enno Rehling 2018-07-17 21:34:22 +02:00
parent fc80e4b83e
commit 7b7d3cb759
2 changed files with 7 additions and 4 deletions

View File

@ -25,10 +25,10 @@ bool is_lighthouse(const building_type *btype)
}
/* update_lighthouse: call this function whenever the size of a lighthouse changes
* it adds temporary markers to the surrounding regions.
* The existence of markers says nothing about the quality of the observer in
* the lighthouse, for this may change more frequently.
*/
* it adds temporary markers to the surrounding regions.
* The existence of markers says nothing about the quality of the observer in
* the lighthouse, since this may change more frequently.
*/
void update_lighthouse(building * lh)
{
region *r = lh->region;

View File

@ -122,6 +122,9 @@ static void test_lighthouse_guard(CuTest * tc) {
CuAssertIntEquals(tc, true, lighthouse_guarded(r2));
CuAssertIntEquals(tc, true, lighthouse_guarded(r3));
CuAssertIntEquals(tc, false, lighthouse_guarded(r4));
b->size = 1; /* size can go down in destroy_cmd */
CuAssertIntEquals(tc, false, lighthouse_guarded(r2));
CuAssertIntEquals(tc, false, lighthouse_guarded(r3));
test_teardown();
}