From: Ben Pfaff Date: Sun, 28 Jan 2007 04:21:55 +0000 (+0000) Subject: Fix order of checks on load average. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa5413391cffb2c4d59c37730c5d4e0f09ebfe7b;p=pintos-anon Fix order of checks on load average. From a CS140 student, via Ben Sapp. --- diff --git a/src/tests/threads/mlfqs-load-1.c b/src/tests/threads/mlfqs-load-1.c index 6b230aa..a39eea2 100644 --- a/src/tests/threads/mlfqs-load-1.c +++ b/src/tests/threads/mlfqs-load-1.c @@ -31,12 +31,12 @@ test_mlfqs_load_1 (void) load_avg = thread_get_load_avg (); ASSERT (load_avg >= 0); elapsed = timer_elapsed (start_time) / TIMER_FREQ; - if (load_avg > 50) - break; - else if (load_avg > 100) + if (load_avg > 100) fail ("load average is %d.%02d " "but should be between 0 and 1 (after %d seconds)", load_avg / 100, load_avg % 100, elapsed); + else if (load_avg > 50) + break; else if (elapsed > 45) fail ("load average stayed below 0.5 for more than 45 seconds"); }