Skip to content

Commit dff21e1

Browse files
gibbz00tgross35
authored andcommitted
Add some context to CMSG_NXTHDR test assertions.
(backport <#4903>) (cherry picked from commit befc34b)
1 parent 4e581d3 commit dff21e1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libc-test/tests/cmsg.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ mod t {
7676
for cmsg_payload_len in 0..64 {
7777
let mut current_cmsghdr_ptr = pcmsghdr;
7878
assert!(!current_cmsghdr_ptr.is_null());
79+
let mut count = 0;
7980

8081
// Go from first cmsghdr to the last (until null) using various
8182
// cmsg_len increments. `cmsg_len` is set by us to check that
@@ -88,9 +89,14 @@ mod t {
8889

8990
let libc_next = libc::CMSG_NXTHDR(&mhdr, current_cmsghdr_ptr);
9091
let system_next = cmsg_nxthdr(&mhdr, current_cmsghdr_ptr);
91-
assert_eq!(libc_next, system_next);
92+
assert_eq!(
93+
system_next, libc_next,
94+
"msg_crontrollen: {}, payload_len: {}, count: {}",
95+
mhdr.msg_controllen, cmsg_payload_len, count
96+
);
9297

9398
current_cmsghdr_ptr = libc_next;
99+
count += 1;
94100
}
95101
}
96102

0 commit comments

Comments
 (0)