mirror of
https://github.com/fluencelabs/wasmer
synced 2025-04-21 08:22:14 +00:00
Fix vmctx offset tests.
This commit is contained in:
parent
26e4278657
commit
08ba696ab0
@ -348,43 +348,45 @@ impl Anyfunc {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod vm_offset_tests {
|
mod vm_offset_tests {
|
||||||
use super::{Anyfunc, Ctx, ImportedFunc, LocalGlobal, LocalMemory, LocalTable};
|
use super::{Anyfunc, Ctx, ImportedFunc, InternalCtx, LocalGlobal, LocalMemory, LocalTable};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn vmctx() {
|
fn vmctx() {
|
||||||
|
assert_eq!(0usize, offset_of!(Ctx => internal).get_byte_offset(),);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Ctx::offset_memories() as usize,
|
Ctx::offset_memories() as usize,
|
||||||
offset_of!(Ctx => memories).get_byte_offset(),
|
offset_of!(InternalCtx => memories).get_byte_offset(),
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Ctx::offset_tables() as usize,
|
Ctx::offset_tables() as usize,
|
||||||
offset_of!(Ctx => tables).get_byte_offset(),
|
offset_of!(InternalCtx => tables).get_byte_offset(),
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Ctx::offset_globals() as usize,
|
Ctx::offset_globals() as usize,
|
||||||
offset_of!(Ctx => globals).get_byte_offset(),
|
offset_of!(InternalCtx => globals).get_byte_offset(),
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Ctx::offset_imported_memories() as usize,
|
Ctx::offset_imported_memories() as usize,
|
||||||
offset_of!(Ctx => imported_memories).get_byte_offset(),
|
offset_of!(InternalCtx => imported_memories).get_byte_offset(),
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Ctx::offset_imported_tables() as usize,
|
Ctx::offset_imported_tables() as usize,
|
||||||
offset_of!(Ctx => imported_tables).get_byte_offset(),
|
offset_of!(InternalCtx => imported_tables).get_byte_offset(),
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Ctx::offset_imported_globals() as usize,
|
Ctx::offset_imported_globals() as usize,
|
||||||
offset_of!(Ctx => imported_globals).get_byte_offset(),
|
offset_of!(InternalCtx => imported_globals).get_byte_offset(),
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Ctx::offset_imported_funcs() as usize,
|
Ctx::offset_imported_funcs() as usize,
|
||||||
offset_of!(Ctx => imported_funcs).get_byte_offset(),
|
offset_of!(InternalCtx => imported_funcs).get_byte_offset(),
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user