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
e69fb78e6b
commit
acfe72f24e
|
@ -223,7 +223,7 @@
|
|||
</string>
|
||||
<string name="seashell">
|
||||
<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
|
||||
als einen Besucher der Botschafterregion 'Muschelplateau'.</text>
|
||||
</string>
|
||||
|
|
|
@ -3,6 +3,7 @@ project(kernel C)
|
|||
SET(_TEST_FILES
|
||||
build.test.c
|
||||
config.test.c
|
||||
faction.test.c
|
||||
save.test.c
|
||||
ship.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, umlaut);
|
||||
/* kernel */
|
||||
ADD_TESTS(suite, faction);
|
||||
ADD_TESTS(suite, build);
|
||||
ADD_TESTS(suite, pool);
|
||||
ADD_TESTS(suite, curse);
|
||||
|
|
Loading…
Reference in New Issue