about summary refs log tree commit diff
path: root/src/libcore/task
diff options
context:
space:
mode:
authorCorey Richardson <corey@octayn.net>2013-05-18 22:02:45 -0400
committerCorey Richardson <corey@octayn.net>2013-05-19 08:16:02 -0400
commitcc57ca012a1f49875e19b1b089c91928dc339979 (patch)
tree9f10c27962dbb7c844bc3abb7e20119d75f02aa6 /src/libcore/task
parent3acf37897a4ca7f019ed8894ec3878801377773d (diff)
Use assert_eq! rather than assert! where possible
Diffstat (limited to 'src/libcore/task')
-rw-r--r--src/libcore/task/mod.rs16
-rw-r--r--src/libcore/task/spawn.rs4
2 files changed, 10 insertions, 10 deletions
diff --git a/src/libcore/task/mod.rs b/src/libcore/task/mod.rs
index a6edee38e18..e96da3b08c9 100644
--- a/src/libcore/task/mod.rs
+++ b/src/libcore/task/mod.rs
@@ -805,7 +805,7 @@ fn test_future_result() {
     let mut builder = task();
     builder.future_result(|r| result = Some(r));
     do builder.spawn {}
-    assert!(result.unwrap().recv() == Success);
+    assert_eq!(result.unwrap().recv(), Success);
 
     result = None;
     let mut builder = task();
@@ -814,7 +814,7 @@ fn test_future_result() {
     do builder.spawn {
         fail!();
     }
-    assert!(result.unwrap().recv() == Failure);
+    assert_eq!(result.unwrap().recv(), Failure);
 }
 
 #[test] #[should_fail] #[ignore(cfg(windows))]
@@ -891,7 +891,7 @@ fn test_spawn_sched_childs_on_default_sched() {
             let ch = ch.take();
             let child_sched_id = unsafe { rt::rust_get_sched_id() };
             assert!(parent_sched_id != child_sched_id);
-            assert!(child_sched_id == default_id);
+            assert_eq!(child_sched_id, default_id);
             ch.send(());
         };
     };
@@ -985,7 +985,7 @@ fn avoid_copying_the_body(spawnfn: &fn(v: ~fn())) {
     }
 
     let x_in_child = p.recv();
-    assert!(x_in_parent == x_in_child);
+    assert_eq!(x_in_parent, x_in_child);
 }
 
 #[test]
@@ -1143,7 +1143,7 @@ fn test_sched_thread_per_core() {
         unsafe {
             let cores = rt::rust_num_threads();
             let reported_threads = rt::rust_sched_threads();
-            assert!((cores as uint == reported_threads as uint));
+            assert_eq!(cores as uint, reported_threads as uint);
             chan.send(());
         }
     }
@@ -1158,9 +1158,9 @@ fn test_spawn_thread_on_demand() {
     do spawn_sched(ManualThreads(2)) || {
         unsafe {
             let max_threads = rt::rust_sched_threads();
-            assert!((max_threads as int == 2));
+            assert_eq!(max_threads as int, 2);
             let running_threads = rt::rust_sched_current_nonlazy_threads();
-            assert!((running_threads as int == 1));
+            assert_eq!(running_threads as int, 1);
 
             let (port2, chan2) = comm::stream();
 
@@ -1169,7 +1169,7 @@ fn test_spawn_thread_on_demand() {
             }
 
             let running_threads2 = rt::rust_sched_current_nonlazy_threads();
-            assert!((running_threads2 as int == 2));
+            assert_eq!(running_threads2 as int, 2);
 
             port2.recv();
             chan.send(());
diff --git a/src/libcore/task/spawn.rs b/src/libcore/task/spawn.rs
index 5f9642604d0..2ac8fc5f073 100644
--- a/src/libcore/task/spawn.rs
+++ b/src/libcore/task/spawn.rs
@@ -774,7 +774,7 @@ fn test_spawn_raw_notify_success() {
     };
     do spawn_raw(opts) {
     }
-    assert!(notify_po.recv() == Success);
+    assert_eq!(notify_po.recv(), Success);
 }
 
 #[test]
@@ -791,5 +791,5 @@ fn test_spawn_raw_notify_failure() {
     do spawn_raw(opts) {
         fail!();
     }
-    assert!(notify_po.recv() == Failure);
+    assert_eq!(notify_po.recv(), Failure);
 }