summaryrefslogtreecommitdiff
path: root/test/sys/test_ioctl.rs
diff options
context:
space:
mode:
authorBryant Mairs <bryantmairs@google.com>2017-12-15 15:37:20 -0800
committerBryant Mairs <bryantmairs@google.com>2017-12-20 07:05:04 -0800
commitee75274b2ad3ccbc8005ef438accd96f6e237443 (patch)
tree9e5855aee75c53ff130801fc65c1c47e3ba7509b /test/sys/test_ioctl.rs
parent46fe1319a73a9d4c0081c2b5f8900d7943f3a44b (diff)
downloadnix-ee75274b2ad3ccbc8005ef438accd96f6e237443.zip
Correct ioctl read and write_ptr tests
Looks like a copy/paste error might have caused this
Diffstat (limited to 'test/sys/test_ioctl.rs')
-rw-r--r--test/sys/test_ioctl.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/sys/test_ioctl.rs b/test/sys/test_ioctl.rs
index 26ff42f8..57ca9177 100644
--- a/test/sys/test_ioctl.rs
+++ b/test/sys/test_ioctl.rs
@@ -269,10 +269,10 @@ mod linux_ioctls {
// From linux/videodev2.h
ioctl!(write_ptr s_audio with b'V', 34; v4l2_audio);
#[test]
- fn test_ioctl_read() {
+ fn test_ioctl_write_ptr() {
let file = tempfile().unwrap();
- let data: v4l2_audio = unsafe { mem::uninitialized() };
- let res = unsafe { g_audio(file.as_raw_fd(), &data) };
+ let data: v4l2_audio = unsafe { mem::zeroed() };
+ let res = unsafe { s_audio(file.as_raw_fd(), &data) };
assert!(res == Err(Sys(ENOTTY)) || res == Err(Sys(ENOSYS)));
}
@@ -288,9 +288,9 @@ mod linux_ioctls {
}
// From linux/videodev2.h
- ioctl!(write_ptr g_audio with b'V', 33; v4l2_audio);
+ ioctl!(read g_audio with b'V', 33; v4l2_audio);
#[test]
- fn test_ioctl_write_ptr() {
+ fn test_ioctl_read() {
let file = tempfile().unwrap();
let mut data: v4l2_audio = unsafe { mem::uninitialized() };
let res = unsafe { g_audio(file.as_raw_fd(), &mut data) };