Rename CurrentCorpusIdx -> CurrentCorpusId (#2216)
* Rename CurrentCorpusIdx -> CurrentCorpusId * why ripgrep do you not find these * ripgrep, why?
This commit is contained in:
parent
cf01d04151
commit
31e1eee96e
@ -175,7 +175,7 @@ pub trait Corpus: UsesInput + Serialize + for<'de> Deserialize<'de> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Trait for types which track the current corpus index
|
/// Trait for types which track the current corpus index
|
||||||
pub trait HasCurrentCorpusIdx {
|
pub trait HasCurrentCorpusId {
|
||||||
/// Set the current corpus index; we have started processing this corpus entry
|
/// Set the current corpus index; we have started processing this corpus entry
|
||||||
fn set_corpus_idx(&mut self, idx: CorpusId) -> Result<(), Error>;
|
fn set_corpus_idx(&mut self, idx: CorpusId) -> Result<(), Error>;
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ pub trait HasCurrentCorpusIdx {
|
|||||||
fn clear_corpus_idx(&mut self) -> Result<(), Error>;
|
fn clear_corpus_idx(&mut self) -> Result<(), Error>;
|
||||||
|
|
||||||
/// Fetch the current corpus index -- typically used after a state recovery or transfer
|
/// Fetch the current corpus index -- typically used after a state recovery or transfer
|
||||||
fn current_corpus_idx(&self) -> Result<Option<CorpusId>, Error>;
|
fn current_corpus_id(&self) -> Result<Option<CorpusId>, Error>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// [`Iterator`] over the ids of a [`Corpus`]
|
/// [`Iterator`] over the ids of a [`Corpus`]
|
||||||
|
@ -7,7 +7,7 @@ use libafl_bolts::current_time;
|
|||||||
use serde::{de::DeserializeOwned, Serialize};
|
use serde::{de::DeserializeOwned, Serialize};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::{Corpus, CorpusId, HasCurrentCorpusIdx, HasTestcase, Testcase},
|
corpus::{Corpus, CorpusId, HasCurrentCorpusId, HasTestcase, Testcase},
|
||||||
events::{Event, EventConfig, EventFirer, EventProcessor, ProgressReporter},
|
events::{Event, EventConfig, EventFirer, EventProcessor, ProgressReporter},
|
||||||
executors::{Executor, ExitKind, HasObservers},
|
executors::{Executor, ExitKind, HasObservers},
|
||||||
feedbacks::Feedback,
|
feedbacks::Feedback,
|
||||||
@ -369,7 +369,7 @@ where
|
|||||||
+ HasCorpus
|
+ HasCorpus
|
||||||
+ HasImported
|
+ HasImported
|
||||||
+ HasCurrentTestcase<<Self::State as UsesInput>::Input>
|
+ HasCurrentTestcase<<Self::State as UsesInput>::Input>
|
||||||
+ HasCurrentCorpusIdx,
|
+ HasCurrentCorpusId,
|
||||||
{
|
{
|
||||||
fn execute_no_process<EM>(
|
fn execute_no_process<EM>(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -697,7 +697,7 @@ where
|
|||||||
+ HasTestcase
|
+ HasTestcase
|
||||||
+ HasImported
|
+ HasImported
|
||||||
+ HasLastReportTime
|
+ HasLastReportTime
|
||||||
+ HasCurrentCorpusIdx
|
+ HasCurrentCorpusId
|
||||||
+ HasCurrentStage,
|
+ HasCurrentStage,
|
||||||
ST: StagesTuple<E, EM, CS::State, Self>,
|
ST: StagesTuple<E, EM, CS::State, Self>,
|
||||||
{
|
{
|
||||||
@ -713,7 +713,7 @@ where
|
|||||||
state.introspection_monitor_mut().start_timer();
|
state.introspection_monitor_mut().start_timer();
|
||||||
|
|
||||||
// Get the next index from the scheduler
|
// Get the next index from the scheduler
|
||||||
let idx = if let Some(idx) = state.current_corpus_idx()? {
|
let idx = if let Some(idx) = state.current_corpus_id()? {
|
||||||
idx // we are resuming
|
idx // we are resuming
|
||||||
} else {
|
} else {
|
||||||
let idx = self.scheduler.next(state)?;
|
let idx = self.scheduler.next(state)?;
|
||||||
|
@ -23,7 +23,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
use crate::mutators::str_decode;
|
use crate::mutators::str_decode;
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::{CorpusId, HasCurrentCorpusIdx},
|
corpus::{CorpusId, HasCurrentCorpusId},
|
||||||
inputs::{HasBytesVec, UsesInput},
|
inputs::{HasBytesVec, UsesInput},
|
||||||
mutators::{
|
mutators::{
|
||||||
buffer_self_copy, mutations::buffer_copy, MultiMutator, MutationResult, Mutator, Named,
|
buffer_self_copy, mutations::buffer_copy, MultiMutator, MutationResult, Mutator, Named,
|
||||||
@ -1087,7 +1087,7 @@ impl AFLppRedQueen {
|
|||||||
|
|
||||||
impl<I, S> MultiMutator<I, S> for AFLppRedQueen
|
impl<I, S> MultiMutator<I, S> for AFLppRedQueen
|
||||||
where
|
where
|
||||||
S: UsesInput + HasMetadata + HasRand + HasMaxSize + HasCorpus + HasCurrentCorpusIdx,
|
S: UsesInput + HasMetadata + HasRand + HasMaxSize + HasCorpus + HasCurrentCorpusId,
|
||||||
I: HasBytesVec + From<Vec<u8>>,
|
I: HasBytesVec + From<Vec<u8>>,
|
||||||
{
|
{
|
||||||
#[allow(clippy::needless_range_loop)]
|
#[allow(clippy::needless_range_loop)]
|
||||||
@ -1135,10 +1135,10 @@ where
|
|||||||
// println!("orig: {:#?} new: {:#?}", orig_cmpvals, new_cmpvals);
|
// println!("orig: {:#?} new: {:#?}", orig_cmpvals, new_cmpvals);
|
||||||
|
|
||||||
// Compute when mutating it for the 1st time.
|
// Compute when mutating it for the 1st time.
|
||||||
let current_corpus_idx = state.current_corpus_idx()?.ok_or_else(|| Error::key_not_found("No corpus-idx is currently being fuzzed, but called AFLppRedQueen::multi_mutated()."))?;
|
let current_corpus_id = state.current_corpus_id()?.ok_or_else(|| Error::key_not_found("No corpus-idx is currently being fuzzed, but called AFLppRedQueen::multi_mutated()."))?;
|
||||||
if self.last_corpus_idx.is_none() || self.last_corpus_idx.unwrap() != current_corpus_idx {
|
if self.last_corpus_idx.is_none() || self.last_corpus_idx.unwrap() != current_corpus_id {
|
||||||
self.text_type = check_if_text(orig_bytes, orig_bytes.len());
|
self.text_type = check_if_text(orig_bytes, orig_bytes.len());
|
||||||
self.last_corpus_idx = Some(current_corpus_idx);
|
self.last_corpus_idx = Some(current_corpus_id);
|
||||||
}
|
}
|
||||||
// println!("approximate size: {cmp_len} x {input_len}");
|
// println!("approximate size: {cmp_len} x {input_len}");
|
||||||
for cmp_idx in 0..cmp_len {
|
for cmp_idx in 0..cmp_len {
|
||||||
|
@ -9,7 +9,7 @@ use libafl_bolts::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::{Corpus, HasCurrentCorpusIdx},
|
corpus::{Corpus, HasCurrentCorpusId},
|
||||||
executors::{Executor, HasObservers},
|
executors::{Executor, HasObservers},
|
||||||
feedbacks::map::MapNoveltiesMetadata,
|
feedbacks::map::MapNoveltiesMetadata,
|
||||||
inputs::{BytesInput, GeneralizedInputMetadata, GeneralizedItem, HasBytesVec, UsesInput},
|
inputs::{BytesInput, GeneralizedInputMetadata, GeneralizedItem, HasBytesVec, UsesInput},
|
||||||
@ -83,7 +83,7 @@ where
|
|||||||
state: &mut E::State,
|
state: &mut E::State,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let Some(corpus_idx) = state.current_corpus_idx()? else {
|
let Some(corpus_idx) = state.current_corpus_id()? else {
|
||||||
return Err(Error::illegal_state(
|
return Err(Error::illegal_state(
|
||||||
"state is not currently processing a corpus index",
|
"state is not currently processing a corpus index",
|
||||||
));
|
));
|
||||||
|
@ -39,7 +39,7 @@ pub use tuneable::*;
|
|||||||
use tuple_list::NonEmptyTuple;
|
use tuple_list::NonEmptyTuple;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::{CorpusId, HasCurrentCorpusIdx},
|
corpus::{CorpusId, HasCurrentCorpusId},
|
||||||
events::{EventFirer, EventRestarter, HasEventManagerId, ProgressReporter},
|
events::{EventFirer, EventRestarter, HasEventManagerId, ProgressReporter},
|
||||||
executors::{Executor, HasObservers},
|
executors::{Executor, HasObservers},
|
||||||
inputs::UsesInput,
|
inputs::UsesInput,
|
||||||
@ -401,7 +401,7 @@ impl<CS, E, EM, OT, PS, Z> Stage<E, EM, Z> for PushStageAdapter<CS, EM, OT, PS,
|
|||||||
where
|
where
|
||||||
CS: Scheduler,
|
CS: Scheduler,
|
||||||
CS::State:
|
CS::State:
|
||||||
HasExecutions + HasMetadata + HasRand + HasCorpus + HasLastReportTime + HasCurrentCorpusIdx,
|
HasExecutions + HasMetadata + HasRand + HasCorpus + HasLastReportTime + HasCurrentCorpusId,
|
||||||
E: Executor<EM, Z> + HasObservers<Observers = OT, State = CS::State>,
|
E: Executor<EM, Z> + HasObservers<Observers = OT, State = CS::State>,
|
||||||
EM: EventFirer<State = CS::State>
|
EM: EventFirer<State = CS::State>
|
||||||
+ EventRestarter
|
+ EventRestarter
|
||||||
@ -423,13 +423,13 @@ where
|
|||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let push_stage = &mut self.push_stage;
|
let push_stage = &mut self.push_stage;
|
||||||
|
|
||||||
let Some(corpus_idx) = state.current_corpus_idx()? else {
|
let Some(corpus_idx) = state.current_corpus_id()? else {
|
||||||
return Err(Error::illegal_state(
|
return Err(Error::illegal_state(
|
||||||
"state is not currently processing a corpus index",
|
"state is not currently processing a corpus index",
|
||||||
));
|
));
|
||||||
};
|
};
|
||||||
|
|
||||||
push_stage.set_current_corpus_idx(corpus_idx);
|
push_stage.set_current_corpus_id(corpus_idx);
|
||||||
|
|
||||||
push_stage.init(fuzzer, state, event_mgr, &mut *executor.observers_mut())?;
|
push_stage.init(fuzzer, state, event_mgr, &mut *executor.observers_mut())?;
|
||||||
|
|
||||||
@ -490,12 +490,12 @@ impl RetryRestartHelper {
|
|||||||
max_retries: usize,
|
max_retries: usize,
|
||||||
) -> Result<bool, Error>
|
) -> Result<bool, Error>
|
||||||
where
|
where
|
||||||
S: HasNamedMetadata + HasCurrentCorpusIdx,
|
S: HasNamedMetadata + HasCurrentCorpusId,
|
||||||
ST: Named,
|
ST: Named,
|
||||||
{
|
{
|
||||||
let corpus_idx = state.current_corpus_idx()?.ok_or_else(|| {
|
let corpus_idx = state.current_corpus_id()?.ok_or_else(|| {
|
||||||
Error::illegal_state(
|
Error::illegal_state(
|
||||||
"No current_corpus_idx set in State, but called RetryRestartHelper::should_skip",
|
"No current_corpus_id set in State, but called RetryRestartHelper::should_skip",
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
@ -655,7 +655,7 @@ pub mod test {
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::{Corpus, HasCurrentCorpusIdx, Testcase},
|
corpus::{Corpus, HasCurrentCorpusId, Testcase},
|
||||||
inputs::NopInput,
|
inputs::NopInput,
|
||||||
stages::{RetryRestartHelper, Stage},
|
stages::{RetryRestartHelper, Stage},
|
||||||
state::{test::test_std_state, HasCorpus, State, UsesState},
|
state::{test::test_std_state, HasCorpus, State, UsesState},
|
||||||
|
@ -98,7 +98,7 @@ where
|
|||||||
pub errored: bool,
|
pub errored: bool,
|
||||||
|
|
||||||
/// The corpus index we're currently working on
|
/// The corpus index we're currently working on
|
||||||
pub current_corpus_idx: Option<CorpusId>,
|
pub current_corpus_id: Option<CorpusId>,
|
||||||
|
|
||||||
/// The input we just ran
|
/// The input we just ran
|
||||||
pub current_input: Option<<CS::State as UsesInput>::Input>, // Todo: Get rid of copy
|
pub current_input: Option<<CS::State as UsesInput>::Input>, // Todo: Get rid of copy
|
||||||
@ -132,7 +132,7 @@ where
|
|||||||
exit_kind: exit_kind_ref,
|
exit_kind: exit_kind_ref,
|
||||||
errored: false,
|
errored: false,
|
||||||
current_input: None,
|
current_input: None,
|
||||||
current_corpus_idx: None,
|
current_corpus_id: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ where
|
|||||||
fn end_of_iter(&mut self, shared_state: PushStageSharedState<CS, EM, OT, Z>, errored: bool) {
|
fn end_of_iter(&mut self, shared_state: PushStageSharedState<CS, EM, OT, Z>, errored: bool) {
|
||||||
self.set_shared_state(shared_state);
|
self.set_shared_state(shared_state);
|
||||||
self.errored = errored;
|
self.errored = errored;
|
||||||
self.current_corpus_idx = None;
|
self.current_corpus_id = None;
|
||||||
if errored {
|
if errored {
|
||||||
self.initialized = false;
|
self.initialized = false;
|
||||||
}
|
}
|
||||||
@ -193,8 +193,8 @@ where
|
|||||||
fn push_stage_helper_mut(&mut self) -> &mut PushStageHelper<CS, EM, OT, Z>;
|
fn push_stage_helper_mut(&mut self) -> &mut PushStageHelper<CS, EM, OT, Z>;
|
||||||
|
|
||||||
/// Set the current corpus index this stage works on
|
/// Set the current corpus index this stage works on
|
||||||
fn set_current_corpus_idx(&mut self, corpus_idx: CorpusId) {
|
fn set_current_corpus_id(&mut self, corpus_idx: CorpusId) {
|
||||||
self.push_stage_helper_mut().current_corpus_idx = Some(corpus_idx);
|
self.push_stage_helper_mut().current_corpus_id = Some(corpus_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Called by `next_std` when this stage is being initialized.
|
/// Called by `next_std` when this stage is being initialized.
|
||||||
|
@ -49,7 +49,7 @@ where
|
|||||||
+ EvaluatorObservers<OT>
|
+ EvaluatorObservers<OT>
|
||||||
+ HasScheduler<Scheduler = CS>,
|
+ HasScheduler<Scheduler = CS>,
|
||||||
{
|
{
|
||||||
current_corpus_idx: Option<CorpusId>,
|
current_corpus_id: Option<CorpusId>,
|
||||||
testcases_to_do: usize,
|
testcases_to_do: usize,
|
||||||
testcases_done: usize,
|
testcases_done: usize,
|
||||||
|
|
||||||
@ -76,8 +76,8 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the current corpus index
|
/// Sets the current corpus index
|
||||||
pub fn set_current_corpus_idx(&mut self, current_corpus_idx: CorpusId) {
|
pub fn set_current_corpus_id(&mut self, current_corpus_id: CorpusId) {
|
||||||
self.current_corpus_idx = Some(current_corpus_idx);
|
self.current_corpus_id = Some(current_corpus_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,13 +112,13 @@ where
|
|||||||
_observers: &mut OT,
|
_observers: &mut OT,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
// Find a testcase to work on, unless someone already set it
|
// Find a testcase to work on, unless someone already set it
|
||||||
self.current_corpus_idx = Some(if let Some(corpus_idx) = self.current_corpus_idx {
|
self.current_corpus_id = Some(if let Some(corpus_idx) = self.current_corpus_id {
|
||||||
corpus_idx
|
corpus_idx
|
||||||
} else {
|
} else {
|
||||||
fuzzer.scheduler_mut().next(state)?
|
fuzzer.scheduler_mut().next(state)?
|
||||||
});
|
});
|
||||||
|
|
||||||
self.testcases_to_do = self.iterations(state, self.current_corpus_idx.unwrap())?;
|
self.testcases_to_do = self.iterations(state, self.current_corpus_id.unwrap())?;
|
||||||
self.testcases_done = 0;
|
self.testcases_done = 0;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ where
|
|||||||
|
|
||||||
let input = state
|
let input = state
|
||||||
.corpus_mut()
|
.corpus_mut()
|
||||||
.cloned_input_for_id(self.current_corpus_idx.unwrap());
|
.cloned_input_for_id(self.current_corpus_id.unwrap());
|
||||||
let mut input = match input {
|
let mut input = match input {
|
||||||
Err(e) => return Some(Err(e)),
|
Err(e) => return Some(Err(e)),
|
||||||
Ok(input) => input,
|
Ok(input) => input,
|
||||||
@ -172,7 +172,7 @@ where
|
|||||||
fuzzer.execute_and_process(state, event_mgr, last_input, observers, &exit_kind, true)?;
|
fuzzer.execute_and_process(state, event_mgr, last_input, observers, &exit_kind, true)?;
|
||||||
|
|
||||||
start_timer!(state);
|
start_timer!(state);
|
||||||
self.mutator.post_exec(state, self.current_corpus_idx)?;
|
self.mutator.post_exec(state, self.current_corpus_id)?;
|
||||||
mark_feature_time!(state, PerfFeature::MutatePostExec);
|
mark_feature_time!(state, PerfFeature::MutatePostExec);
|
||||||
self.testcases_done += 1;
|
self.testcases_done += 1;
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ where
|
|||||||
_event_mgr: &mut EM,
|
_event_mgr: &mut EM,
|
||||||
_observers: &mut OT,
|
_observers: &mut OT,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
self.current_corpus_idx = None;
|
self.current_corpus_id = None;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -233,7 +233,7 @@ where
|
|||||||
Self {
|
Self {
|
||||||
mutator,
|
mutator,
|
||||||
psh: PushStageHelper::new(shared_state, exit_kind),
|
psh: PushStageHelper::new(shared_state, exit_kind),
|
||||||
current_corpus_idx: None, // todo
|
current_corpus_id: None, // todo
|
||||||
testcases_to_do: 0,
|
testcases_to_do: 0,
|
||||||
testcases_done: 0,
|
testcases_done: 0,
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ use libafl_bolts::current_time;
|
|||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::{Corpus, HasCurrentCorpusIdx},
|
corpus::{Corpus, HasCurrentCorpusId},
|
||||||
events::EventFirer,
|
events::EventFirer,
|
||||||
schedulers::minimizer::IsFavoredMetadata,
|
schedulers::minimizer::IsFavoredMetadata,
|
||||||
stages::Stage,
|
stages::Stage,
|
||||||
@ -69,7 +69,7 @@ where
|
|||||||
state: &mut E::State,
|
state: &mut E::State,
|
||||||
_manager: &mut EM,
|
_manager: &mut EM,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let Some(corpus_idx) = state.current_corpus_idx()? else {
|
let Some(corpus_idx) = state.current_corpus_id()? else {
|
||||||
return Err(Error::illegal_state(
|
return Err(Error::illegal_state(
|
||||||
"state is not currently processing a corpus index",
|
"state is not currently processing a corpus index",
|
||||||
));
|
));
|
||||||
|
@ -10,7 +10,7 @@ use libafl_bolts::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::{Corpus, HasCurrentCorpusIdx, Testcase},
|
corpus::{Corpus, HasCurrentCorpusId, Testcase},
|
||||||
events::EventFirer,
|
events::EventFirer,
|
||||||
executors::{Executor, ExitKind, HasObservers},
|
executors::{Executor, ExitKind, HasObservers},
|
||||||
feedbacks::{Feedback, FeedbackFactory, HasObserverHandle},
|
feedbacks::{Feedback, FeedbackFactory, HasObserverHandle},
|
||||||
@ -72,7 +72,7 @@ where
|
|||||||
state: &mut CS::State,
|
state: &mut CS::State,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let Some(base_corpus_idx) = state.current_corpus_idx()? else {
|
let Some(base_corpus_idx) = state.current_corpus_id()? else {
|
||||||
return Err(Error::illegal_state(
|
return Err(Error::illegal_state(
|
||||||
"state is not currently processing a corpus index",
|
"state is not currently processing a corpus index",
|
||||||
));
|
));
|
||||||
|
@ -27,7 +27,7 @@ use crate::monitors::ClientPerfMonitor;
|
|||||||
#[cfg(feature = "scalability_introspection")]
|
#[cfg(feature = "scalability_introspection")]
|
||||||
use crate::monitors::ScalabilityMonitor;
|
use crate::monitors::ScalabilityMonitor;
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::{Corpus, CorpusId, HasCurrentCorpusIdx, HasTestcase, Testcase},
|
corpus::{Corpus, CorpusId, HasCurrentCorpusId, HasTestcase, Testcase},
|
||||||
events::{Event, EventFirer, LogSeverity},
|
events::{Event, EventFirer, LogSeverity},
|
||||||
feedbacks::Feedback,
|
feedbacks::Feedback,
|
||||||
fuzzer::{Evaluator, ExecuteInputResult},
|
fuzzer::{Evaluator, ExecuteInputResult},
|
||||||
@ -49,7 +49,7 @@ pub trait State:
|
|||||||
+ DeserializeOwned
|
+ DeserializeOwned
|
||||||
+ MaybeHasClientPerfMonitor
|
+ MaybeHasClientPerfMonitor
|
||||||
+ MaybeHasScalabilityMonitor
|
+ MaybeHasScalabilityMonitor
|
||||||
+ HasCurrentCorpusIdx
|
+ HasCurrentCorpusId
|
||||||
+ HasCurrentStage
|
+ HasCurrentStage
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -457,7 +457,7 @@ impl<I, C, R, SC> HasStartTime for StdState<I, C, R, SC> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<I, C, R, SC> HasCurrentCorpusIdx for StdState<I, C, R, SC> {
|
impl<I, C, R, SC> HasCurrentCorpusId for StdState<I, C, R, SC> {
|
||||||
fn set_corpus_idx(&mut self, idx: CorpusId) -> Result<(), Error> {
|
fn set_corpus_idx(&mut self, idx: CorpusId) -> Result<(), Error> {
|
||||||
self.corpus_idx = Some(idx);
|
self.corpus_idx = Some(idx);
|
||||||
Ok(())
|
Ok(())
|
||||||
@ -468,7 +468,7 @@ impl<I, C, R, SC> HasCurrentCorpusIdx for StdState<I, C, R, SC> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn current_corpus_idx(&self) -> Result<Option<CorpusId>, Error> {
|
fn current_corpus_id(&self) -> Result<Option<CorpusId>, Error> {
|
||||||
Ok(self.corpus_idx)
|
Ok(self.corpus_idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -503,10 +503,10 @@ where
|
|||||||
impl<I, T> HasCurrentTestcase<I> for T
|
impl<I, T> HasCurrentTestcase<I> for T
|
||||||
where
|
where
|
||||||
I: Input,
|
I: Input,
|
||||||
T: HasCorpus + HasCurrentCorpusIdx + UsesInput<Input = I>,
|
T: HasCorpus + HasCurrentCorpusId + UsesInput<Input = I>,
|
||||||
{
|
{
|
||||||
fn current_testcase(&self) -> Result<Ref<'_, Testcase<I>>, Error> {
|
fn current_testcase(&self) -> Result<Ref<'_, Testcase<I>>, Error> {
|
||||||
let Some(corpus_id) = self.current_corpus_idx()? else {
|
let Some(corpus_id) = self.current_corpus_id()? else {
|
||||||
return Err(Error::key_not_found(
|
return Err(Error::key_not_found(
|
||||||
"We are not currently processing a testcase",
|
"We are not currently processing a testcase",
|
||||||
));
|
));
|
||||||
@ -516,7 +516,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn current_testcase_mut(&self) -> Result<RefMut<'_, Testcase<I>>, Error> {
|
fn current_testcase_mut(&self) -> Result<RefMut<'_, Testcase<I>>, Error> {
|
||||||
let Some(corpus_id) = self.current_corpus_idx()? else {
|
let Some(corpus_id) = self.current_corpus_id()? else {
|
||||||
return Err(Error::illegal_state(
|
return Err(Error::illegal_state(
|
||||||
"We are not currently processing a testcase",
|
"We are not currently processing a testcase",
|
||||||
));
|
));
|
||||||
@ -1214,7 +1214,7 @@ impl<I> HasRand for NopState<I> {
|
|||||||
|
|
||||||
impl<I> State for NopState<I> where I: Input {}
|
impl<I> State for NopState<I> where I: Input {}
|
||||||
|
|
||||||
impl<I> HasCurrentCorpusIdx for NopState<I> {
|
impl<I> HasCurrentCorpusId for NopState<I> {
|
||||||
fn set_corpus_idx(&mut self, _idx: CorpusId) -> Result<(), Error> {
|
fn set_corpus_idx(&mut self, _idx: CorpusId) -> Result<(), Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -1223,7 +1223,7 @@ impl<I> HasCurrentCorpusIdx for NopState<I> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn current_corpus_idx(&self) -> Result<Option<CorpusId>, Error> {
|
fn current_corpus_id(&self) -> Result<Option<CorpusId>, Error> {
|
||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user