summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2015-03-24 23:25:10 -0700
committerCarl Lerche <me@carllerche.com>2015-03-24 23:25:10 -0700
commit47d2332c3c388ecf094fc1d1890a223f3189f330 (patch)
treeee7bfae92f24d00e0732158f100caecd2f75c5f2 /test
parent2b60633c8bdd5359c317bb74e698777106befb85 (diff)
downloadnix-47d2332c3c388ecf094fc1d1890a223f3189f330.zip
NixResult -> nix::Result; NixError -> nix::Error
Diffstat (limited to 'test')
-rw-r--r--test/sys/test_socket.rs2
-rw-r--r--test/sys/test_termios.rs6
-rw-r--r--test/test_stat.rs6
-rw-r--r--test/test_unistd.rs10
4 files changed, 12 insertions, 12 deletions
diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs
index d175b693..97ee889d 100644
--- a/test/sys/test_socket.rs
+++ b/test/sys/test_socket.rs
@@ -30,7 +30,7 @@ pub fn test_path_to_sock_addr() {
let actual = Path::new("/foo/bar");
let addr = UnixAddr::new(actual).unwrap();
- let expect: &'static [i8] = unsafe { mem::transmute(b"/foo/bar") };
+ let expect: &'static [i8] = unsafe { mem::transmute(b"/foo/bar".as_slice()) };
assert_eq!(&addr.0.sun_path[..8], expect);
assert_eq!(addr.path(), actual);
diff --git a/test/sys/test_termios.rs b/test/sys/test_termios.rs
index 24ce3434..fd6dbcd6 100644
--- a/test/sys/test_termios.rs
+++ b/test/sys/test_termios.rs
@@ -1,6 +1,6 @@
use nix::errno::Errno;
use nix::sys::termios;
-use nix::{NixError, unistd};
+use nix::{Error, unistd};
#[test]
fn test_tcgetattr() {
@@ -11,8 +11,8 @@ fn test_tcgetattr() {
Ok(true) => assert!(termios.is_ok()),
// If it's an invalid file descriptor, tcgetattr should also return
// the same error
- Err(NixError::Sys(Errno::EBADF)) => {
- assert!(termios.err() == Some(NixError::Sys(Errno::EBADF)));
+ Err(Error::Sys(Errno::EBADF)) => {
+ assert!(termios.err() == Some(Error::Sys(Errno::EBADF)));
},
// Otherwise it should return any error
_ => assert!(termios.is_err())
diff --git a/test/test_stat.rs b/test/test_stat.rs
index 023cb569..dc3bddad 100644
--- a/test/test_stat.rs
+++ b/test/test_stat.rs
@@ -4,9 +4,9 @@ use nix::fcntl::open;
use nix::unistd::{close, unlink};
use nix::fcntl::O_CREAT;
use nix::sys::stat::{FileStat, S_IWUSR};
-use nix::NixResult;
+use nix::Result;
-fn assert_stat_results(stat_result: NixResult<FileStat>) {
+fn assert_stat_results(stat_result: Result<FileStat>) {
match stat_result {
Ok(stats) => {
assert!(stats.st_dev > 0); // must be positive integer, exact number machine dependent
@@ -27,7 +27,7 @@ fn assert_stat_results(stat_result: NixResult<FileStat>) {
#[test]
fn test_stat_and_fstat() {
- let filename = b"target/foo.txt";
+ let filename = b"target/foo.txt".as_slice();
let fd = open(filename, O_CREAT, S_IWUSR).unwrap(); // create empty file
let stat_result = stat(filename);
diff --git a/test/test_unistd.rs b/test/test_unistd.rs
index d457c668..7a70dca1 100644
--- a/test/test_unistd.rs
+++ b/test/test_unistd.rs
@@ -50,11 +50,11 @@ fn test_execve() {
dup(writer).unwrap();
// exec!
execve(&CString::new(SH_PATH).unwrap(),
- &[CString::new(b"").unwrap(),
- CString::new(b"-c").unwrap(),
- CString::new(b"echo nix!!! && echo foo=$foo && echo baz=$baz").unwrap()],
- &[CString::new(b"foo=bar").unwrap(),
- CString::new(b"baz=quux").unwrap()]).unwrap();
+ &[CString::new(b"".as_slice()).unwrap(),
+ CString::new(b"-c".as_slice()).unwrap(),
+ CString::new(b"echo nix!!! && echo foo=$foo && echo baz=$baz".as_slice()).unwrap()],
+ &[CString::new(b"foo=bar".as_slice()).unwrap(),
+ CString::new(b"baz=quux".as_slice()).unwrap()]).unwrap();
},
Parent(child_pid) => {
// Wait for the child to exit.