-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fuzzing for Take and SearchSorted functions (#724)
- Loading branch information
1 parent
5682fee
commit 36c33bd
Showing
12 changed files
with
247 additions
and
78 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::collections::HashSet; | ||
|
||
use arbitrary::{Arbitrary, Result, Unstructured}; | ||
|
||
use crate::compressors::{CompressorRef, EncodingCompressor}; | ||
use crate::{SamplingCompressor, ALL_COMPRESSORS}; | ||
|
||
impl<'a, 'b: 'a> Arbitrary<'a> for SamplingCompressor<'b> { | ||
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> { | ||
let compressors: HashSet<CompressorRef> = u.arbitrary()?; | ||
Ok(Self::new(compressors)) | ||
} | ||
} | ||
|
||
impl<'a, 'b: 'a> Arbitrary<'a> for &'b dyn EncodingCompressor { | ||
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> { | ||
u.choose(&ALL_COMPRESSORS.clone()).cloned() | ||
} | ||
} |
Oops, something went wrong.