fuzz for sulution with timeout

This commit is contained in:
Alwin Berger 2022-05-04 21:11:19 +02:00
parent 01e40ded1d
commit 865e97cca7

View File

@ -193,11 +193,29 @@ where
let mut last = current_time();
let monitor_timeout = STATS_TIMEOUT_DEFAULT;
let mut done = false;
let mut tiem = 0;
while !done {
self.fuzz_one(stages, executor, state, manager)?;
last = manager.maybe_report_progress(state, last, monitor_timeout)?;
done = state.solutions().count() > 1;
done = state.solutions().count() > 0;
}
return Ok(0);
}
/// Fuzz until solution with limit
fn fuzz_for_solution_or_n(
&mut self,
stages: &mut ST,
executor: &mut E,
state: &mut S,
manager: &mut EM,
iters: u64,
) -> Result<usize, Error> {
let mut last = current_time();
let monitor_timeout = STATS_TIMEOUT_DEFAULT;
for _ in 0..iters {
self.fuzz_one(stages, executor, state, manager)?;
last = manager.maybe_report_progress(state, last, monitor_timeout)?;
if state.solutions().count() > 0 {break;}
}
return Ok(0);
}