forked from github/server
add a test for get_monsters().
I want to make sure I don't break this in the future.
This commit is contained in:
parent
5c7b93d0ce
commit
fb7c8a898f
|
@ -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;
|
||||||
|
}
|
|
@ -63,6 +63,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