mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-09 13:16:26 +00:00
Fix few wasm-c-api python binding issues (#2029)
How to python language binding test cases: ``` $ cd <wamr_dir>/language-bindings/python $ python -m pip install -e . $ cd wasm-c-api $ python -m unittest tests/test_basic.py $ python -m unittest tests/test_advanced.py ```
This commit is contained in:
parent
05d7ec30b1
commit
915b4d2a89
|
@ -1905,7 +1905,7 @@ wasm_trap_new_internal(wasm_store_t *store,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fill in message */
|
/* fill in message */
|
||||||
if (strlen(error_info) > 0) {
|
if (error_info && strlen(error_info) > 0) {
|
||||||
if (!(trap->message = malloc_internal(sizeof(wasm_byte_vec_t)))) {
|
if (!(trap->message = malloc_internal(sizeof(wasm_byte_vec_t)))) {
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1183,9 +1183,10 @@ class BasicTestSuite(unittest.TestCase):
|
||||||
self._wasm_store, module, imports, create_null_pointer(wasm_trap_t)
|
self._wasm_store, module, imports, create_null_pointer(wasm_trap_t)
|
||||||
)
|
)
|
||||||
|
|
||||||
wasm_instance_delete(instance)
|
|
||||||
wasm_module_delete(module)
|
wasm_module_delete(module)
|
||||||
|
|
||||||
|
self.assertIsNullPointer(instance)
|
||||||
|
|
||||||
def test_wasm_instance_new_pos(self):
|
def test_wasm_instance_new_pos(self):
|
||||||
binary = load_module_file(MODULE_BINARY)
|
binary = load_module_file(MODULE_BINARY)
|
||||||
module = wasm_module_new(self._wasm_store, binary)
|
module = wasm_module_new(self._wasm_store, binary)
|
||||||
|
@ -1227,9 +1228,10 @@ class BasicTestSuite(unittest.TestCase):
|
||||||
create_null_pointer(wasm_trap_t),
|
create_null_pointer(wasm_trap_t),
|
||||||
)
|
)
|
||||||
|
|
||||||
wasm_instance_delete(instance)
|
|
||||||
wasm_module_delete(module)
|
wasm_module_delete(module)
|
||||||
|
|
||||||
|
self.assertIsNullPointer(instance)
|
||||||
|
|
||||||
# test those APIs in advanced:
|
# test those APIs in advanced:
|
||||||
# wasm_instance_delete
|
# wasm_instance_delete
|
||||||
# wasm_instance_exports
|
# wasm_instance_exports
|
||||||
|
|
Loading…
Reference in New Issue
Block a user