Skip to content

Commit

Permalink
update test availability on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
glbrntt committed Aug 22, 2019
1 parent d4dca50 commit a110c85
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Tests/GRPCTests/PlatformSupportTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ class PlatformSupportTests: GRPCTestCase {

func testMakeEventLoopGroupReturnsNIOTSGroupForNetworkFramework() {
// If we don't have Network.framework then we can't test this.
guard #available(macOS 10.14, *) else { return }

#if canImport(Network)
self.group = PlatformSupport.makeEventLoopGroup(
loopCount: 1,
networkPreference: .userDefined(.networkFramework)
)

XCTAssertTrue(self.group is NIOTSEventLoopGroup)
#endif
}

func testMakeClientBootstrapReturnsClientBootstrapForMultiThreadedGroup() {
Expand All @@ -47,24 +47,24 @@ class PlatformSupportTests: GRPCTestCase {

func testMakeClientBootstrapReturnsNIOTSConnectionBootstrapForNIOTSGroup() {
// If we don't have Network.framework then we can't test this.
guard #available(macOS 10.14, *) else { return }

#if canImport(Network)
self.group = NIOTSEventLoopGroup(loopCount: 1)
let bootstrap = PlatformSupport.makeClientBootstrap(group: self.group)
XCTAssertTrue(bootstrap is NIOTSConnectionBootstrap)
#endif
}

func testMakeClientBootstrapReturnsNIOTSConnectionBootstrapForQoSEventLoop() {
// If we don't have Network.framework then we can't test this.
guard #available(macOS 10.14, *) else { return }

#if canImport(Network)
self.group = NIOTSEventLoopGroup(loopCount: 1)

let eventLoop = self.group.next()
XCTAssertTrue(eventLoop is QoSEventLoop)

let bootstrap = PlatformSupport.makeClientBootstrap(group: eventLoop)
XCTAssertTrue(bootstrap is NIOTSConnectionBootstrap)
#endif
}

func testMakeServerBootstrapReturnsServerBootstrapForMultiThreadedGroup() {
Expand All @@ -83,23 +83,23 @@ class PlatformSupportTests: GRPCTestCase {

func testMakeServerBootstrapReturnsNIOTSListenerBootstrapForNIOTSGroup() {
// If we don't have Network.framework then we can't test this.
guard #available(macOS 10.14, *) else { return }

#if canImport(Network)
self.group = NIOTSEventLoopGroup(loopCount: 1)
let bootstrap = PlatformSupport.makeServerBootstrap(group: self.group)
XCTAssertTrue(bootstrap is NIOTSListenerBootstrap)
#endif
}

func testMakeServerBootstrapReturnsNIOTSListenerBootstrapForQoSEventLoop() {
// If we don't have Network.framework then we can't test this.
guard #available(macOS 10.14, *) else { return }

#if canImport(Network)
self.group = NIOTSEventLoopGroup(loopCount: 1)

let eventLoop = self.group.next()
XCTAssertTrue(eventLoop is QoSEventLoop)

let bootstrap = PlatformSupport.makeServerBootstrap(group: eventLoop)
XCTAssertTrue(bootstrap is NIOTSListenerBootstrap)
#if canImport(Network)
}
}

0 comments on commit a110c85

Please sign in to comment.