Index: tests/OFSPXSocketTests.m ================================================================== --- tests/OFSPXSocketTests.m +++ tests/OFSPXSocketTests.m @@ -163,18 +163,32 @@ 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); - [sockClient asyncConnectToNode: node - network: network - port: port]; - - [[OFRunLoop mainRunLoop] runUntilDate: - [OFDate dateWithTimeIntervalSinceNow: 2]]; - - TEST(@"-[asyncAccept] & -[asyncConnectToNode:network:port:]", - delegate->_accepted && delegate->_connected) + @try { + [sockClient asyncConnectToNode: node + network: network + port: port]; + + [[OFRunLoop mainRunLoop] runUntilDate: + [OFDate dateWithTimeIntervalSinceNow: 2]]; + + 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 Index: tests/OFSPXStreamSocketTests.m ================================================================== --- tests/OFSPXStreamSocketTests.m +++ tests/OFSPXStreamSocketTests.m @@ -167,18 +167,32 @@ 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); - [sockClient asyncConnectToNode: node - network: network - port: port]; - - [[OFRunLoop mainRunLoop] runUntilDate: - [OFDate dateWithTimeIntervalSinceNow: 2]]; - - TEST(@"-[asyncAccept] & -[asyncConnectToNode:network:port:]", - delegate->_accepted && delegate->_connected) + @try { + [sockClient asyncConnectToNode: node + network: network + port: port]; + + [[OFRunLoop mainRunLoop] runUntilDate: + [OFDate dateWithTimeIntervalSinceNow: 2]]; + + 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