From 2fd3b6f068410f5a0e0d0110206224265800dfaa Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Wed, 24 Jul 2024 20:51:23 +0200 Subject: [PATCH] #268: Add check for type id in virtual serialize test --- tests/unit/test_virtual_serialize.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/unit/test_virtual_serialize.cc b/tests/unit/test_virtual_serialize.cc index de515f33..cea61c7f 100644 --- a/tests/unit/test_virtual_serialize.cc +++ b/tests/unit/test_virtual_serialize.cc @@ -618,20 +618,21 @@ INSTANTIATE_TYPED_TEST_CASE_P( using TestDeserializationFromBase = TestHarness; template -void testDeserializationFromBase() { +void testDeserializationFromBase(TestEnum expected_id) { std::unique_ptr task(new Derived(TEST_CONSTRUCT{})); auto ret = checkpoint::serialize(*task); auto out = checkpoint::deserialize(std::move(ret)); EXPECT_TRUE(nullptr != out); - EXPECT_EQ(TestEnum::Derived2, out->getID()); + EXPECT_EQ(expected_id, out->getID()); out->check(); } -TEST_F(TestDeserializationFromBase, test_deserilization_from_base) { - testDeserializationFromBase(); - testDeserializationFromBase(); - testDeserializationFromBase(); +TEST_F(TestDeserializationFromBase, test_deserialization_from_base) { + testDeserializationFromBase( + TestEnum::Derived3); + testDeserializationFromBase( + TestEnum::Derived2); } ////////////////////////////////////////////////////////////////////////////////