std: silence warnings when compiling test.

This commit is contained in:
Huon Wilson 2013-12-20 01:12:56 +11:00
parent b3cee62034
commit c00104f36a
14 changed files with 28 additions and 46 deletions

View file

@ -907,22 +907,14 @@ pub fn utime(p: &CString, atime: u64, mtime: u64) -> IoResult<()> {
#[cfg(test)]
mod tests {
use io::native::file::{CFile, FileDesc};
use io::fs;
use io;
use libc;
use os;
use path::Path;
use rand;
use result::Ok;
use rt::rtio::RtioFileStream;
fn tmpdir() -> Path {
let ret = os::tmpdir().join(format!("rust-{}", rand::random::<u32>()));
fs::mkdir(&ret, io::UserRWX);
ret
}
#[ignore(cfg(target_os = "freebsd"))] // hmm, maybe pipes have a tiny buffer
#[test]
fn test_file_desc() {
// Run this test with some pipes so we don't have to mess around with
// opening or closing files.
@ -949,6 +941,7 @@ mod tests {
}
#[ignore(cfg(windows))] // apparently windows doesn't like tmpfile
#[test]
fn test_cfile() {
unsafe {
let f = libc::tmpfile();

View file

@ -220,7 +220,7 @@ mod test {
#[test]
fn test_null_writer() {
let mut s = NullWriter;
let mut buf = ~[0, 0, 0];
let buf = ~[0, 0, 0];
s.write(buf);
s.flush();
}
@ -248,7 +248,7 @@ mod test {
struct TestWriter;
impl Writer for TestWriter {
fn write(&mut self, buf: &[u8]) {
fn write(&mut self, _buf: &[u8]) {
unsafe { writes += 1 }
}