diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2019-06-17 01:41:29 +0200 |
---|---|---|
committer | laforge <laforge@gnumonks.org> | 2019-06-24 13:51:06 +0000 |
commit | 2d24eba903db365336dce56c29d6fbacf3b88112 (patch) | |
tree | 84c628e47765056a7ab66b747f911ea41c4484c7 /tests | |
parent | 3a499f3cb25035c263a6e630ff7b27a659b6bdea (diff) |
decompress_crbb: add length argument for search_runlen
search_runlen() must know the exact size in bits when parsing
the bits otherwise it read over the buffer.
Fixes testcase #7 which was wrongly decoded.
Change-Id: Ie34a0651e7e7efea4e9ecff1e3a467588113cf47
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bitcomp/BitcompTest.cpp | 5 | ||||
-rw-r--r-- | tests/bitcomp/BitcompTest.err | 9 |
2 files changed, 4 insertions, 10 deletions
diff --git a/tests/bitcomp/BitcompTest.cpp b/tests/bitcomp/BitcompTest.cpp index 3fd3b1af..14246fe4 100644 --- a/tests/bitcomp/BitcompTest.cpp +++ b/tests/bitcomp/BitcompTest.cpp @@ -91,14 +91,13 @@ struct test_data { .ucmp_len = 90, .expect_rc = 0, }, - /* TODO: previously marked as "Invalid inputs" but succeeds */ + /* Invalid inputs */ { .crbb_len = 18, .cc = 1, .crbb_data = {0x1E, 0x70, 0xc0}, .ucmp_data = {0xb0, 0x00, 0x00}, .ucmp_len = 19, - .expect_rc = 0, + .expect_rc = -1, }, - /* Invalid inputs */ { .crbb_len = 14, .cc = 1, .crbb_data = {0x00, 0x1E, 0x7c}, .ucmp_data = {0x0}, diff --git a/tests/bitcomp/BitcompTest.err b/tests/bitcomp/BitcompTest.err index 0642845e..0c9bc665 100644 --- a/tests/bitcomp/BitcompTest.err +++ b/tests/bitcomp/BitcompTest.err @@ -108,13 +108,8 @@ len = 18 Run_length = 1 Run_length = 1 Run_length = 2 -Run_length = 15 -rc = 0 - -expected data = b0 00 00 -expected len = 19 -decoded data = b0 00 00 -decoded len = 19 +rc = -1 +Failed to decode CRBB: length 18, data 1e 70 c0 Test:8 Tree based decoding: |