2016-02-13 07:50:06 +01:00
|
|
|
#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);
|
2016-03-11 09:45:39 +01:00
|
|
|
free(data);
|
2016-02-13 07:50:06 +01:00
|
|
|
data = gamedata_open("test.dat", "rb", 0);
|
|
|
|
CuAssertPtrNotNull(tc, data);
|
|
|
|
gamedata_close(data);
|
2016-03-11 09:43:16 +01:00
|
|
|
free(data);
|
2016-02-13 07:50:06 +01:00
|
|
|
CuAssertIntEquals(tc, 0, remove("test.dat"));
|
|
|
|
}
|
|
|
|
|
|
|
|
CuSuite *get_gamedata_suite(void)
|
|
|
|
{
|
|
|
|
CuSuite *suite = CuSuiteNew();
|
|
|
|
SUITE_ADD_TEST(suite, test_gamedata);
|
|
|
|
return suite;
|
|
|
|
}
|