From feb3f6c78ea8736c0953264067323a8002f0ed19 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 19 Mar 2018 14:01:58 +0100 Subject: [PATCH] Fix warnings in tests. 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 e3a024a8f0..35d60c23ff 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 a161f72215..450eb385b5 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 }