Skip to content

Commit

Permalink
Test fixes and rebase conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Apr 1, 2015
1 parent 6ebb6e6 commit 8dff0ac
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ use std::fmt;
use std::hash::{Hash, SipHasher, Hasher};
use std::mem;
use std::num::ToPrimitive;
use std::num::wrapping::WrappingOps;
use std::ops;
use std::rc::Rc;
use std::vec::IntoIter;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/old_io/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ mod bench {
({
use super::u64_from_be_bytes;

let len = $stride.wrapping_mul(100).wrapping_add($start_index);
let len = ($stride as u8).wrapping_mul(100).wrapping_add($start_index);
let data = (0..len).collect::<Vec<_>>();
let mut sum = 0;
$b.iter(|| {
Expand Down
7 changes: 7 additions & 0 deletions src/libstd/sys/windows/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ impl FileDesc {
_ => Err(super::last_error()),
}
}

#[allow(dead_code)]
pub fn unwrap(self) -> fd_t {
let fd = self.fd;
unsafe { mem::forget(self) };
fd
}
}

impl Drop for FileDesc {
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/windows/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ mod tests {
#[test]
fn test_make_command_line() {
fn test_wrapper(prog: &str, args: &[&str]) -> String {
make_command_line(&CString::new(prog),
make_command_line(&CString::new(prog).unwrap(),
&args.iter()
.map(|a| CString::new(a))
.map(|a| CString::new(*a).unwrap())
.collect::<Vec<CString>>())
}

Expand Down
7 changes: 3 additions & 4 deletions src/libstd/sys/windows/process2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,9 @@ mod tests {
fn test_wrapper(prog: &str, args: &[&str]) -> String {
String::from_utf16(
&make_command_line(OsStr::from_str(prog),
args.iter()
.map(|a| OsString::from_str(a))
.collect::<Vec<OsString>>()
.as_slice())).unwrap()
&args.iter()
.map(|a| OsString::from(a))
.collect::<Vec<OsString>>())).unwrap()
}

assert_eq!(
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass-fulldeps/create-dir-all-bare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-android

#![feature(rustc_private)]

extern crate rustc_back;
Expand Down
1 change: 1 addition & 0 deletions src/test/run-pass-fulldeps/rename-directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// This test can't be a unit test in std,
// because it needs TempDir, which is in extra

// ignore-android
// pretty-expanded FIXME #23616

#![feature(rustc_private, path_ext)]
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/big-literals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ pub fn main() {
assert_eq!(0xffffffffffffffff, (-1 as u64));
assert_eq!(18446744073709551615, (-1 as u64));

assert_eq!((-2147483648).wrapping_sub(1), 2147483647);
assert_eq!((-2147483648i32).wrapping_sub(1), 2147483647);
}
6 changes: 3 additions & 3 deletions src/test/run-pass/tcp-stress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ extern crate libc;
use std::sync::mpsc::channel;
use std::old_io::net::tcp::{TcpListener, TcpStream};
use std::old_io::{Acceptor, Listener, Reader, Writer};
use std::thread::{Builder, Thread};
use std::thread::{self, Builder};
use std::time::Duration;

fn main() {
// This test has a chance to time out, try to not let it time out
Thread::spawn(move|| -> () {
thread::spawn(move|| -> () {
use std::old_io::timer;
timer::sleep(Duration::milliseconds(30 * 1000));
println!("timed out!");
unsafe { libc::exit(1) }
});

let (tx, rx) = channel();
Thread::spawn(move || -> () {
thread::spawn(move || -> () {
let mut listener = TcpListener::bind("127.0.0.1:0").unwrap();
tx.send(listener.socket_name().unwrap()).unwrap();
let mut acceptor = listener.listen();
Expand Down

0 comments on commit 8dff0ac

Please sign in to comment.