Skip to content

Commit

Permalink
Merge pull request #19 from epi052/move-reset-to-fuzzer-trait
Browse files Browse the repository at this point in the history
Move reset to fuzzer trait
  • Loading branch information
epi052 authored Dec 28, 2022
2 parents 350b8dc + 724b2e5 commit f12d65a
Show file tree
Hide file tree
Showing 16 changed files with 979 additions and 92 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "feroxfuzz"
version = "1.0.0-rc.6"
version = "1.0.0-rc.7"
edition = "2021"
authors = ["Ben 'epi' Risher (@epi052)"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/client/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub(super) fn parse_version(data: &Data) -> Result<Version, FeroxFuzzError> {
error!(%data, "failed to parse http version; must be a valid http version when using a reqwest client");

Err(FeroxFuzzError::InvalidVersionError {
version: format!("{}", data),
version: format!("{data}"),
})
}
}
Expand Down
22 changes: 21 additions & 1 deletion src/corpora/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,22 @@ pub enum CorpusItemType {
///
/// [`Data`]: crate::input::Data
Data(Data),

/// When the corpus item type is [`CorpusItemType::LotsOfData`], all [`Data`]
/// values associated with the key will be added to the corpus.
///
/// # Note
///
/// There are a lot of [`From`] implementations for [`Data`]. When creating
/// a [`CorpusItemType::Data`] item, you can probably just use `.into`:
///
/// ```
/// # use feroxfuzz::corpora::CorpusItemType;
/// CorpusItemType::LotsOfData(vec!["something".into()]);
/// ```
///
/// [`Data`]: crate::input::Data
LotsOfData(Vec<Data>),
}

/// Collection of all current test cases
Expand All @@ -87,7 +103,7 @@ pub trait Corpus: Named {
/// most of the methods/traits implemented by the underlying [`Corpus`] types
/// are implemented here as well. Meaning, you should be able to use the
/// underlying [`Corpus`] types seamlessly through this wrapper.
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[non_exhaustive]
pub enum CorpusType {
Expand Down Expand Up @@ -257,10 +273,14 @@ mod typestate {
pub trait CorpusBuildState {}
pub struct NoItems;
pub struct NoName;
pub struct NotUnique;
pub struct HasItems;
pub struct HasName;
pub struct Unique;
impl CorpusBuildState for NoItems {}
impl CorpusBuildState for NoName {}
impl CorpusBuildState for NotUnique {}
impl CorpusBuildState for HasItems {}
impl CorpusBuildState for HasName {}
impl CorpusBuildState for Unique {}
}
Loading

0 comments on commit f12d65a

Please sign in to comment.