WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

Commit c075dec1 authored by John Zhang's avatar John Zhang
Browse files

fix mistake in test

parent 471e8f22
......@@ -7,56 +7,56 @@ def within_err(res, exp, err=1e15):
def test_double_add():
fnp = fncptr_from_c_script("test_double_add.c", "test_fnc", restype=ctypes.c_double)
fnp, _ = fncptr_from_c_script("test_double_add.c", "test_fnc", restype=ctypes.c_double)
assert fnp() == 5.859873
def test_double_sub():
fnp = fncptr_from_c_script("test_double_sub.c", "test_fnc", restype=ctypes.c_double)
fnp, _ = fncptr_from_c_script("test_double_sub.c", "test_fnc", restype=ctypes.c_double)
assert within_err(fnp(), 0.423313)
def test_double_mul():
fnp = fncptr_from_c_script("test_double_mul.c", "test_fnc", restype=ctypes.c_double)
fnp, _ = fncptr_from_c_script("test_double_mul.c", "test_fnc", restype=ctypes.c_double)
assert fnp() == 8.53972942004
def test_double_div():
fnp = fncptr_from_c_script("test_double_div.c", "test_fnc", restype=ctypes.c_double)
fnp, _ = fncptr_from_c_script("test_double_div.c", "test_fnc", restype=ctypes.c_double)
assert fnp() == within_err(fnp, 1.1557282546316052)
def test_double_ordered_eq():
fnp = fncptr_from_c_script("test_double_ordered_eq.c", "test_fnc")
fnp, _ = fncptr_from_c_script("test_double_ordered_eq.c", "test_fnc")
assert fnp() == 0
def test_double_ordered_ne():
fnp = fncptr_from_c_script("test_double_ordered_ne.c", "test_fnc")
fnp, _ = fncptr_from_c_script("test_double_ordered_ne.c", "test_fnc")
assert fnp() == 1
def test_double_ordered_lt():
fnp = fncptr_from_c_script("test_double_ordered_lt.c", "test_fnc")
fnp, _ = fncptr_from_c_script("test_double_ordered_lt.c", "test_fnc")
assert fnp() == 1
def test_double_ordered_le():
fnp = fncptr_from_c_script("test_double_ordered_le.c", "test_fnc")
fnp, _ = fncptr_from_c_script("test_double_ordered_le.c", "test_fnc")
assert fnp() == 1
def test_double_ordered_ge():
fnp = fncptr_from_c_script("test_double_ordered_ge.c", "test_fnc")
fnp, _ = fncptr_from_c_script("test_double_ordered_ge.c", "test_fnc")
assert fnp() == 1
def test_double_ordered_gt():
fnp = fncptr_from_c_script("test_double_ordered_gt.c", "test_fnc")
fnp, _ = fncptr_from_c_script("test_double_ordered_gt.c", "test_fnc")
assert fnp() == 1
def test_double_arg_pass():
fnp = fncptr_from_c_script("test_double_arg_pass.c", "test_fnc",
fnp, _ = fncptr_from_c_script("test_double_arg_pass.c", "test_fnc",
[ctypes.c_double, ctypes.c_double], ctypes.c_double)
assert fnp(3.141593, 2.71828) == 5.859873
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