diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2014-10-27 23:39:06 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2014-10-27 23:39:06 (GMT) |
commit | 7a677a77a683a6716307034a176228075ce9fea5 (patch) | |
tree | d9359141f856f9612ac1cf201642313e8835d91e /programs | |
parent | 508855c48826aa0544a907f02b52515aabba5e16 (diff) | |
download | lz4-7a677a77a683a6716307034a176228075ce9fea5.zip lz4-7a677a77a683a6716307034a176228075ce9fea5.tar.gz lz4-7a677a77a683a6716307034a176228075ce9fea5.tar.bz2 |
LZ4 HC streaming integrated within lz4frame
Diffstat (limited to 'programs')
-rw-r--r--[-rwxr-xr-x] | programs/Makefile | 8 | ||||
-rw-r--r--[-rwxr-xr-x] | programs/frametest.c | 15 | ||||
-rw-r--r--[-rwxr-xr-x] | programs/fuzzer.c | 0 |
3 files changed, 12 insertions, 11 deletions
diff --git a/programs/Makefile b/programs/Makefile index e7e57a1..e313fc5 100755..100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -174,13 +174,13 @@ test-frame: frametest test-mem: lz4 datagen frametest ./datagen -g16KB > tmp - valgrind ./lz4 -9 -BD -f tmp /dev/null + valgrind --leak-check=yes ./lz4 -9 -BD -f tmp /dev/null ./datagen -g16MB > tmp - valgrind ./lz4 -9 -B5D -f tmp /dev/null + valgrind --leak-check=yes ./lz4 -9 -B5D -f tmp /dev/null ./datagen -g256MB > tmp - valgrind ./lz4 -B4D -f tmp /dev/null + valgrind --leak-check=yes ./lz4 -B4D -f tmp /dev/null rm tmp - valgrind ./frametest -i100 + valgrind --leak-check=yes ./frametest -i100 test-mem32: lz4c32 datagen # unfortunately, valgrind doesn't seem to work with non-native binary. If someone knows how to do a valgrind-test on a 32-bits exe with a 64-bits system... diff --git a/programs/frametest.c b/programs/frametest.c index abf0cde..c7e6f45 100755..100644 --- a/programs/frametest.c +++ b/programs/frametest.c @@ -426,10 +426,11 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi LZ4F_preferences_t* prefsPtr = &prefs; (void)FUZ_rand(&coreRand); // update rand seed - prefs.frameInfo.blockMode = BMId; - prefs.frameInfo.blockSizeID = BSId; - prefs.frameInfo.contentChecksumFlag = CCflag; + prefs.frameInfo.blockMode = (blockMode_t)BMId; + prefs.frameInfo.blockSizeID = (blockSizeID_t)BSId; + prefs.frameInfo.contentChecksumFlag = (contentChecksum_t)CCflag; prefs.autoFlush = autoflush; + prefs.compressionLevel = FUZ_rand(&randState) % 5; if ((FUZ_rand(&randState)&0xF) == 1) prefsPtr = NULL; DISPLAYUPDATE(2, "\r%5u ", testNb); @@ -444,7 +445,7 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi { const BYTE* ip = (const BYTE*)srcBuffer + srcStart; const BYTE* const iend = ip + srcSize; - BYTE* op = compressedBuffer; + BYTE* op = (BYTE*)compressedBuffer; BYTE* const oend = op + LZ4F_compressFrameBound(srcDataLength, NULL); unsigned maxBits = FUZ_highbit((U32)srcSize); result = LZ4F_compressBegin(cCtx, op, oend-op, prefsPtr); @@ -478,9 +479,9 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi } { - const BYTE* ip = compressedBuffer; + const BYTE* ip = (const BYTE*)compressedBuffer; const BYTE* const iend = ip + cSize; - BYTE* op = decodedBuffer; + BYTE* op = (BYTE*)decodedBuffer; BYTE* const oend = op + srcDataLength; unsigned maxBits = FUZ_highbit((U32)cSize); unsigned nonContiguousDst = (FUZ_rand(&randState) & 3) == 1; @@ -602,7 +603,7 @@ int main(int argc, char** argv) pause = 1; break; - case 'i': + case 'i': argument++; nbTests=0; while ((*argument>='0') && (*argument<='9')) diff --git a/programs/fuzzer.c b/programs/fuzzer.c index b7721c8..b7721c8 100755..100644 --- a/programs/fuzzer.c +++ b/programs/fuzzer.c |