test_otherops.py 427 Bytes
Newer Older
1
from util import fncptr_from_c_script, mu_instance_via_ctyeps, may_spawn_proc
John Zhang's avatar
John Zhang committed
2
3
import ctypes

John Zhang's avatar
John Zhang committed
4
@may_spawn_proc
John Zhang's avatar
John Zhang committed
5
def test_select():
Kunshan Wang's avatar
Kunshan Wang committed
6
    fnp, _ = fncptr_from_c_script('test_select.c', 'test_fnc', [ctypes.c_byte])
John Zhang's avatar
John Zhang committed
7
8
    assert fnp(0) == 20
    assert fnp(1) == 10
John Zhang's avatar
John Zhang committed
9

10
@may_spawn_proc
John Zhang's avatar
John Zhang committed
11
def test_commoninst_pin():
12
    mu = mu_instance_via_ctyeps()
John Zhang's avatar
John Zhang committed
13
14
    fnp, _ = fncptr_from_c_script("test_commoninst_pin.c", 'test_pin')
    assert fnp() == 6