diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-09 11:41:37 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-09 11:41:37 +0200 |
commit | 6d9591660a1f83e8abe1f1d4f1ca68a9ae7a8325 (patch) | |
tree | b8039e25d4111e8c86932fb6364d7931dcea52d7 | |
parent | e9cd43f3b017c148497e3185c4b397f124399c8f (diff) |
a
-rw-r--r-- | test/app.cpp | 2 | ||||
-rw-r--r-- | test/app.hpp | 2 | ||||
-rw-r--r-- | test/save.cpp (renamed from test/serializer.cpp) | 15 |
3 files changed, 13 insertions, 6 deletions
diff --git a/test/app.cpp b/test/app.cpp index 0ff2bdaa..38269296 100644 --- a/test/app.cpp +++ b/test/app.cpp @@ -61,7 +61,7 @@ int test_app::exec() FM_TEST(test_json3), FM_TEST(test_bitmask), FM_TEST(test_loader2), - FM_TEST(test_serializer1), + FM_TEST(test_save), FM_TEST(test_loader3), FM_TEST(test_astar_pool), FM_TEST(test_astar), diff --git a/test/app.hpp b/test/app.hpp index 6ec88371..98e08523 100644 --- a/test/app.hpp +++ b/test/app.hpp @@ -42,7 +42,7 @@ struct test_app final : private FM_APPLICATION static void test_region(); static void test_saves(); static void test_script(); - static void test_serializer1(); + static void test_save(); static void test_tile_iter(); static void test_wall_atlas(); static void test_wall_atlas2(); diff --git a/test/serializer.cpp b/test/save.cpp index c933a12f..a2c7f48a 100644 --- a/test/serializer.cpp +++ b/test/save.cpp @@ -117,7 +117,7 @@ void assert_chunks_equal(const chunk& a, const chunk& b) } } -void test_serializer(StringView input, StringView tmp) +void test_save1(StringView input, StringView tmp) { if (Path::exists(tmp)) Path::remove(tmp); @@ -139,13 +139,20 @@ void test_serializer(StringView input, StringView tmp) assert_chunks_equal(w[coord], c2); } +void test_offset_frac(StringView tmp) +{ + // todo! test non-zero offset_frac +} + } // namespace -void test_app::test_serializer1() +void test_app::test_save() { fm_assert(Path::exists(Path::join(loader.TEMP_PATH, "CMakeCache.txt"))); const auto tmp_filename = Path::join(loader.TEMP_PATH, "test/test-serializer1.dat"_s); - test_serializer({}, tmp_filename); + + test_save1({}, tmp_filename); + test_offset_frac(tmp_filename); } void test_app::test_saves() @@ -160,7 +167,7 @@ void test_app::test_saves() { fm_assert(file.hasSuffix(".dat"_s)); auto path = Path::join(dir, file); - test_serializer(path, tmp_filename); + test_save1(path, tmp_filename); } } |