Rename some functions in fuzzer.rs (#2355)

* rename

* fmt
This commit is contained in:
Dongjia "toka" Zhang 2024-07-01 21:47:10 +02:00 committed by GitHub
parent 140f84441a
commit 7c95afc42f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 13 additions and 14 deletions

View File

@ -608,7 +608,7 @@ where
process::id(), process::id(),
event_name event_name
); );
fuzzer.execute_and_process( fuzzer.evaluate_execution(
state, state,
self, self,
input.clone(), input.clone(),

View File

@ -443,9 +443,8 @@ where
{ {
state.scalability_monitor_mut().testcase_with_observers += 1; state.scalability_monitor_mut().testcase_with_observers += 1;
} }
fuzzer.execute_and_process( fuzzer
state, self, input, &observers, &exit_kind, false, .evaluate_execution(state, self, input, &observers, &exit_kind, false)?
)?
} else { } else {
#[cfg(feature = "scalability_introspection")] #[cfg(feature = "scalability_introspection")]
{ {

View File

@ -636,7 +636,7 @@ where
{ {
state.scalability_monitor_mut().testcase_with_observers += 1; state.scalability_monitor_mut().testcase_with_observers += 1;
} }
fuzzer.execute_and_process(state, self, input, &observers, &exit_kind, false)? fuzzer.evaluate_execution(state, self, input, &observers, &exit_kind, false)?
} else { } else {
#[cfg(feature = "scalability_introspection")] #[cfg(feature = "scalability_introspection")]
{ {

View File

@ -70,8 +70,8 @@ pub trait HasObjective: UsesState {
/// Evaluates if an input is interesting using the feedback /// Evaluates if an input is interesting using the feedback
pub trait ExecutionProcessor<OT>: UsesState { pub trait ExecutionProcessor<OT>: UsesState {
/// Evaluate if a set of observation channels has an interesting state /// Check the outcome of the execution, find if it is worth for corpus or objectives
fn execute_no_process<EM>( fn check_results<EM>(
&mut self, &mut self,
state: &mut Self::State, state: &mut Self::State,
manager: &mut EM, manager: &mut EM,
@ -98,7 +98,7 @@ pub trait ExecutionProcessor<OT>: UsesState {
EM: EventFirer<State = Self::State>; EM: EventFirer<State = Self::State>;
/// Evaluate if a set of observation channels has an interesting state /// Evaluate if a set of observation channels has an interesting state
fn execute_and_process<EM>( fn evaluate_execution<EM>(
&mut self, &mut self,
state: &mut Self::State, state: &mut Self::State,
manager: &mut EM, manager: &mut EM,
@ -356,7 +356,7 @@ where
+ HasCurrentTestcase<<Self::State as UsesInput>::Input> + HasCurrentTestcase<<Self::State as UsesInput>::Input>
+ HasCurrentCorpusId, + HasCurrentCorpusId,
{ {
fn execute_no_process<EM>( fn check_results<EM>(
&mut self, &mut self,
state: &mut Self::State, state: &mut Self::State,
manager: &mut EM, manager: &mut EM,
@ -399,7 +399,7 @@ where
Ok(res) Ok(res)
} }
fn execute_and_process<EM>( fn evaluate_execution<EM>(
&mut self, &mut self,
state: &mut Self::State, state: &mut Self::State,
manager: &mut EM, manager: &mut EM,
@ -411,7 +411,7 @@ where
where where
EM: EventFirer<State = Self::State>, EM: EventFirer<State = Self::State>,
{ {
let exec_res = self.execute_no_process(state, manager, &input, observers, exit_kind)?; let exec_res = self.check_results(state, manager, &input, observers, exit_kind)?;
let corpus_id = self.process_execution( let corpus_id = self.process_execution(
state, state,
manager, manager,
@ -548,7 +548,7 @@ where
self.scheduler.on_evaluation(state, &input, &*observers)?; self.scheduler.on_evaluation(state, &input, &*observers)?;
self.execute_and_process(state, manager, input, &*observers, &exit_kind, send_events) self.evaluate_execution(state, manager, input, &*observers, &exit_kind, send_events)
} }
} }

View File

@ -169,7 +169,7 @@ where
) -> Result<(), Error> { ) -> Result<(), Error> {
// todo: is_interesting, etc. // todo: is_interesting, etc.
fuzzer.execute_and_process(state, event_mgr, last_input, observers, &exit_kind, true)?; fuzzer.evaluate_execution(state, event_mgr, last_input, observers, &exit_kind, true)?;
start_timer!(state); start_timer!(state);
self.mutator.post_exec(state, self.current_corpus_id)?; self.mutator.post_exec(state, self.current_corpus_id)?;

View File

@ -139,7 +139,7 @@ where
// TODO replace if process_execution adds a return value for solution index // TODO replace if process_execution adds a return value for solution index
let solution_count = state.solutions().count(); let solution_count = state.solutions().count();
let corpus_count = state.corpus().count(); let corpus_count = state.corpus().count();
let (_, corpus_id) = fuzzer.execute_and_process( let (_, corpus_id) = fuzzer.evaluate_execution(
state, state,
manager, manager,
input.clone(), input.clone(),