From bdc9af9b6992196d62bf065e0f3b097b0214520a Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 23 Aug 2016 07:44:17 +0200 Subject: [PATCH] fix intermittent test for dead code path, all new volcanos have reduceproduction attributes --- src/volcano.c | 1 + src/volcano.test.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/volcano.c b/src/volcano.c index d035d4a23..9bcf62ff4 100644 --- a/src/volcano.c +++ b/src/volcano.c @@ -269,6 +269,7 @@ void volcano_update(void) rsetterrain(r, T_VOLCANO); } else { + // TODO: this code path is inactive. are we only keeping it for old data? fix data instead. if (rng_int() % 100 < 12) { ADDMSG(&r->msgs, msg_message("volcanostopsmoke", "region", r)); rsetterrain(r, T_VOLCANO); diff --git a/src/volcano.test.c b/src/volcano.test.c index c53b39b69..91411b660 100644 --- a/src/volcano.test.c +++ b/src/volcano.test.c @@ -4,6 +4,11 @@ #include #include + +#include + +#include + #include static void test_volcano_update(CuTest *tc) { @@ -14,6 +19,7 @@ static void test_volcano_update(CuTest *tc) { t_active = test_create_terrain("activevolcano", LAND_REGION); test_cleanup(); r = test_create_region(0, 0, t_active); + a_add(&r->attribs, make_reduceproduction(25, 10)); volcano_update(); CuAssertPtrEquals(tc, (void *)t_volcano, (void *)r->terrain); test_cleanup();