-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests to ensure oob checks work as expected
- Loading branch information
1 parent
4c87cc2
commit 1899abb
Showing
12 changed files
with
209 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the OracleNIO open source project | ||
// | ||
// Copyright (c) 2024 Timo Zacherl and the OracleNIO project authors | ||
// Licensed under Apache License v2.0 | ||
// | ||
// See LICENSE for license information | ||
// See CONTRIBUTORS.md for the list of OracleNIO project authors | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
import NIOCore | ||
import NIOTestUtils | ||
import XCTest | ||
|
||
@testable import OracleNIO | ||
|
||
final class ControlTests: XCTestCase { | ||
func testResetOOB() throws { | ||
var message = try ByteBuffer(plainHexEncodedBytes: "00 09") | ||
let result = try OracleBackendMessage.decode( | ||
from: &message, | ||
of: .control, | ||
context: .init(capabilities: .desired()) | ||
) | ||
XCTAssertEqual(result.0, [.resetOOB]) | ||
} | ||
|
||
func testUnknown() throws { | ||
var message = try ByteBuffer(plainHexEncodedBytes: "01 09") | ||
try XCTAssertThrowsError( | ||
OracleBackendMessage.decode( | ||
from: &message, | ||
of: .control, | ||
context: .init(capabilities: .desired()) | ||
), expected: OraclePartialDecodingError.unknownControlTypeReceived(controlType: 0x0109)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,6 @@ enum OracleFrontendMessage { | |
case authPhaseTwo | ||
case logoff | ||
case close | ||
case oob | ||
case marker | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters