mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 21:28:21 +00:00
test(api) Clean up tests.
This commit is contained in:
6
lib/api/src/externals/function.rs
vendored
6
lib/api/src/externals/function.rs
vendored
@@ -920,9 +920,7 @@ mod inner {
|
||||
#[cfg(test)]
|
||||
mod test_func {
|
||||
use super::*;
|
||||
use std::ptr;
|
||||
use wasm_common::Type;
|
||||
// WasmTypeList
|
||||
|
||||
fn func() {}
|
||||
fn func__i32() -> i32 {
|
||||
@@ -974,9 +972,7 @@ mod inner {
|
||||
#[test]
|
||||
fn test_function_pointer() {
|
||||
let f = Function::new(func_i32__i32);
|
||||
let function = unsafe {
|
||||
std::mem::transmute::<*const FunctionBody, fn(usize, i32) -> i32>(f.address)
|
||||
};
|
||||
let function = unsafe { std::mem::transmute::<_, fn(usize, i32) -> i32>(f.address) };
|
||||
assert_eq!(function(0, 3), 6);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user