Coverage Report

Created: 2026-10-28 06:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/swift-nio/swift-nio-fuzz/Sources/swift-nio-http1-fuzz/main.swift
Line
Count
Source
1
import NIOHTTP1
2
import NIO
3
4
@_cdecl("LLVMFuzzerTestOneInput")
5
14.1k
public func test(_ start: UnsafeRawPointer, _ count: Int) -> CInt {
6
14.1k
    let bytes = UnsafeRawBufferPointer(start: start, count: count)
7
14.1k
    let channel = EmbeddedChannel()
8
14.1k
    var buffer = channel.allocator.buffer(capacity: count)
9
14.1k
    buffer.writeBytes(bytes)
10
14.1k
    do {
11
14.1k
        try channel.pipeline.addHandler(ByteToMessageHandler(HTTPRequestDecoder())).wait()
12
14.1k
        try channel.writeInbound(buffer)
13
9.65k
        channel.embeddedEventLoop.run()
14
9.65k
    } catch {
15
14.1k
    }
16
14.1k
    do {
17
14.1k
        try channel.finish(acceptAlreadyClosed: true)
18
8.63k
    } catch {
19
14.1k
    }
20
14.1k
    return 0
21
14.1k
}