From 7b7d3cb7597440d19722c56ac631e7392a414f26 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 17 Jul 2018 21:34:22 +0200 Subject: [PATCH] test: lighhouse size reduction reduces effectiveness --- src/lighthouse.c | 8 ++++---- src/lighthouse.test.c | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lighthouse.c b/src/lighthouse.c index 2ff1c6191..ff1cc5b84 100644 --- a/src/lighthouse.c +++ b/src/lighthouse.c @@ -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; diff --git a/src/lighthouse.test.c b/src/lighthouse.test.c index bcc7c0ab7..f85b5ce99 100644 --- a/src/lighthouse.test.c +++ b/src/lighthouse.test.c @@ -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(); }