Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test:type matching issue and code redundancy #4079

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/unit/interpreter/interpreter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ TEST_F(InterpreterTest, wasm_runtime_is_built_in_module)
bool ret = wasm_runtime_is_built_in_module("env");
ASSERT_TRUE(ret);

ret = ret = wasm_runtime_is_built_in_module("env1");
ret = wasm_runtime_is_built_in_module("env1");
ASSERT_FALSE(ret);
}
12 changes: 5 additions & 7 deletions tests/unit/wasm-vm/wasm_vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class WasmVMTest : public testing::Test

TEST_F(WasmVMTest, Test_app1)
{
unsigned argv[10];
uint32 argv[10];

ASSERT_TRUE(app1_wasm != NULL);

Expand Down Expand Up @@ -151,7 +151,7 @@ TEST_F(WasmVMTest, Test_app1)

TEST_F(WasmVMTest, Test_app2)
{
unsigned argv[10];
uint32 argv[10];

/* Load module */
module = wasm_runtime_load(app2_wasm, sizeof(app2_wasm), error_buf,
Expand Down Expand Up @@ -416,7 +416,7 @@ TEST_F(WasmVMTest, Test_app2)

TEST_F(WasmVMTest, Test_app3)
{
unsigned argv[10];
uint32 argv[10];

/* Load module */
module = wasm_runtime_load(app3_wasm, sizeof(app3_wasm), error_buf,
Expand Down Expand Up @@ -465,7 +465,6 @@ TEST_F(WasmVMTest, Test_app3)
ASSERT_TRUE(buf != NULL);

ASSERT_EQ(wasm_runtime_addr_native_to_app(module_inst, buf), argv[0]);
int32 buf_offset = argv[0];

/* call my_malloc */
func_inst = wasm_runtime_lookup_function(module_inst, "my_malloc");
Expand All @@ -482,7 +481,6 @@ TEST_F(WasmVMTest, Test_app3)
ASSERT_TRUE(buf1 != NULL);

ASSERT_EQ(wasm_runtime_addr_native_to_app(module_inst, buf1), argv[0]);
int32 buf_offset1 = argv[0];

wasm_runtime_deinstantiate(module_inst);
wasm_runtime_unload(module);
Expand Down Expand Up @@ -526,7 +524,7 @@ TEST_F(WasmVMTest, Test_app4_single)
uint8 *buffer = NULL;
uint32 buffer_size = 0;
bool ret = false;
unsigned argv[10];
uint32 argv[10];

wasm_runtime_set_module_reader(&module_reader_callback,
&module_destroyer_callback);
Expand Down Expand Up @@ -584,7 +582,7 @@ TEST_F(WasmVMTest, Test_app4_plus_one)
uint8 *buffer = NULL;
uint32 buffer_size = 0;
bool ret = false;
uint32_t argv[10] = { 0 };
uint32 argv[10] = { 0 };

wasm_runtime_set_module_reader(&module_reader_callback,
&module_destroyer_callback);
Expand Down
Loading