Skip to content

Commit bedea25

Browse files
gjcairothomasvl
authored andcommitted
Fix FuzzTests unit tests
1 parent 601e03a commit bedea25

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Tests/SwiftProtobufTests/Test_FuzzTests.swift

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ final class Test_FuzzTests: XCTestCase {
5555

5656
func assertTextFormatFails(_ asBytes: [UInt8], options: TextFormatDecodingOptions = TextFormatDecodingOptions(), file: XCTestFileArgType = #file, line: UInt = #line) {
5757
guard let str = String(data: Data(asBytes), encoding: .utf8) else {
58-
XCTFail("Failed to make a string", file: file, line: line)
58+
print(
59+
"""
60+
Failed to make string (at \(file):\(line)): nothing to try and decode.
61+
The fuzzer does not fail in this case and neither should we, skipping test.
62+
"""
63+
)
5964
return
6065
}
6166
XCTAssertThrowsError(
@@ -75,7 +80,12 @@ final class Test_FuzzTests: XCTestCase {
7580

7681
func assertTextFormatSucceeds(_ asBytes: [UInt8], options: TextFormatDecodingOptions = TextFormatDecodingOptions(), file: XCTestFileArgType = #file, line: UInt = #line) {
7782
guard let str = String(data: Data(asBytes), encoding: .utf8) else {
78-
XCTFail("Failed to make a string", file: file, line: line)
83+
print(
84+
"""
85+
Failed to make string (at \(file):\(line)): nothing to try and decode.
86+
The fuzzer does not fail in this case and neither should we, skipping test.
87+
"""
88+
)
7989
return
8090
}
8191
XCTAssertNoThrow(

0 commit comments

Comments
 (0)