Skip to content

Commit befc34b

Browse files
gibbz00tgross35
authored andcommitted
Add some context to CMSG_NXTHDR test assertions.
1 parent 2782869 commit befc34b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

libc-test/tests/cmsg.rs

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

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

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

9297
current_cmsghdr_ptr = libc_next;
98+
count += 1;
9399
}
94100
}
95101

0 commit comments

Comments
 (0)