mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
Decode the lcode and dcode code lengths.
This commit is contained in:
1 parent
9933c971a2
commit
e772352036
4 files changed
+160
-101
No files matched your search
+26
-56
@@ -228,72 +228,42 @@ void test_puffs_flate_work_in_progress() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (dec.private_impl.f_wip0 != 266) {
|
||||
FAIL("wip0: got %" PRIu32 ", want %" PRIu32, dec.private_impl.f_wip0,
|
||||
(uint32_t)(266));
|
||||
// As per the package's README.md:
|
||||
// lcode_lengths[31] = 0
|
||||
// lcode_lengths[32] = 4
|
||||
// lcode_lengths[33] = 8
|
||||
// lcode_lengths[34] = 0
|
||||
// etc
|
||||
// dcode_lengths[18] = 3
|
||||
// dcode_lengths[19] = 6
|
||||
if (dec.private_impl.f_code_lengths[31] != 0) {
|
||||
FAIL("cl[31]: got %" PRIu8 ", want %" PRIu8,
|
||||
dec.private_impl.f_code_lengths[31], (uint8_t)(0));
|
||||
return;
|
||||
}
|
||||
if (dec.private_impl.f_wip1 != 20) {
|
||||
FAIL("wip1: got %" PRIu32 ", want %" PRIu32, dec.private_impl.f_wip1,
|
||||
(uint32_t)(20));
|
||||
if (dec.private_impl.f_code_lengths[32] != 4) {
|
||||
FAIL("cl[32]: got %" PRIu8 ", want %" PRIu8,
|
||||
dec.private_impl.f_code_lengths[32], (uint8_t)(4));
|
||||
return;
|
||||
}
|
||||
|
||||
if (dec.private_impl.f_code_lengths[16] != 0) {
|
||||
FAIL("cl[16]: got %" PRIu8 ", want %" PRIu8,
|
||||
dec.private_impl.f_code_lengths[16], (uint8_t)(0));
|
||||
if (dec.private_impl.f_code_lengths[33] != 8) {
|
||||
FAIL("cl[33]: got %" PRIu8 ", want %" PRIu8,
|
||||
dec.private_impl.f_code_lengths[33], (uint8_t)(8));
|
||||
return;
|
||||
}
|
||||
if (dec.private_impl.f_code_lengths[17] != 4) {
|
||||
FAIL("cl[17]: got %" PRIu8 ", want %" PRIu8,
|
||||
dec.private_impl.f_code_lengths[17], (uint8_t)(4));
|
||||
if (dec.private_impl.f_code_lengths[34] != 0) {
|
||||
FAIL("cl[34]: got %" PRIu8 ", want %" PRIu8,
|
||||
dec.private_impl.f_code_lengths[34], (uint8_t)(0));
|
||||
return;
|
||||
}
|
||||
if (dec.private_impl.f_code_lengths[18] != 5) {
|
||||
FAIL("cl[18]: got %" PRIu8 ", want %" PRIu8,
|
||||
dec.private_impl.f_code_lengths[18], (uint8_t)(5));
|
||||
if (dec.private_impl.f_code_lengths[266 + 18] != 3) {
|
||||
FAIL("cl[266 + 18]: got %" PRIu8 ", want %" PRIu8,
|
||||
dec.private_impl.f_code_lengths[266 + 18], (uint8_t)(3));
|
||||
return;
|
||||
}
|
||||
if (dec.private_impl.f_code_lengths[3] != 5) {
|
||||
FAIL("cl[3]: got %" PRIu8 ", want %" PRIu8,
|
||||
dec.private_impl.f_code_lengths[3], (uint8_t)(5));
|
||||
return;
|
||||
}
|
||||
|
||||
if (dec.private_impl.f_huffs[0].private_impl.f_counts[3] != 7) {
|
||||
FAIL("c[3]: got %" PRIu16 ", want %" PRIu16,
|
||||
dec.private_impl.f_huffs[0].private_impl.f_counts[3], (uint16_t)(7));
|
||||
return;
|
||||
}
|
||||
if (dec.private_impl.f_huffs[0].private_impl.f_counts[4] != 1) {
|
||||
FAIL("c[4]: got %" PRIu16 ", want %" PRIu16,
|
||||
dec.private_impl.f_huffs[0].private_impl.f_counts[4], (uint16_t)(1));
|
||||
return;
|
||||
}
|
||||
if (dec.private_impl.f_huffs[0].private_impl.f_counts[5] != 2) {
|
||||
FAIL("c[5]: got %" PRIu16 ", want %" PRIu16,
|
||||
dec.private_impl.f_huffs[0].private_impl.f_counts[5], (uint16_t)(2));
|
||||
return;
|
||||
}
|
||||
|
||||
if (dec.private_impl.f_huffs[0].private_impl.f_symbols[6] != 9) {
|
||||
FAIL("s[6]: got %" PRIu16 ", want %" PRIu16,
|
||||
dec.private_impl.f_huffs[0].private_impl.f_symbols[6], (uint16_t)(9));
|
||||
return;
|
||||
}
|
||||
if (dec.private_impl.f_huffs[0].private_impl.f_symbols[7] != 17) {
|
||||
FAIL("s[7]: got %" PRIu16 ", want %" PRIu16,
|
||||
dec.private_impl.f_huffs[0].private_impl.f_symbols[7], (uint16_t)(17));
|
||||
return;
|
||||
}
|
||||
if (dec.private_impl.f_huffs[0].private_impl.f_symbols[8] != 3) {
|
||||
FAIL("s[8]: got %" PRIu16 ", want %" PRIu16,
|
||||
dec.private_impl.f_huffs[0].private_impl.f_symbols[8], (uint16_t)(3));
|
||||
return;
|
||||
}
|
||||
if (dec.private_impl.f_huffs[0].private_impl.f_symbols[9] != 18) {
|
||||
FAIL("s[9]: got %" PRIu16 ", want %" PRIu16,
|
||||
dec.private_impl.f_huffs[0].private_impl.f_symbols[9], (uint16_t)(18));
|
||||
if (dec.private_impl.f_code_lengths[266 + 19] != 6) {
|
||||
FAIL("cl[266 + 19]: got %" PRIu8 ", want %" PRIu8,
|
||||
dec.private_impl.f_code_lengths[266 + 19], (uint8_t)(6));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user