From 8904cc20c4da3ba911a298c798ac9008cc13d1d4 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Tue, 10 Sep 2024 18:23:39 +0400 Subject: [PATCH] fixed serialization test --- tests/unit_tests/serialization.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/unit_tests/serialization.cpp b/tests/unit_tests/serialization.cpp index 47e0d4c4..bd53b009 100644 --- a/tests/unit_tests/serialization.cpp +++ b/tests/unit_tests/serialization.cpp @@ -757,30 +757,30 @@ struct A struct A_v1 : public A { std::vector vector_two; - + uint8_t current_version = 1; BEGIN_SERIALIZE() FIELD(one) FIELD(two) FIELD(vector_one) - VERSION(1) - if (s_version < 1) return true; + VERSION_TO_MEMBER(1, current_version) FIELD(vector_two) END_SERIALIZE() }; + struct A_v2 : public A_v1 { std::vector vector_3; std::vector vector_4; - + uint8_t current_version = 2; BEGIN_SERIALIZE() //CURRENT_VERSION(2) FIELD(one) FIELD(two) FIELD(vector_one) - VERSION(2) + VERSION_TO_MEMBER(2, current_version) if (s_version < 1) return true; FIELD(vector_two) if (s_version < 2) return true; @@ -792,13 +792,14 @@ struct A_v2 : public A_v1 struct A_v3 : public A_v2 { std::vector vector_5; + uint8_t current_version = 3; BEGIN_SERIALIZE() //CURRENT_VERSION(3) FIELD(one) FIELD(two) FIELD(vector_one) - VERSION(3) + VERSION_TO_MEMBER(3, current_version) if (s_version < 1) return true; FIELD(vector_two) if (s_version < 2) return true;