Index: tests/OFSCTPSocketTests.m ================================================================== --- tests/OFSCTPSocketTests.m +++ tests/OFSCTPSocketTests.m @@ -15,10 +15,11 @@ * file. */ #include "config.h" +#include #include #import "TestsAppDelegate.h" static OFString *module = @"OFSCTPSocket"; @@ -32,13 +33,29 @@ char buf[6]; TEST(@"+[socket]", (server = [OFSCTPSocket socket]) && (client = [OFSCTPSocket socket])) - TEST(@"-[bindToHost:port:]", - (port = [server bindToHost: @"127.0.0.1" - port: 0])) + @try { + TEST(@"-[bindToHost:port:]", + (port = [server bindToHost: @"127.0.0.1" + port: 0])) + } @catch (OFBindFailedException *e) { + switch (e.errNo) { + case EPROTONOSUPPORT: + [self outputString: @"[OFSCTPSocket] " + @"-[bindToHost:port:]: SCTP " + @"unsupported, skipping tests\n" + inColor: GREEN]; + break; + default: + @throw e; + } + + objc_autoreleasePoolPop(pool); + return; + } TEST(@"-[listen]", R([server listen])) TEST(@"-[connectToHost:port:]", R([client connectToHost: @"127.0.0.1"