Skip to content

Commit 24c6cf4

Browse files
committed
fix: re-enable serialization tests in llmq_snapshot_tests
1 parent f818d13 commit 24c6cf4

File tree

1 file changed

+12
-31
lines changed

1 file changed

+12
-31
lines changed

src/test/llmq_snapshot_tests.cpp

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,16 @@ BOOST_AUTO_TEST_CASE(quorum_snapshot_empty_data_test)
116116
// Test with empty data
117117
CQuorumSnapshot emptySnapshot({}, MODE_NO_SKIPPING, {});
118118

119-
// TODO: Serialization roundtrip tests are disabled because CQuorumSnapshot uses custom
120-
// serialization for bit vectors that may not produce byte-identical output after roundtrip.
121-
// These tests should be re-enabled once proper equality operators are implemented for CQuorumSnapshot.
122-
// TODO: Enable serialization roundtrip test once CQuorumSnapshot serialization is fixed
123-
// BOOST_CHECK(TestSerializationRoundtrip(emptySnapshot));
119+
// Test serialization roundtrip
120+
BOOST_CHECK(TestSerializationRoundtrip(emptySnapshot));
124121

125122
// Test with empty active members but non-empty skip list
126123
CQuorumSnapshot snapshot1({}, MODE_SKIPPING_ENTRIES, {1, 2, 3});
127-
// TODO: See above - custom bit vector serialization prevents byte-identical roundtrip
128-
// TODO: Enable serialization roundtrip test once CQuorumSnapshot serialization is fixed
129-
// BOOST_CHECK(TestSerializationRoundtrip(snapshot1));
124+
BOOST_CHECK(TestSerializationRoundtrip(snapshot1));
130125

131126
// Test with non-empty active members but empty skip list
132127
CQuorumSnapshot snapshot2({true, false, true}, MODE_NO_SKIPPING, {});
133-
// TODO: See above - custom bit vector serialization prevents byte-identical roundtrip
134-
// TODO: Enable serialization roundtrip test once CQuorumSnapshot serialization is fixed
135-
// BOOST_CHECK(TestSerializationRoundtrip(snapshot2));
128+
BOOST_CHECK(TestSerializationRoundtrip(snapshot2));
136129
}
137130

138131
BOOST_AUTO_TEST_CASE(quorum_snapshot_bit_serialization_test)
@@ -141,32 +134,24 @@ BOOST_AUTO_TEST_CASE(quorum_snapshot_bit_serialization_test)
141134

142135
// Test single bit
143136
CQuorumSnapshot snapshot1({true}, MODE_NO_SKIPPING, {});
144-
// TODO: See above - custom bit vector serialization prevents byte-identical roundtrip
145-
// TODO: Enable serialization roundtrip test once CQuorumSnapshot serialization is fixed
146-
// BOOST_CHECK(TestSerializationRoundtrip(snapshot1));
137+
BOOST_CHECK(TestSerializationRoundtrip(snapshot1));
147138

148139
// Test 8 bits (full byte)
149140
CQuorumSnapshot snapshot8(std::vector<bool>(8, true), MODE_NO_SKIPPING, {});
150-
// TODO: See above - custom bit vector serialization prevents byte-identical roundtrip
151-
// TODO: Enable serialization roundtrip test once CQuorumSnapshot serialization is fixed
152-
// BOOST_CHECK(TestSerializationRoundtrip(snapshot8));
141+
BOOST_CHECK(TestSerializationRoundtrip(snapshot8));
153142

154143
// Test 9 bits (more than one byte)
155144
CQuorumSnapshot snapshot9(std::vector<bool>(9, false), MODE_NO_SKIPPING, {});
156145
snapshot9.activeQuorumMembers[8] = true; // Set last bit
157-
// TODO: See above - custom bit vector serialization prevents byte-identical roundtrip
158-
// TODO: Enable serialization roundtrip test once CQuorumSnapshot serialization is fixed
159-
// BOOST_CHECK(TestSerializationRoundtrip(snapshot9));
146+
BOOST_CHECK(TestSerializationRoundtrip(snapshot9));
160147

161148
// Test alternating pattern
162149
std::vector<bool> alternating(16);
163150
for (size_t i = 0; i < alternating.size(); i++) {
164151
alternating[i] = (i % 2 == 0);
165152
}
166153
CQuorumSnapshot snapshotAlt(alternating, MODE_NO_SKIPPING, {});
167-
// TODO: See above - custom bit vector serialization prevents byte-identical roundtrip
168-
// TODO: Enable serialization roundtrip test once CQuorumSnapshot serialization is fixed
169-
// BOOST_CHECK(TestSerializationRoundtrip(snapshotAlt));
154+
BOOST_CHECK(TestSerializationRoundtrip(snapshotAlt));
170155
}
171156

172157
BOOST_AUTO_TEST_CASE(quorum_rotation_info_construction_test)
@@ -185,7 +170,7 @@ BOOST_AUTO_TEST_CASE(quorum_rotation_info_construction_test)
185170
// Note: CQuorumRotationInfo serialization requires complex setup
186171
// This is better tested in functional tests
187172

188-
BOOST_AUTO_TEST_CASE(get_quorum_rotation_info_test)
173+
BOOST_AUTO_TEST_CASE(get_quorum_rotation_info_serialization_test)
189174
{
190175
CGetQuorumRotationInfo getInfo;
191176

@@ -194,19 +179,15 @@ BOOST_AUTO_TEST_CASE(get_quorum_rotation_info_test)
194179
getInfo.blockRequestHash = GetTestBlockHash(100);
195180
getInfo.extraShare = true;
196181

197-
// TODO: CGetQuorumRotationInfo serialization test disabled - uses standard SERIALIZE_METHODS
198-
// but may have issues with empty vectors. Should investigate and re-enable.
199-
// TODO: Enable serialization roundtrip test once CGetQuorumsBaseBlockInfo serialization is fixed
200-
// BOOST_CHECK(TestSerializationRoundtrip(getInfo));
182+
// Test serialization
183+
BOOST_CHECK(TestSerializationRoundtrip(getInfo));
201184

202185
// Test with empty base block hashes
203186
CGetQuorumRotationInfo emptyInfo;
204187
emptyInfo.blockRequestHash = GetTestBlockHash(200);
205188
emptyInfo.extraShare = false;
206189

207-
// TODO: See above - investigate serialization issues with empty base block hashes
208-
// TODO: Enable serialization roundtrip test once CGetQuorumsBaseBlockInfo serialization is fixed
209-
// BOOST_CHECK(TestSerializationRoundtrip(emptyInfo));
190+
BOOST_CHECK(TestSerializationRoundtrip(emptyInfo));
210191
}
211192

212193
BOOST_AUTO_TEST_CASE(quorum_snapshot_json_test)

0 commit comments

Comments
 (0)