summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-11-22 10:18:32 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-11-22 10:18:32 +0100
commit0f9235dad59619b0b3b3e518b287e3fb8103481f (patch)
tree9f75d7dc0be89be3bcdd3d3fff1ba831fb991db1
parenta0734389692cc09af3344020506e7a8998e2d6a9 (diff)
a
-rw-r--r--test/wall-atlas.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/wall-atlas.cpp b/test/wall-atlas.cpp
index 5bf143d8..c04aaeba 100644
--- a/test/wall-atlas.cpp
+++ b/test/wall-atlas.cpp
@@ -41,7 +41,8 @@ void test_read_header(StringView filename)
void test_read_groups(StringView filename)
{
constexpr Group group_defaults;
- const auto jroot = json_helper::from_json_(Path::join(json_path(), filename));
+ const auto path = Path::join(json_path(), filename);
+ const auto jroot = json_helper::from_json_(path);
auto info = read_info_header(jroot);
fm_assert(info.name == "foo"_s);
@@ -70,6 +71,13 @@ void test_read_groups(StringView filename)
fm_assert(dir.overlay.tint_mult == Vector4{0.125f, 0.25f, 0.5f, 1.f } );
fm_assert(dir.overlay.tint_add == Vector3{1, 2, 3} );
fm_assert(dir.overlay.mirrored == true );
+
+ const auto atlas2 = wall_atlas_def::deserialize(path);
+ fm_assert(atlas2.header == info);
+ auto idx2 = atlas2.direction_to_Direction_array_index[(size_t)Direction_::W];
+ fm_assert(idx2);
+ const auto& dir2 = atlas2.direction_array[idx2.val];
+ fm_assert(dir == dir2);
}
[[nodiscard]] wall_atlas_def read_and_check(StringView filename)