From 59a6c2262560f8bf9c0212fedf7c2dd064f86932 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 01:27:14 -0700 Subject: [PATCH] test(wom): add WOM3 magic-distinctness check --- tests/test_open_formats.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_open_formats.cpp b/tests/test_open_formats.cpp index fd3abecc..252475cb 100644 --- a/tests/test_open_formats.cpp +++ b/tests/test_open_formats.cpp @@ -79,6 +79,13 @@ TEST_CASE("WOM2 magic differs from WOM1", "[wom]") { REQUIRE(0x314D4F57 != 0x324D4F57); // WOM1 != WOM2 } +TEST_CASE("WOM3 magic is distinct from WOM1/WOM2", "[wom]") { + // WOM3 = "WOM3" little-endian. Distinctness ensures the loader can + // tell which version a file is and pick the right read path. + REQUIRE(0x334D4F57 != 0x314D4F57); // WOM3 != WOM1 + REQUIRE(0x334D4F57 != 0x324D4F57); // WOM3 != WOM2 +} + TEST_CASE("WOM rejects invalid magic", "[wom]") { ensureTestDir(); std::string path = TEST_DIR + "/bad.wom";