diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 11:32:48 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:53 +0200 |
commit | 618efe4d40b7120d85e83b0d8dbff868267270ea (patch) | |
tree | 817c6ebf1d6146e34760014e7f222cbf1de61a40 | |
parent | 3edbf126a5b79642a0463a6105b3bd584383017d (diff) |
Use do_run_from_file() for test_white_list_exception
-rw-r--r-- | tests/core/test_white_list_exception.in | 22 | ||||
-rw-r--r-- | tests/core/test_white_list_exception.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 25 |
3 files changed, 26 insertions, 22 deletions
diff --git a/tests/core/test_white_list_exception.in b/tests/core/test_white_list_exception.in new file mode 100644 index 00000000..c7c29c35 --- /dev/null +++ b/tests/core/test_white_list_exception.in @@ -0,0 +1,22 @@ + + #include <stdio.h> + + void thrower() { + printf("infunc..."); + throw(99); + printf("FAIL"); + } + + void somefunction() { + try { + thrower(); + } catch(...) { + printf("done!*\n"); + } + } + + int main() { + somefunction(); + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_white_list_exception.out b/tests/core/test_white_list_exception.out new file mode 100644 index 00000000..62e1a81c --- /dev/null +++ b/tests/core/test_white_list_exception.out @@ -0,0 +1 @@ +infunc...done!*
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index b1d8f0c8..0f70786d 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1255,29 +1255,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co Settings.EXCEPTION_CATCHING_WHITELIST = ["__Z12somefunctionv"] Settings.INLINING_LIMIT = 50 # otherwise it is inlined and not identified - src = ''' - #include <stdio.h> - - void thrower() { - printf("infunc..."); - throw(99); - printf("FAIL"); - } - - void somefunction() { - try { - thrower(); - } catch(...) { - printf("done!*\\n"); - } - } + test_path = path_from_root('tests', 'core', 'test_white_list_exception') + src, output = (test_path + s for s in ('.in', '.out')) - int main() { - somefunction(); - return 0; - } - ''' - self.do_run(src, 'infunc...done!*') + self.do_run_from_file(src, output) Settings.DISABLE_EXCEPTION_CATCHING = 0 Settings.EXCEPTION_CATCHING_WHITELIST = [] |