tests fixed
This commit is contained in:
parent
ab793303fb
commit
e40b26ffbc
@ -516,9 +516,9 @@ mod tests {
|
||||
corpus::{Corpus, InMemoryCorpus, Testcase},
|
||||
engines::{Engine, Fuzzer, State, StdFuzzer},
|
||||
executors::{Executor, ExitKind, InMemoryExecutor},
|
||||
inputs::bytes::BytesInput,
|
||||
inputs::{Input, BytesInput},
|
||||
mutators::{mutation_bitflip, ComposedByMutations, StdScheduledMutator},
|
||||
stages::mutational::StdMutationalStage,
|
||||
stages::StdMutationalStage,
|
||||
tuples::tuple_list,
|
||||
utils::StdRand,
|
||||
};
|
||||
@ -526,7 +526,7 @@ mod tests {
|
||||
#[cfg(feature = "std")]
|
||||
use crate::events::{LoggerEventManager, SimpleStats};
|
||||
|
||||
fn harness<I>(_executor: &dyn Executor<I>, _buf: &[u8]) -> ExitKind {
|
||||
fn harness<E: Executor<I>, I: Input>(_executor: &E, _buf: &[u8]) -> ExitKind {
|
||||
ExitKind::Ok
|
||||
}
|
||||
|
||||
@ -548,7 +548,7 @@ mod tests {
|
||||
"main",
|
||||
harness,
|
||||
tuple_list!(),
|
||||
Box::new(|_, _, _, _, _| ()),
|
||||
//Box::new(|_, _, _, _, _| ()),
|
||||
&state,
|
||||
&corpus,
|
||||
&mut event_manager,
|
||||
|
@ -374,43 +374,33 @@ pub mod unix_signals {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
use alloc::boxed::Box;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
use crate::{
|
||||
executors::{Executor, ExitKind, InMemoryExecutor},
|
||||
inputs::NopInput,
|
||||
executors::{Executor, InMemoryExecutor, ExitKind},
|
||||
inputs::Input,
|
||||
tuples::tuple_list,
|
||||
};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
fn test_harness_fn_nop(_executor: &dyn Executor<NopInput>, buf: &[u8]) -> ExitKind {
|
||||
println!("Fake exec with buf of len {}", buf.len());
|
||||
ExitKind::Ok
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
fn test_harness_fn_nop(_executor: &dyn Executor<NopInput>, _buf: &[u8]) -> ExitKind {
|
||||
fn test_harness_fn_nop<E: Executor<I>, I: Input>(_executor: &E, _buf: &[u8]) -> ExitKind {
|
||||
ExitKind::Ok
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_inmem_exec() {
|
||||
use crate::{
|
||||
corpus::InMemoryCorpus, events::NopEventManager, inputs::NopInput, utils::StdRand,
|
||||
inputs::NopInput,
|
||||
};
|
||||
|
||||
let mut in_mem_executor = InMemoryExecutor::<
|
||||
NopInput,
|
||||
(),
|
||||
InMemoryCorpus<_, _>,
|
||||
NopEventManager<_>,
|
||||
(),
|
||||
StdRand,
|
||||
> {
|
||||
harness_fn: test_harness_fn_nop,
|
||||
on_crash_fn: Box::new(|_, _, _, _, _| ()),
|
||||
// TODO: on_crash_fn: Box::new(|_, _, _, _, _| ()),
|
||||
observers: tuple_list!(),
|
||||
name: "main",
|
||||
phantom: PhantomData,
|
||||
};
|
||||
let mut input = NopInput {};
|
||||
assert!(in_mem_executor.run_target(&mut input).is_ok());
|
||||
|
@ -1,3 +1,5 @@
|
||||
//! Executors take input, and run it in the target.
|
||||
|
||||
pub mod inmemory;
|
||||
pub use inmemory::InMemoryExecutor;
|
||||
#[cfg(feature = "runtime")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user