From: oech3 <79379754+oech3@users.noreply.github.com> Date: Tue, 13 Jan 2026 14:10:23 +0000 (+0000) Subject: tests: nice: ensure large values are clamped X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e326d0df65fc01116215ff778e907b3a8dd0df91;p=thirdparty%2Fcoreutils.git tests: nice: ensure large values are clamped * tests/nice/nice.sh: Ensure integers > UINTMAX_MAX are supported. From https://github.com/coreutils/coreutils/pull/170 --- diff --git a/tests/nice/nice.sh b/tests/nice/nice.sh index 09c35adca8..3badb01861 100755 --- a/tests/nice/nice.sh +++ b/tests/nice/nice.sh @@ -74,7 +74,7 @@ done if test x$(nice -n -1 nice 2> /dev/null) = x0 ; then # GNU/Hurd does not allow negative niceness even if we are a privileged user. if test "$(uname)" = GNU; then - max_nice=$(nice -n "$INT_MAX" nice) || framework_failure_ + max_nice=$(nice -n "$INT_MAX" nice) || fail=1 # Check that the lowest niceness is 0. nice -n -1 nice > out || fail=1 echo '0' > exp || framework_failure_ @@ -120,4 +120,7 @@ else test x$(nice --1 nice) = x-1 || fail=1 fi +# Ensure large values are clamped +nice -n $UINTMAX_OFLOW nice || fail=1 + Exit $fail