From 8602701349dc7649e1c7ebee958757de5dcb687e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 21 Nov 2023 20:46:23 +0100 Subject: test wall atlas header as well --- test/wall-atlas.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/wall-atlas.cpp b/test/wall-atlas.cpp index 2d1e4f85..47dc64ac 100644 --- a/test/wall-atlas.cpp +++ b/test/wall-atlas.cpp @@ -12,6 +12,12 @@ using namespace std::string_view_literals; namespace { +const StringView temp_filename() { + fm_assert(Path::exists(Path::join(loader.TEMP_PATH, "CMakeCache.txt"))); + static const auto tmp_filename = Path::join(loader.TEMP_PATH, "test/test-wall-atlas.json"_s); + return tmp_filename; +}; + StringView json_path() { static const auto path = [] { @@ -50,7 +56,11 @@ void test_read_groups(StringView filename) { constexpr Group group_defaults; const auto jroot = json_helper::from_json_(Path::join(json_path(), filename)); - read_info_header(jroot); + + auto info = read_info_header(jroot); + fm_assert(info.name == "foo"_s); + fm_assert(info.depth == 42); + fm_assert(info.description == ""_s); fm_assert(jroot["depth"sv] == 42); fm_assert( jroot.contains("n"sv) ); @@ -76,6 +86,21 @@ void test_read_groups(StringView filename) fm_assert(dir.overlay.mirrored == true ); } +struct wall_atlas_ +{ + bool operator==(const wall_atlas_&) const noexcept = default; + + Info header; + Array directions; + Array frames; +}; + +void write_to_temp_file() +{ + const auto filename = temp_filename(); + +} + } // namespace } // namespace floormat::Wall::detail -- cgit v1.2.3