@@ -202,9 +202,12 @@ final class Test_AsyncMessageSequence: XCTestCase {
202
202
203
203
// Slow test case found by oss-fuzz: 1 million zero-sized messages
204
204
// A similar test with BinaryDelimited is about 4x faster, showing
205
- // that we have some room for improvement here:
205
+ // that we have some room for improvement here.
206
+ // (Note this currently only tests 100,000 zero-sized messages,
207
+ // but the constant below is easy to edit if you want to experiment.)
206
208
func testLargeExample( ) async throws {
207
- let bytes = [ UInt8] ( repeating: 0 , count: 1000000 )
209
+ let messageCount = 100_000
210
+ let bytes = [ UInt8] ( repeating: 0 , count: messageCount)
208
211
let byteStream = asyncByteStream ( bytes: bytes)
209
212
let decodedStream = byteStream. binaryProtobufDelimitedMessages (
210
213
of: SwiftProtoTesting_TestAllTypes . self,
@@ -214,7 +217,7 @@ final class Test_AsyncMessageSequence: XCTestCase {
214
217
XCTAssertEqual ( message, SwiftProtoTesting_TestAllTypes ( ) )
215
218
count += 1
216
219
}
217
- XCTAssertEqual ( count, 1000000 )
220
+ XCTAssertEqual ( count, messageCount )
218
221
}
219
222
220
223
fileprivate func asyncByteStream( bytes: [ UInt8 ] ) -> AsyncStream < UInt8 > {
0 commit comments