diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-05 21:30:17 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-05 21:30:17 +0100 |
commit | 6e3e64671cbf33cbf050a2f5c577e13e5851b27f (patch) | |
tree | 421c0f43d6405249012df5240ad2caa7d13d25f9 /test | |
parent | 7f82a729ae5074beafb6b4fd50d2f025dd05dfbe (diff) |
wip
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 1 | ||||
-rw-r--r-- | test/json/frameset-header2.json | 9 | ||||
-rw-r--r-- | test/json/wall-atlas-header1.json (renamed from test/json/frameset-header.json) | 0 | ||||
-rw-r--r-- | test/wall-atlas.cpp | 33 |
4 files changed, 14 insertions, 29 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 897268f3..8473f091 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -21,7 +21,6 @@ endif() fm_add_install_executable(${self}) set(save-dir "${CMAKE_BINARY_DIR}/test/save") -file(REMOVE_RECURSE "${save-dir}") file(GLOB files "save/*.dat" CONFIGURE_ARGS) foreach(file ${files}) install(FILES "${file}" DESTINATION "${save-dir}") diff --git a/test/json/frameset-header2.json b/test/json/frameset-header2.json deleted file mode 100644 index 8b32cabc..00000000 --- a/test/json/frameset-header2.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "foo", - "depth": 42, - "framesets": { - "w": {}, - "n": {} - }, - "frames": [] -} diff --git a/test/json/frameset-header.json b/test/json/wall-atlas-header1.json index 8b32cabc..8b32cabc 100644 --- a/test/json/frameset-header.json +++ b/test/json/wall-atlas-header1.json diff --git a/test/wall-atlas.cpp b/test/wall-atlas.cpp index b9ba2aec..9fbd4579 100644 --- a/test/wall-atlas.cpp +++ b/test/wall-atlas.cpp @@ -7,25 +7,21 @@ #include <Corrade/Containers/PairStl.h> #include <Corrade/Utility/Path.h> -namespace floormat { +namespace floormat::Wall::detail { using nlohmann::json; namespace { -[[nodiscard]] Pair<wall_atlas_def, json> test_atlas_header(StringView path, StringView filename) +void test_atlas_header(StringView path, StringView filename) { - auto j = json_helper::from_json_(Path::join(path, filename)); - wall_atlas_def def; - test::read_atlas_header(j, def); + auto jroot = json_helper::from_json_(Path::join(path, filename)); + auto info = read_info_header(jroot); - fm_assert(def.info.name == "foo"_s); - fm_assert(def.info.depth == 42); - fm_assert(def.dir_count == 2); - - constexpr auto none = (uint8_t)-1; - enum : uint8_t { N, E, S, W, }; + fm_assert(info.name == "foo"_s); + fm_assert(info.depth == 42); +#if 0 fm_assert(def.dir_indexes[N] == 0 || def.dir_indexes[N] == 1); fm_assert(def.dir_indexes[E] == none); fm_assert(def.dir_indexes[S] == none); @@ -36,21 +32,20 @@ namespace { fm_assert(def.dir_indexes[W] == 0); else fm_assert(false); - - return {std::move(def), std::move(j)}; +#endif } } // namespace -void test_app::test_wall_atlas() +} // namespace floormat::Wall::detail + +void floormat::test_app::test_wall_atlas() { + using namespace floormat::Wall::detail; + fm_assert(Path::exists(Path::join(loader.TEMP_PATH, "CMakeCache.txt"))); const auto path = Path::join(loader.TEMP_PATH, "test/json"_s); fm_assert(Path::isDirectory(path)); - (void)test_atlas_header(path, "frame_direction-header.json"_s); + (void)test_atlas_header(path, "wall-atlas-header1.json"_s); } - - - -} // namespace floormat |