Fix binary protocol test fixtures

This commit is contained in:
jack
2025-10-15 17:37:19 +01:00
committed by islam
parent ba49b885bb
commit 5beff8b4dc
2 changed files with 5 additions and 3 deletions
@@ -68,8 +68,9 @@ struct BinaryProtocolTests {
let encodedData = try #require(BinaryProtocol.encode(packet), "Failed to encode packet with large payload")
// The encoded size should be smaller than uncompressed due to compression
let uncompressedSize = BinaryProtocol.headerSize + BinaryProtocol.senderIDSize + largePayload.count
#expect(encodedData.count < uncompressedSize)
let headerSize = BinaryProtocol.headerSize(for: packet.version)
let uncompressedSize = headerSize + BinaryProtocol.senderIDSize + largePayload.count
#expect(encodedData.count < uncompressedSize, "Compressed packet should be smaller than uncompressed form")
// Decode and verify
let decodedPacket = try #require(BinaryProtocol.decode(encodedData), "Failed to decode compressed packet")