Fix two bugs in the base Pintos code:
[pintos-anon] / src / tests / threads / priority-donate-multiple.c
index 69056914306bdede6f7c53047adfdb33d3ce706f..df4689cecc602a17bc6dfbe183dd23504a8970b1 100644 (file)
@@ -24,7 +24,7 @@ test_priority_donate_multiple (void)
   struct lock a, b;
 
   /* This test does not work with the MLFQS. */
-  ASSERT (!enable_mlfqs);
+  ASSERT (!thread_mlfqs);
 
   /* Make sure our priority is the default. */
   ASSERT (thread_get_priority () == PRI_DEFAULT);
@@ -35,18 +35,18 @@ test_priority_donate_multiple (void)
   lock_acquire (&a);
   lock_acquire (&b);
 
-  thread_create ("a", PRI_DEFAULT - 1, a_thread_func, &a);
+  thread_create ("a", PRI_DEFAULT + 1, a_thread_func, &a);
   msg ("Main thread should have priority %d.  Actual priority: %d.",
-       PRI_DEFAULT - 1, thread_get_priority ());
+       PRI_DEFAULT + 1, thread_get_priority ());
 
-  thread_create ("b", PRI_DEFAULT - 2, b_thread_func, &b);
+  thread_create ("b", PRI_DEFAULT + 2, b_thread_func, &b);
   msg ("Main thread should have priority %d.  Actual priority: %d.",
-       PRI_DEFAULT - 2, thread_get_priority ());
+       PRI_DEFAULT + 2, thread_get_priority ());
 
   lock_release (&b);
   msg ("Thread b should have just finished.");
   msg ("Main thread should have priority %d.  Actual priority: %d.",
-       PRI_DEFAULT - 1, thread_get_priority ());
+       PRI_DEFAULT + 1, thread_get_priority ());
 
   lock_release (&a);
   msg ("Thread a should have just finished.");