diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-07 18:33:48 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-07 18:33:48 +0100 |
commit | 039677a6b78f74ef019ac37a5e789efad6093743 (patch) | |
tree | 77451bedf3baec98223e0244684c925b5275c28a | |
parent | c83c8185aad63d8f36f3915814a320fd2da2ff7b (diff) |
a
-rw-r--r-- | test/json/wall-atlas-02_groups.json | 7 | ||||
-rw-r--r-- | test/wall-atlas.cpp | 11 |
2 files changed, 17 insertions, 1 deletions
diff --git a/test/json/wall-atlas-02_groups.json b/test/json/wall-atlas-02_groups.json index c8062b82..5bfafe94 100644 --- a/test/json/wall-atlas-02_groups.json +++ b/test/json/wall-atlas-02_groups.json @@ -4,10 +4,15 @@ "frames": [], "n": {}, "w": { - "wall": {}, + "wall": { + "default-tint": false + }, "side": { "pixel-size": "42 x 192", "default-tint": true + }, + "top": { + "pixel-size": "42 x 192" } } } diff --git a/test/wall-atlas.cpp b/test/wall-atlas.cpp index f5ddf2b5..9d20d50a 100644 --- a/test/wall-atlas.cpp +++ b/test/wall-atlas.cpp @@ -48,6 +48,7 @@ void test_read_empty_direction(StringView filename) 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); @@ -61,9 +62,19 @@ void test_read_groups(StringView filename) fm_assert(read_direction_metadata(jroot, Direction_::N).is_empty()); fm_assert(read_direction_metadata(jroot, Direction_::E).is_empty()); fm_assert(read_direction_metadata(jroot, Direction_::S).is_empty()); + const auto dir = read_direction_metadata(jroot, Direction_::W); + fm_assert(dir.wall.pixel_size == Vector2ui{}); + fm_assert(!dir.wall.default_tint); + fm_assert(dir.wall._default_tint_specified); + fm_assert(dir.side.pixel_size == Vector2ui{42, 192}); + fm_assert(dir.side.default_tint); + fm_assert(dir.side._default_tint_specified); + + fm_assert(dir.top.default_tint == group_defaults.default_tint); + fm_assert(!dir.top._default_tint_specified); } } // namespace |