From 0c3b04fa0fc71d319fae14287246126e2e7c84d3 Mon Sep 17 00:00:00 2001 From: Guillaume Pinot Date: Sun, 17 Nov 2013 12:47:47 +0100 Subject: [PATCH] Clarrify the message for test mode and use u8 instead of i8 for storing bits --- src/test/bench/shootout-mandelbrot.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/bench/shootout-mandelbrot.rs b/src/test/bench/shootout-mandelbrot.rs index 70fd95f3d47..a08dfb29d3e 100644 --- a/src/test/bench/shootout-mandelbrot.rs +++ b/src/test/bench/shootout-mandelbrot.rs @@ -21,14 +21,15 @@ static LIMIT: f64 = 2.0; fn main() { let args = std::os::args(); let (w, mut out) = if args.len() < 2 { - println("Test mode: do not dump the image."); + println("Test mode: do not dump the image because it's not utf8," + + " which interferes with the test runner."); (1000, ~DummyWriter as ~Writer) } else { (from_str(args[1]).unwrap(), ~BufferedWriter::new(std::io::stdout()) as ~Writer) }; let h = w; - let mut byte_acc = 0i8; + let mut byte_acc = 0u8; let mut bit_num = 0; writeln!(out, "P4\n{} {}", w, h); @@ -62,12 +63,12 @@ fn main() { bit_num += 1; if bit_num == 8 { - out.write_i8(byte_acc); + out.write_u8(byte_acc); byte_acc = 0; bit_num = 0; } else if x == w - 1 { byte_acc <<= 8 - w % 8; - out.write_i8(byte_acc); + out.write_u8(byte_acc); byte_acc = 0; bit_num = 0; }