add empty calendar unit test.

This commit is contained in:
Enno Rehling 2017-05-07 13:35:59 +02:00
parent 2e3f68ed87
commit 3e1462a192
3 changed files with 52 additions and 26 deletions

View File

@ -197,42 +197,42 @@ target_link_libraries(convert
) )
set(TESTS_SRC set(TESTS_SRC
monsters.test.c
names.test.c
donations.test.c
wormhole.test.c
alchemy.test.c
guard.test.c
test_eressea.c test_eressea.c
tests.c tests.c
alchemy.test.c
battle.test.c battle.test.c
vortex.test.c calendar.test.c
tests.test.c
volcano.test.c
reports.test.c
creport.test.c creport.test.c
report.test.c
summary.test.c
travelthru.test.c
direction.test.c direction.test.c
donations.test.c
economy.test.c economy.test.c
give.test.c
guard.test.c
json.test.c json.test.c
keyword.test.c keyword.test.c
give.test.c
laws.test.c laws.test.c
lighthouse.test.c lighthouse.test.c
magic.test.c magic.test.c
market.test.c market.test.c
monsters.test.c monsters.test.c
move.test.c move.test.c
names.test.c
piracy.test.c piracy.test.c
prefix.test.c prefix.test.c
renumber.test.c renumber.test.c
reports.test.c
report.test.c
summary.test.c
skill.test.c skill.test.c
spells.test.c spells.test.c
spy.test.c spy.test.c
study.test.c study.test.c
tests.test.c
travelthru.test.c
upkeep.test.c upkeep.test.c
volcano.test.c
vortex.test.c
wormhole.test.c
spells/flyingship.test.c spells/flyingship.test.c
spells/magicresistance.test.c spells/magicresistance.test.c
triggers/shock.test.c triggers/shock.test.c

25
src/calendar.test.c Normal file
View File

@ -0,0 +1,25 @@
#include <platform.h>
#include "calendar.h"
#include <kernel/config.h>
#include <CuTest.h>
#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;
}

View File

@ -116,35 +116,36 @@ int RunAllTests(int argc, char *argv[])
ADD_SUITE(ally); ADD_SUITE(ally);
ADD_SUITE(messages); ADD_SUITE(messages);
/* gamecode */ /* gamecode */
ADD_SUITE(guard);
ADD_SUITE(report);
ADD_SUITE(creport);
ADD_SUITE(summary);
ADD_SUITE(names);
ADD_SUITE(battle); ADD_SUITE(battle);
ADD_SUITE(volcano); ADD_SUITE(calendar);
ADD_SUITE(creport);
ADD_SUITE(donations); ADD_SUITE(donations);
ADD_SUITE(travelthru);
ADD_SUITE(economy); ADD_SUITE(economy);
ADD_SUITE(flyingship); ADD_SUITE(flyingship);
ADD_SUITE(give); ADD_SUITE(give);
ADD_SUITE(guard);
ADD_SUITE(key);
ADD_SUITE(laws); ADD_SUITE(laws);
ADD_SUITE(lighthouse); ADD_SUITE(lighthouse);
ADD_SUITE(market); ADD_SUITE(market);
ADD_SUITE(monsters); ADD_SUITE(monsters);
ADD_SUITE(move); ADD_SUITE(move);
ADD_SUITE(names);
ADD_SUITE(otherfaction);
ADD_SUITE(piracy); ADD_SUITE(piracy);
ADD_SUITE(prefix); ADD_SUITE(prefix);
ADD_SUITE(renumber); ADD_SUITE(renumber);
ADD_SUITE(key); ADD_SUITE(report);
ADD_SUITE(shock);
ADD_SUITE(spy);
ADD_SUITE(stealth); ADD_SUITE(stealth);
ADD_SUITE(otherfaction); ADD_SUITE(study);
ADD_SUITE(summary);
ADD_SUITE(travelthru);
ADD_SUITE(upkeep); ADD_SUITE(upkeep);
ADD_SUITE(volcano);
ADD_SUITE(vortex); ADD_SUITE(vortex);
ADD_SUITE(wormhole); ADD_SUITE(wormhole);
ADD_SUITE(spy);
ADD_SUITE(study);
ADD_SUITE(shock);
if (suites) { if (suites) {
CuSuite *summary = CuSuiteNew(); CuSuite *summary = CuSuiteNew();