Skip to content

Commit 29a1cdc

Browse files
committed
Fix set_no_inherit test
1 parent 6224522 commit 29a1cdc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/socket.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,27 +107,27 @@ where
107107
#[test]
108108
fn set_no_inherit() {
109109
let socket = Socket::new(Domain::IPV4, Type::STREAM, None).unwrap();
110-
assert_flag_inherit(&socket, false);
110+
assert_flag_no_inherit(&socket, false);
111111

112112
socket.set_no_inherit(true).unwrap();
113-
assert_flag_inherit(&socket, true);
113+
assert_flag_no_inherit(&socket, true);
114114

115115
socket.set_no_inherit(false).unwrap();
116-
assert_flag_inherit(&socket, false);
116+
assert_flag_no_inherit(&socket, false);
117117
}
118118

119119
#[cfg(all(feature = "all", windows))]
120120
#[test]
121121
fn type_no_inherit() {
122122
let ty = Type::STREAM.no_inherit();
123123
let socket = Socket::new(Domain::IPV4, ty, None).unwrap();
124-
assert_flag_inherit(&socket, true);
124+
assert_flag_no_inherit(&socket, true);
125125
}
126126

127-
/// Assert that `FLAG_INHERIT` is set on `socket`.
127+
/// Assert that `FLAG_INHERIT` is not set on `socket`.
128128
#[cfg(windows)]
129129
#[track_caller]
130-
pub fn assert_flag_inherit<S>(socket: &S, want: bool)
130+
pub fn assert_flag_no_inherit<S>(socket: &S, want: bool)
131131
where
132132
S: AsRawSocket,
133133
{
@@ -138,7 +138,7 @@ where
138138
}
139139
assert_eq!(
140140
flags & HANDLE_FLAG_INHERIT != 0,
141-
want,
141+
!want,
142142
"FLAG_INHERIT option"
143143
);
144144
}

0 commit comments

Comments
 (0)