Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamGS committed Aug 15, 2024
1 parent d6e4899 commit eeffdba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions fuzz/fuzz_targets/fuzz_target_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use vortex::compute::slice;
use vortex::compute::unary::scalar_at;
use vortex::encoding::EncodingId;
use vortex::Array;
use vortex_fuzz::FuzzArrayAction;
use vortex_fuzz::{Action, FuzzArrayAction};
use vortex_sampling_compressor::compressors::CompressorRef;
use vortex_sampling_compressor::SamplingCompressor;
use vortex_scalar::{PValue, Scalar, ScalarValue};
Expand All @@ -21,19 +21,19 @@ fuzz_target!(|fuzz_action: FuzzArrayAction| -> Corpus {
};

match action {
vortex_fuzz::Action::Compress(c) => match fuzz_compress(&array, c.as_ref()) {
Action::Compress(c) => match fuzz_compress(&array, c.as_ref()) {
Some(compressed_array) => {
assert_array_eq(&array, &compressed_array);
Corpus::Keep
}
None => return Corpus::Reject,
},
vortex_fuzz::Action::Slice(range) => {
Action::Slice(range) => {
let slice = slice(&array, range.start, range.end).unwrap();
assert_slice(&array, &slice, range.start);
Corpus::Keep
}
vortex_fuzz::Action::NoOp => Corpus::Reject,
Action::NoOp => Corpus::Reject,
}
});

Expand Down
2 changes: 1 addition & 1 deletion fuzz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<'a> Arbitrary<'a> for FuzzArrayAction {
let action = match u.int_in_range(0..=9)? {
0 => {
let start = u.choose_index(array.len())?;
let stop = u.choose_index(array.len() - start).unwrap() + start;
let stop = u.choose_index(array.len() - start)? + start;
Action::Slice(start..stop)
}
1 => Action::Compress(Box::new(ALPCompressor) as _),
Expand Down

0 comments on commit eeffdba

Please sign in to comment.