From f4651c01a134759e3dc904960f96d568e6855a4f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 28 Jan 2007 04:21:55 +0000 Subject: [PATCH] Fix order of checks on load average. From a CS140 student, via Ben Sapp. --- src/tests/threads/mlfqs-load-1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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"); } -- 2.30.2