summaryrefslogtreecommitdiff
path: root/test/sys
diff options
context:
space:
mode:
authorIgor Gnatenko <i.gnatenko.brain@gmail.com>2018-05-10 11:45:33 +0200
committerIgor Gnatenko <i.gnatenko.brain@gmail.com>2018-09-01 11:39:36 +0200
commitecad72a18e798870ae3591c6ea49a2dd544ba5f3 (patch)
tree9c3f8eefb8f022159d27cc2a8ffffbd0ff9d22a0 /test/sys
parent32fece20b4704d3a959a8a94122dea8952a11d80 (diff)
downloadnix-ecad72a18e798870ae3591c6ea49a2dd544ba5f3.zip
deps: update tempfile to 3
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Diffstat (limited to 'test/sys')
-rw-r--r--test/sys/test_socket.rs7
-rw-r--r--test/sys/test_uio.rs9
2 files changed, 7 insertions, 9 deletions
diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs
index e5a69eb0..3329417d 100644
--- a/test/sys/test_socket.rs
+++ b/test/sys/test_socket.rs
@@ -5,6 +5,7 @@ use std::path::Path;
use std::str::FromStr;
use std::os::unix::io::RawFd;
use libc::c_char;
+use tempfile;
#[test]
pub fn test_inetv4_addr_to_sock_addr() {
@@ -90,9 +91,8 @@ pub fn test_abstract_uds_addr() {
pub fn test_getsockname() {
use nix::sys::socket::{socket, AddressFamily, SockType, SockFlag};
use nix::sys::socket::{bind, SockAddr};
- use tempdir::TempDir;
- let tempdir = TempDir::new("test_getsockname").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
let sockname = tempdir.path().join("sock");
let sock = socket(AddressFamily::Unix, SockType::Stream, SockFlag::empty(), None)
.expect("socket failed");
@@ -406,9 +406,8 @@ pub fn test_unixdomain() {
use nix::sys::socket::{bind, socket, connect, listen, accept, SockAddr};
use nix::unistd::{read, write, close};
use std::thread;
- use tempdir::TempDir;
- let tempdir = TempDir::new("test_unixdomain").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
let sockname = tempdir.path().join("sock");
let s1 = socket(AddressFamily::Unix, SockType::Stream,
SockFlag::empty(), None).expect("socket failed");
diff --git a/test/sys/test_uio.rs b/test/sys/test_uio.rs
index 9f56c810..47f3b468 100644
--- a/test/sys/test_uio.rs
+++ b/test/sys/test_uio.rs
@@ -5,8 +5,7 @@ use std::{cmp, iter};
use std::fs::{OpenOptions};
use std::os::unix::io::AsRawFd;
-use tempdir::TempDir;
-use tempfile::tempfile;
+use tempfile::{tempfile, tempdir};
#[test]
fn test_writev() {
@@ -114,7 +113,7 @@ fn test_pwrite() {
fn test_pread() {
use std::io::Write;
- let tempdir = TempDir::new("nix-test_pread").unwrap();
+ let tempdir = tempdir().unwrap();
let path = tempdir.path().join("pread_test_file");
let mut file = OpenOptions::new().write(true).read(true).create(true)
@@ -142,7 +141,7 @@ fn test_pwritev() {
IoVec::from_slice(&to_write[64..128]),
];
- let tempdir = TempDir::new("nix-test_pwritev").unwrap();
+ let tempdir = tempdir().unwrap();
// pwritev them into a temporary file
let path = tempdir.path().join("pwritev_test_file");
@@ -166,7 +165,7 @@ fn test_preadv() {
let to_write: Vec<u8> = (0..200).collect();
let expected: Vec<u8> = (100..200).collect();
- let tempdir = TempDir::new("nix-test_preadv").unwrap();
+ let tempdir = tempdir().unwrap();
let path = tempdir.path().join("preadv_test_file");