Skip to content
Permalink
Browse files

allow deprecated tests to test deprecated functionality (#1271)

Motivation:

It's important to also test deprecated functionliaty. One way of
achieving this without warnings is to also deprecate the tests that test
this deprecated functionality. Unfortunately, on Linux we need to
generate lists of tests which would then reference deprecated tests
(which gives us a warning).

Modifications:

Deprecate test suites and the main test runner all the way to the top so
never get warnings.

Result:

Possible to test deprecated functionlity without warnings.
  • Loading branch information
weissi committed Nov 27, 2019
1 parent 302dee3 commit c2c725044a0986e04b72a8c75b86ee703fcb8a35
Showing with 178 additions and 75 deletions.
  1. +83 −72 Tests/LinuxMain.swift
  2. +1 −0 Tests/NIOConcurrencyHelpersTests/NIOConcurrencyHelpersTests+XCTest.swift
  3. +1 −0 Tests/NIOFoundationCompatTests/Codable+ByteBufferTest+XCTest.swift
  4. +1 −0 Tests/NIOHTTP1Tests/ByteBufferUtilsTest+XCTest.swift
  5. +1 −0 Tests/NIOHTTP1Tests/HTTPClientUpgradeTests+XCTest.swift
  6. +1 −0 Tests/NIOHTTP1Tests/HTTPDecoderLengthTest+XCTest.swift
  7. +1 −0 Tests/NIOHTTP1Tests/HTTPDecoderTest+XCTest.swift
  8. +1 −0 Tests/NIOHTTP1Tests/HTTPHeadersTest+XCTest.swift
  9. +1 −0 Tests/NIOHTTP1Tests/HTTPRequestEncoderTest+XCTest.swift
  10. +1 −0 Tests/NIOHTTP1Tests/HTTPResponseEncoderTest+XCTest.swift
  11. +1 −0 Tests/NIOHTTP1Tests/HTTPResponseStatusTests+XCTest.swift
  12. +1 −0 Tests/NIOHTTP1Tests/HTTPServerClientTest+XCTest.swift
  13. +1 −0 Tests/NIOHTTP1Tests/HTTPServerPipelineHandlerTest+XCTest.swift
  14. +1 −0 Tests/NIOHTTP1Tests/HTTPServerProtocolErrorHandlerTest+XCTest.swift
  15. +1 −0 Tests/NIOHTTP1Tests/HTTPServerUpgradeTests+XCTest.swift
  16. +1 −0 Tests/NIOHTTP1Tests/HTTPTest+XCTest.swift
  17. +1 −0 Tests/NIOHTTP1Tests/HTTPTypesTest+XCTest.swift
  18. +1 −0 Tests/NIOTLSTests/ApplicationProtocolNegotiationHandlerTests+XCTest.swift
  19. +1 −0 Tests/NIOTLSTests/SNIHandlerTests+XCTest.swift
  20. +1 −0 Tests/NIOTestUtilsTests/ByteToMessageDecoderVerifierTest+XCTest.swift
  21. +1 −0 Tests/NIOTestUtilsTests/EventCounterHandlerTest+XCTest.swift
  22. +1 −0 Tests/NIOTestUtilsTests/NIOHTTP1TestServerTest+XCTest.swift
  23. +1 −0 Tests/NIOTests/AcceptBackoffHandlerTest+XCTest.swift
  24. +1 −0 Tests/NIOTests/BaseObjectsTest+XCTest.swift
  25. +1 −0 Tests/NIOTests/BlockingIOThreadPoolTest+XCTest.swift
  26. +1 −0 Tests/NIOTests/BootstrapTest+XCTest.swift
  27. +2 −0 Tests/NIOTests/ByteBufferTest+XCTest.swift
  28. +9 −0 Tests/NIOTests/ByteBufferTest.swift
  29. +1 −0 Tests/NIOTests/ChannelNotificationTest+XCTest.swift
  30. +1 −0 Tests/NIOTests/ChannelOptionStorageTest+XCTest.swift
  31. +1 −0 Tests/NIOTests/ChannelPipelineTest+XCTest.swift
  32. +1 −0 Tests/NIOTests/ChannelTests+XCTest.swift
  33. +1 −0 Tests/NIOTests/CircularBufferTests+XCTest.swift
  34. +3 −0 Tests/NIOTests/CodecTest+XCTest.swift
  35. +1 −0 Tests/NIOTests/CustomChannelTests+XCTest.swift
  36. +1 −0 Tests/NIOTests/DatagramChannelTests+XCTest.swift
  37. +1 −0 Tests/NIOTests/EchoServerClientTest+XCTest.swift
  38. +1 −0 Tests/NIOTests/EmbeddedChannelTest+XCTest.swift
  39. +1 −0 Tests/NIOTests/EmbeddedEventLoopTest+XCTest.swift
  40. +1 −0 Tests/NIOTests/EventLoopFutureTest+XCTest.swift
  41. +1 −0 Tests/NIOTests/EventLoopTest+XCTest.swift
  42. +1 −0 Tests/NIOTests/FileRegionTest+XCTest.swift
  43. +1 −0 Tests/NIOTests/GetAddrInfoResolverTest+XCTest.swift
  44. +1 −0 Tests/NIOTests/HappyEyeballsTest+XCTest.swift
  45. +1 −0 Tests/NIOTests/HeapTests+XCTest.swift
  46. +1 −0 Tests/NIOTests/IdleStateHandlerTest+XCTest.swift
  47. +1 −0 Tests/NIOTests/IntegerTypesTest+XCTest.swift
  48. +1 −0 Tests/NIOTests/MarkedCircularBufferTests+XCTest.swift
  49. +1 −0 Tests/NIOTests/MulticastTest+XCTest.swift
  50. +1 −0 Tests/NIOTests/NIOAnyDebugTest+XCTest.swift
  51. +1 −0 Tests/NIOTests/NIOCloseOnErrorHandlerTest+XCTest.swift
  52. +1 −0 Tests/NIOTests/NonBlockingFileIOTest+XCTest.swift
  53. +1 −0 Tests/NIOTests/PendingDatagramWritesManagerTests+XCTest.swift
  54. +1 −0 Tests/NIOTests/PipeChannelTest+XCTest.swift
  55. +1 −0 Tests/NIOTests/PriorityQueueTests+XCTest.swift
  56. +1 −0 Tests/NIOTests/RecvByteBufAllocatorTest+XCTest.swift
  57. +1 −0 Tests/NIOTests/SelectorTest+XCTest.swift
  58. +1 −0 Tests/NIOTests/SocketAddressTest+XCTest.swift
  59. +1 −0 Tests/NIOTests/SocketChannelTest+XCTest.swift
  60. +1 −0 Tests/NIOTests/SocketOptionProviderTest+XCTest.swift
  61. +1 −0 Tests/NIOTests/StreamChannelsTest+XCTest.swift
  62. +1 −0 Tests/NIOTests/SystemTest+XCTest.swift
  63. +1 −0 Tests/NIOTests/ThreadTest+XCTest.swift
  64. +1 −0 Tests/NIOTests/TypeAssistedChannelHandlerTests+XCTest.swift
  65. +1 −0 Tests/NIOTests/UtilitiesTest+XCTest.swift
  66. +1 −0 Tests/NIOWebSocketTests/Base64Test+XCTest.swift
  67. +1 −0 Tests/NIOWebSocketTests/WebSocketClientEndToEndTests+XCTest.swift
  68. +1 −0 Tests/NIOWebSocketTests/WebSocketFrameDecoderTest+XCTest.swift
  69. +1 −0 Tests/NIOWebSocketTests/WebSocketFrameEncoderTest+XCTest.swift
  70. +1 −0 Tests/NIOWebSocketTests/WebSocketServerEndToEndTests+XCTest.swift
  71. +15 −3 scripts/generate_linux_tests.rb
@@ -31,76 +31,87 @@ import XCTest
@testable import NIOTests
@testable import NIOWebSocketTests

XCTMain([
testCase(AcceptBackoffHandlerTest.allTests),
testCase(AdaptiveRecvByteBufferAllocatorTest.allTests),
testCase(ApplicationProtocolNegotiationHandlerTests.allTests),
testCase(Base64Test.allTests),
testCase(BaseObjectTest.allTests),
testCase(BlockingIOThreadPoolTest.allTests),
testCase(BootstrapTest.allTests),
testCase(ByteBufferTest.allTests),
testCase(ByteBufferUtilsTest.allTests),
testCase(ByteToMessageDecoderTest.allTests),
testCase(ByteToMessageDecoderVerifierTest.allTests),
testCase(ChannelNotificationTest.allTests),
testCase(ChannelOptionStorageTest.allTests),
testCase(ChannelPipelineTest.allTests),
testCase(ChannelTests.allTests),
testCase(CircularBufferTests.allTests),
testCase(CodableByteBufferTest.allTests),
testCase(CustomChannelTests.allTests),
testCase(DatagramChannelTests.allTests),
testCase(EchoServerClientTest.allTests),
testCase(EmbeddedChannelTest.allTests),
testCase(EmbeddedEventLoopTest.allTests),
testCase(EventCounterHandlerTest.allTests),
testCase(EventLoopFutureTest.allTests),
testCase(EventLoopTest.allTests),
testCase(FileRegionTest.allTests),
testCase(GetaddrinfoResolverTest.allTests),
testCase(HTTPClientUpgradeTestCase.allTests),
testCase(HTTPDecoderLengthTest.allTests),
testCase(HTTPDecoderTest.allTests),
testCase(HTTPHeadersTest.allTests),
testCase(HTTPRequestEncoderTests.allTests),
testCase(HTTPResponseEncoderTests.allTests),
testCase(HTTPResponseStatusTests.allTests),
testCase(HTTPServerClientTest.allTests),
testCase(HTTPServerPipelineHandlerTest.allTests),
testCase(HTTPServerProtocolErrorHandlerTest.allTests),
testCase(HTTPServerUpgradeTestCase.allTests),
testCase(HTTPTest.allTests),
testCase(HTTPTypesTest.allTests),
testCase(HappyEyeballsTest.allTests),
testCase(HeapTests.allTests),
testCase(IdleStateHandlerTest.allTests),
testCase(IntegerTypesTest.allTests),
testCase(MarkedCircularBufferTests.allTests),
testCase(MessageToByteEncoderTest.allTests),
testCase(MessageToByteHandlerTest.allTests),
testCase(MulticastTest.allTests),
testCase(NIOAnyDebugTest.allTests),
testCase(NIOCloseOnErrorHandlerTest.allTests),
testCase(NIOConcurrencyHelpersTests.allTests),
testCase(NIOHTTP1TestServerTest.allTests),
testCase(NonBlockingFileIOTest.allTests),
testCase(PendingDatagramWritesManagerTests.allTests),
testCase(PipeChannelTest.allTests),
testCase(PriorityQueueTest.allTests),
testCase(SNIHandlerTest.allTests),
testCase(SelectorTest.allTests),
testCase(SocketAddressTest.allTests),
testCase(SocketChannelTest.allTests),
testCase(SocketOptionProviderTest.allTests),
testCase(StreamChannelTest.allTests),
testCase(SystemTest.allTests),
testCase(ThreadTest.allTests),
testCase(TypeAssistedChannelHandlerTest.allTests),
testCase(UtilitiesTest.allTests),
testCase(WebSocketClientEndToEndTests.allTests),
testCase(WebSocketFrameDecoderTest.allTests),
testCase(WebSocketFrameEncoderTest.allTests),
testCase(WebSocketServerEndToEndTests.allTests),
])
// This protocol is necessary to we can call the 'run' method (on an existential of this protocol)
// without the compiler noticing that we're calling a deprecated function.
// This hack exists so we can deprecate individual tests which test deprecated functionality without
// getting a compiler warning...
protocol LinuxMainRunner { func run() }
class LinuxMainRunnerImpl: LinuxMainRunner {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
func run() {
XCTMain([
testCase(AcceptBackoffHandlerTest.allTests),
testCase(AdaptiveRecvByteBufferAllocatorTest.allTests),
testCase(ApplicationProtocolNegotiationHandlerTests.allTests),
testCase(Base64Test.allTests),
testCase(BaseObjectTest.allTests),
testCase(BlockingIOThreadPoolTest.allTests),
testCase(BootstrapTest.allTests),
testCase(ByteBufferTest.allTests),
testCase(ByteBufferUtilsTest.allTests),
testCase(ByteToMessageDecoderTest.allTests),
testCase(ByteToMessageDecoderVerifierTest.allTests),
testCase(ChannelNotificationTest.allTests),
testCase(ChannelOptionStorageTest.allTests),
testCase(ChannelPipelineTest.allTests),
testCase(ChannelTests.allTests),
testCase(CircularBufferTests.allTests),
testCase(CodableByteBufferTest.allTests),
testCase(CustomChannelTests.allTests),
testCase(DatagramChannelTests.allTests),
testCase(EchoServerClientTest.allTests),
testCase(EmbeddedChannelTest.allTests),
testCase(EmbeddedEventLoopTest.allTests),
testCase(EventCounterHandlerTest.allTests),
testCase(EventLoopFutureTest.allTests),
testCase(EventLoopTest.allTests),
testCase(FileRegionTest.allTests),
testCase(GetaddrinfoResolverTest.allTests),
testCase(HTTPClientUpgradeTestCase.allTests),
testCase(HTTPDecoderLengthTest.allTests),
testCase(HTTPDecoderTest.allTests),
testCase(HTTPHeadersTest.allTests),
testCase(HTTPRequestEncoderTests.allTests),
testCase(HTTPResponseEncoderTests.allTests),
testCase(HTTPResponseStatusTests.allTests),
testCase(HTTPServerClientTest.allTests),
testCase(HTTPServerPipelineHandlerTest.allTests),
testCase(HTTPServerProtocolErrorHandlerTest.allTests),
testCase(HTTPServerUpgradeTestCase.allTests),
testCase(HTTPTest.allTests),
testCase(HTTPTypesTest.allTests),
testCase(HappyEyeballsTest.allTests),
testCase(HeapTests.allTests),
testCase(IdleStateHandlerTest.allTests),
testCase(IntegerTypesTest.allTests),
testCase(MarkedCircularBufferTests.allTests),
testCase(MessageToByteEncoderTest.allTests),
testCase(MessageToByteHandlerTest.allTests),
testCase(MulticastTest.allTests),
testCase(NIOAnyDebugTest.allTests),
testCase(NIOCloseOnErrorHandlerTest.allTests),
testCase(NIOConcurrencyHelpersTests.allTests),
testCase(NIOHTTP1TestServerTest.allTests),
testCase(NonBlockingFileIOTest.allTests),
testCase(PendingDatagramWritesManagerTests.allTests),
testCase(PipeChannelTest.allTests),
testCase(PriorityQueueTest.allTests),
testCase(SNIHandlerTest.allTests),
testCase(SelectorTest.allTests),
testCase(SocketAddressTest.allTests),
testCase(SocketChannelTest.allTests),
testCase(SocketOptionProviderTest.allTests),
testCase(StreamChannelTest.allTests),
testCase(SystemTest.allTests),
testCase(ThreadTest.allTests),
testCase(TypeAssistedChannelHandlerTest.allTests),
testCase(UtilitiesTest.allTests),
testCase(WebSocketClientEndToEndTests.allTests),
testCase(WebSocketFrameDecoderTest.allTests),
testCase(WebSocketFrameEncoderTest.allTests),
testCase(WebSocketServerEndToEndTests.allTests),
])
}
}
(LinuxMainRunnerImpl() as LinuxMainRunner).run()
#endif
@@ -24,6 +24,7 @@ import XCTest
extension NIOConcurrencyHelpersTests {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (NIOConcurrencyHelpersTests) -> () throws -> Void)] {
return [
("testLargeContendedAtomicSum", testLargeContendedAtomicSum),
@@ -24,6 +24,7 @@ import XCTest
extension CodableByteBufferTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (CodableByteBufferTest) -> () throws -> Void)] {
return [
("testSimpleDecode", testSimpleDecode),
@@ -24,6 +24,7 @@ import XCTest
extension ByteBufferUtilsTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ByteBufferUtilsTest) -> () throws -> Void)] {
return [
("testComparators", testComparators),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPClientUpgradeTestCase {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPClientUpgradeTestCase) -> () throws -> Void)] {
return [
("testSimpleUpgradeSucceeds", testSimpleUpgradeSucceeds),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPDecoderLengthTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPDecoderLengthTest) -> () throws -> Void)] {
return [
("testHTTP11SemanticEOFOnChannelInactive", testHTTP11SemanticEOFOnChannelInactive),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPDecoderTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPDecoderTest) -> () throws -> Void)] {
return [
("testDoesNotDecodeRealHTTP09Request", testDoesNotDecodeRealHTTP09Request),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPHeadersTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPHeadersTest) -> () throws -> Void)] {
return [
("testCasePreservedButInsensitiveLookup", testCasePreservedButInsensitiveLookup),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPRequestEncoderTests {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPRequestEncoderTests) -> () throws -> Void)] {
return [
("testNoAutoHeadersForHEAD", testNoAutoHeadersForHEAD),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPResponseEncoderTests {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPResponseEncoderTests) -> () throws -> Void)] {
return [
("testNoAutoHeadersFor101", testNoAutoHeadersFor101),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPResponseStatusTests {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPResponseStatusTests) -> () throws -> Void)] {
return [
("testHTTPResponseStatusFromStatusCode", testHTTPResponseStatusFromStatusCode),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPServerClientTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPServerClientTest) -> () throws -> Void)] {
return [
("testSimpleGetByteBuffer", testSimpleGetByteBuffer),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPServerPipelineHandlerTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPServerPipelineHandlerTest) -> () throws -> Void)] {
return [
("testBasicBufferingBehaviour", testBasicBufferingBehaviour),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPServerProtocolErrorHandlerTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPServerProtocolErrorHandlerTest) -> () throws -> Void)] {
return [
("testHandlesBasicErrors", testHandlesBasicErrors),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPServerUpgradeTestCase {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPServerUpgradeTestCase) -> () throws -> Void)] {
return [
("testUpgradeWithoutUpgrade", testUpgradeWithoutUpgrade),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPTest) -> () throws -> Void)] {
return [
("testHTTPSimpleNoHeaders", testHTTPSimpleNoHeaders),
@@ -24,6 +24,7 @@ import XCTest
extension HTTPTypesTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPTypesTest) -> () throws -> Void)] {
return [
("testConvertToString", testConvertToString),
@@ -24,6 +24,7 @@ import XCTest
extension ApplicationProtocolNegotiationHandlerTests {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ApplicationProtocolNegotiationHandlerTests) -> () throws -> Void)] {
return [
("testChannelProvidedToCallback", testChannelProvidedToCallback),
@@ -24,6 +24,7 @@ import XCTest
extension SNIHandlerTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (SNIHandlerTest) -> () throws -> Void)] {
return [
("testLibre227NoSNIDripFeed", testLibre227NoSNIDripFeed),
@@ -24,6 +24,7 @@ import XCTest
extension ByteToMessageDecoderVerifierTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ByteToMessageDecoderVerifierTest) -> () throws -> Void)] {
return [
("testWrongResults", testWrongResults),
@@ -24,6 +24,7 @@ import XCTest
extension EventCounterHandlerTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (EventCounterHandlerTest) -> () throws -> Void)] {
return [
("testNothingButEmbeddedChannelInit", testNothingButEmbeddedChannelInit),
@@ -24,6 +24,7 @@ import XCTest
extension NIOHTTP1TestServerTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (NIOHTTP1TestServerTest) -> () throws -> Void)] {
return [
("testTheExampleInTheDocs", testTheExampleInTheDocs),
@@ -24,6 +24,7 @@ import XCTest
extension AcceptBackoffHandlerTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (AcceptBackoffHandlerTest) -> () throws -> Void)] {
return [
("testECONNABORTED", testECONNABORTED),
@@ -24,6 +24,7 @@ import XCTest
extension BaseObjectTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (BaseObjectTest) -> () throws -> Void)] {
return [
("testNIOByteBufferConversion", testNIOByteBufferConversion),
@@ -24,6 +24,7 @@ import XCTest
extension BlockingIOThreadPoolTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (BlockingIOThreadPoolTest) -> () throws -> Void)] {
return [
("testDoubleShutdownWorks", testDoubleShutdownWorks),
@@ -24,6 +24,7 @@ import XCTest
extension BootstrapTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (BootstrapTest) -> () throws -> Void)] {
return [
("testBootstrapsCallInitializersOnCorrectEventLoop", testBootstrapsCallInitializersOnCorrectEventLoop),
@@ -24,6 +24,7 @@ import XCTest
extension ByteBufferTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ByteBufferTest) -> () throws -> Void)] {
return [
("testAllocateAndCount", testAllocateAndCount),
@@ -173,6 +174,7 @@ extension ByteBufferTest {
("testByteBufferAllocatorSize1Capacity", testByteBufferAllocatorSize1Capacity),
("testByteBufferModifiedWithoutAllocationLogic", testByteBufferModifiedWithoutAllocationLogic),
("testByteBufferModifyIfUniquelyOwnedMayThrow", testByteBufferModifyIfUniquelyOwnedMayThrow),
("testDeprecatedSetBytes", testDeprecatedSetBytes),
]
}
}
@@ -2441,6 +2441,15 @@ class ByteBufferTest: XCTestCase {
XCTAssertTrue(error is MyError)
}
}

@available(*, deprecated, message: "deprecated because it tests deprecated functionality")
func testDeprecatedSetBytes() {
self.buf.clear()
self.buf.writeString("hello")
self.buf.set(buffer: self.buf, at: 5)
self.buf.moveWriterIndex(forwardBy: 5)
XCTAssertEqual("hellohello", self.buf.readString(length: 10))
}
}

private enum AllocationExpectationState: Int {
@@ -24,6 +24,7 @@ import XCTest
extension ChannelNotificationTest {

@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ChannelNotificationTest) -> () throws -> Void)] {
return [
("testNotificationOrder", testNotificationOrder),

0 comments on commit c2c7250

Please sign in to comment.
You can’t perform that action at this time.