Split C complex.h from C++ complex testing
This commit is contained in:
parent
9a2513bf85
commit
fd592fdc3b
7 changed files with 117 additions and 98 deletions
24
Examples/test-suite/python/ccomplextest_runme.py
Normal file
24
Examples/test-suite/python/ccomplextest_runme.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import ccomplextest
|
||||
|
||||
a = complex(-1, 2)
|
||||
|
||||
if ccomplextest.has_c99_complex():
|
||||
if ccomplextest.Conj(a) != a.conjugate():
|
||||
raise RuntimeError("bad complex mapping")
|
||||
|
||||
if ccomplextest.Conjf(a) != a.conjugate():
|
||||
raise RuntimeError("bad complex mapping")
|
||||
|
||||
if ccomplextest.Conj2(a) != a.conjugate():
|
||||
raise RuntimeError("bad complex mapping")
|
||||
|
||||
if ccomplextest.Conjf2(a) != a.conjugate():
|
||||
raise RuntimeError("bad complex mapping")
|
||||
|
||||
if ccomplextest.Conj3(a) != a.conjugate():
|
||||
raise RuntimeError("bad complex mapping")
|
||||
|
||||
if ccomplextest.Conjf3(a) != a.conjugate():
|
||||
raise RuntimeError("bad complex mapping")
|
||||
else:
|
||||
print("Not a c99 compiler")
|
||||
Loading…
Add table
Add a link
Reference in a new issue