mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-02-14 03:12:10 +02:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user