1
Fork 0

liballoc: more compact way to adjust test sizes for Miri

This commit is contained in:
Ralf Jung 2020-04-23 20:05:01 +02:00
parent f1c30519f3
commit eb1de2ff39
6 changed files with 35 additions and 71 deletions

View file

@ -409,16 +409,14 @@ fn panic_safe() {
}
let mut rng = thread_rng();
const DATASZ: usize = 32;
#[cfg(not(miri))] // Miri is too slow
const NTEST: usize = 10;
#[cfg(miri)]
const NTEST: usize = 1;
// Miri is too slow
let ntest = if cfg!(miri) { 1 } else { 10 };
// don't use 0 in the data -- we want to catch the zeroed-out case.
let data = (1..=DATASZ).collect::<Vec<_>>();
// since it's a fuzzy test, run several tries.
for _ in 0..NTEST {
for _ in 0..ntest {
for i in 1..=DATASZ {
DROP_COUNTER.store(0, Ordering::SeqCst);