From 5ff30fe2e5871fc9c9bef7978b22ec39ffd87def Mon Sep 17 00:00:00 2001 From: George Lu Date: Thu, 31 May 2018 16:13:36 -0700 Subject: [PATCH 1/4] Unknown Suffix Error Changed so only compiled formats are printed in list of supported extensions --- programs/fileio.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/programs/fileio.c b/programs/fileio.c index d5b389e1e..a1da4bc3b 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -1754,8 +1754,18 @@ int FIO_decompressMultipleFilenames(const char** srcNamesTable, unsigned nbFiles && strcmp(suffixPtr, ZSTD_EXTENSION) && strcmp(suffixPtr, LZMA_EXTENSION) && strcmp(suffixPtr, LZ4_EXTENSION)) ) { - DISPLAYLEVEL(1, "zstd: %s: unknown suffix (%s/%s/%s/%s/%s expected) -- ignored \n", - srcFileName, GZ_EXTENSION, XZ_EXTENSION, ZSTD_EXTENSION, LZMA_EXTENSION, LZ4_EXTENSION); + char suffixlist[50] = ZSTD_EXTENSION; + #ifdef ZSTD_GZCOMPRESS + strcat(suffixlist, "/" GZ_EXTENSION); + #endif + #ifdef ZSTD_LZMACOMPRESS + strcat(suffixlist, "/" XZ_EXTENSION "/" LZMA_EXTENSION); + #endif + #ifdef ZSTD_LZ4COMPRESS + strcat(suffixlist, "/" LZ4_EXTENSION); + #endif + DISPLAYLEVEL(1, "zstd: %s: unknown suffix (%s expected) -- ignored \n", + srcFileName, suffixlist); skippedFiles++; continue; } else { From c9b1068298ec8c92b611ed9d6c98a3d8c45f0b10 Mon Sep 17 00:00:00 2001 From: George Lu Date: Thu, 31 May 2018 17:47:29 -0700 Subject: [PATCH 2/4] removed strcats --- programs/fileio.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/programs/fileio.c b/programs/fileio.c index a1da4bc3b..b1d2a2415 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -1754,16 +1754,17 @@ int FIO_decompressMultipleFilenames(const char** srcNamesTable, unsigned nbFiles && strcmp(suffixPtr, ZSTD_EXTENSION) && strcmp(suffixPtr, LZMA_EXTENSION) && strcmp(suffixPtr, LZ4_EXTENSION)) ) { - char suffixlist[50] = ZSTD_EXTENSION; - #ifdef ZSTD_GZCOMPRESS - strcat(suffixlist, "/" GZ_EXTENSION); + const char* suffixlist = ZSTD_EXTENSION + #ifdef ZSTD_GZCOMPRESS + "/" GZ_EXTENSION #endif #ifdef ZSTD_LZMACOMPRESS - strcat(suffixlist, "/" XZ_EXTENSION "/" LZMA_EXTENSION); + "/" XZ_EXTENSION "/" LZMA_EXTENSION #endif #ifdef ZSTD_LZ4COMPRESS - strcat(suffixlist, "/" LZ4_EXTENSION); + "/" LZ4_EXTENSION #endif + ; DISPLAYLEVEL(1, "zstd: %s: unknown suffix (%s expected) -- ignored \n", srcFileName, suffixlist); skippedFiles++; From 53ea32cabea62e40caf797bbf74c287ae71ac90e Mon Sep 17 00:00:00 2001 From: George Lu Date: Fri, 1 Jun 2018 10:43:06 -0700 Subject: [PATCH 3/4] Suffix list test --- tests/playTests.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/playTests.sh b/tests/playTests.sh index 200de4bd9..e2dbccbf5 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -620,6 +620,23 @@ else $ECHO "lz4 mode not supported" fi +$ECHO "\n===> suffix list test" + +$ZSTD -d tmp.abc 2> tmplg || echo + +if [ $GZIPMODE -ne 1 ]; then + grep ".gz" tmplg > $INTOVOID && die "Unsupported suffix listed" +fi + +if [ $LZMAMODE -ne 1 ]; then + grep ".lzma" tmplg > $INTOVOID && die "Unsupported suffix listed" + grep ".xz" tmplg > $INTOVOID && die "Unsupported suffix listed" +fi + +if [ $LZ4MODE -ne 1 ]; then + grep ".lz4" tmplg > $INTOVOID && die "Unsupported suffix listed" +fi + $ECHO "\n===> zstd round-trip tests " roundTripTest From 110ec9079d5a2d423432d09754bf7c8e065aa000 Mon Sep 17 00:00:00 2001 From: George Lu Date: Fri, 1 Jun 2018 12:45:02 -0700 Subject: [PATCH 4/4] Remove echo --- tests/playTests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/playTests.sh b/tests/playTests.sh index e2dbccbf5..51f55b9d8 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -622,7 +622,7 @@ fi $ECHO "\n===> suffix list test" -$ZSTD -d tmp.abc 2> tmplg || echo +! $ZSTD -d tmp.abc 2> tmplg if [ $GZIPMODE -ne 1 ]; then grep ".gz" tmplg > $INTOVOID && die "Unsupported suffix listed"