Skip to content

Commit 7974dcc

Browse files
committed
Remove a few more cases of mem::uninitialized in the tests
Somehow I didn't noticed these in PR #1158, probably because they're only built on Linux.
1 parent 154ff58 commit 7974dcc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/sys/test_ioctl.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ mod linux_ioctls {
182182
#[test]
183183
fn test_ioctl_read_bad() {
184184
let file = tempfile().unwrap();
185-
let mut termios = unsafe { mem::uninitialized() };
185+
let mut termios = unsafe { mem::zeroed() };
186186
let res = unsafe { tcgets(file.as_raw_fd(), &mut termios) };
187187
assert_eq!(res, Err(Sys(ENOTTY)));
188188
}
@@ -199,7 +199,7 @@ mod linux_ioctls {
199199
#[test]
200200
fn test_ioctl_write_ptr_bad() {
201201
let file = tempfile().unwrap();
202-
let termios: termios = unsafe { mem::uninitialized() };
202+
let termios: termios = unsafe { mem::zeroed() };
203203
let res = unsafe { tcsets(file.as_raw_fd(), &termios) };
204204
assert_eq!(res, Err(Sys(ENOTTY)));
205205
}
@@ -250,7 +250,7 @@ mod linux_ioctls {
250250
#[test]
251251
fn test_ioctl_read() {
252252
let file = tempfile().unwrap();
253-
let mut data: v4l2_audio = unsafe { mem::uninitialized() };
253+
let mut data: v4l2_audio = unsafe { mem::zeroed() };
254254
let res = unsafe { g_audio(file.as_raw_fd(), &mut data) };
255255
assert!(res == Err(Sys(ENOTTY)) || res == Err(Sys(ENOSYS)));
256256
}
@@ -260,7 +260,7 @@ mod linux_ioctls {
260260
#[test]
261261
fn test_ioctl_readwrite() {
262262
let file = tempfile().unwrap();
263-
let mut data: v4l2_audio = unsafe { mem::uninitialized() };
263+
let mut data: v4l2_audio = unsafe { mem::zeroed() };
264264
let res = unsafe { enum_audio(file.as_raw_fd(), &mut data) };
265265
assert!(res == Err(Sys(ENOTTY)) || res == Err(Sys(ENOSYS)));
266266
}

0 commit comments

Comments
 (0)