Skip to content

Commit

Permalink
miri can't handle lots of iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhoo committed May 6, 2020
1 parent d944731 commit d0f080b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl BuildHasher for ZeroHashBuilder {
}

fn check<S: BuildHasher + Default>() {
let range = 0..1000;
let range = if cfg!(miri) { 0..16 } else { 0..1000 };
let guard = epoch::pin();
let map = HashMap::<i32, i32, S>::default();
for i in range.clone() {
Expand Down
9 changes: 9 additions & 0 deletions tests/jdk/map_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ use flurry::*;
use rand::prelude::*;
use std::hash::Hash;

#[cfg(not(miri))]
const SIZE: usize = 50_000;
#[cfg(miri)]
const SIZE: usize = 12;

// there must be more things absent than present!
#[cfg(not(miri))]
const ABSENT_SIZE: usize = 1 << 17;
#[cfg(miri)]
const ABSENT_SIZE: usize = 1 << 5;

const ABSENT_MASK: usize = ABSENT_SIZE - 1;

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

0 comments on commit d0f080b

Please sign in to comment.