From ee75274b2ad3ccbc8005ef438accd96f6e237443 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Fri, 15 Dec 2017 15:37:20 -0800 Subject: Correct ioctl read and write_ptr tests Looks like a copy/paste error might have caused this --- test/sys/test_ioctl.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/sys/test_ioctl.rs') 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) }; -- cgit v1.2.3