From b6dbaa584eb936287c9028403f3cf7920e097715 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 19 Mar 2018 19:36:10 +0100 Subject: [PATCH] Fix warnings in tests. (#193) Motivation: When running swift test two warnings were printed. Modifications: - Signal that we want to ignore the return value - Use boolean test in the while loop Result: Cleaner build --- Tests/NIOTests/ChannelNotificationTest.swift | 2 +- Tests/NIOTests/EmbeddedEventLoopTest.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/NIOTests/ChannelNotificationTest.swift b/Tests/NIOTests/ChannelNotificationTest.swift index 4f44c9514..7f0dab519 100644 --- a/Tests/NIOTests/ChannelNotificationTest.swift +++ b/Tests/NIOTests/ChannelNotificationTest.swift @@ -317,7 +317,7 @@ class ChannelNotificationTest: XCTestCase { buffer.write(string: "test") - while let result = try? channel.writeAndFlush(buffer).wait() { + while (try? channel.writeAndFlush(buffer).wait()) != nil { // Just write in a loop until it fails to ensure we detect the closed connection in a timely manner. } try channel.closeFuture.wait() diff --git a/Tests/NIOTests/EmbeddedEventLoopTest.swift b/Tests/NIOTests/EmbeddedEventLoopTest.swift index a161f7221..450eb385b 100644 --- a/Tests/NIOTests/EmbeddedEventLoopTest.swift +++ b/Tests/NIOTests/EmbeddedEventLoopTest.swift @@ -300,7 +300,7 @@ public class EmbeddedEventLoopTest: XCTestCase { } // Finally schedule a task for 10ns. - loop.scheduleTask(in: .nanoseconds(10)) { + _ = loop.scheduleTask(in: .nanoseconds(10)) { XCTAssertEqual(orderingCounter, 5) orderingCounter = 6 }