Fix unused imports in oracles
This commit is contained in:
@@ -12,8 +12,7 @@
|
|||||||
|
|
||||||
pub mod dummy;
|
pub mod dummy;
|
||||||
|
|
||||||
use dummy::{dummy_imports, dummy_values};
|
use dummy::dummy_imports;
|
||||||
use std::collections::{HashMap, HashSet};
|
|
||||||
use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
|
use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
|
||||||
use wasmtime::*;
|
use wasmtime::*;
|
||||||
|
|
||||||
@@ -114,6 +113,8 @@ pub fn differential_execution(
|
|||||||
ttf: &crate::generators::WasmOptTtf,
|
ttf: &crate::generators::WasmOptTtf,
|
||||||
configs: &[crate::generators::DifferentialConfig],
|
configs: &[crate::generators::DifferentialConfig],
|
||||||
) {
|
) {
|
||||||
|
use std::collections::{HashMap, HashSet};
|
||||||
|
|
||||||
crate::init_fuzzing();
|
crate::init_fuzzing();
|
||||||
|
|
||||||
// We need at least two configs.
|
// We need at least two configs.
|
||||||
@@ -205,7 +206,7 @@ pub fn differential_execution(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let ty = f.ty();
|
let ty = f.ty();
|
||||||
let params = match dummy_values(ty.params()) {
|
let params = match dummy::dummy_values(ty.params()) {
|
||||||
Ok(p) => p,
|
Ok(p) => p,
|
||||||
Err(_) => continue,
|
Err(_) => continue,
|
||||||
};
|
};
|
||||||
@@ -217,9 +218,8 @@ pub fn differential_execution(
|
|||||||
assert_same_export_func_result(&existing_result, &this_result, name);
|
assert_same_export_func_result(&existing_result, &this_result, name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn init_hang_limit(instance: &Instance) {
|
fn init_hang_limit(instance: &Instance) {
|
||||||
match instance.get_export("hangLimitInitializer") {
|
match instance.get_export("hangLimitInitializer") {
|
||||||
None => return,
|
None => return,
|
||||||
Some(Extern::Func(f)) => {
|
Some(Extern::Func(f)) => {
|
||||||
@@ -228,13 +228,13 @@ fn init_hang_limit(instance: &Instance) {
|
|||||||
}
|
}
|
||||||
Some(_) => panic!("unexpected hangLimitInitializer export"),
|
Some(_) => panic!("unexpected hangLimitInitializer export"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn assert_same_export_func_result(
|
fn assert_same_export_func_result(
|
||||||
lhs: &Result<Box<[Val]>, Trap>,
|
lhs: &Result<Box<[Val]>, Trap>,
|
||||||
rhs: &Result<Box<[Val]>, Trap>,
|
rhs: &Result<Box<[Val]>, Trap>,
|
||||||
func_name: &str,
|
func_name: &str,
|
||||||
) {
|
) {
|
||||||
let fail = || {
|
let fail = || {
|
||||||
panic!(
|
panic!(
|
||||||
"differential fuzzing failed: exported func {} returned two \
|
"differential fuzzing failed: exported func {} returned two \
|
||||||
@@ -281,12 +281,14 @@ fn assert_same_export_func_result(
|
|||||||
}
|
}
|
||||||
_ => fail(),
|
_ => fail(),
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Invoke the given API calls.
|
/// Invoke the given API calls.
|
||||||
#[cfg(feature = "binaryen")]
|
#[cfg(feature = "binaryen")]
|
||||||
pub fn make_api_calls(api: crate::generators::api::ApiCalls) {
|
pub fn make_api_calls(api: crate::generators::api::ApiCalls) {
|
||||||
use crate::generators::api::ApiCall;
|
use crate::generators::api::ApiCall;
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
crate::init_fuzzing();
|
crate::init_fuzzing();
|
||||||
|
|
||||||
@@ -401,7 +403,7 @@ pub fn make_api_calls(api: crate::generators::api::ApiCalls) {
|
|||||||
let nth = nth % funcs.len();
|
let nth = nth % funcs.len();
|
||||||
let f = &funcs[nth];
|
let f = &funcs[nth];
|
||||||
let ty = f.ty();
|
let ty = f.ty();
|
||||||
let params = match dummy_values(ty.params()) {
|
let params = match dummy::dummy_values(ty.params()) {
|
||||||
Ok(p) => p,
|
Ok(p) => p,
|
||||||
Err(_) => continue,
|
Err(_) => continue,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user