[Toybox] [PATCH] Add the gzip/gunzip/zcat tests I wrote for toolbox gzip/gunzip/zcat.
enh
enh at google.com
Wed Apr 26 15:03:56 PDT 2017
On Wed, Apr 26, 2017 at 2:43 PM, Rob Landley <rob at landley.net> wrote:
> On 04/24/2017 03:43 PM, enh wrote:
> > Bringing the zlib-based gzip/gunzip/zcat over to toybox is a problem for
> > another day,
>
> Blah, I should take this one.
>
> I have deflate decompression side implemented already (and working at
> one point, although I just tested "make zcat" and got a bad crc
> decompressing the musl-1.1.16.gz tarball). I have the first 1/3 or so of
> compression side implemented and somewhere around here is a version
> that's about 2/3 through. I stopped at "where do dictionary resets
> happen" and basically go the answer "nobody seems to agree, just do it
> every 250k". (Which means my gzip and other gzip won't necessarily
> produce the same binary, but it should extract the same. There's
> actually a format hitch you can do sticking in gratuitous resets to
> allow parallel decompression, it's a bit like mp4 streaming mode
> sticking in extra keyframes, only noticeably cheaper. :)
>
> Adding zlib mode to that is basically the same plumbing as
> toys/*/md5sum.c does for libcrypto.
>
> Lemme try to find a chunk of time to devote to that...
if you're actually going to start to look, i'll attach my port of the
current toolbox implementation.
---
Config.in | 6 ++
scripts/make.sh | 2 +-
toys/pending/compress.c | 93 ----------------------
toys/pending/gzip.c | 199
++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 206 insertions(+), 94 deletions(-)
create mode 100644 toys/pending/gzip.c
>
> > but at least the tests are easy...
> >
> > (These tests pass with TEST_HOST and on the toolbox versions, but the
> > toybox toys are in pending and very broken.)
>
> The problem is this is just testing that gzip and gunzip reverse each
> other. If they share infrastructure and screw something up the same way,
> what have you proved? Also you can't test gunzip without gzip being
> present.
>
> For bzip I added a tests/files/bzcat (and already had a lot of
> tests/files/blkid/*.bz2). I'd like to have at least a couple canned .gz
> files for reference under tests/files.
>
> I'll try to take a closer look at this later...
>
> Rob
>
--
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170426/6261f01c/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Implement-zlib-based-gzip-gunzip-zcat.patch
Type: text/x-patch
Size: 10009 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170426/6261f01c/attachment-0002.bin>
More information about the Toybox
mailing list