From: Yann Collet Date: Mon, 25 Jul 2016 23:26:56 +0000 (+0200) Subject: strengthened integrity tests X-Git-Tag: v0.8.0^2~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24a3d90bf011699bcac8f2e9d31fdb83adccf004;p=thirdparty%2Fzstd.git strengthened integrity tests --- diff --git a/NEWS b/NEWS index 64c1d4ff9..7ffa4023f 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,9 @@ v0.8.0 -Fixed : premature end of frame when zero-sized raw block, reported by Eric Biggers +New : updated compresson format Fixed : legacy mode with ZSTD_HEAPMODE=0, by Christopher Bergqvist +Fixed : premature end of frame when zero-sized raw block, reported by Eric Biggers Fixed : checksum correctly checked in single-pass mode +Fixed : combined --test amd --rm, reported by Andreas M. Nilsson Modified : minor compression level adaptations Updated : compression format specification to v0.2.0 changed : zstd.h moved to /lib directory diff --git a/programs/fileio.c b/programs/fileio.c index 538438cd9..3233be2e5 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -744,7 +744,7 @@ static int FIO_decompressDstFile(dRess_t ress, result = FIO_decompressSrcFile(ress, srcFileName); if (fclose(ress.dstFile)) EXM_THROW(38, "Write error : cannot properly close %s", dstFileName); - if (result != 0) if (remove(dstFileName)) EXM_THROW(39, "remove %s error : %s", dstFileName, strerror(errno)); + if (result != 0) if (remove(dstFileName)) result=1; /* don't do anything if remove fails */ return result; } diff --git a/programs/playTests.sh b/programs/playTests.sh index 6939aa817..755060814 100755 --- a/programs/playTests.sh +++ b/programs/playTests.sh @@ -204,8 +204,11 @@ $ZSTD -t tmp1.zst $ZSTD --test tmp1.zst $ECHO "test multiple files (*.zst) " $ZSTD -t *.zst -$ECHO "test good and bad files (*) " +$ECHO "test bad files (*) " $ZSTD -t * && die "bad files not detected !" +$ZSTD -t tmp1 && die "bad file not detected !" +cp tmp1 tmp2.zst +$ZSTD -t tmp2.zst && die "bad file not detected !" $ECHO "test --rm and --test combined " $ZSTD -t --rm tmp1.zst ls -ls tmp1.zst # check file is still present