Guard the image part of the alt_string test against big-endian targets

The test for json_view documents over an alternative string type called alt_editable_document::load() and save(). Both exist only on little-endian targets, so the test suite did not compile on big-endian targets such as s390x. Guard the two image lines with the condition the other image tests use (unit-json_view_image.cpp, unit-json_view_positions.cpp).

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-11-11 08:53:49 +01:00
1 parent 8d591bf720
commit d431462800
1 file changed
+3
+3
View File
@@ -531,8 +531,11 @@ TEST_CASE("alternative string type with json_view")
CHECK(d.root().materialize() == expected); CHECK(d.root().materialize() == expected);
CHECK(alt_json::parse(d.root().dump()) == expected); CHECK(alt_json::parse(d.root().dump()) == expected);
// save() and load() do not exist on big-endian targets
#if !(defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
const alt_editable_document loaded = alt_editable_document::load(d.save()); const alt_editable_document loaded = alt_editable_document::load(d.save());
CHECK(loaded.root().materialize() == expected); CHECK(loaded.root().materialize() == expected);
#endif
} }
} }