forked from github/server
29 lines
705 B
C
29 lines
705 B
C
#include <platform.h>
|
|
#include <kernel/config.h>
|
|
|
|
#include "save.h"
|
|
#include "version.h"
|
|
#include <CuTest.h>
|
|
#include <tests.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
static void test_readwrite_data(CuTest * tc)
|
|
{
|
|
const char *filename = "test.dat";
|
|
char path[MAX_PATH];
|
|
test_cleanup();
|
|
sprintf(path, "%s/%s", datapath(), filename);
|
|
CuAssertIntEquals(tc, 0, writegame(filename));
|
|
CuAssertIntEquals(tc, 0, readgame(filename, false));
|
|
CuAssertIntEquals(tc, RELEASE_VERSION, global.data_version);
|
|
CuAssertIntEquals(tc, 0, remove(path));
|
|
test_cleanup();
|
|
}
|
|
|
|
CuSuite *get_save_suite(void)
|
|
{
|
|
CuSuite *suite = CuSuiteNew();
|
|
SUITE_ADD_TEST(suite, test_readwrite_data);
|
|
return suite;
|
|
}
|