server/src/kernel/gamedata.test.c
2018-09-29 13:21:46 +02:00

27 lines
597 B
C

#include <platform.h>
#include "gamedata.h"
#include <CuTest.h>
#include <tests.h>
#include <stdio.h>
static void test_gamedata(CuTest * tc)
{
gamedata *data;
data = gamedata_open("test.dat", "wb", 0);
CuAssertPtrNotNull(tc, data);
gamedata_close(data);
free(data);
data = gamedata_open("test.dat", "rb", 0);
CuAssertPtrNotNull(tc, data);
gamedata_close(data);
free(data);
CuAssertIntEquals(tc, 0, remove("test.dat"));
}
CuSuite *get_gamedata_suite(void)
{
CuSuite *suite = CuSuiteNew();
SUITE_ADD_TEST(suite, test_gamedata);
return suite;
}