mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-30 05:28:45 +00:00
Motivation: When we spiked out these codecs we were missing a number of error handling paths, which meant that erroneous input would lead to crashes. While we don't expect these handlers to have to face that kind of input, we should still aim to tolerate it where doing so is reasonable. Modifications: - Replaced all force unwraps and preconditions with throwing. Result: Fewer crashes on bad input.
60 lines
3.2 KiB
Swift
60 lines
3.2 KiB
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the SwiftNIO open source project
|
|
//
|
|
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// HTTP2ToHTTP1CodecTests+XCTest.swift
|
|
//
|
|
import XCTest
|
|
|
|
///
|
|
/// NOTE: This file was generated by generate_linux_tests.rb
|
|
///
|
|
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
|
|
///
|
|
|
|
extension HTTP2ToHTTP1CodecTests {
|
|
|
|
static var allTests : [(String, (HTTP2ToHTTP1CodecTests) -> () throws -> Void)] {
|
|
return [
|
|
("testBasicRequestServerSide", testBasicRequestServerSide),
|
|
("testRequestWithOnlyHeadServerSide", testRequestWithOnlyHeadServerSide),
|
|
("testRequestWithTrailers", testRequestWithTrailers),
|
|
("testSendingSimpleResponse", testSendingSimpleResponse),
|
|
("testResponseWithoutTrailers", testResponseWithoutTrailers),
|
|
("testResponseWith100Blocks", testResponseWith100Blocks),
|
|
("testPassingPromisesThroughWritesOnServer", testPassingPromisesThroughWritesOnServer),
|
|
("testBasicResponseClientSide", testBasicResponseClientSide),
|
|
("testResponseWithOnlyHeadClientSide", testResponseWithOnlyHeadClientSide),
|
|
("testResponseWithTrailers", testResponseWithTrailers),
|
|
("testSendingSimpleRequest", testSendingSimpleRequest),
|
|
("testRequestWithoutTrailers", testRequestWithoutTrailers),
|
|
("testResponseWith100BlocksClientSide", testResponseWith100BlocksClientSide),
|
|
("testPassingPromisesThroughWritesOnClient", testPassingPromisesThroughWritesOnClient),
|
|
("testReceiveRequestWithoutMethod", testReceiveRequestWithoutMethod),
|
|
("testReceiveRequestWithDuplicateMethod", testReceiveRequestWithDuplicateMethod),
|
|
("testReceiveRequestWithoutPath", testReceiveRequestWithoutPath),
|
|
("testReceiveRequestWithDuplicatePath", testReceiveRequestWithDuplicatePath),
|
|
("testReceiveRequestWithoutAuthority", testReceiveRequestWithoutAuthority),
|
|
("testReceiveRequestWithDuplicateAuthority", testReceiveRequestWithDuplicateAuthority),
|
|
("testReceiveRequestWithoutScheme", testReceiveRequestWithoutScheme),
|
|
("testReceiveRequestWithDuplicateScheme", testReceiveRequestWithDuplicateScheme),
|
|
("testReceiveResponseWithoutStatus", testReceiveResponseWithoutStatus),
|
|
("testReceiveResponseWithDuplicateStatus", testReceiveResponseWithDuplicateStatus),
|
|
("testReceiveResponseWithNonNumericalStatus", testReceiveResponseWithNonNumericalStatus),
|
|
("testSendRequestWithoutHost", testSendRequestWithoutHost),
|
|
("testSendRequestWithDuplicateHost", testSendRequestWithDuplicateHost),
|
|
]
|
|
}
|
|
}
|
|
|