summaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py29
1 files changed, 3 insertions, 26 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 19e9e188..548b5452 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -788,33 +788,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run_from_file(src, output)
def test_isnan(self):
- src = r'''
- #include <stdio.h>
-
- int IsNaN(double x){
- int rc; /* The value return */
- volatile double y = x;
- volatile double z = y;
- rc = (y!=z);
- return rc;
- }
+ test_path = path_from_root('tests', 'core', 'test_isnan')
+ src, output = (test_path + s for s in ('.in', '.out'))
- int main() {
- double tests[] = { 1.0, 3.333, 1.0/0.0, 0.0/0.0, -1.0/0.0, -0, 0, -123123123, 12.0E200 };
- for (int i = 0; i < sizeof(tests)/sizeof(double); i++)
- printf("%d - %f - %d\n", i, tests[i], IsNaN(tests[i]));
- }
- '''
- self.do_run(src, '''0 - 1.000000 - 0
-1 - 3.333000 - 0
-2 - inf - 0
-3 - nan - 1
-4 - -inf - 0
-5 - 0.000000 - 0
-6 - 0.000000 - 0
-7 - -123123123.000000 - 0
-8 - 1.2e+201 - 0
-''')
+ self.do_run_from_file(src, output)
def test_globaldoubles(self):
src = r'''