]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Make fast=0 fail
authorJennifer Liu <jenniferliu620@fb.com>
Wed, 27 Jun 2018 21:27:27 +0000 (14:27 -0700)
committerJennifer Liu <jenniferliu620@fb.com>
Wed, 27 Jun 2018 21:27:27 +0000 (14:27 -0700)
circleci/.config.yml.swo [deleted file]
circleci/config.yml [deleted file]
programs/zstdcli.c
tests/playTests.sh

diff --git a/circleci/.config.yml.swo b/circleci/.config.yml.swo
deleted file mode 100644 (file)
index b1cd777..0000000
Binary files a/circleci/.config.yml.swo and /dev/null differ
diff --git a/circleci/config.yml b/circleci/config.yml
deleted file mode 100644 (file)
index 65e6c33..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-version: 2
-jobs:
-  build:
-    docker:
-      - image: debian:stretch
-    steps:
-      - checkout
-      - run:
-          name: Greeting
-          command: echo Hello, world.
-      - run:
-          name: Print the Current Time
-          command: date
index 6b6a93528f6d10fc0469f5ffd65f350bed88099d..ad473e330627074bd6feef043712dd903b678946 100644 (file)
@@ -568,6 +568,8 @@ int main(int argCount, const char* argv[])
                             fastLevel = readU32FromChar(&argument);
                             if (fastLevel) {
                               dictCLevel = cLevel = -(int)fastLevel;
+                            } else {
+                              CLEAN_RETURN(badusage(programName));
                             }
                         } else if (*argument != 0) {
                             /* Invalid character following --fast */
index 52d4dd0b906c29254d3e35a40eef96bdfaef817b..9f30f29ec13173ebc4542928eb8d828d6c5a5637 100755 (executable)
@@ -108,6 +108,7 @@ $ECHO "test : --fast aka negative compression levels"
 $ZSTD --fast -f tmp  # == -1
 $ZSTD --fast=3 -f tmp  # == -3
 $ZSTD --fast=200000 -f tmp  # == no compression
+! $ZSTD -c --fast=0  tmp # should fail
 $ECHO "test : too large numeric argument"
 $ZSTD --fast=9999999999 -f tmp  && die "should have refused numeric value"
 $ECHO "test : compress to stdout"
@@ -532,7 +533,7 @@ fi
 if [ $GZIPMODE -eq 1 ]; then
     ./datagen > tmp
     rm -f tmp.zst
-    $ZSTD --format=gzip --format=zstd -f tmp 
+    $ZSTD --format=gzip --format=zstd -f tmp
     test -f tmp.zst
 fi
 
@@ -637,11 +638,11 @@ $ECHO "\n===> suffix list test"
 
 ! $ZSTD -d tmp.abc 2> tmplg
 
-if [ $GZIPMODE -ne 1 ]; then 
+if [ $GZIPMODE -ne 1 ]; then
     grep ".gz" tmplg > $INTOVOID && die "Unsupported suffix listed"
 fi
 
-if [ $LZMAMODE -ne 1 ]; then 
+if [ $LZMAMODE -ne 1 ]; then
     grep ".lzma" tmplg > $INTOVOID && die "Unsupported suffix listed"
     grep ".xz" tmplg > $INTOVOID && die "Unsupported suffix listed"
 fi