light/modules/test/private/fuzz.cpp

25 lines
541 B
C++
Raw Normal View History

2025-07-30 23:02:53 +03:30
#include <test/test.hpp>
namespace lt::test {
2025-07-30 23:02:53 +03:30
auto process_fuzz_input(const uint8_t *data, size_t size) -> int32_t
try
{
return details::Registry::process_fuzz_input(data, size);
2025-07-30 23:02:53 +03:30
}
catch (const std::exception &exp)
{
std::println("Fuzz input resulted in uncaught exception:");
std::println("\twhat: {}", exp.what());
std::println("\tinput size: {}", size);
2025-07-30 23:02:53 +03:30
return EXIT_FAILURE;
}
}; // namespace lt::test
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
return lt::test::process_fuzz_input(data, size);
}