Skip to content

Commit

Permalink
miri: test with slightly larger BTrees
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Feb 13, 2019
1 parent 767dadf commit c154bf7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/liballoc/tests/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ use std::iter::FromIterator;
use super::DeterministicRng;

#[test]
#[cfg(not(miri))] // Miri is too slow
fn test_basic_large() {
let mut map = BTreeMap::new();
#[cfg(not(miri))] // Miri is too slow
let size = 10000;
#[cfg(miri)]
let size = 200;
assert_eq!(map.len(), 0);

for i in 0..size {
Expand Down Expand Up @@ -73,7 +75,7 @@ fn test_iter() {
#[cfg(not(miri))] // Miri is too slow
let size = 10000;
#[cfg(miri)]
let size = 100;
let size = 200;

// Forwards
let mut map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
Expand All @@ -98,7 +100,7 @@ fn test_iter_rev() {
#[cfg(not(miri))] // Miri is too slow
let size = 10000;
#[cfg(miri)]
let size = 100;
let size = 200;

// Forwards
let mut map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
Expand Down Expand Up @@ -137,7 +139,7 @@ fn test_iter_mixed() {
#[cfg(not(miri))] // Miri is too slow
let size = 10000;
#[cfg(miri)]
let size = 100;
let size = 200;

// Forwards
let mut map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
Expand Down Expand Up @@ -267,7 +269,7 @@ fn test_range_1000() {
#[cfg(not(miri))] // Miri is too slow
let size = 1000;
#[cfg(miri)]
let size = 100;
let size = 200;
let map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();

fn test(map: &BTreeMap<u32, u32>, size: u32, min: Bound<&u32>, max: Bound<&u32>) {
Expand Down Expand Up @@ -307,7 +309,7 @@ fn test_range() {
#[cfg(not(miri))] // Miri is too slow
let size = 200;
#[cfg(miri)]
let size = 20;
let size = 30;
let map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();

for i in 0..size {
Expand All @@ -329,7 +331,7 @@ fn test_range_mut() {
#[cfg(not(miri))] // Miri is too slow
let size = 200;
#[cfg(miri)]
let size = 20;
let size = 30;
let mut map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();

for i in 0..size {
Expand Down Expand Up @@ -506,7 +508,7 @@ fn test_clone() {
#[cfg(not(miri))] // Miri is too slow
let size = 100;
#[cfg(miri)]
let size = 20;
let size = 30;
assert_eq!(map.len(), 0);

for i in 0..size {
Expand Down

0 comments on commit c154bf7

Please sign in to comment.