Skip to content

Commit 350ce8d

Browse files
author
me
committed
more cov
1 parent 5b822e5 commit 350ce8d

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

.github/workflows/coverage.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,20 @@ jobs:
3939
LLVM_PROFILE_FILE="request.profraw" ./build/request_parser /tmp/corpus/ seeds/request_parser/ -max_total_time=30
4040
LLVM_PROFILE_FILE="response.profraw" ./build/response_parser /tmp/corpus/ seeds/response_parser/ -max_total_time=30
4141
LLVM_PROFILE_FILE="sha1.profraw" ./build/sha1 -max_total_time=30
42+
LLVM_PROFILE_FILE="base64.profraw" ./build/base64 -max_total_time=30
4243
4344
- name: Generate coverage report
4445
run: |
4546
llvm-profdata merge -o coverage.profdata \
4647
request.profraw \
4748
response.profraw \
48-
sha1.profraw
49+
sha1.profraw \
50+
base64.profraw
4951
llvm-cov export -format=lcov -instr-profile coverage.profdata \
5052
-object ./build/request_parser \
5153
-object ./build/response_parser \
5254
-object ./build/sha1 \
55+
-object ./build/base64 \
5356
-sources ./src \
5457
> coverage_${{github.sha}}.txt
5558

examples/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,5 @@ if (HTTP_BUILD_FUZZERS)
7676
add_fuzz(request_parser fuzz/request_parser.cpp)
7777
add_fuzz(response_parser fuzz/response_parser.cpp)
7878
add_fuzz(sha1 fuzz/sha1.cpp)
79+
add_fuzz(base64 fuzz/base64.cpp)
7980
endif()

examples/fuzz/base64.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <cstdint>
2+
#include <cstddef>
3+
#include <http.h>
4+
5+
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
6+
{
7+
auto encoded = http::base64_encode(size, data);
8+
auto decoded = http::base64_decode(encoded);
9+
return 0;
10+
}

0 commit comments

Comments
 (0)