diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 11:22:32 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:53 +0200 |
commit | c5b55a9f04b6d0ee5506de9631a62bd351350799 (patch) | |
tree | d57b3541b337812047f7ad6a672505b3c27d817d /tests/test_core.py | |
parent | 9635141fdd8aaa73657f7a6644d9dc200ea05332 (diff) |
Use do_run_from_file() for test_longjmp_repeat
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index d16e02d3..136016e5 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1118,30 +1118,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co def test_longjmp_repeat(self): Settings.MAX_SETJMPS = 1 - src = r''' - #include <stdio.h> - #include <setjmp.h> - - static jmp_buf buf; + test_path = path_from_root('tests', 'core', 'test_longjmp_repeat') + src, output = (test_path + s for s in ('.in', '.out')) - int main() { - volatile int x = 0; - printf("setjmp:%d\n", setjmp(buf)); - x++; - printf("x:%d\n", x); - if (x < 4) longjmp(buf, x*2); - return 0; - } - ''' - self.do_run(src, '''setjmp:0 -x:1 -setjmp:2 -x:2 -setjmp:4 -x:3 -setjmp:6 -x:4 -''') + self.do_run_from_file(src, output) def test_longjmp_stacked(self): src = r''' |