From 4bcda7148de04086bb30a3a79d739761fa9cb1ee Mon Sep 17 00:00:00 2001 From: Ben Blum Date: Wed, 17 Jul 2013 15:31:20 -0400 Subject: [PATCH] Fix warnings in src/test/bench tests. Nobody will ever care. --- src/test/bench/core-std.rs | 4 ++-- src/test/bench/core-uint-to-str.rs | 2 +- src/test/bench/graph500-bfs.rs | 6 +++--- src/test/bench/msgsend-pipes-shared.rs | 9 +++----- src/test/bench/msgsend-pipes.rs | 9 +++----- src/test/bench/msgsend-ring-mutex-arcs.rs | 9 ++++---- src/test/bench/msgsend-ring-pipes.rs | 5 ++--- src/test/bench/msgsend-ring-rw-arcs.rs | 9 ++++---- src/test/bench/pingpong.rs | 2 +- src/test/bench/shootout-ackermann.rs | 2 +- src/test/bench/shootout-binarytrees.rs | 2 +- src/test/bench/shootout-chameneos-redux.rs | 8 +++---- src/test/bench/shootout-fasta-redux.rs | 1 - src/test/bench/shootout-fibo.rs | 2 +- src/test/bench/shootout-k-nucleotide-pipes.rs | 21 +++++++++---------- src/test/bench/shootout-nbody.rs | 1 - src/test/bench/shootout-pfib.rs | 7 +++---- src/test/bench/shootout-reverse-complement.rs | 1 - src/test/bench/shootout-threadring.rs | 4 ++-- src/test/bench/std-smallintmap.rs | 2 +- src/test/bench/sudoku.rs | 21 +++++++++---------- src/test/bench/task-perf-alloc-unwind.rs | 2 +- .../bench/task-perf-jargon-metal-smoke.rs | 2 +- src/test/bench/task-perf-linked-failure.rs | 2 +- src/test/bench/task-perf-one-million.rs | 3 +-- src/test/bench/task-perf-spawnalot.rs | 2 +- 26 files changed, 60 insertions(+), 78 deletions(-) diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs index 1f98865a10c..ea5aa309dc6 100644 --- a/src/test/bench/core-std.rs +++ b/src/test/bench/core-std.rs @@ -30,7 +30,7 @@ macro_rules! bench ( fn main() { let argv = os::args(); - let tests = argv.slice(1, argv.len()); + let _tests = argv.slice(1, argv.len()); bench!(shift_push); bench!(read_line); @@ -44,7 +44,7 @@ fn main() { fn maybe_run_test(argv: &[~str], name: ~str, test: &fn()) { let mut run_test = false; - if os::getenv(~"RUST_BENCH").is_some() { + if os::getenv("RUST_BENCH").is_some() { run_test = true } else if argv.len() > 0 { run_test = argv.iter().any(|x| x == &~"all") || argv.iter().any(|x| x == &name) diff --git a/src/test/bench/core-uint-to-str.rs b/src/test/bench/core-uint-to-str.rs index f960363766d..2c5cb5d1347 100644 --- a/src/test/bench/core-uint-to-str.rs +++ b/src/test/bench/core-uint-to-str.rs @@ -13,7 +13,7 @@ use std::uint; fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"10000000"] } else if args.len() <= 1u { ~[~"", ~"100000"] diff --git a/src/test/bench/graph500-bfs.rs b/src/test/bench/graph500-bfs.rs index 8a0d9bcead0..f17b6658f9d 100644 --- a/src/test/bench/graph500-bfs.rs +++ b/src/test/bench/graph500-bfs.rs @@ -410,7 +410,7 @@ fn validate(edges: ~[(node_id, node_id)], fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"15", ~"48"] } else if args.len() <= 1 { ~[~"", ~"10", ~"16"] @@ -447,7 +447,7 @@ fn main() { let graph_arc = arc::ARC(graph.clone()); do gen_search_keys(graph, num_keys).map() |root| { - io::stdout().write_line(~""); + io::stdout().write_line(""); io::stdout().write_line(fmt!("Search key: %?", root)); if do_sequential { @@ -511,7 +511,7 @@ fn main() { } }; - io::stdout().write_line(~""); + io::stdout().write_line(""); io::stdout().write_line( fmt!("Total sequential: %? \t Total Parallel: %? \t Speedup: %?x", total_seq, total_par, total_seq / total_par)); diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs index 8aff30ec80a..9b0fd23d9cb 100644 --- a/src/test/bench/msgsend-pipes-shared.rs +++ b/src/test/bench/msgsend-pipes-shared.rs @@ -22,15 +22,12 @@ extern mod extra; use std::comm::{Port, Chan, SharedChan}; use std::comm; -use std::io::{Writer, WriterUtil}; use std::io; use std::os; use std::task; -use std::ptr; use std::uint; -use std::vec; -fn move_out(x: T) {} +fn move_out(_x: T) {} enum request { get_count, @@ -38,7 +35,7 @@ enum request { stop } -fn server(requests: &Port, responses: &comm::Chan) { +fn server(requests: &Port, responses: &Chan) { let mut count = 0u; let mut done = false; while !done { @@ -102,7 +99,7 @@ fn run(args: &[~str]) { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"1000000", ~"10000"] } else if args.len() <= 1u { ~[~"", ~"10000", ~"4"] diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs index 0046fb9dd12..5ce5e902ed1 100644 --- a/src/test/bench/msgsend-pipes.rs +++ b/src/test/bench/msgsend-pipes.rs @@ -16,16 +16,13 @@ extern mod extra; -use std::comm::{Port, PortSet, Chan, stream}; -use std::io::{Writer, WriterUtil}; +use std::comm::{PortSet, Chan, stream}; use std::io; use std::os; -use std::ptr; use std::task; use std::uint; -use std::vec; -fn move_out(x: T) {} +fn move_out(_x: T) {} enum request { get_count, @@ -98,7 +95,7 @@ fn run(args: &[~str]) { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"1000000", ~"8"] } else if args.len() <= 1u { ~[~"", ~"10000", ~"4"] diff --git a/src/test/bench/msgsend-ring-mutex-arcs.rs b/src/test/bench/msgsend-ring-mutex-arcs.rs index a60e0b9e340..86784c0b7d3 100644 --- a/src/test/bench/msgsend-ring-mutex-arcs.rs +++ b/src/test/bench/msgsend-ring-mutex-arcs.rs @@ -24,7 +24,6 @@ use std::cell::Cell; use std::io; use std::os; use std::uint; -use std::vec; // A poor man's pipe. type pipe = arc::MutexARC<~[uint]>; @@ -60,8 +59,8 @@ fn thread_ring(i: uint, count: uint, num_chan: pipe, num_port: pipe) { // Send/Receive lots of messages. for uint::range(0u, count) |j| { //error!("task %?, iter %?", i, j); - let mut num_chan2 = num_chan.take_unwrap(); - let mut num_port2 = num_port.take_unwrap(); + let num_chan2 = num_chan.take_unwrap(); + let num_port2 = num_port.take_unwrap(); send(&num_chan2, i * j); num_chan = Some(num_chan2); let _n = recv(&num_port2); @@ -72,7 +71,7 @@ fn thread_ring(i: uint, count: uint, num_chan: pipe, num_port: pipe) { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"100", ~"10000"] } else if args.len() <= 1u { ~[~"", ~"10", ~"100"] @@ -84,7 +83,7 @@ fn main() { let msg_per_task = uint::from_str(args[2]).get(); let (num_chan, num_port) = init(); - let mut num_chan = Cell::new(num_chan); + let num_chan = Cell::new(num_chan); let start = time::precise_time_s(); diff --git a/src/test/bench/msgsend-ring-pipes.rs b/src/test/bench/msgsend-ring-pipes.rs index b4692c774aa..b79f171147a 100644 --- a/src/test/bench/msgsend-ring-pipes.rs +++ b/src/test/bench/msgsend-ring-pipes.rs @@ -24,7 +24,6 @@ use std::cell::Cell; use std::io; use std::os; use std::pipes::recv; -use std::ptr; use std::uint; use std::util; @@ -58,7 +57,7 @@ fn thread_ring(i: uint, fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"100", ~"10000"] } else if args.len() <= 1u { ~[~"", ~"100", ~"1000"] @@ -70,7 +69,7 @@ fn main() { let msg_per_task = uint::from_str(args[2]).get(); let (num_port, num_chan) = ring::init(); - let mut num_chan = Cell::new(num_chan); + let num_chan = Cell::new(num_chan); let start = time::precise_time_s(); diff --git a/src/test/bench/msgsend-ring-rw-arcs.rs b/src/test/bench/msgsend-ring-rw-arcs.rs index 0c6b97c6b78..b4037d866a0 100644 --- a/src/test/bench/msgsend-ring-rw-arcs.rs +++ b/src/test/bench/msgsend-ring-rw-arcs.rs @@ -24,7 +24,6 @@ use std::cell::Cell; use std::io; use std::os; use std::uint; -use std::vec; // A poor man's pipe. type pipe = arc::RWARC<~[uint]>; @@ -56,8 +55,8 @@ fn thread_ring(i: uint, count: uint, num_chan: pipe, num_port: pipe) { // Send/Receive lots of messages. for uint::range(0u, count) |j| { //error!("task %?, iter %?", i, j); - let mut num_chan2 = num_chan.take_unwrap(); - let mut num_port2 = num_port.take_unwrap(); + let num_chan2 = num_chan.take_unwrap(); + let num_port2 = num_port.take_unwrap(); send(&num_chan2, i * j); num_chan = Some(num_chan2); let _n = recv(&num_port2); @@ -68,7 +67,7 @@ fn thread_ring(i: uint, count: uint, num_chan: pipe, num_port: pipe) { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"100", ~"10000"] } else if args.len() <= 1u { ~[~"", ~"10", ~"100"] @@ -80,7 +79,7 @@ fn main() { let msg_per_task = uint::from_str(args[2]).get(); let (num_chan, num_port) = init(); - let mut num_chan = Cell::new(num_chan); + let num_chan = Cell::new(num_chan); let start = time::precise_time_s(); diff --git a/src/test/bench/pingpong.rs b/src/test/bench/pingpong.rs index 1d32a78303a..2eb27437890 100644 --- a/src/test/bench/pingpong.rs +++ b/src/test/bench/pingpong.rs @@ -190,7 +190,7 @@ fn timeit(f: &fn()) -> float { } fn main() { - let count = if os::getenv(~"RUST_BENCH").is_some() { + let count = if os::getenv("RUST_BENCH").is_some() { 250000 } else { 100 diff --git a/src/test/bench/shootout-ackermann.rs b/src/test/bench/shootout-ackermann.rs index 51fec4dbfe8..ff806c8b5d4 100644 --- a/src/test/bench/shootout-ackermann.rs +++ b/src/test/bench/shootout-ackermann.rs @@ -28,7 +28,7 @@ fn ack(m: int, n: int) -> int { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"12"] } else if args.len() <= 1u { ~[~"", ~"8"] diff --git a/src/test/bench/shootout-binarytrees.rs b/src/test/bench/shootout-binarytrees.rs index 76ef4c12380..d88843e1180 100644 --- a/src/test/bench/shootout-binarytrees.rs +++ b/src/test/bench/shootout-binarytrees.rs @@ -40,7 +40,7 @@ fn main() { use std::os; use std::int; let args = std::os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"17"] } else if args.len() <= 1u { ~[~"", ~"8"] diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index deb2d4b300b..f218b963aaa 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -12,7 +12,6 @@ extern mod extra; -use extra::sort; use std::cell::Cell; use std::comm::*; use std::io; @@ -20,7 +19,6 @@ use std::option; use std::os; use std::task; use std::uint; -use std::vec; fn print_complements() { let all = [Blue, Red, Yellow]; @@ -206,7 +204,7 @@ fn rendezvous(nn: uint, set: ~[color]) { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"200000"] } else if args.len() <= 1u { ~[~"", ~"600"] @@ -217,10 +215,10 @@ fn main() { let nn = uint::from_str(args[1]).get(); print_complements(); - io::println(~""); + io::println(""); rendezvous(nn, ~[Blue, Red, Yellow]); - io::println(~""); + io::println(""); rendezvous(nn, ~[Blue, Red, Yellow, Red, Yellow, Blue, Red, Yellow, Red, Blue]); diff --git a/src/test/bench/shootout-fasta-redux.rs b/src/test/bench/shootout-fasta-redux.rs index 5ebcfe164ce..cc23c001833 100644 --- a/src/test/bench/shootout-fasta-redux.rs +++ b/src/test/bench/shootout-fasta-redux.rs @@ -2,7 +2,6 @@ use std::cast::transmute; use std::from_str::FromStr; use std::libc::{FILE, STDOUT_FILENO, c_int, fdopen, fputc, fputs, fwrite, size_t}; use std::os; -use std::str; use std::uint::{min, range}; use std::vec::bytes::copy_memory; use std::vec; diff --git a/src/test/bench/shootout-fibo.rs b/src/test/bench/shootout-fibo.rs index a1bb0e9e6d8..de36a59dd65 100644 --- a/src/test/bench/shootout-fibo.rs +++ b/src/test/bench/shootout-fibo.rs @@ -24,7 +24,7 @@ fn fib(n: int) -> int { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"40"] } else if args.len() <= 1u { ~[~"", ~"30"] diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index a3755919ffe..46b882f7b82 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -121,8 +121,8 @@ fn windows_with_carry(bb: &[u8], nn: uint, } fn make_sequence_processor(sz: uint, - from_parent: &comm::Port<~[u8]>, - to_parent: &comm::Chan<~str>) { + from_parent: &Port<~[u8]>, + to_parent: &Chan<~str>) { let mut freqs: HashMap<~[u8], uint> = HashMap::new(); let mut carry: ~[u8] = ~[]; let mut total: uint = 0u; @@ -143,11 +143,11 @@ fn make_sequence_processor(sz: uint, let buffer = match sz { 1u => { sort_and_fmt(&freqs, total) } 2u => { sort_and_fmt(&freqs, total) } - 3u => { fmt!("%u\t%s", find(&freqs, ~"GGT"), ~"GGT") } - 4u => { fmt!("%u\t%s", find(&freqs, ~"GGTA"), ~"GGTA") } - 6u => { fmt!("%u\t%s", find(&freqs, ~"GGTATT"), ~"GGTATT") } - 12u => { fmt!("%u\t%s", find(&freqs, ~"GGTATTTTAATT"), ~"GGTATTTTAATT") } - 18u => { fmt!("%u\t%s", find(&freqs, ~"GGTATTTTAATTTATAGT"), ~"GGTATTTTAATTTATAGT") } + 3u => { fmt!("%u\t%s", find(&freqs, ~"GGT"), "GGT") } + 4u => { fmt!("%u\t%s", find(&freqs, ~"GGTA"), "GGTA") } + 6u => { fmt!("%u\t%s", find(&freqs, ~"GGTATT"), "GGTATT") } + 12u => { fmt!("%u\t%s", find(&freqs, ~"GGTATTTTAATT"), "GGTATTTTAATT") } + 18u => { fmt!("%u\t%s", find(&freqs, ~"GGTATTTTAATTTATAGT"), "GGTATTTTAATTTATAGT") } _ => { ~"" } }; @@ -156,8 +156,7 @@ fn make_sequence_processor(sz: uint, // given a FASTA file on stdin, process sequence THREE fn main() { - let args = os::args(); - let rdr = if os::getenv(~"RUST_BENCH").is_some() { + let rdr = if os::getenv("RUST_BENCH").is_some() { // FIXME: Using this compile-time env variable is a crummy way to // get to this massive data set, but include_bin! chokes on it (#2598) let path = Path(env!("CFG_SRC_DIR")) @@ -203,7 +202,7 @@ fn main() { // start processing if this is the one ('>', false) => { - match line.slice_from(1).find_str(~"THREE") { + match line.slice_from(1).find_str("THREE") { option::Some(_) => { proc_mode = true; } option::None => { } } @@ -217,7 +216,7 @@ fn main() { let line_bytes = line.as_bytes(); for sizes.iter().enumerate().advance |(ii, _sz)| { - let mut lb = line_bytes.to_owned(); + let lb = line_bytes.to_owned(); to_child[ii].send(lb); } } diff --git a/src/test/bench/shootout-nbody.rs b/src/test/bench/shootout-nbody.rs index a56d1f44fa2..1fab646fb37 100644 --- a/src/test/bench/shootout-nbody.rs +++ b/src/test/bench/shootout-nbody.rs @@ -1,7 +1,6 @@ use std::from_str::FromStr; use std::os; use std::uint::range; -use std::vec; static PI: f64 = 3.141592653589793; static SOLAR_MASS: f64 = 4.0 * PI * PI; diff --git a/src/test/bench/shootout-pfib.rs b/src/test/bench/shootout-pfib.rs index cbc2d3f0ea8..6ea22715750 100644 --- a/src/test/bench/shootout-pfib.rs +++ b/src/test/bench/shootout-pfib.rs @@ -28,7 +28,6 @@ use std::io::WriterUtil; use std::io; use std::os; use std::result::{Ok, Err}; -use std::str; use std::task; use std::u64; use std::uint; @@ -59,13 +58,13 @@ struct Config { } fn parse_opts(argv: ~[~str]) -> Config { - let opts = ~[getopts::optflag(~"stress")]; + let opts = ~[getopts::optflag("stress")]; let opt_args = argv.slice(1, argv.len()); match getopts::getopts(opt_args, opts) { Ok(ref m) => { - return Config {stress: getopts::opt_present(m, ~"stress")} + return Config {stress: getopts::opt_present(m, "stress")} } Err(_) => { fail!(); } } @@ -97,7 +96,7 @@ fn stress(num_tasks: int) { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"20"] } else if args.len() <= 1u { ~[~"", ~"8"] diff --git a/src/test/bench/shootout-reverse-complement.rs b/src/test/bench/shootout-reverse-complement.rs index e57dee06c75..6ce62ccd127 100644 --- a/src/test/bench/shootout-reverse-complement.rs +++ b/src/test/bench/shootout-reverse-complement.rs @@ -5,7 +5,6 @@ use std::cast::transmute; use std::libc::{STDOUT_FILENO, c_int, fdopen, fgets, fopen, fputc, fwrite}; use std::libc::{size_t}; use std::ptr::null; -use std::vec::raw::set_len; static LINE_LEN: u32 = 80; diff --git a/src/test/bench/shootout-threadring.rs b/src/test/bench/shootout-threadring.rs index d30c1294435..7e75ac85848 100644 --- a/src/test/bench/shootout-threadring.rs +++ b/src/test/bench/shootout-threadring.rs @@ -15,7 +15,7 @@ use std::os; fn start(n_tasks: int, token: int) { let (p, ch1) = stream(); let mut p = p; - let mut ch1 = ch1; + let ch1 = ch1; ch1.send(token); // XXX could not get this to work with a range closure let mut i = 2; @@ -55,7 +55,7 @@ fn roundtrip(id: int, n_tasks: int, p: &Port, ch: &Chan) { } fn main() { - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"2000000", ~"503"] } else { diff --git a/src/test/bench/std-smallintmap.rs b/src/test/bench/std-smallintmap.rs index 23ac68315e3..7f2accb6f0e 100644 --- a/src/test/bench/std-smallintmap.rs +++ b/src/test/bench/std-smallintmap.rs @@ -32,7 +32,7 @@ fn check_sequential(min: uint, max: uint, map: &SmallIntMap) { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"100000", ~"100"] } else if args.len() <= 1u { ~[~"", ~"10000", ~"50"] diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index 2396d6efc5c..f4ddc090c21 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -15,7 +15,6 @@ extern mod extra; use std::io::{ReaderUtil, WriterUtil}; use std::io; use std::os; -use std::str; use std::u8; use std::uint; use std::unstable::intrinsics::cttz16; @@ -50,7 +49,7 @@ impl Sudoku { } pub fn from_vec(vec: &[[u8, ..9], ..9]) -> Sudoku { - let mut g = do vec::from_fn(9u) |i| { + let g = do vec::from_fn(9u) |i| { do vec::from_fn(9u) |j| { vec[i][j] } }; return Sudoku::new(g) @@ -161,17 +160,17 @@ impl Sudoku { // Stores available colors as simple bitfield, bit 0 is always unset struct Colors(u16); -static heads: u16 = (1u16 << 10) - 1; /* bits 9..0 */ +static HEADS: u16 = (1u16 << 10) - 1; /* bits 9..0 */ impl Colors { fn new(start_color: u8) -> Colors { // Sets bits 9..start_color let tails = !0u16 << start_color; - return Colors(heads & tails); + return Colors(HEADS & tails); } fn next(&self) -> u8 { - let val = **self & heads; + let val = **self & HEADS; if (0u16 == val) { return 0u8; } else { @@ -190,7 +189,7 @@ impl Colors { } } -static default_sudoku: [[u8, ..9], ..9] = [ +static DEFAULT_SUDOKU: [[u8, ..9], ..9] = [ /* 0 1 2 3 4 5 6 7 8 */ /* 0 */ [0u8, 4u8, 0u8, 6u8, 0u8, 0u8, 0u8, 3u8, 2u8], /* 1 */ [0u8, 0u8, 8u8, 0u8, 2u8, 0u8, 0u8, 0u8, 0u8], @@ -204,7 +203,7 @@ static default_sudoku: [[u8, ..9], ..9] = [ ]; #[cfg(test)] -static default_solution: [[u8, ..9], ..9] = [ +static DEFAULT_SOLUTION: [[u8, ..9], ..9] = [ /* 0 1 2 3 4 5 6 7 8 */ /* 0 */ [1u8, 4u8, 9u8, 6u8, 7u8, 5u8, 8u8, 3u8, 2u8], /* 1 */ [5u8, 3u8, 8u8, 1u8, 2u8, 9u8, 7u8, 4u8, 6u8], @@ -258,10 +257,10 @@ fn colors_remove_works() { } #[test] -fn check_default_sudoku_solution() { +fn check_DEFAULT_SUDOKU_solution() { // GIVEN - let mut sudoku = Sudoku::from_vec(&default_sudoku); - let solution = Sudoku::from_vec(&default_solution); + let mut sudoku = Sudoku::from_vec(&DEFAULT_SUDOKU); + let solution = Sudoku::from_vec(&DEFAULT_SOLUTION); // WHEN sudoku.solve(); @@ -274,7 +273,7 @@ fn main() { let args = os::args(); let use_default = args.len() == 1u; let mut sudoku = if use_default { - Sudoku::from_vec(&default_sudoku) + Sudoku::from_vec(&DEFAULT_SUDOKU) } else { Sudoku::read(io::stdin()) }; diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index f397f954623..3470cc92745 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -22,7 +22,7 @@ enum UniqueList { } fn main() { - let (repeat, depth) = if os::getenv(~"RUST_BENCH").is_some() { + let (repeat, depth) = if os::getenv("RUST_BENCH").is_some() { (50, 1000) } else { (10, 10) diff --git a/src/test/bench/task-perf-jargon-metal-smoke.rs b/src/test/bench/task-perf-jargon-metal-smoke.rs index d3fd20a0293..4e27841a748 100644 --- a/src/test/bench/task-perf-jargon-metal-smoke.rs +++ b/src/test/bench/task-perf-jargon-metal-smoke.rs @@ -43,7 +43,7 @@ fn child_generation(gens_left: uint, c: comm::Chan<()>) { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"100000"] } else if args.len() <= 1 { ~[~"", ~"100"] diff --git a/src/test/bench/task-perf-linked-failure.rs b/src/test/bench/task-perf-linked-failure.rs index e07e5334712..7eb138e99a0 100644 --- a/src/test/bench/task-perf-linked-failure.rs +++ b/src/test/bench/task-perf-linked-failure.rs @@ -63,7 +63,7 @@ fn spawn_supervised_blocking(myname: &str, f: ~fn()) { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"100000"] } else if args.len() <= 1u { ~[~"", ~"100"] diff --git a/src/test/bench/task-perf-one-million.rs b/src/test/bench/task-perf-one-million.rs index 1cd90962c5b..7f986eab789 100644 --- a/src/test/bench/task-perf-one-million.rs +++ b/src/test/bench/task-perf-one-million.rs @@ -12,7 +12,6 @@ // xfail-test OOM on linux-32 without opts -use std::comm::*; use std::os; use std::task; use std::uint; @@ -49,7 +48,7 @@ fn calc(children: uint, parent_wait_chan: &Chan>>) { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"30"] } else if args.len() <= 1u { ~[~"", ~"10"] diff --git a/src/test/bench/task-perf-spawnalot.rs b/src/test/bench/task-perf-spawnalot.rs index 1a8fc7e098d..a152c302133 100644 --- a/src/test/bench/task-perf-spawnalot.rs +++ b/src/test/bench/task-perf-spawnalot.rs @@ -24,7 +24,7 @@ fn g() { } fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { ~[~"", ~"400"] } else if args.len() <= 1u { ~[~"", ~"10"]