std: silence some test warnings.
This commit is contained in:
@@ -980,7 +980,6 @@ mod tests {
|
||||
use super::*;
|
||||
use prelude::*;
|
||||
|
||||
use iter;
|
||||
use uint;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -92,7 +92,6 @@ fn test_tls_multitask() {
|
||||
fn my_key(_x: @~str) { }
|
||||
local_data_set(my_key, @~"parent data");
|
||||
do task::spawn {
|
||||
unsafe {
|
||||
// TLS shouldn't carry over.
|
||||
assert!(local_data_get(my_key).is_none());
|
||||
local_data_set(my_key, @~"child data");
|
||||
@@ -100,7 +99,6 @@ fn test_tls_multitask() {
|
||||
~"child data");
|
||||
// should be cleaned up for us
|
||||
}
|
||||
}
|
||||
// Must work multiple times
|
||||
assert!(*(local_data_get(my_key).get()) == ~"parent data");
|
||||
assert!(*(local_data_get(my_key).get()) == ~"parent data");
|
||||
@@ -206,13 +204,12 @@ fn test_tls_cleanup_on_failure() {
|
||||
local_data_set(str_key, @~"parent data");
|
||||
local_data_set(box_key, @@());
|
||||
do task::spawn {
|
||||
unsafe { // spawn_linked
|
||||
// spawn_linked
|
||||
local_data_set(str_key, @~"string data");
|
||||
local_data_set(box_key, @@());
|
||||
local_data_set(int_key, @42);
|
||||
fail!();
|
||||
}
|
||||
}
|
||||
// Not quite nondeterministic.
|
||||
local_data_set(int_key, @31337);
|
||||
fail!();
|
||||
|
||||
@@ -160,14 +160,14 @@ mod test {
|
||||
let mut timer2 = TimerWatcher::new(&mut loop_);
|
||||
do timer2.start(10, 0) |timer2, _| {
|
||||
|
||||
unsafe { *count_ptr += 1; }
|
||||
*count_ptr += 1;
|
||||
|
||||
timer2.close(||());
|
||||
|
||||
// Restart the original timer
|
||||
let mut timer = timer;
|
||||
do timer.start(1, 0) |timer, _| {
|
||||
unsafe { *count_ptr += 1; }
|
||||
*count_ptr += 1;
|
||||
timer.close(||());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2249,7 +2249,7 @@ mod tests {
|
||||
assert!("" <= "");
|
||||
assert!("" <= "foo");
|
||||
assert!("foo" <= "foo");
|
||||
assert!("foo" != ~"bar");
|
||||
assert!("foo" != "bar");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -3156,6 +3156,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_add() {
|
||||
#[allow(unnecessary_allocation)];
|
||||
macro_rules! t (
|
||||
($s1:expr, $s2:expr, $e:expr) => {
|
||||
assert_eq!($s1 + $s2, $e);
|
||||
|
||||
@@ -934,7 +934,6 @@ fn test_spawn_sched_blocking() {
|
||||
let lock = testrt::rust_dbg_lock_create();
|
||||
|
||||
do spawn_sched(SingleThreaded) {
|
||||
unsafe {
|
||||
testrt::rust_dbg_lock_lock(lock);
|
||||
|
||||
start_ch.send(());
|
||||
@@ -944,7 +943,6 @@ fn test_spawn_sched_blocking() {
|
||||
testrt::rust_dbg_lock_unlock(lock);
|
||||
|
||||
fin_ch.send(());
|
||||
}
|
||||
};
|
||||
|
||||
// Wait until the other task has its lock
|
||||
|
||||
@@ -3861,11 +3861,11 @@ mod tests {
|
||||
fn test_vec_zero() {
|
||||
use num::Zero;
|
||||
macro_rules! t (
|
||||
($ty:ty) => {
|
||||
($ty:ty) => {{
|
||||
let v: $ty = Zero::zero();
|
||||
assert!(v.is_empty());
|
||||
assert!(v.is_zero());
|
||||
}
|
||||
}}
|
||||
);
|
||||
|
||||
t!(&[int]);
|
||||
|
||||
Reference in New Issue
Block a user