fixed unittest
This commit is contained in:
parent
97b56291a8
commit
1d1ab50698
@ -63,7 +63,6 @@ impl Corpus for DefaultQueue<'_> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn add(&mut self, entry: Box<dyn Testcase>) {
|
fn add(&mut self, entry: Box<dyn Testcase>) {
|
||||||
println!("printing {?entry}")
|
|
||||||
self.entries.push(entry);
|
self.entries.push(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,8 +91,11 @@ impl Corpus for DefaultQueue<'_> {
|
|||||||
|
|
||||||
/// Gets the next entry
|
/// Gets the next entry
|
||||||
fn get(&mut self) -> Result<&Box<dyn Testcase>, AflError> {
|
fn get(&mut self) -> Result<&Box<dyn Testcase>, AflError> {
|
||||||
|
if self.entries.len() == 0 {
|
||||||
|
return Err(AflError::Unknown)
|
||||||
|
}
|
||||||
self.pos = self.pos + 1;
|
self.pos = self.pos + 1;
|
||||||
if self.pos > self.entries.len() {
|
if self.pos >= self.entries.len() {
|
||||||
self.cycles = self.cycles + 1;
|
self.cycles = self.cycles + 1;
|
||||||
self.pos = 0;
|
self.pos = 0;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
use std::io::Error;
|
|
||||||
|
|
||||||
use crate::AflError;
|
use crate::AflError;
|
||||||
use crate::inputs::Input;
|
use crate::inputs::Input;
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
pub mod bytes;
|
pub mod bytes;
|
||||||
|
|
||||||
use std::io::Error;
|
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
use std::io::Error;
|
use std::io::Error;
|
||||||
use crate::inputs::Input;
|
use crate::inputs::Input;
|
||||||
use crate::utils::Rand;
|
|
||||||
|
|
||||||
pub mod scheduled;
|
pub mod scheduled;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user