20 lines
748 B
C++
20 lines
748 B
C++
// Coverage-guided fuzz target for the standalone parsers (Clang/libFuzzer).
|
|
// Build and run through fuzz/run.sh.
|
|
#include <Void/Data/StrictJson.hpp>
|
|
#include <Void/Text/Semver.hpp>
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <string_view>
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) {
|
|
const std::string_view input{reinterpret_cast<const char *>(data), size};
|
|
(void)Void::Json::Strict::parse(input);
|
|
// TOML/lockfile/tar are covered by the deterministic mutation harness
|
|
// (CoreEngineTests.fuzz_mutated_inputs_never_crash_parsers): their implementations
|
|
// are not header-only.
|
|
(void)Void::Semver::parse_range(input);
|
|
(void)Void::Semver::parse_strict(input);
|
|
return 0;
|
|
}
|