ObjFW  Check-in [b945f29ecf]

Overview
Comment:OFSPXSocketTests: Make async tests optional
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b945f29ecf943b7e538633bf64078ddba93f4b2f29226b61cad4c56b4a99a68a
User & Date: js on 2020-06-13 18:54:03
Other Links: manifest | tags
Context
2020-06-13
19:03
OFLocaleTests: Fix inconsistent output check-in: 5f0a80bb81 user: js tags: trunk
18:54
OFSPXSocketTests: Make async tests optional check-in: b945f29ecf user: js tags: trunk
17:18
OFSelectKernelEventObserver: Use of_socket_errno() check-in: 0e3a8fbbf7 user: js tags: trunk
Changes

Modified tests/OFSPXSocketTests.m from [6d42db054f] to [0285d3399d].

161
162
163
164
165
166
167

168
169
170



171
172
173


174
175
176
177
















178
179
180
161
162
163
164
165
166
167
168



169
170
171
172


173
174
175



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194







+
-
-
-
+
+
+

-
-
+
+

-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+




	of_socket_address_get_ipx_node(&address1, node);
	memcpy(delegate->_expectedNode, node, IPX_NODE_LEN);
	delegate->_expectedNetwork = network =
	    of_socket_address_get_ipx_network(&address1);
	delegate->_expectedPort = port = of_socket_address_get_port(&address1);

	@try {
	[sockClient asyncConnectToNode: node
			       network: network
				  port: port];
		[sockClient asyncConnectToNode: node
				       network: network
					  port: port];

	[[OFRunLoop mainRunLoop] runUntilDate:
	    [OFDate dateWithTimeIntervalSinceNow: 2]];
		[[OFRunLoop mainRunLoop] runUntilDate:
		    [OFDate dateWithTimeIntervalSinceNow: 2]];

	TEST(@"-[asyncAccept] & -[asyncConnectToNode:network:port:]",
	    delegate->_accepted && delegate->_connected)

		TEST(@"-[asyncAccept] & -[asyncConnectToNode:network:port:]",
		    delegate->_accepted && delegate->_connected)
	} @catch (OFObserveFailedException *e) {
		switch (e.errNo) {
		case ENOTSOCK:
			of_stdout.foregroundColor = [OFColor lime];
			[of_stdout writeLine:
			    @"[OFSPXSocket] -[asyncAccept] & "
			    @"-[asyncConnectToNode:network:port:]: select() "
			    @"not supported for SPX, skipping test"];
			break;
		default:
			@throw e;
		}
	}

	objc_autoreleasePoolPop(pool);
}
@end

Modified tests/OFSPXStreamSocketTests.m from [c4c06acd4d] to [897f2e1598].

165
166
167
168
169
170
171

172
173
174



175
176
177


178
179
180
181
















182
183
184
165
166
167
168
169
170
171
172



173
174
175
176


177
178
179



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198







+
-
-
-
+
+
+

-
-
+
+

-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+




	of_socket_address_get_ipx_node(&address1, node);
	memcpy(delegate->_expectedNode, node, IPX_NODE_LEN);
	delegate->_expectedNetwork = network =
	    of_socket_address_get_ipx_network(&address1);
	delegate->_expectedPort = port = of_socket_address_get_port(&address1);

	@try {
	[sockClient asyncConnectToNode: node
			       network: network
				  port: port];
		[sockClient asyncConnectToNode: node
				       network: network
					  port: port];

	[[OFRunLoop mainRunLoop] runUntilDate:
	    [OFDate dateWithTimeIntervalSinceNow: 2]];
		[[OFRunLoop mainRunLoop] runUntilDate:
		    [OFDate dateWithTimeIntervalSinceNow: 2]];

	TEST(@"-[asyncAccept] & -[asyncConnectToNode:network:port:]",
	    delegate->_accepted && delegate->_connected)

		TEST(@"-[asyncAccept] & -[asyncConnectToNode:network:port:]",
		    delegate->_accepted && delegate->_connected)
	} @catch (OFObserveFailedException *e) {
		switch (e.errNo) {
		case ENOTSOCK:
			of_stdout.foregroundColor = [OFColor lime];
			[of_stdout writeLine:
			    @"[OFSPXStreamSocket] -[asyncAccept] & "
			    @"-[asyncConnectToNode:network:port:]: select() "
			    @"not supported for SPX, skipping test"];
			break;
		default:
			@throw e;
		}
	}

	objc_autoreleasePoolPop(pool);
}
@end