mirror of
https://github.com/apple/swift-nio
synced 2026-11-30 05:28:44 +00:00
support qemu: qemu returns ENOPROTOOPT for unknown socket opts (#1806)
Motivation: When running SwiftNIO under Qemu, then one test case fails because it expects `ENOTSOCK` but Qemu returns `ENOPROTOOPT`. This is a Qemu bug. Modification: Accept `ENOTSOCK` or `ENOPROTOOPT`. Result: Test suite works under Qemu.
This commit is contained in:
1 parent
5b6b7f02d7
commit
f7918a80f1
1 file changed
+2
-3
@@ -36,10 +36,9 @@ class SystemTest: XCTestCase {
|
||||
}
|
||||
XCTFail("success even though the call was invalid")
|
||||
} catch let e as IOError {
|
||||
XCTAssertEqual(ENOTSOCK, e.errnoCode)
|
||||
XCTAssert([ENOTSOCK /* almost everything */, ENOPROTOOPT /* in Qemu */].contains(e.errnoCode))
|
||||
XCTAssert(e.description.contains("setsockopt"))
|
||||
XCTAssert(e.description.contains("\(ENOTSOCK)"))
|
||||
XCTAssert(e.localizedDescription.contains("\(ENOTSOCK)"), "\(e.localizedDescription)")
|
||||
XCTAssert(e.description.contains("\(ENOTSOCK)") || e.description.contains("\(ENOPROTOOPT)"))
|
||||
} catch let e {
|
||||
XCTFail("wrong error thrown: \(e)")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user