Skip to content

Commit 16cfee3

Browse files
authored
Merge pull request #4571 from tgross35/libc-test-auto-test2
test: Start using automatic test detection
2 parents 309c084 + b0de59a commit 16cfee3

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

libc-test/Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ name = "linux-termios"
6363
path = "test/linux_termios.rs"
6464
harness = false
6565

66-
[[test]]
67-
name = "cmsg"
68-
path = "test/cmsg.rs"
69-
harness = true
70-
7166
[[test]]
7267
name = "makedev"
7368
path = "test/makedev.rs"

libc-test/test/cmsg.rs renamed to libc-tests/tests/cmsg.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ mod t {
5555
#[cfg(not(target_arch = "sparc64"))]
5656
#[test]
5757
fn test_cmsg_nxthdr() {
58-
use std::ptr;
5958
// Helps to align the buffer on the stack.
6059
#[repr(align(8))]
6160
struct Align8<T>(T);
@@ -65,7 +64,7 @@ mod t {
6564
let mut mhdr: msghdr = unsafe { mem::zeroed() };
6665
for start_ofs in 0..64 {
6766
let pcmsghdr = buffer.0.as_mut_ptr().cast::<cmsghdr>();
68-
mhdr.msg_control = pcmsghdr as *mut c_void;
67+
mhdr.msg_control = pcmsghdr.cast::<c_void>();
6968
mhdr.msg_controllen = (160 - start_ofs) as _;
7069
for cmsg_len in 0..64 {
7170
// Address must be a multiple of 0x4 for testing on AIX.
@@ -80,7 +79,7 @@ mod t {
8079
let next = cmsg_nxthdr(&mhdr, pcmsghdr);
8180
assert_eq!(libc_next, next);
8281

83-
if libc_next != ptr::null_mut() {
82+
if !libc_next.is_null() {
8483
(*libc_next).cmsg_len = next_cmsg_len;
8584
let libc_next = libc::CMSG_NXTHDR(&mhdr, pcmsghdr);
8685
let next = cmsg_nxthdr(&mhdr, pcmsghdr);

0 commit comments

Comments
 (0)