File tree 2 files changed +16
-20
lines changed
library/std/src/sys/unix/ext
2 files changed +16
-20
lines changed Original file line number Diff line number Diff line change @@ -89,23 +89,3 @@ pub mod impl_bsd {
89
89
}
90
90
}
91
91
}
92
-
93
- #[ cfg( test) ]
94
- mod test {
95
- use crate :: os:: unix:: net:: UnixStream ;
96
- use libc:: { getegid, geteuid} ;
97
-
98
- #[ test]
99
- fn test_socket_pair ( ) {
100
- // Create two connected sockets and get their peer credentials. They should be equal.
101
- let ( sock_a, sock_b) = UnixStream :: pair ( ) . unwrap ( ) ;
102
- let ( cred_a, cred_b) = ( sock_a. peer_cred ( ) . unwrap ( ) , sock_b. peer_cred ( ) . unwrap ( ) ) ;
103
- assert_eq ! ( cred_a, cred_b) ;
104
-
105
- // Check that the UID and GIDs match up.
106
- let uid = unsafe { geteuid ( ) } ;
107
- let gid = unsafe { getegid ( ) } ;
108
- assert_eq ! ( cred_a. uid, uid) ;
109
- assert_eq ! ( cred_a. gid, gid) ;
110
- }
111
- }
Original file line number Diff line number Diff line change
1
+ use crate :: os:: unix:: net:: UnixStream ;
2
+ use libc:: { getegid, geteuid} ;
3
+
4
+ #[ test]
5
+ fn test_socket_pair ( ) {
6
+ // Create two connected sockets and get their peer credentials. They should be equal.
7
+ let ( sock_a, sock_b) = UnixStream :: pair ( ) . unwrap ( ) ;
8
+ let ( cred_a, cred_b) = ( sock_a. peer_cred ( ) . unwrap ( ) , sock_b. peer_cred ( ) . unwrap ( ) ) ;
9
+ assert_eq ! ( cred_a, cred_b) ;
10
+
11
+ // Check that the UID and GIDs match up.
12
+ let uid = unsafe { geteuid ( ) } ;
13
+ let gid = unsafe { getegid ( ) } ;
14
+ assert_eq ! ( cred_a. uid, uid) ;
15
+ assert_eq ! ( cred_a. gid, gid) ;
16
+ }
You can’t perform that action at this time.
0 commit comments