@@ -30,36 +30,34 @@ final class SocketTest: XCTestCase {
30
30
let writeBufAddr = writeBuf. baseAddress
31
31
32
32
let syscallTestCases : Array < MockTestCase > = [
33
- MockTestCase ( name: " socket " , PF_INET6, SOCK_STREAM, 0 , interruptable : true ) {
33
+ MockTestCase ( name: " socket " , . interruptable , PF_INET6, SOCK_STREAM, 0 ) {
34
34
retryOnInterrupt in
35
35
_ = try SocketDescriptor . open ( . ipv6, . stream, retryOnInterrupt: retryOnInterrupt)
36
36
} ,
37
- MockTestCase ( name: " shutdown " , rawSocket , SHUT_RD , interruptable : false ) {
37
+ MockTestCase ( name: " shutdown " , . noInterrupt , rawSocket , SHUT_RD ) {
38
38
retryOnInterrupt in
39
39
_ = try socket. shutdown ( . read)
40
40
} ,
41
- MockTestCase ( name: " listen " , rawSocket , 999 , interruptable : false ) {
41
+ MockTestCase ( name: " listen " , . noInterrupt , rawSocket , 999 ) {
42
42
retryOnInterrupt in
43
43
_ = try socket. listen ( backlog: 999 )
44
44
} ,
45
45
MockTestCase (
46
- name: " recv " , rawSocket, bufAddr, bufCount, MSG_PEEK, interruptable : true
46
+ name: " recv " , . interruptable , rawSocket, bufAddr, bufCount, MSG_PEEK
47
47
) {
48
48
retryOnInterrupt in
49
49
_ = try socket. receive (
50
50
into: rawBuf, flags: . peek, retryOnInterrupt: retryOnInterrupt)
51
51
} ,
52
52
MockTestCase (
53
- name: " send " , rawSocket, writeBufAddr, bufCount, MSG_DONTROUTE,
54
- interruptable: true
53
+ name: " send " , . interruptable, rawSocket, writeBufAddr, bufCount, MSG_DONTROUTE
55
54
) {
56
55
retryOnInterrupt in
57
56
_ = try socket. send (
58
57
writeBuf, flags: . doNotRoute, retryOnInterrupt: retryOnInterrupt)
59
58
} ,
60
59
MockTestCase (
61
- name: " recvfrom " , rawSocket, Wildcard ( ) , Wildcard ( ) , 42 , Wildcard ( ) , Wildcard ( ) ,
62
- interruptable: true
60
+ name: " recvfrom " , . interruptable, rawSocket, Wildcard ( ) , Wildcard ( ) , 42 , Wildcard ( ) , Wildcard ( )
63
61
) { retryOnInterrupt in
64
62
var sender = SocketAddress ( )
65
63
_ = try socket. receive ( into: rawBuf,
@@ -68,8 +66,7 @@ final class SocketTest: XCTestCase {
68
66
retryOnInterrupt: retryOnInterrupt)
69
67
} ,
70
68
MockTestCase (
71
- name: " sendto " , rawSocket, Wildcard ( ) , Wildcard ( ) , 42 , Wildcard ( ) , Wildcard ( ) ,
72
- interruptable: true
69
+ name: " sendto " , . interruptable, rawSocket, Wildcard ( ) , Wildcard ( ) , 42 , Wildcard ( ) , Wildcard ( )
73
70
) { retryOnInterrupt in
74
71
let recipient = SocketAddress ( ipv4: . loopback, port: 123 )
75
72
_ = try socket. send ( UnsafeRawBufferPointer ( rawBuf) ,
@@ -78,8 +75,7 @@ final class SocketTest: XCTestCase {
78
75
retryOnInterrupt: retryOnInterrupt)
79
76
} ,
80
77
MockTestCase (
81
- name: " recvmsg " , rawSocket, Wildcard ( ) , 42 ,
82
- interruptable: true
78
+ name: " recvmsg " , . interruptable, rawSocket, Wildcard ( ) , 42
83
79
) { retryOnInterrupt in
84
80
var sender = SocketAddress ( )
85
81
var ancillary = SocketDescriptor . AncillaryMessageBuffer ( )
@@ -90,8 +86,7 @@ final class SocketTest: XCTestCase {
90
86
retryOnInterrupt: retryOnInterrupt)
91
87
} ,
92
88
MockTestCase (
93
- name: " sendmsg " , rawSocket, Wildcard ( ) , 42 ,
94
- interruptable: true
89
+ name: " sendmsg " , . interruptable, rawSocket, Wildcard ( ) , 42
95
90
) { retryOnInterrupt in
96
91
let recipient = SocketAddress ( ipv4: . loopback, port: 123 )
97
92
let ancillary = SocketDescriptor . AncillaryMessageBuffer ( )
0 commit comments