Commit b6c93384 authored by John Zhang's avatar John Zhang

use python script for exception tests, put them under test_rpython.py

parent 6e256904
from util import fncptr_from_c_script, preload_libmu
from util import fncptr_from_c_script
import ctypes, ctypes.util
def test_branch():
......@@ -19,21 +19,3 @@ def test_extern_func():
fn, _ = fncptr_from_c_script("test_extern_func.c", "test_write", [ctypes.c_void_p, ctypes.c_size_t], ctypes.c_int64)
buf = ctypes.create_string_buffer('hello world!\n')
assert fn(ctypes.byref(buf), len(buf)) == len(buf)
def test_throw():
# from rpython.rlib import rmu_fast as rmu
preload_libmu()
fn, _ = fncptr_from_c_script("test_throw.c", "test_fnc", [ctypes.c_int64], ctypes.c_int64)
# mu = rmu.MuVM()
# mu.current_thread_as_mu_thread(rmu.null(rmu.MuCPtr))
assert fn(0) == 20
assert fn(100) == 10
def test_exception_stack_unwind():
# from rpython.rlib import rmu_fast as rmu
preload_libmu()
fn, _ = fncptr_from_c_script("test_exception_stack_unwind.c", "test_fnc", [ctypes.c_int64], ctypes.c_int64)
# mu = rmu.MuVM()
# mu.current_thread_as_mu_thread(rmu.null(rmu.MuCPtr))
assert fn(0) == 20
assert fn(100) == 10
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment