@@ -4,6 +4,8 @@ extern crate alloc;
44extern crate histo;
55#[ macro_use]
66extern crate quickcheck;
7+ #[ macro_use]
8+ extern crate cfg_if;
79extern crate rand;
810extern crate wee_alloc;
911
@@ -257,10 +259,10 @@ impl Operations {
257259 let handle2 = thread:: spawn ( move || ops2. run_with_allocator ( & WEE ) ) ;
258260 let handle3 = thread:: spawn ( move || ops3. run_with_allocator ( & WEE ) ) ;
259261
260- handle0. join ( ) . unwrap ( ) ;
261- handle1. join ( ) . unwrap ( ) ;
262- handle2. join ( ) . unwrap ( ) ;
263- handle3. join ( ) . unwrap ( ) ;
262+ handle0. join ( ) . expect ( "Thread 0 Failed" ) ;
263+ handle1. join ( ) . expect ( "Thread 1 Failed" ) ;
264+ handle2. join ( ) . expect ( "Thread 2 Failed" ) ;
265+ handle3. join ( ) . expect ( "Thread 3 Failed" ) ;
264266 }
265267
266268 pub fn run_with_allocator < A : Alloc > ( & self , mut a : A ) {
@@ -344,12 +346,17 @@ macro_rules! run_quickchecks {
344346// with each other.
345347run_quickchecks ! ( quickchecks_0) ;
346348run_quickchecks ! ( quickchecks_1) ;
347- run_quickchecks ! ( quickchecks_2) ;
348- run_quickchecks ! ( quickchecks_3) ;
349- run_quickchecks ! ( quickchecks_4) ;
350- run_quickchecks ! ( quickchecks_5) ;
351- run_quickchecks ! ( quickchecks_6) ;
352- run_quickchecks ! ( quickchecks_7) ;
349+ // Limit the extent of the stress testing for the limited-size static backend
350+ cfg_if ! {
351+ if #[ cfg( not( feature = "static_array_backend" ) ) ] {
352+ run_quickchecks!( quickchecks_2) ;
353+ run_quickchecks!( quickchecks_3) ;
354+ run_quickchecks!( quickchecks_4) ;
355+ run_quickchecks!( quickchecks_5) ;
356+ run_quickchecks!( quickchecks_6) ;
357+ run_quickchecks!( quickchecks_7) ;
358+ }
359+ }
353360
354361#[ test]
355362fn multi_threaded_quickchecks ( ) {
@@ -389,7 +396,10 @@ test_trace!(test_trace_dogfood, "../traces/dogfood.trace");
389396test_trace ! ( test_trace_ffmpeg, "../traces/ffmpeg.trace" ) ;
390397test_trace ! ( test_trace_find, "../traces/find.trace" ) ;
391398test_trace ! ( test_trace_gcc_hello, "../traces/gcc-hello.trace" ) ;
392- test_trace ! ( test_trace_grep_random_data, "../traces/grep-random-data.trace" ) ;
399+ test_trace ! (
400+ test_trace_grep_random_data,
401+ "../traces/grep-random-data.trace"
402+ ) ;
393403test_trace ! ( test_trace_grep_recursive, "../traces/grep-recursive.trace" ) ;
394404test_trace ! ( test_trace_ls, "../traces/ls.trace" ) ;
395405test_trace ! ( test_trace_source_map, "../traces/source-map.trace" ) ;
@@ -408,13 +418,7 @@ fn regression_test_1() {
408418
409419#[ test]
410420fn regression_test_2 ( ) {
411- Operations ( vec ! [
412- Alloc ( 168 ) ,
413- Free ( 0 ) ,
414- Alloc ( 0 ) ,
415- Alloc ( 168 ) ,
416- Free ( 2 ) ,
417- ] ) . run_single_threaded ( ) ;
421+ Operations ( vec ! [ Alloc ( 168 ) , Free ( 0 ) , Alloc ( 0 ) , Alloc ( 168 ) , Free ( 2 ) ] ) . run_single_threaded ( ) ;
418422}
419423
420424#[ test]
@@ -472,15 +476,17 @@ fn smoke() {
472476 let mut a = & wee_alloc:: WeeAlloc :: INIT ;
473477 unsafe {
474478 let layout = Layout :: new :: < u8 > ( ) ;
475- let ptr = a. alloc ( layout. clone ( ) ) . unwrap ( ) ;
479+ let ptr = a. alloc ( layout. clone ( ) )
480+ . expect ( "Should be able to alloc a fresh Layout clone" ) ;
476481 {
477482 let ptr = ptr. as_ptr ( ) as * mut u8 ;
478483 * ptr = 9 ;
479484 assert_eq ! ( * ptr, 9 ) ;
480485 }
481486 a. dealloc ( ptr, layout. clone ( ) ) ;
482487
483- let ptr = a. alloc ( layout. clone ( ) ) . unwrap ( ) ;
488+ let ptr = a. alloc ( layout. clone ( ) )
489+ . expect ( "Should be able to alloc from a second clone" ) ;
484490 {
485491 let ptr = ptr. as_ptr ( ) as * mut u8 ;
486492 * ptr = 10 ;
@@ -490,9 +496,10 @@ fn smoke() {
490496 }
491497}
492498
493- // This takes too long with our extra assertion checks enabled.
499+ // This takes too long with our extra assertion checks enabled,
500+ // and the fixed-sized static array backend is too small.
494501#[ test]
495- #[ cfg( not( feature = "extra_assertions" ) ) ]
502+ #[ cfg( not( any ( feature = "extra_assertions" , feature = "static_array_backend" ) ) ) ]
496503fn stress ( ) {
497504 use rand:: Rng ;
498505 use std:: cmp;
0 commit comments