forked from github/server
Merge pull request #29 from badgerman/master
add a test for get_monsters().
This commit is contained in:
commit
73d3980e72
|
@ -223,7 +223,7 @@
|
||||||
</string>
|
</string>
|
||||||
<string name="seashell">
|
<string name="seashell">
|
||||||
<text locale="en">This badge pronounces its wearer an official visitor to the
|
<text locale="en">This badge pronounces its wearer an official visitor to the
|
||||||
region of Muschelplateau.</text>
|
embassies of Muschelplateau.</text>
|
||||||
<text locale="de">Dieses Abzeichen identifiziert die Partei seines Trägers offiziell
|
<text locale="de">Dieses Abzeichen identifiziert die Partei seines Trägers offiziell
|
||||||
als einen Besucher der Botschafterregion 'Muschelplateau'.</text>
|
als einen Besucher der Botschafterregion 'Muschelplateau'.</text>
|
||||||
</string>
|
</string>
|
||||||
|
|
|
@ -3,6 +3,7 @@ project(kernel C)
|
||||||
SET(_TEST_FILES
|
SET(_TEST_FILES
|
||||||
build.test.c
|
build.test.c
|
||||||
config.test.c
|
config.test.c
|
||||||
|
faction.test.c
|
||||||
save.test.c
|
save.test.c
|
||||||
ship.test.c
|
ship.test.c
|
||||||
spell.test.c
|
spell.test.c
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
#include <platform.h>
|
||||||
|
#include <kernel/types.h>
|
||||||
|
#include <kernel/config.h>
|
||||||
|
#include "faction.h"
|
||||||
|
#include <CuTest.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
void test_get_monsters(CuTest *tc) {
|
||||||
|
faction *f;
|
||||||
|
CuAssertPtrEquals(tc, NULL, get_monsters());
|
||||||
|
f = get_or_create_monsters();
|
||||||
|
CuAssertPtrEquals(tc, f, get_monsters());
|
||||||
|
CuAssertIntEquals(tc, 666, f->no);
|
||||||
|
CuAssertStrEquals(tc, "Monster", f->name);
|
||||||
|
free_gamedata();
|
||||||
|
CuAssertPtrEquals(tc, NULL, get_monsters());
|
||||||
|
f = get_or_create_monsters();
|
||||||
|
CuAssertPtrEquals(tc, f, get_monsters());
|
||||||
|
CuAssertIntEquals(tc, 666, f->no);
|
||||||
|
}
|
||||||
|
|
||||||
|
CuSuite *get_faction_suite(void)
|
||||||
|
{
|
||||||
|
CuSuite *suite = CuSuiteNew();
|
||||||
|
SUITE_ADD_TEST(suite, test_get_monsters);
|
||||||
|
return suite;
|
||||||
|
}
|
|
@ -34,6 +34,7 @@ int RunAllTests(void)
|
||||||
ADD_TESTS(suite, functions);
|
ADD_TESTS(suite, functions);
|
||||||
ADD_TESTS(suite, umlaut);
|
ADD_TESTS(suite, umlaut);
|
||||||
/* kernel */
|
/* kernel */
|
||||||
|
ADD_TESTS(suite, faction);
|
||||||
ADD_TESTS(suite, build);
|
ADD_TESTS(suite, build);
|
||||||
ADD_TESTS(suite, pool);
|
ADD_TESTS(suite, pool);
|
||||||
ADD_TESTS(suite, curse);
|
ADD_TESTS(suite, curse);
|
||||||
|
|
Loading…
Reference in New Issue