summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-04-08 17:05:16 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-04-08 19:40:10 +0200
commit064379bd0bd929f6b87c50f740e9a783b4d9e054 (patch)
treeb717428ace85bde06fff19ac96b11d95787b538f /test
parent4eefaf4e12199c071d2e6ee0d99b46d2e1d45557 (diff)
a
Diffstat (limited to 'test')
-rw-r--r--test/serializer.cpp8
1 files changed, 5 insertions, 3 deletions
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<const critter&>(ae);
const auto& e2 = static_cast<const critter&>(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());
}
}
}