#include #include #include "save.h" #include "version.h" #include #include #include 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; }