Migrates the old cc_fuzz_target in //third_party/spdy to the modern go/fuzztest framework. PiperOrigin-RevId: 679146196
diff --git a/quiche/spdy/core/http2_frame_decoder_adapter_fuzzer.cc b/quiche/spdy/core/http2_frame_decoder_adapter_fuzzer.cc index 9073a75..b54ecfa 100644 --- a/quiche/spdy/core/http2_frame_decoder_adapter_fuzzer.cc +++ b/quiche/spdy/core/http2_frame_decoder_adapter_fuzzer.cc
@@ -1,13 +1,11 @@ -#include <cstddef> -#include <cstdint> - +#include "testing/fuzzing/fuzztest.h" #include "quiche/http2/core/http2_frame_decoder_adapter.h" #include "quiche/http2/core/spdy_no_op_visitor.h" -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { +void DecoderFuzzTest(const std::string& data) { spdy::SpdyNoOpVisitor visitor; http2::Http2DecoderAdapter decoder; decoder.set_visitor(&visitor); - decoder.ProcessInput(reinterpret_cast<const char *>(data), size); - return 0; // Always return 0; other values are reserved for future uses. + decoder.ProcessInput(data.data(), data.size()); } +FUZZ_TEST(Http2FrameDecoderAdapterFuzzTest, DecoderFuzzTest);