diff options
author | julien.hamaide <julien.hamaide@fishingcactus.com> | 2012-01-11 21:11:52 +0100 |
---|---|---|
committer | julien.hamaide <julien.hamaide@fishingcactus.com> | 2012-01-11 21:11:52 +0100 |
commit | 90f408e5ad1e9971f762c90ffeaa79a1ac4394d7 (patch) | |
tree | 691e682059d9f3c4ce6636d7b920538dd86d41e9 /tests/runner.py | |
parent | 664caa0c759c7536bc69cb1d2e3e4f6d04e3da54 (diff) |
Better test for exception handling
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/runner.py b/tests/runner.py index 185fdcfe..035c4c78 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -1195,11 +1195,15 @@ if 'benchmark' not in str(sys.argv) and 'sanity' not in str(sys.argv): class MyException { - + public: + MyException(){ std::cout << "Construct..."; } + MyException( const MyException & ) { std::cout << "Copy..."; } + ~MyException(){ std::cout << "Destruct..."; } }; int function() { + std::cout << "Throw..."; throw MyException(); } @@ -1214,9 +1218,18 @@ if 'benchmark' not in str(sys.argv) and 'sanity' not in str(sys.argv): { function2(); } + catch (MyException & e) + { + std::cout << "Catched..."; + } + + try + { + function2(); + } catch (MyException e) { - std::cout << "Exception catched" ; + std::cout << "Catched..."; } return 0; @@ -1224,7 +1237,7 @@ if 'benchmark' not in str(sys.argv) and 'sanity' not in str(sys.argv): ''' Settings.DISABLE_EXCEPTION_CATCHING = 0 - self.do_run(src, 'Exception catched') + self.do_run(src, 'Throw...Construct...Catched...Destruct...Throw...Construct...Copy...Catched...Destruct...Destruct...') def test_typed_exceptions(self): return self.skip('TODO: fix this for llvm 3.0') |