diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 11:53:28 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:54 +0200 |
commit | 2be08eb3a196ad79e66309d0632a659ea052cf17 (patch) | |
tree | 1c7ddb1f308bda47a8aaa449441d93817a49722f /tests/test_core.py | |
parent | b647d9d786873add910bb2477a0f0f8f40abd9e0 (diff) |
Use do_run_from_file() for test_mathfuncptr
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 16 |
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''' |