Commit 26f037cf authored by Mike Iovine's avatar Mike Iovine
Browse files

Add more tests

parent 27b5e31d
No related merge requests found
Pipeline #30570 failed with stage
in 0 seconds
Showing with 19 additions and 4 deletions
+19 -4
......@@ -198,12 +198,27 @@ TEST (HuffmanTests, TestReadChunkFixed) {
ASSERT_EQ (read_chunk((char *) buf, HUFFMAN_FIXED), i);
}
/* Test reading all possible fixed distances */
// TODO test fixed distance codes as well?
}
/*
* Mapping of distance literal -> code, again, as laid out in memory.
*/
int codes_dist[30] = {0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22,
14, 30, 1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11,
27, 7, 23};
for (int i = 0; i < 30; i++) {
reset_pos();
// TODO
TEST (HuffmanTests, TestReadLens) {}
int code = codes_dist[i];
unsigned char buf[1];
buf[0] = code;
ASSERT_EQ (read_chunk((char *) buf, HUFFMAN_FIXED_DISTS), i);
}
}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment