Skip to content

Commit f38f7e5

Browse files
committed
tests for freeing null pointers
1 parent 7a5ec49 commit f38f7e5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/unittests/capi_test.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ TEST(capi, parse)
2727
EXPECT_EQ(fizzy_parse(wasm_prefix, sizeof(wasm_prefix)), nullptr);
2828
}
2929

30+
TEST(capi, free_module_null)
31+
{
32+
fizzy_free_module(nullptr);
33+
}
34+
3035
TEST(capi, instantiate)
3136
{
3237
uint8_t wasm_prefix[]{0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00};
@@ -65,6 +70,11 @@ TEST(capi, instantiate_imported_function)
6570
fizzy_free_instance(instance);
6671
}
6772

73+
TEST(capi, free_instance_null)
74+
{
75+
fizzy_free_instance(nullptr);
76+
}
77+
6878
TEST(capi, execute)
6979
{
7080
/* wat2wasm

0 commit comments

Comments
 (0)