| 57 | } |
| 58 | |
| 59 | void TestDecode(const uint8_t* data, size_t size) |
| 60 | { |
| 61 | auto expectedLength = size - sizeof(ChunkHeader); |
| 62 | auto chdr_in = reinterpret_cast<const ChunkHeader*>(data); |
| 63 | ASSERT_EQ(chdr_in->length, expectedLength); |
| 64 | |
| 65 | MemoryStream ms(data, size); |
| 66 | SawyerChunkReader reader(&ms); |
| 67 | auto chunk = reader.ReadChunk(); |
| 68 | ASSERT_EQ(chunk->GetEncoding(), chdr_in->encoding); |
| 69 | ASSERT_EQ(chunk->GetLength(), sizeof(randomdata)); |
| 70 | auto result = memcmp(chunk->GetData(), randomdata, sizeof(randomdata)); |
| 71 | ASSERT_EQ(result, 0); |
| 72 | } |
| 73 | }; |
| 74 | |
| 75 | TEST_F(SawyerCodingTest, write_read_chunk_none) |
nothing calls this directly
no test coverage detected