fixed unittest

This commit is contained in:
Dominik Maier 2020-10-26 05:51:52 +01:00
parent 97b56291a8
commit 1d1ab50698
4 changed files with 4 additions and 6 deletions

View File

@ -63,7 +63,6 @@ impl Corpus for DefaultQueue<'_> {
}
fn add(&mut self, entry: Box<dyn Testcase>) {
println!("printing {?entry}")
self.entries.push(entry);
}
@ -92,8 +91,11 @@ impl Corpus for DefaultQueue<'_> {
/// Gets the next entry
fn get(&mut self) -> Result<&Box<dyn Testcase>, AflError> {
if self.entries.len() == 0 {
return Err(AflError::Unknown)
}
self.pos = self.pos + 1;
if self.pos > self.entries.len() {
if self.pos >= self.entries.len() {
self.cycles = self.cycles + 1;
self.pos = 0;
}

View File

@ -1,5 +1,3 @@
use std::io::Error;
use crate::AflError;
use crate::inputs::Input;

View File

@ -1,6 +1,5 @@
pub mod bytes;
use std::io::Error;
use std::fs::File;
use std::io::Write;
use std::io::Read;

View File

@ -1,6 +1,5 @@
use std::io::Error;
use crate::inputs::Input;
use crate::utils::Rand;
pub mod scheduled;