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