Skip to content

Commit 386cd04

Browse files
Add a test that passes a CmsgSpace that is too large
1 parent 0ca612c commit 386cd04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/sys/test_socket.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,12 @@ fn test_impl_scm_credentials_and_rights<T>(mut space: ::nix::sys::socket::CmsgSp
359359
let msg = recvmsg(recv, &iov, Some(&mut space), MsgFlags::empty()).unwrap();
360360
let mut received_cred = None;
361361

362-
assert_eq!(msg.cmsgs().count(), 2);
362+
assert_eq!(msg.cmsgs().count(), 2, "expected 2 cmsgs");
363363

364364
for cmsg in msg.cmsgs() {
365365
match cmsg {
366366
ControlMessage::ScmRights(fds) => {
367-
assert_eq!(received_r, None);
367+
assert_eq!(received_r, None, "already received fd");
368368
assert_eq!(fds.len(), 1);
369369
received_r = Some(fds[0]);
370370
}

0 commit comments

Comments
 (0)