From aef8486fee3e06114d6e8d5b736abb22b6e1f975 Mon Sep 17 00:00:00 2001 From: Jennifer Liu Date: Wed, 27 Jun 2018 14:27:27 -0700 Subject: [PATCH] Make fast=0 fail --- circleci/.config.yml.swo | Bin 4096 -> 0 bytes circleci/config.yml | 13 ------------- programs/zstdcli.c | 2 ++ tests/playTests.sh | 7 ++++--- 4 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 circleci/.config.yml.swo delete mode 100644 circleci/config.yml diff --git a/circleci/.config.yml.swo b/circleci/.config.yml.swo deleted file mode 100644 index b1cd77710ed6ef2ec3ebd48aad50a713f0f0f637..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmYc?2=nw+u+TGL00IFJ0RaN(j0{<+d3l*>sYN-NrDjH81u$7u8cCgQZc+iNBoeO< zNg>cceV5eY?2`Nf{i@=U6#eAPqU4;^9m6a3~goQ#WHgVK|(GVC7fzc2c4S~@R7!85Z5Eu=C(GVC7fuR!u0G&r73IG5A diff --git a/circleci/config.yml b/circleci/config.yml deleted file mode 100644 index 65e6c33bb..000000000 --- a/circleci/config.yml +++ /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 diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 6b6a93528..ad473e330 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -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 */ diff --git a/tests/playTests.sh b/tests/playTests.sh index 52d4dd0b9..9f30f29ec 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -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