Skip to content

Uncompressed lengths do not match original #1

Open
@WayneKeenan

Description

@WayneKeenan

Hi, I ran a number of tests and have found that in some cases the decoded file doesn't match the original unencoded file.

For example, test "128b_null.bin":

It is a file of 128 bytes that are all 0.
It encodes to 45 bytes.
It decodes to 126 bytes.

There are other cases, e.g.: 255b_null.bin, 256b_null.bin & 2k_null.bin.

The worst case here is a 4 byte difference, i.e. 512b_null.bin where 512 bytes of 0 are encoded to 89 bytes but decodes to 508 bytes

--------------------------------------------
Testing: 1k_null.bin
Encoding is done
Decoding is done
1024 .. 117 .. 1024
--------------------------------------------
Testing: 128b_null.bin
Encoding is done
Decoding is done
Binary files ./test_data/uncompressed.expected/128b_null.bin and ./test_data/uncompressed.actual/128b_null.bin differ
128 .. 45 .. 126
--------------------------------------------
Testing: 12k_0to3scale.bin
Encoding is done
Decoding is done
12288 .. 3297 .. 12288
--------------------------------------------
Testing: 12k_null.bin
Encoding is done
Decoding is done
12288 .. 227 .. 12288
--------------------------------------------
Testing: 16k_null.bin
Encoding is done
Decoding is done
16384 .. 241 .. 16384
--------------------------------------------
Testing: 1k_null.bin
Encoding is done
Decoding is done
1024 .. 117 .. 1024
--------------------------------------------
Testing: 255b_null.bin
Encoding is done
Decoding is done
Binary files ./test_data/uncompressed.expected/255b_null.bin and ./test_data/uncompressed.actual/255b_null.bin differ
255 .. 65 .. 254
--------------------------------------------
Testing: 256b_null.bin
Encoding is done
Decoding is done
Binary files ./test_data/uncompressed.expected/256b_null.bin and ./test_data/uncompressed.actual/256b_null.bin differ
256 .. 65 .. 254
--------------------------------------------
Testing: 2k_null.bin
Encoding is done
Decoding is done
Binary files ./test_data/uncompressed.expected/2k_null.bin and ./test_data/uncompressed.actual/2k_null.bin differ
2048 .. 146 .. 2047
--------------------------------------------
Testing: 32b_null.bin
Encoding is done
Decoding is done
Binary files ./test_data/uncompressed.expected/32b_null.bin and ./test_data/uncompressed.actual/32b_null.bin differ
32 .. 19 .. 30
--------------------------------------------
Testing: 32bytes_0to3scale.bin
Encoding is done
Decoding is done
Binary files ./test_data/uncompressed.expected/32bytes_0to3scale.bin and ./test_data/uncompressed.actual/32bytes_0to3scale.bin differ
32 .. 26 .. 31
--------------------------------------------
Testing: 4k_null.bin
Encoding is done
Decoding is done
4096 .. 177 .. 4096
--------------------------------------------
Testing: 4k_random.bin
Encoding is done
Decoding is done
4096 .. 4146 .. 4096
--------------------------------------------
Testing: 512b_null.bin
Encoding is done
Decoding is done
Binary files ./test_data/uncompressed.expected/512b_null.bin and ./test_data/uncompressed.actual/512b_null.bin differ
512 .. 89 .. 508
--------------------------------------------
Testing: 64b_null.bin
Encoding is done
Decoding is done
Binary files ./test_data/uncompressed.expected/64b_null.bin and ./test_data/uncompressed.actual/64b_null.bin differ
64 .. 30 .. 63
--------------------------------------------
Testing: 768b_null.bin
Encoding is done
Decoding is done
Binary files ./test_data/uncompressed.expected/768b_null.bin and ./test_data/uncompressed.actual/768b_null.bin differ
768 .. 105 .. 767
--------------------------------------------
Testing: 8k_null.bin
Encoding is done
Decoding is done
8192 .. 209 .. 8192

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions