mirror of
https://github.com/lz4/lz4.git
synced 2024-11-30 13:26:08 +08:00
198e532300
Specifically this adds support for the following options: - LZ4_ALIGN_TEST - LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION - LZ4_DISTANCE_MAX - LZ4_FAST_DEC_LOOP - LZ4_FORCE_SW_BITCOUNT - LZ4_FREESTANDING - LZ4_USER_MEMORY_FUNCTIONS - compiling ossfuzz targets - compiling more test targets - registering some tests
36 lines
1.3 KiB
Bash
Executable File
36 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
FPREFIX="tmp-dict"
|
|
|
|
set -e
|
|
|
|
remove () {
|
|
rm $FPREFIX*
|
|
}
|
|
|
|
trap remove EXIT
|
|
|
|
set -x
|
|
|
|
datagen -g16KB > $FPREFIX
|
|
datagen -g32KB > $FPREFIX-sample-32k
|
|
< $FPREFIX-sample-32k lz4 -D $FPREFIX | lz4 -dD $FPREFIX | diff - $FPREFIX-sample-32k
|
|
datagen -g128MB > $FPREFIX-sample-128m
|
|
< $FPREFIX-sample-128m lz4 -D $FPREFIX | lz4 -dD $FPREFIX | diff - $FPREFIX-sample-128m
|
|
touch $FPREFIX-sample-0
|
|
< $FPREFIX-sample-0 lz4 -D $FPREFIX | lz4 -dD $FPREFIX | diff - $FPREFIX-sample-0
|
|
|
|
< $FPREFIX-sample-32k lz4 -D $FPREFIX-sample-0 | lz4 -dD $FPREFIX-sample-0 | diff - $FPREFIX-sample-32k
|
|
< $FPREFIX-sample-0 lz4 -D $FPREFIX-sample-0 | lz4 -dD $FPREFIX-sample-0 | diff - $FPREFIX-sample-0
|
|
lz4 -bi0 -D $FPREFIX $FPREFIX-sample-32k $FPREFIX-sample-32k
|
|
|
|
echo "---- test lz4 dictionary loading ----"
|
|
datagen -g128KB > $FPREFIX-data-128KB
|
|
set -e; \
|
|
for l in 0 1 4 128 32767 32768 32769 65535 65536 65537 98303 98304 98305 131071 131072 131073; do \
|
|
datagen -g$$l > $FPREFIX-$$l; \
|
|
dd if=$FPREFIX-$$l of=$FPREFIX-$$l-tail bs=1 count=65536 skip=$((l > 65536 ? l - 65536 : 0)); \
|
|
< $FPREFIX-$$l lz4 -D stdin $FPREFIX-data-128KB -c | lz4 -dD $FPREFIX-$$l-tail | diff - $FPREFIX-data-128KB; \
|
|
< $FPREFIX-$$l-tail lz4 -D stdin $FPREFIX-data-128KB -c | lz4 -dD $FPREFIX-$$l | diff - $FPREFIX-data-128KB; \
|
|
done
|