summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/json/wall-atlas-02_groups.json7
-rw-r--r--test/wall-atlas.cpp11
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