Test fixes and rebase conflicts

This commit is contained in:
Alex Crichton 2015-03-31 18:59:36 -07:00
parent 6ebb6e60b9
commit 8dff0ac143
9 changed files with 20 additions and 12 deletions

View File

@ -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;

View File

@ -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(|| {

View File

@ -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 {

View File

@ -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>>())
}

View File

@ -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!(

View File

@ -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;

View File

@ -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)]

View File

@ -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);
}

View File

@ -23,12 +23,12 @@ 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!");
@ -36,7 +36,7 @@ fn main() {
});
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();