diff options
author | Yann Collet <cyan@fb.com> | 2022-07-15 14:11:26 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2022-07-15 17:30:53 (GMT) |
commit | 6784e78e006329ba67eb799a1cb94dd7267a9241 (patch) | |
tree | 96330ac7e1f25829df98330cab8cc57eca44f35f /tests | |
parent | 0c620ce212d92d009f47293ea5e0b676c3380fbb (diff) | |
download | lz4-6784e78e006329ba67eb799a1cb94dd7267a9241.zip lz4-6784e78e006329ba67eb799a1cb94dd7267a9241.tar.gz lz4-6784e78e006329ba67eb799a1cb94dd7267a9241.tar.bz2 |
support skippable frames within pipe
fix #977
fseek() doesn't work for pipe,
switch to "read and forget" mode in such case.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile | 14 | ||||
-rw-r--r-- | tests/frametest.c | 2 | ||||
-rw-r--r-- | tests/goldenSamples/skip.bin | bin | 0 -> 38 bytes |
3 files changed, 13 insertions, 3 deletions
diff --git a/tests/Makefile b/tests/Makefile index 6f063a1..002fb40 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -342,6 +342,17 @@ test-lz4-multiple-legacy: lz4 datagen ! $(LZ4) -f -l -m tmp-tlm-concat1 notHere-legacy tmp-tlm-concat2 # must fail : notHere-legacy not present @$(RM) tmp-tlm* +SKIPFILE = goldenSamples/skip.bin +test-lz4-skippable: lz4 datagen + @echo "\n ---- test lz4 with skippable frames ----" + $(LZ4) -dc $(SKIPFILE) + $(LZ4) -dc < $(SKIPFILE) + cat $(SKIPFILE) | $(LZ4) -dc + echo "Hello from Valid Frame!\n" > tmplsk + $(LZ4) tmplsk -c > tmplsk.lz4 + cat $(SKIPFILE) tmplsk.lz4 $(SKIPFILE) | $(LZ4) -dc + $(RM) tmplsk* + test-lz4-basic: lz4 datagen unlz4 lz4cat @echo "\n ---- test lz4 basic compression/decompression ----" $(DATAGEN) -g0 | $(LZ4) -v | $(LZ4) -t @@ -484,7 +495,8 @@ test-lz4-essentials : lz4 datagen test-lz4-basic test-lz4-multiple test-lz4-mult @$(RM) tmp* test-lz4: lz4 datagen test-lz4-essentials test-lz4-opt-parser \ - test-lz4-sparse test-lz4-hugefile test-lz4-dict + test-lz4-sparse test-lz4-hugefile test-lz4-dict \ + test-lz4-skippable @$(RM) tmp* test-lz4c: lz4c datagen diff --git a/tests/frametest.c b/tests/frametest.c index 58eac38..2d355bb 100644 --- a/tests/frametest.c +++ b/tests/frametest.c @@ -65,8 +65,6 @@ static void FUZ_writeLE32 (void* dstVoidPtr, U32 value32) /*-************************************ * Constants **************************************/ -#define LZ4F_MAGIC_SKIPPABLE_START 0x184D2A50U - #define KB *(1U<<10) #define MB *(1U<<20) #define GB *(1U<<30) diff --git a/tests/goldenSamples/skip.bin b/tests/goldenSamples/skip.bin Binary files differnew file mode 100644 index 0000000..1a8b9d5 --- /dev/null +++ b/tests/goldenSamples/skip.bin |