Skip to content

Commit

Permalink
Fiz fuzz targets
Browse files Browse the repository at this point in the history
  • Loading branch information
c410-f3r committed Jul 24, 2021
1 parent d7d56f8 commit 3773ea6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mop-blocks-fuzz/gp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ fn obj(_: &[f64; 2]) -> f64 {
}

fuzz_target!(|data: Data| {
let mdb_rslt = MpDefinitionsBuilderVec::<_, (ObjDirection, fn(&[f64; 2]) -> f64)>::default()
.domain(data.domain)
.push_obj((ObjDirection::Min, obj as fn(&[f64; 2]) -> f64))
.unwrap()
.build();
let obj_fn: fn(&[f64; 2]) -> f64 = obj;
let fun = || {
MpDefinitionsBuilderVec::<_, (ObjDirection, fn(&[f64; 2]) -> f64)>::default()
.domain(data.domain.clone())
.push_obj((ObjDirection::Min, obj_fn))?
.build()
};

let mdb = if let Ok(r) = mdb_rslt {
let mdb = if let Ok(r) = fun() {
r
} else {
return;
Expand Down

0 comments on commit 3773ea6

Please sign in to comment.