]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
update test for 32-bit mode
authorYann Collet <yann.collet.73@gmail.com>
Mon, 10 Feb 2025 07:02:14 +0000 (23:02 -0800)
committerYann Collet <yann.collet.73@gmail.com>
Mon, 10 Feb 2025 07:02:14 +0000 (23:02 -0800)
--max doesn't work in 32-bit mode, due to address space limitation

tests/cli-tests/compression/levels.sh
tests/cli-tests/compression/levels.sh.stderr.exact

index db3baba6d44e4b1caae44f9bf9e686de70eccd82..8da3b4e746bc7f045115f61b4d322eed2add5069 100755 (executable)
@@ -5,12 +5,20 @@ set -v
 
 datagen > file
 
+# Retrieve the program's version information
+version_info=$(zstd -V)
+
 # Compress with various levels and ensure that their sizes are ordered
 zstd --fast=10 file -o file-f10.zst -q
 zstd --fast=1 file -o file-f1.zst -q
 zstd -1 file -o file-1.zst -q
 zstd -19 file -o file-19.zst -q
-zstd --max file -o file-max.zst -q
+if echo "$version_info" | grep -q '32-bit'; then
+    # skip --max test: not enough address space
+    cp file-19.zst file-max.zst
+else
+    zstd --max file -o file-max.zst -q
+fi
 
 zstd -t file-f10.zst file-f1.zst file-1.zst file-19.zst file-max.zst
 
index ddec06467f38f930cb3f032f8be46b58c4b07905..dff9784dd40ee38b810cf9bd78b90e8548d7cf1a 100644 (file)
@@ -1,12 +1,20 @@
 
 datagen > file
 
+# Retrieve the program's version information
+version_info=$(zstd -V)
+
 # Compress with various levels and ensure that their sizes are ordered
 zstd --fast=10 file -o file-f10.zst -q
 zstd --fast=1 file -o file-f1.zst -q
 zstd -1 file -o file-1.zst -q
 zstd -19 file -o file-19.zst -q
-zstd --max file -o file-max.zst -q
+if echo "$version_info" | grep -q '32-bit'; then
+    # skip --max test: not enough address space
+    cp file-19.zst file-max.zst
+else
+    zstd --max file -o file-max.zst -q
+fi
 
 zstd -t file-f10.zst file-f1.zst file-1.zst file-19.zst file-max.zst
 5 files decompressed : 327685 bytes total