Skip to content

Commit 12ecdb6

Browse files
committed
Enabled unit tests in std and extra.
1 parent 9e4fdde commit 12ecdb6

27 files changed

+46
-109
lines changed

src/libextra/arc.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ mod tests {
612612
}
613613
}
614614
615-
#[test] #[should_fail] #[ignore(cfg(windows))]
615+
#[test] #[should_fail]
616616
fn test_arc_condvar_poison() {
617617
unsafe {
618618
let arc = ~MutexArc::new(1);
@@ -636,7 +636,7 @@ mod tests {
636636
}
637637
}
638638
}
639-
#[test] #[should_fail] #[ignore(cfg(windows))]
639+
#[test] #[should_fail]
640640
fn test_mutex_arc_poison() {
641641
unsafe {
642642
let arc = ~MutexArc::new(1);
@@ -651,7 +651,7 @@ mod tests {
651651
}
652652
}
653653
}
654-
#[test] #[should_fail] #[ignore(cfg(windows))]
654+
#[test] #[should_fail]
655655
pub fn test_mutex_arc_unwrap_poison() {
656656
let arc = MutexArc::new(1);
657657
let arc2 = ~(&arc).clone();
@@ -668,7 +668,7 @@ mod tests {
668668
let one = arc.unwrap();
669669
assert!(one == 1);
670670
}
671-
#[test] #[should_fail] #[ignore(cfg(windows))]
671+
#[test] #[should_fail]
672672
fn test_rw_arc_poison_wr() {
673673
let arc = ~RWArc::new(1);
674674
let arc2 = (*arc).clone();
@@ -681,7 +681,7 @@ mod tests {
681681
assert_eq!(*one, 1);
682682
}
683683
}
684-
#[test] #[should_fail] #[ignore(cfg(windows))]
684+
#[test] #[should_fail]
685685
fn test_rw_arc_poison_ww() {
686686
let arc = ~RWArc::new(1);
687687
let arc2 = (*arc).clone();
@@ -694,7 +694,7 @@ mod tests {
694694
assert_eq!(*one, 1);
695695
}
696696
}
697-
#[test] #[should_fail] #[ignore(cfg(windows))]
697+
#[test] #[should_fail]
698698
fn test_rw_arc_poison_dw() {
699699
let arc = ~RWArc::new(1);
700700
let arc2 = (*arc).clone();
@@ -709,7 +709,7 @@ mod tests {
709709
assert_eq!(*one, 1);
710710
}
711711
}
712-
#[test] #[ignore(cfg(windows))]
712+
#[test]
713713
fn test_rw_arc_no_poison_rr() {
714714
let arc = ~RWArc::new(1);
715715
let arc2 = (*arc).clone();
@@ -722,7 +722,7 @@ mod tests {
722722
assert_eq!(*one, 1);
723723
}
724724
}
725-
#[test] #[ignore(cfg(windows))]
725+
#[test]
726726
fn test_rw_arc_no_poison_rw() {
727727
let arc = ~RWArc::new(1);
728728
let arc2 = (*arc).clone();
@@ -735,7 +735,7 @@ mod tests {
735735
assert_eq!(*one, 1);
736736
}
737737
}
738-
#[test] #[ignore(cfg(windows))]
738+
#[test]
739739
fn test_rw_arc_no_poison_dr() {
740740
let arc = ~RWArc::new(1);
741741
let arc2 = (*arc).clone();

src/libextra/arena.rs

-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ fn test_arena_destructors() {
291291

292292
#[test]
293293
#[should_fail]
294-
#[ignore(cfg(windows))]
295294
fn test_arena_destructors_fail() {
296295
let arena = Arena::new();
297296
// Put some stuff in the arena.

src/libextra/c_vec.rs

-2
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ mod tests {
185185

186186
#[test]
187187
#[should_fail]
188-
#[ignore(cfg(windows))]
189188
fn test_overrun_get() {
190189
let cv = malloc(16u as size_t);
191190

@@ -194,7 +193,6 @@ mod tests {
194193

195194
#[test]
196195
#[should_fail]
197-
#[ignore(cfg(windows))]
198196
fn test_overrun_set() {
199197
let cv = malloc(16u as size_t);
200198

src/libextra/flatpipes.rs

-2
Original file line numberDiff line numberDiff line change
@@ -967,12 +967,10 @@ mod test {
967967
}
968968

969969
#[test]
970-
#[ignore(cfg(windows))]
971970
fn test_try_recv_none4_reader() {
972971
test_try_recv_none4(reader_port_loader);
973972
}
974973
#[test]
975-
#[ignore(cfg(windows))]
976974
fn test_try_recv_none4_pipe() {
977975
test_try_recv_none4(pipe_port_loader);
978976
}

src/libextra/future.rs

-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ mod test {
212212
213213
#[test]
214214
#[should_fail]
215-
#[ignore(cfg(target_os = "win32"))]
216215
fn test_futurefail() {
217216
let mut f = spawn(|| fail!());
218217
let _x: ~str = f.get();

src/libextra/priority_queue.rs

-3
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ mod tests {
338338

339339
#[test]
340340
#[should_fail]
341-
#[ignore(cfg(windows))]
342341
fn test_empty_pop() { let mut heap = PriorityQueue::new::<int>(); heap.pop(); }
343342

344343
#[test]
@@ -349,7 +348,6 @@ mod tests {
349348

350349
#[test]
351350
#[should_fail]
352-
#[ignore(cfg(windows))]
353351
fn test_empty_top() { let empty = PriorityQueue::new::<int>(); empty.top(); }
354352

355353
#[test]
@@ -360,7 +358,6 @@ mod tests {
360358

361359
#[test]
362360
#[should_fail]
363-
#[ignore(cfg(windows))]
364361
fn test_empty_replace() { let mut heap = PriorityQueue::new(); heap.replace(5); }
365362

366363
#[test]

src/libextra/sync.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ mod tests {
921921
assert!(!cond.signal());
922922
}
923923
}
924-
#[test] #[ignore(cfg(windows))]
924+
#[test]
925925
fn test_mutex_killed_simple() {
926926
// Mutex must get automatically unlocked if failed/killed within.
927927
let m = ~Mutex::new();
@@ -937,7 +937,7 @@ mod tests {
937937
do m.lock { }
938938
}
939939
#[ignore(reason = "linked failure")]
940-
#[test] #[ignore(cfg(windows))]
940+
#[test]
941941
fn test_mutex_killed_cond() {
942942
// Getting killed during cond wait must not corrupt the mutex while
943943
// unwinding (e.g. double unlock).
@@ -964,7 +964,7 @@ mod tests {
964964
}
965965
}
966966
#[ignore(reason = "linked failure")]
967-
#[test] #[ignore(cfg(windows))]
967+
#[test]
968968
fn test_mutex_killed_broadcast() {
969969
use std::unstable::finally::Finally;
970970

@@ -1024,7 +1024,7 @@ mod tests {
10241024
cond.wait();
10251025
}
10261026
}
1027-
#[test] #[ignore(cfg(windows))]
1027+
#[test]
10281028
fn test_mutex_different_conds() {
10291029
let result = do task::try {
10301030
let m = ~Mutex::new_with_condvars(2);
@@ -1045,7 +1045,7 @@ mod tests {
10451045
};
10461046
assert!(result.is_err());
10471047
}
1048-
#[test] #[ignore(cfg(windows))]
1048+
#[test]
10491049
fn test_mutex_no_condvars() {
10501050
let result = do task::try {
10511051
let m = ~Mutex::new_with_condvars(0);
@@ -1275,7 +1275,7 @@ mod tests {
12751275
test_rwlock_cond_broadcast_helper(12, false, true);
12761276
test_rwlock_cond_broadcast_helper(12, false, false);
12771277
}
1278-
#[cfg(test)] #[ignore(cfg(windows))]
1278+
#[cfg(test)]
12791279
fn rwlock_kill_helper(mode1: RWLockMode, mode2: RWLockMode) {
12801280
// Mutex must get automatically unlocked if failed/killed within.
12811281
let x = ~RWLock::new();
@@ -1290,23 +1290,23 @@ mod tests {
12901290
// child task must have finished by the time try returns
12911291
do lock_rwlock_in_mode(x, mode2) { }
12921292
}
1293-
#[test] #[ignore(cfg(windows))]
1293+
#[test]
12941294
fn test_rwlock_reader_killed_writer() {
12951295
rwlock_kill_helper(Read, Write);
12961296
}
1297-
#[test] #[ignore(cfg(windows))]
1297+
#[test]
12981298
fn test_rwlock_writer_killed_reader() {
12991299
rwlock_kill_helper(Write,Read );
13001300
}
1301-
#[test] #[ignore(cfg(windows))]
1301+
#[test]
13021302
fn test_rwlock_reader_killed_reader() {
13031303
rwlock_kill_helper(Read, Read );
13041304
}
1305-
#[test] #[ignore(cfg(windows))]
1305+
#[test]
13061306
fn test_rwlock_writer_killed_writer() {
13071307
rwlock_kill_helper(Write,Write);
13081308
}
1309-
#[test] #[ignore(cfg(windows))]
1309+
#[test]
13101310
fn test_rwlock_kill_downgrader() {
13111311
rwlock_kill_helper(Downgrade, Read);
13121312
rwlock_kill_helper(Read, Downgrade);
@@ -1321,7 +1321,7 @@ mod tests {
13211321
rwlock_kill_helper(Downgrade, DowngradeRead);
13221322
rwlock_kill_helper(Downgrade, DowngradeRead);
13231323
}
1324-
#[test] #[should_fail] #[ignore(cfg(windows))]
1324+
#[test] #[should_fail]
13251325
fn test_rwlock_downgrade_cant_swap() {
13261326
// Tests that you can't downgrade with a different rwlock's token.
13271327
let x = ~RWLock::new();

src/libextra/test.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,6 @@ mod tests {
11631163
}
11641164

11651165
#[test]
1166-
#[ignore(cfg(windows))]
11671166
fn test_should_fail() {
11681167
fn f() { fail!(); }
11691168
let desc = TestDescAndFn {

src/libstd/c_str.rs

-2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ mod tests {
283283

284284
#[test]
285285
#[should_fail]
286-
#[ignore(cfg(windows))]
287286
fn test_with_ref_empty_fail() {
288287
let c_str = unsafe { CString::new(ptr::null(), false) };
289288
c_str.with_ref(|_| ());
@@ -306,7 +305,6 @@ mod tests {
306305
}
307306

308307
#[test]
309-
#[ignore(cfg(windows))]
310308
fn test_to_c_str_fail() {
311309
use c_str::null_byte::cond;
312310

src/libstd/cell.rs

-2
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,13 @@ fn test_basic() {
9393

9494
#[test]
9595
#[should_fail]
96-
#[ignore(cfg(windows))]
9796
fn test_take_empty() {
9897
let value_cell = Cell::new_empty::<~int>();
9998
value_cell.take();
10099
}
101100

102101
#[test]
103102
#[should_fail]
104-
#[ignore(cfg(windows))]
105103
fn test_put_back_non_empty() {
106104
let value_cell = Cell::new(~10);
107105
value_cell.put_back(~20);

src/libstd/io.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,6 @@ mod tests {
20172017
20182018
#[test]
20192019
#[should_fail]
2020-
#[ignore(cfg(windows))]
20212020
fn test_read_buffer_too_small() {
20222021
let path = &Path("tmp/lib-io-test-read-buffer-too-small.tmp");
20232022
// ensure the file exists

src/libstd/local_data.rs

-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ fn test_tls_overwrite_multiple_types() {
201201
202202
#[test]
203203
#[should_fail]
204-
#[ignore(cfg(windows))]
205204
fn test_tls_cleanup_on_failure() {
206205
static str_key: Key<@~str> = &Key;
207206
static box_key: Key<@@()> = &Key;

src/libstd/num/int_macros.rs

-1
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,6 @@ mod tests {
919919

920920
#[test]
921921
#[should_fail]
922-
#[ignore(cfg(windows))]
923922
fn test_range_step_zero_step() {
924923
do range_step(0,10,0) |_i| { true };
925924
}

src/libstd/num/uint_macros.rs

-4
Original file line numberDiff line numberDiff line change
@@ -638,14 +638,12 @@ mod tests {
638638
639639
#[test]
640640
#[should_fail]
641-
#[ignore(cfg(windows))]
642641
pub fn to_str_radix1() {
643642
100u.to_str_radix(1u);
644643
}
645644
646645
#[test]
647646
#[should_fail]
648-
#[ignore(cfg(windows))]
649647
pub fn to_str_radix37() {
650648
100u.to_str_radix(37u);
651649
}
@@ -697,13 +695,11 @@ mod tests {
697695

698696
#[test]
699697
#[should_fail]
700-
#[ignore(cfg(windows))]
701698
fn test_range_step_zero_step_up() {
702699
do range_step(0,10,0) |_i| { true };
703700
}
704701
#[test]
705702
#[should_fail]
706-
#[ignore(cfg(windows))]
707703
fn test_range_step_zero_step_down() {
708704
do range_step(0,-10,0) |_i| { true };
709705
}

src/libstd/option.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ mod tests {
479479
assert_eq!(y2, 5);
480480
assert!(y.is_none());
481481
}
482-
#[test] #[should_fail] #[ignore(cfg(windows))]
482+
#[test] #[should_fail]
483483
fn test_option_too_much_dance() {
484484
let mut y = Some(util::NonCopyable);
485485
let _y2 = y.take_unwrap();

src/libstd/os.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1815,7 +1815,6 @@ mod tests {
18151815
}
18161816
18171817
#[test]
1818-
#[ignore(cfg(windows))]
18191818
#[ignore]
18201819
fn test_setenv_overwrite() {
18211820
let n = make_rand_name();
@@ -1829,7 +1828,6 @@ mod tests {
18291828
// Windows GetEnvironmentVariable requires some extra work to make sure
18301829
// the buffer the variable is copied into is the right size
18311830
#[test]
1832-
#[ignore(cfg(windows))]
18331831
#[ignore]
18341832
fn test_getenv_big() {
18351833
let mut s = ~"";

src/libstd/ptr.rs

-2
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,6 @@ pub mod ptr_tests {
670670

671671
#[test]
672672
#[should_fail]
673-
#[ignore(cfg(windows))]
674673
fn test_ptr_array_each_with_len_null_ptr() {
675674
unsafe {
676675
array_each_with_len(0 as **libc::c_char, 1, |e| {
@@ -680,7 +679,6 @@ pub mod ptr_tests {
680679
}
681680
#[test]
682681
#[should_fail]
683-
#[ignore(cfg(windows))]
684682
fn test_ptr_array_each_null_ptr() {
685683
unsafe {
686684
array_each(0 as **libc::c_char, |e| {

src/libstd/rand.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,6 @@ mod test {
10071007

10081008
#[test]
10091009
#[should_fail]
1010-
#[ignore(cfg(windows))]
10111010
fn test_gen_int_from_fail() {
10121011
let mut r = rng();
10131012
r.gen_int_range(5, -2);
@@ -1024,7 +1023,6 @@ mod test {
10241023

10251024
#[test]
10261025
#[should_fail]
1027-
#[ignore(cfg(windows))]
10281026
fn test_gen_uint_range_fail() {
10291027
let mut r = rng();
10301028
r.gen_uint_range(5u, 2u);

0 commit comments

Comments
 (0)