GitLab will be upgraded to the 12.10.14-ce.0 on 28 Sept 2020 at 2.00pm (AEDT) to 2.30pm (AEDT). During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

test_cmpops.py 935 Bytes
Newer Older
John Zhang's avatar
John Zhang committed
1
from util import fncptr_from_c_script
2 3

def test_eq_int():
John Zhang's avatar
John Zhang committed
4
    fn, _ = fncptr_from_c_script("test_eq_int.c", "test_fnc")
5 6 7
    assert fn() == 0

def test_eq_ref():
John Zhang's avatar
John Zhang committed
8
    fn, _ = fncptr_from_c_script("test_eq_ref.c", "test_fnc")
9 10 11
    assert fn() == 0

def test_ne_int():
John Zhang's avatar
John Zhang committed
12
    fn, _ = fncptr_from_c_script("test_ne_int.c", "test_fnc")
13 14 15
    assert fn() == 1

def test_ne_ref():
John Zhang's avatar
John Zhang committed
16
    fn, _ = fncptr_from_c_script("test_ne_ref.c", "test_fnc")
17 18 19
    assert fn() == 1

def test_sge():
John Zhang's avatar
John Zhang committed
20
    fn, _ = fncptr_from_c_script("test_sge.c", "test_fnc")
21 22 23
    assert fn() == 1

def test_sgt():
John Zhang's avatar
John Zhang committed
24
    fn, _ = fncptr_from_c_script("test_sgt.c", "test_fnc")
25 26 27
    assert fn() == 0

def test_sle():
John Zhang's avatar
John Zhang committed
28
    fn, _ = fncptr_from_c_script("test_sle.c", "test_fnc")
29 30 31
    assert fn() == 1

def test_slt():
John Zhang's avatar
John Zhang committed
32
    fn, _ = fncptr_from_c_script("test_slt.c", "test_fnc")
33 34 35
    assert fn() == 0

def test_ult():
John Zhang's avatar
John Zhang committed
36
    fn, _ = fncptr_from_c_script("test_ult.c", "test_fnc")
37
    assert fn() == 0