From: Ulrich Drepper Date: Wed, 19 Mar 2003 23:03:56 +0000 (+0000) Subject: Update. X-Git-Tag: cvs/glibc-2_3_3~1152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c937b84395e9e85d4f5a6a8cd1a7175539fb53b;p=platform%2Fupstream%2Fglibc.git Update. 2003-03-19 Ulrich Drepper * posix/tst-nice.c (do_test): Remove invalid of return value. Don't run test if initial level != 0. --- diff --git a/ChangeLog b/ChangeLog index fd3a747..0a8e2af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-03-19 Ulrich Drepper + + * posix/tst-nice.c (do_test): Remove invalid of return value. + Don't run test if initial level != 0. + 2003-03-19 Amos Waterland * posix/tst-nice.c: New file. diff --git a/posix/tst-nice.c b/posix/tst-nice.c index d5833c3..07fe67e 100644 --- a/posix/tst-nice.c +++ b/posix/tst-nice.c @@ -25,8 +25,9 @@ static int do_test (void) { - int ret, expected; + int ret; const int incr = 10; + const int expected = 10; /* Discover current nice value. */ errno = 0; @@ -36,7 +37,11 @@ do_test (void) printf ("break: nice(%d) return: %d, errno: %d\n", 0, ret, errno); return 1; } - expected = ret + incr; + /* We cannot generally add up the increments since the values are + capped. So we run the test only if we initially run at level + 0. */ + if (ret != 0) + return 0; /* Nice ourselves up. */ errno = 0; @@ -49,7 +54,7 @@ do_test (void) /* Check for return value being zero when it shouldn't. Cannot simply check for expected value since nice values are capped at 2^n-1. */ - if (ret == 0 && ret != expected) + if (ret != expected) { printf ("fail: retval (%d) of nice(%d) != %d\n", ret, incr, expected); return 1;