mirror of
https://github.com/facebook/zstd.git
synced 2025-12-24 17:21:03 +03:00
added tests with null files, changed condition to check that the file is more than 0 bytes
This commit is contained in:
@@ -889,7 +889,7 @@ static int getFileInfo(fileInfo_t* info, const char* inFileName){
|
||||
BYTE headerBuffer[ZSTD_FRAMEHEADERSIZE_MAX];
|
||||
size_t const numBytesRead = fread(headerBuffer, 1, sizeof(headerBuffer), srcFile);
|
||||
if (numBytesRead < ZSTD_frameHeaderSize_min) {
|
||||
if (feof(srcFile) && numBytesRead == 0) {
|
||||
if (feof(srcFile) && numBytesRead == 0 && info->compressedSize > 0) {
|
||||
break;
|
||||
}
|
||||
else if (feof(srcFile)) {
|
||||
|
||||
@@ -564,6 +564,14 @@ $ECHO "\n**** zstd --list/-l error detection tests ****"
|
||||
! $ZSTD -lv tmp1*
|
||||
! $ZSTD --list -v tmp2 tmp23.zst
|
||||
|
||||
$ECHO "\n**** zstd --list/-l test with null files ****"
|
||||
./datagen -g0 > tmp5
|
||||
$ZSTD tmp5
|
||||
! $ZSTD -l tmp5*
|
||||
! $ZSTD -lv tmp5*
|
||||
! $ZSTD --list tmp5*
|
||||
! $ZSTD --list -v tmp5*
|
||||
|
||||
rm tmp*
|
||||
|
||||
if [ "$1" != "--test-large-data" ]; then
|
||||
|
||||
Reference in New Issue
Block a user