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.py16
1 files changed, 3 insertions, 13 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index e155d053..6e4ef726 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1526,20 +1526,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_mathfuncptr(self):
- src = '''
- #include <math.h>
- #include <stdio.h>
+ test_path = path_from_root('tests', 'core', 'test_mathfuncptr')
+ src, output = (test_path + s for s in ('.in', '.out'))
- int
- main(int argc, char **argv) {
- float (*fn)(float) = argc != 12 ? &sqrtf : &fabsf;
- float (*fn2)(float) = argc != 13 ? &fabsf : &sqrtf;
- float (*fn3)(float) = argc != 14 ? &erff : &fabsf;
- printf("fn2(-5) = %d, fn(10) = %.2f, erf(10) = %.2f\\n", (int)fn2(-5), fn(10), fn3(10));
- return 0;
- }
- '''
- self.do_run(src, 'fn2(-5) = 5, fn(10) = 3.16, erf(10) = 1.00')
+ self.do_run_from_file(src, output)
def test_funcptrfunc(self):
src = r'''