return error code when benchmark fails
such scenario can happen, for example, when trying a decompression-only benchmark on invalid data. Other possibilities include an allocation error in an intermediate step. So far, the benchmark would return immediately, but still return 0. On command line, this would be confusing, as the program appears successful (though it does not display any successful message). Now it returns !0, which can be interpreted as an error by command line.
This commit is contained in:
@@ -1217,6 +1217,8 @@ zstd -rqi0b1e2 tmp1
|
||||
println "benchmark decompression only"
|
||||
zstd -f tmp1
|
||||
zstd -b -d -i0 tmp1.zst
|
||||
println "benchmark can fail - decompression on invalid data"
|
||||
zstd -b -d -i0 tmp1 && die "invalid .zst data => benchmark should have failed"
|
||||
|
||||
GZIPMODE=1
|
||||
zstd --format=gzip -V || GZIPMODE=0
|
||||
|
||||
Reference in New Issue
Block a user