]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: nproc: ensure --ignore clamps overflowed num
authoroech3 <79379754+oech3@users.noreply.github.com>
Sun, 14 Jun 2026 16:02:18 +0000 (01:02 +0900)
committerPádraig Brady <P@draigBrady.com>
Thu, 18 Jun 2026 14:50:45 +0000 (15:50 +0100)
* tests/nproc/nproc-positive.sh: Test --ignore overflowed num
is clamped to $UINTMAX_MAX.
https://github.com/coreutils/coreutils/pull/293

tests/nproc/nproc-positive.sh

index 923db10d939f5b54ff7094b2fa4c700ec2c6b79e..6f7b17c48c81d137514fd5d2c2c64e2acf697589 100755 (executable)
@@ -18,6 +18,7 @@
 
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ nproc
+getlimits_
 
 for mode in --all ''; do
     procs=$(nproc $mode)
@@ -40,5 +41,6 @@ done
 
 procs=$(OMP_NUM_THREADS=42 nproc --ignore=40)
 test "$procs" -eq 2 || fail=1
+test $(OMP_NUM_THREADS=42 nproc --ignore ${UINTMAX_OFLOW}) = 1 || fail=1
 
 Exit $fail