From e326d0df65fc01116215ff778e907b3a8dd0df91 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Tue, 13 Jan 2026 14:10:23 +0000 Subject: [PATCH] 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 --- tests/nice/nice.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/nice/nice.sh b/tests/nice/nice.sh index 09c35adca..3badb0186 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