From 3e1462a1923316898efa304b4c5189eb2ba8bba8 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 7 May 2017 13:35:59 +0200 Subject: [PATCH] add empty calendar unit test. --- src/CMakeLists.txt | 28 ++++++++++++++-------------- src/calendar.test.c | 25 +++++++++++++++++++++++++ src/test_eressea.c | 25 +++++++++++++------------ 3 files changed, 52 insertions(+), 26 deletions(-) create mode 100644 src/calendar.test.c diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ebe914dfe..c4c306118 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -197,42 +197,42 @@ target_link_libraries(convert ) set(TESTS_SRC - monsters.test.c - names.test.c - donations.test.c - wormhole.test.c - alchemy.test.c - guard.test.c test_eressea.c tests.c + alchemy.test.c battle.test.c - vortex.test.c - tests.test.c - volcano.test.c - reports.test.c + calendar.test.c creport.test.c - report.test.c - summary.test.c - travelthru.test.c direction.test.c + donations.test.c economy.test.c + give.test.c + guard.test.c json.test.c keyword.test.c - give.test.c laws.test.c lighthouse.test.c magic.test.c market.test.c monsters.test.c move.test.c + names.test.c piracy.test.c prefix.test.c renumber.test.c + reports.test.c + report.test.c + summary.test.c skill.test.c spells.test.c spy.test.c study.test.c + tests.test.c + travelthru.test.c upkeep.test.c + volcano.test.c + vortex.test.c + wormhole.test.c spells/flyingship.test.c spells/magicresistance.test.c triggers/shock.test.c diff --git a/src/calendar.test.c b/src/calendar.test.c new file mode 100644 index 000000000..e8df8cd58 --- /dev/null +++ b/src/calendar.test.c @@ -0,0 +1,25 @@ +#include + +#include "calendar.h" + +#include + +#include +#include "tests.h" + +static void test_calendar(CuTest * tc) +{ + gamedate gd; + + test_setup(); + get_gamedate(0, &gd); + CuAssertIntEquals(tc, 0, gd.month); + test_cleanup(); +} + +CuSuite *get_calendar_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_calendar); + return suite; +} diff --git a/src/test_eressea.c b/src/test_eressea.c index 1d991725f..5361ddf5e 100644 --- a/src/test_eressea.c +++ b/src/test_eressea.c @@ -116,35 +116,36 @@ int RunAllTests(int argc, char *argv[]) ADD_SUITE(ally); ADD_SUITE(messages); /* gamecode */ - ADD_SUITE(guard); - ADD_SUITE(report); - ADD_SUITE(creport); - ADD_SUITE(summary); - ADD_SUITE(names); ADD_SUITE(battle); - ADD_SUITE(volcano); + ADD_SUITE(calendar); + ADD_SUITE(creport); ADD_SUITE(donations); - ADD_SUITE(travelthru); ADD_SUITE(economy); ADD_SUITE(flyingship); ADD_SUITE(give); + ADD_SUITE(guard); + ADD_SUITE(key); ADD_SUITE(laws); ADD_SUITE(lighthouse); ADD_SUITE(market); ADD_SUITE(monsters); ADD_SUITE(move); + ADD_SUITE(names); + ADD_SUITE(otherfaction); ADD_SUITE(piracy); ADD_SUITE(prefix); ADD_SUITE(renumber); - ADD_SUITE(key); + ADD_SUITE(report); + ADD_SUITE(shock); + ADD_SUITE(spy); ADD_SUITE(stealth); - ADD_SUITE(otherfaction); + ADD_SUITE(study); + ADD_SUITE(summary); + ADD_SUITE(travelthru); ADD_SUITE(upkeep); + ADD_SUITE(volcano); ADD_SUITE(vortex); ADD_SUITE(wormhole); - ADD_SUITE(spy); - ADD_SUITE(study); - ADD_SUITE(shock); if (suites) { CuSuite *summary = CuSuiteNew();