pub struct FakeController { /* private fields */ }
Expand description
Test fake that allows configuring how to respond to fuchsia.fuzzer.Controller
methods.
These fields are Rc<RefCell<_>> in order to be cloned and shared with the Task
serving the
controller. Unit tests can use this object to query values passed in FIDL requests and set
values returned by FIDL responses.
Implementations§
Source§impl FakeController
impl FakeController
Sourcepub fn set_output(&self, output: TestOutput, socket: Socket) -> Status
pub fn set_output(&self, output: TestOutput, socket: Socket) -> Status
Simulates a call to fuchsia.fuzzer.Manager/GetOutput
without a fuzz-manager
.
Sourcepub fn get_corpus_type(&self) -> Corpus
pub fn get_corpus_type(&self) -> Corpus
Returns the type of corpus received via FIDL requests.
Sourcepub fn set_corpus_type(&self, corpus_type: Corpus)
pub fn set_corpus_type(&self, corpus_type: Corpus)
Sets the type of corpus to return via FIDL responses.
Sourcepub fn take_input_to_send(&self) -> Option<Vec<u8>>
pub fn take_input_to_send(&self) -> Option<Vec<u8>>
Returns the test input to be sent via a FIDL response.
Sourcepub fn set_input_to_send(&self, input_to_send: &[u8])
pub fn set_input_to_send(&self, input_to_send: &[u8])
Sets the test input to be sent via a FIDL response.
Sourcepub fn get_options(&self) -> Options
pub fn get_options(&self) -> Options
Returns the options received via FIDL requests.
Sourcepub fn set_options(&self, options: Options)
pub fn set_options(&self, options: Options)
Sets the options to return via FIDL responses.
Sourcepub fn get_received_input(&self) -> Vec<u8> ⓘ
pub fn get_received_input(&self) -> Vec<u8> ⓘ
Returns the test input received via FIDL requests.
Sourcepub fn get_result(&self) -> Result<FuzzResult, Status>
pub fn get_result(&self) -> Result<FuzzResult, Status>
Returns the fuzzing result to be sent via a FIDL response.
Sourcepub fn set_result(&self, result: Result<FuzzResult, Status>)
pub fn set_result(&self, result: Result<FuzzResult, Status>)
Sets the fuzzing result to be sent via a FIDL response.
Sourcepub fn get_status(&self) -> Status
pub fn get_status(&self) -> Status
Gets the fuzzer status to be sent via FIDL responses.
Sourcepub fn set_status(&self, status: Status)
pub fn set_status(&self, status: Status)
Sets the fuzzer status to be sent via FIDL responses.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Simulates a long-running workflow being canceled by fuchsia.fuzzer.Manager/Stop
.
Sourcepub fn is_canceled(&self) -> bool
pub fn is_canceled(&self) -> bool
Get whether a simulated call to fuchsia.fuzzer.Manager/Stop
has been made.
Trait Implementations§
Source§impl Clone for FakeController
impl Clone for FakeController
Auto Trait Implementations§
impl Freeze for FakeController
impl !RefUnwindSafe for FakeController
impl !Send for FakeController
impl !Sync for FakeController
impl Unpin for FakeController
impl !UnwindSafe for FakeController
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)