fixed warnings
This commit is contained in:
parent
944753c741
commit
97080d4f8a
@ -112,34 +112,37 @@ where
|
|||||||
R: Rand,
|
R: Rand,
|
||||||
//CE: CustomEvent<S, C, E, I, R>,
|
//CE: CustomEvent<S, C, E, I, R>,
|
||||||
{
|
{
|
||||||
fn name(&self) -> &str {
|
pub fn name(&self) -> &str {
|
||||||
match self {
|
match self {
|
||||||
Event::LoadInitial { sender_id, _marker } => "Initial",
|
Event::LoadInitial {
|
||||||
|
sender_id: _,
|
||||||
|
_marker,
|
||||||
|
} => "Initial",
|
||||||
Event::NewTestcase {
|
Event::NewTestcase {
|
||||||
sender_id,
|
sender_id: _,
|
||||||
input,
|
input: _,
|
||||||
fitness,
|
fitness: _,
|
||||||
_marker,
|
_marker,
|
||||||
} => "New Testcase",
|
} => "New Testcase",
|
||||||
Event::UpdateStats {
|
Event::UpdateStats {
|
||||||
sender_id,
|
sender_id: _,
|
||||||
new_execs,
|
new_execs: _,
|
||||||
_marker,
|
_marker,
|
||||||
} => "Stats",
|
} => "Stats",
|
||||||
Event::Crash {
|
Event::Crash {
|
||||||
sender_id,
|
sender_id: _,
|
||||||
input,
|
input: _,
|
||||||
_marker,
|
_marker,
|
||||||
} => "Crash",
|
} => "Crash",
|
||||||
Event::Timeout {
|
Event::Timeout {
|
||||||
sender_id,
|
sender_id: _,
|
||||||
input,
|
input: _,
|
||||||
_marker,
|
_marker,
|
||||||
} => "Timeout",
|
} => "Timeout",
|
||||||
Event::Log {
|
Event::Log {
|
||||||
sender_id,
|
sender_id: _,
|
||||||
severity_level,
|
severity_level: _,
|
||||||
message,
|
message: _,
|
||||||
_marker,
|
_marker,
|
||||||
} => "Log",
|
} => "Log",
|
||||||
//Event::Custom {sender_id, custom_event} => custom_event.name(),
|
//Event::Custom {sender_id, custom_event} => custom_event.name(),
|
||||||
@ -148,33 +151,33 @@ where
|
|||||||
|
|
||||||
fn handle_in_broker(
|
fn handle_in_broker(
|
||||||
&self,
|
&self,
|
||||||
/*broker: &dyn EventManager<S, C, E, I, R>,*/ state: &mut S,
|
/*broker: &dyn EventManager<S, C, E, I, R>,*/ _state: &mut S,
|
||||||
corpus: &mut C,
|
_corpus: &mut C,
|
||||||
) -> Result<BrokerEventResult, AflError> {
|
) -> Result<BrokerEventResult, AflError> {
|
||||||
match self {
|
match self {
|
||||||
Event::LoadInitial { sender_id, _marker } => Ok(BrokerEventResult::Handled),
|
Event::LoadInitial { sender_id: _, _marker } => Ok(BrokerEventResult::Handled),
|
||||||
Event::NewTestcase {
|
Event::NewTestcase {
|
||||||
sender_id,
|
sender_id: _,
|
||||||
input,
|
input: _,
|
||||||
fitness,
|
fitness: _,
|
||||||
_marker,
|
_marker,
|
||||||
} => Ok(BrokerEventResult::Forward),
|
} => Ok(BrokerEventResult::Forward),
|
||||||
Event::UpdateStats {
|
Event::UpdateStats {
|
||||||
sender_id,
|
sender_id: _,
|
||||||
new_execs,
|
new_execs: _,
|
||||||
_marker,
|
_marker,
|
||||||
} => {
|
} => {
|
||||||
// TODO
|
// TODO
|
||||||
Ok(BrokerEventResult::Handled)
|
Ok(BrokerEventResult::Handled)
|
||||||
}
|
}
|
||||||
Event::Crash {
|
Event::Crash {
|
||||||
sender_id,
|
sender_id: _,
|
||||||
input,
|
input: _,
|
||||||
_marker,
|
_marker,
|
||||||
} => Ok(BrokerEventResult::Handled),
|
} => Ok(BrokerEventResult::Handled),
|
||||||
Event::Timeout {
|
Event::Timeout {
|
||||||
sender_id,
|
sender_id: _,
|
||||||
input,
|
input: _,
|
||||||
_marker,
|
_marker,
|
||||||
} => {
|
} => {
|
||||||
// TODO
|
// TODO
|
||||||
@ -191,18 +194,18 @@ where
|
|||||||
Ok(BrokerEventResult::Handled)
|
Ok(BrokerEventResult::Handled)
|
||||||
}
|
}
|
||||||
//Event::Custom {sender_id, custom_event} => custom_event.handle_in_broker(state, corpus),
|
//Event::Custom {sender_id, custom_event} => custom_event.handle_in_broker(state, corpus),
|
||||||
_ => Ok(BrokerEventResult::Forward),
|
//_ => Ok(BrokerEventResult::Forward),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_in_client(
|
fn handle_in_client(
|
||||||
&self,
|
&self,
|
||||||
/*client: &dyn EventManager<S, C, E, I, R>,*/ state: &mut S,
|
/*client: &dyn EventManager<S, C, E, I, R>,*/ _state: &mut S,
|
||||||
corpus: &mut C,
|
corpus: &mut C,
|
||||||
) -> Result<(), AflError> {
|
) -> Result<(), AflError> {
|
||||||
match self {
|
match self {
|
||||||
Event::NewTestcase {
|
Event::NewTestcase {
|
||||||
sender_id,
|
sender_id: _,
|
||||||
input,
|
input,
|
||||||
fitness,
|
fitness,
|
||||||
_marker,
|
_marker,
|
||||||
@ -240,7 +243,7 @@ where
|
|||||||
/// Return the number of processes events or an error
|
/// Return the number of processes events or an error
|
||||||
fn process(&mut self, state: &mut S, corpus: &mut C) -> Result<usize, AflError>;
|
fn process(&mut self, state: &mut S, corpus: &mut C) -> Result<usize, AflError>;
|
||||||
|
|
||||||
fn on_recv(&self, _state: &mut S, corpus: &mut C) -> Result<(), AflError> {
|
fn on_recv(&self, _state: &mut S, _corpus: &mut C) -> Result<(), AflError> {
|
||||||
// TODO: Better way to move out of testcase, or get ref
|
// TODO: Better way to move out of testcase, or get ref
|
||||||
//Ok(corpus.add(self.testcase.take().unwrap()))
|
//Ok(corpus.add(self.testcase.take().unwrap()))
|
||||||
Ok(())
|
Ok(())
|
||||||
@ -308,7 +311,7 @@ where
|
|||||||
// Ignore broker-only events
|
// Ignore broker-only events
|
||||||
BrokerEventResult::Handled => Ok(()),
|
BrokerEventResult::Handled => Ok(()),
|
||||||
})
|
})
|
||||||
.collect::<Result<(), AflError>>();
|
.for_each(drop);
|
||||||
let count = self.events.len();
|
let count = self.events.len();
|
||||||
dbg!("Handled {} events", count);
|
dbg!("Handled {} events", count);
|
||||||
self.events.clear();
|
self.events.clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user