Skip to content

Commit d0f080b

Browse files
committed
miri can't handle lots of iterations
1 parent d944731 commit d0f080b

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

tests/hasher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl BuildHasher for ZeroHashBuilder {
2323
}
2424

2525
fn check<S: BuildHasher + Default>() {
26-
let range = 0..1000;
26+
let range = if cfg!(miri) { 0..16 } else { 0..1000 };
2727
let guard = epoch::pin();
2828
let map = HashMap::<i32, i32, S>::default();
2929
for i in range.clone() {

tests/jdk/map_check.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@ use flurry::*;
33
use rand::prelude::*;
44
use std::hash::Hash;
55

6+
#[cfg(not(miri))]
67
const SIZE: usize = 50_000;
8+
#[cfg(miri)]
9+
const SIZE: usize = 12;
10+
11+
// there must be more things absent than present!
12+
#[cfg(not(miri))]
713
const ABSENT_SIZE: usize = 1 << 17;
14+
#[cfg(miri)]
15+
const ABSENT_SIZE: usize = 1 << 5;
16+
817
const ABSENT_MASK: usize = ABSENT_SIZE - 1;
918

1019
fn t1<K, V>(map: &HashMap<K, V>, keys: &[K], expect: usize)

0 commit comments

Comments
 (0)