class Relay
Defined at line 273 of file fidling/gen/src/sys/fuzzing/libfuzzer/testing/test.fuzzer/hlcpp/test/fuzzer/cpp/fidl.h
Relays test data from unit test to test fuzzer.
As noted above, the unit tests want to be able to exchange data with libFuzzer processes in the
same component without having control over how those processes are spawned. This protocol
provides a solution: both unit test and fuzzer can connect the relay and use it to establish
means for subsequent communication. Since both are part of the same component, the two uses are
merged into a single protocol capability.
Public Members
static const char[] Name_
Public Methods
void ~Relay ()
void SetTestData (::test::fuzzer::SignaledBuffer data, SetTestDataCallback callback)
Registers the buffer and eventpair used to exchange test data. This is called by the unit
test both at the start of a test, and after a fuzzer process exits and closes its end of the
eventpair. This allows for the libFuzzer workflows that consist of multiple, sequential
fuzzer processes. This call blocks until |Finish| is called.
void WatchTestData (WatchTestDataCallback callback)
Waits for a call to |SetTestData|, then returns its signaled buffer. This is called by the
fuzzer once per fuzzer process.
void Finish ()
Finishes the previous call to |SetTestData|. Does nothing if no call has been made. This is
called by the fuzzer once per process after it has received and set up the test data.