Skip to content

Commit

Permalink
test: fix seeded_rng uses
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Feb 19, 2013
1 parent acc1477 commit 2ec958d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/test/bench/core-map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,26 +302,26 @@ fn main() {
}
};

let seed = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let seed = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

{
let rng = rand::seeded_rng(&seed);
let rng = rand::seeded_rng(seed);
let mut results = empty_results();
old_int_benchmarks(rng, num_keys, &mut results);
old_str_benchmarks(rng, num_keys, &mut results);
write_results("std::oldmap::HashMap", &results);
}

{
let rng = rand::seeded_rng(&seed);
let rng = rand::seeded_rng(seed);
let mut results = empty_results();
linear_int_benchmarks(rng, num_keys, &mut results);
linear_str_benchmarks(rng, num_keys, &mut results);
write_results("core::hashmap::linear::LinearMap", &results);
}

{
let rng = rand::seeded_rng(&seed);
let rng = rand::seeded_rng(seed);
let mut results = empty_results();
tree_int_benchmarks(rng, num_keys, &mut results);
tree_str_benchmarks(rng, num_keys, &mut results);
Expand Down
8 changes: 4 additions & 4 deletions src/test/bench/core-set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,27 +152,27 @@ fn main() {
}
};

let seed = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let seed = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let max = 200000;

{
let rng = rand::seeded_rng(&seed);
let rng = rand::seeded_rng(seed);
let mut results = empty_results();
results.bench_int(rng, num_keys, max, || LinearSet::new::<uint>());
results.bench_str(rng, num_keys, || LinearSet::new::<~str>());
write_results("core::hashmap::LinearSet", &results);
}

{
let rng = rand::seeded_rng(&seed);
let rng = rand::seeded_rng(seed);
let mut results = empty_results();
results.bench_int(rng, num_keys, max, || TreeSet::new::<uint>());
results.bench_str(rng, num_keys, || TreeSet::new::<~str>());
write_results("std::treemap::TreeSet", &results);
}

{
let rng = rand::seeded_rng(&seed);
let rng = rand::seeded_rng(seed);
let mut results = empty_results();
results.bench_int(rng, num_keys, max, || BitvSet::new());
write_results("std::bitv::BitvSet", &results);
Expand Down

0 comments on commit 2ec958d

Please sign in to comment.