From 064379bd0bd929f6b87c50f740e9a783b4d9e054 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 8 Apr 2024 17:05:16 +0200 Subject: a --- test/serializer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/serializer.cpp b/test/serializer.cpp index 86105d3b..c933a12f 100644 --- a/test/serializer.cpp +++ b/test/serializer.cpp @@ -85,9 +85,13 @@ void assert_chunks_equal(const chunk& a, const chunk& b) { const auto& ae = *a.objects()[i]; const auto& be = *b.objects()[i]; + const auto type = ae.type(); fm_assert(ae.type() == be.type()); - switch (ae.type()) + fm_assert(type < object_type::COUNT && type != object_type::none); + switch (type) { + case object_type::none: + case object_type::COUNT: std::unreachable(); case object_type::critter: { const auto& e1 = static_cast(ae); const auto& e2 = static_cast(be); @@ -109,8 +113,6 @@ void assert_chunks_equal(const chunk& a, const chunk& b) fm_assert(p1 == p2); break; } - default: - fm_abort("invalid object type '%d'", (int)ae.type()); } } } -- cgit v1.2.3