summaryrefslogtreecommitdiff
path: root/test/sys/test_ioctl.rs
diff options
context:
space:
mode:
authorCorey Richardson <corey@octayn.net>2015-07-05 07:33:45 -0400
committerPaul Osborne <Paul.Osborne@digi.com>2015-08-12 19:29:21 -0500
commit23332d6e8d7b00b0134980b16af1da8f2376590c (patch)
treecb38ac11e4b8ca74714c058356715218a9626485 /test/sys/test_ioctl.rs
parent1875f229d6c028456b7b4f5c3ebc05de5c031e8b (diff)
downloadnix-23332d6e8d7b00b0134980b16af1da8f2376590c.zip
Fix tests
Diffstat (limited to 'test/sys/test_ioctl.rs')
-rw-r--r--test/sys/test_ioctl.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/sys/test_ioctl.rs b/test/sys/test_ioctl.rs
index 49f49206..78496fcb 100644
--- a/test/sys/test_ioctl.rs
+++ b/test/sys/test_ioctl.rs
@@ -5,42 +5,42 @@ use nix::sys::ioctl::*;
#[test]
fn test_op_none() {
- assert_eq!(op_none('q' as u8, 10), 0x0000710A);
- assert_eq!(op_none('a' as u8, 255), 0x000061FF);
+ assert_eq!(io!(b'q', 10), 0x0000710A);
+ assert_eq!(io!(b'a', 255), 0x000061FF);
}
#[test]
fn test_op_write() {
- assert_eq!(op_write('z' as u8, 10, 1), 0x40017A0A);
- assert_eq!(op_write('z' as u8, 10, 512), 0x42007A0A);
+ assert_eq!(iow!(b'z', 10, 1), 0x40017A0A);
+ assert_eq!(iow!(b'z', 10, 512), 0x42007A0A);
}
#[cfg(target_pointer_width = "64")]
#[test]
fn test_op_write_64() {
- assert_eq!(op_write('z' as u8, 10, 1 << 32), 0x40007A0A);
+ assert_eq!(iow!(b'z', 10, (1 as u64) << 32), 0x40007A0A);
}
#[test]
fn test_op_read() {
- assert_eq!(op_read('z' as u8, 10, 1), 0x80017A0A);
- assert_eq!(op_read('z' as u8, 10, 512), 0x82007A0A);
+ assert_eq!(ior!(b'z', 10, 1), 0x80017A0A);
+ assert_eq!(ior!(b'z', 10, 512), 0x82007A0A);
}
#[cfg(target_pointer_width = "64")]
#[test]
fn test_op_read_64() {
- assert_eq!(op_read('z' as u8, 10, 1 << 32), 0x80007A0A);
+ assert_eq!(ior!(b'z', 10, (1 as u64) << 32), 0x80007A0A);
}
#[test]
fn test_op_read_write() {
- assert_eq!(op_read_write('z' as u8, 10, 1), 0xC0017A0A);
- assert_eq!(op_read_write('z' as u8, 10, 512), 0xC2007A0A);
+ assert_eq!(iorw!(b'z', 10, 1), 0xC0017A0A);
+ assert_eq!(iorw!(b'z', 10, 512), 0xC2007A0A);
}
#[cfg(target_pointer_width = "64")]
#[test]
fn test_op_read_write_64() {
- assert_eq!(op_read_write('z' as u8, 10, 1 << 32), 0xC0007A0A);
+ assert_eq!(iorw!(b'z', 10, (1 as u64) << 32), 0xC0007A0A);
}