| 5 | #include <gtest/gtest.h> |
| 6 | |
| 7 | TEST(Huffman, CompressionShouldNotChangeData) |
| 8 | { |
| 9 | CHuffman Huffman; |
| 10 | Huffman.Init(); |
| 11 | |
| 12 | unsigned char aInput[64]; |
| 13 | unsigned char aCompressed[2048]; |
| 14 | |
| 15 | mem_zero(aInput, sizeof(aInput)); |
| 16 | mem_zero(aCompressed, sizeof(aCompressed)); |
| 17 | |
| 18 | int Size = Huffman.Compress(aInput, sizeof(aInput), aCompressed, sizeof(aCompressed)); |
| 19 | |
| 20 | unsigned char aDecompressed[2048]; |
| 21 | Huffman.Decompress(aCompressed, sizeof(aCompressed), aDecompressed, sizeof(aDecompressed)); |
| 22 | |
| 23 | int match = mem_comp(aInput, aDecompressed, Size); |
| 24 | EXPECT_EQ(match, 0); |
| 25 | } |
| 26 | |
| 27 | TEST(Huffman, CompressionCompatible) |
| 28 | { |
nothing calls this directly
no test coverage detected