Skip to content

Commit

Permalink
rename test vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Eitu33 committed Feb 1, 2023
1 parent 23b344c commit 35f8ca1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/tests/tests_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,14 @@ fn test_class_id() {
// get string and array offsets
let return_string = instance.exports.get_function("return_string").unwrap();
let return_array = instance.exports.get_function("return_array").unwrap();
let string_offset = return_string
let string_ptr = return_string
.call(&mut store, &[])
.unwrap()
.get(0)
.unwrap()
.i32()
.unwrap();
let array_offset = return_array
let array_ptr = return_array
.call(&mut store, &[])
.unwrap()
.get(0)
Expand All @@ -354,10 +354,10 @@ fn test_class_id() {
let u32_size = std::mem::size_of::<u32>() as u32;

// read and assert string class id
let string_ptr: WasmPtr<u8> = WasmPtr::new(string_offset as u32)
let string_w_ptr: WasmPtr<u8> = WasmPtr::new(string_ptr as u32)
.sub_offset(u32_size * 2)
.unwrap();
let slice_len_buf = string_ptr
let slice_len_buf = string_w_ptr
.slice(&memory_view, u32_size)
.unwrap()
.read_to_vec()
Expand All @@ -371,10 +371,10 @@ fn test_class_id() {
assert_eq!(string_class_id, 2);

// read and assert array class id
let array_ptr: WasmPtr<u8> = WasmPtr::new(array_offset as u32)
let array_w_ptr: WasmPtr<u8> = WasmPtr::new(array_ptr as u32)
.sub_offset(u32_size * 2)
.unwrap();
let slice_len_buf = array_ptr
let slice_len_buf = array_w_ptr
.slice(&memory_view, u32_size)
.unwrap()
.read_to_vec()
Expand Down

0 comments on commit 35f8ca1

Please sign in to comment.