Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compress/decompress tests for lzop(1) compatibility #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rminnich
Copy link

@rminnich rminnich commented Nov 6, 2020

Make existing decompress tests a bit more idiomatic by having them
check returned error values.

Add two tests which compare uncompressed and compressed output from lzop(1).

Currently, we can now uncompress data compressed with lzop -1.

Make debug prints conditioned on a variable (Verbose), not commented out, and expose
both Verbose and the print function (Debug) so users of this package can set them.
Debug defaults to an empty function.

For the loops where we do not want to continually call an empty function, Verbose
is used to control whether we call Debug at all.

Still kind of a WIP, comments appreciated. I actually have a need for this package in u-root.

Signed-off-by: Ronald G Minnich [email protected]

@coveralls
Copy link

coveralls commented Nov 6, 2020

Coverage Status

Coverage decreased (-0.3%) to 92.444% when pulling 922225d on rminnich:decompresslzoptest into 96a758e on rasky:master.

@rminnich rminnich force-pushed the decompresslzoptest branch 2 times, most recently from f14ff9e to 3c287be Compare November 6, 2020 17:45
Make existing decompress tests a bit more idiomatic by having them
check returned error values.

Add two tests which compare uncompressed and compressed output from lzop(1).

Currently, we can now uncompress data compressed with lzop -1.

The choice of 0x32 as the starting point is sketchy however.

Make debug prints conditioned on a variable (Verbose), not commented out, and expose
both Verbose and the print function (Debug) so users of this package can set them.
Debug defaults to an empty function.

For the loops where we do not want to continually call an empty function, Verbose
is used to control whether we call Debug at all.

Signed-off-by: Ronald G Minnich <[email protected]>
Signed-off-by: Ronald G Minnich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants