1
0
mirror of https://github.com/facebook/zstd.git synced 2025-08-07 06:23:00 +03:00

Make fast=0 fail

This commit is contained in:
Jennifer Liu
2018-06-27 14:27:27 -07:00
parent a3cb97b038
commit aef8486fee
4 changed files with 6 additions and 16 deletions

Binary file not shown.

View File

@@ -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

View 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 */

View File

@@ -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"