aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2010-11-20 15:19:01 -0800
committerAlon Zakai <azakai@mozilla.com>2010-11-20 15:19:01 -0800
commitaa7790adb7357136620b4a4f4924b3ab5dccc75d (patch)
tree36d31a878320b62eadd64742368a25e045e005d3 /tests
parent77fe34354be3cf141622d7869afafc622924d44a (diff)
minimal C++ exceptions support
Diffstat (limited to 'tests')
-rw-r--r--tests/runner.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index bf39bb55..fc9e2f21 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -442,6 +442,32 @@ if 'benchmark' not in sys.argv:
'''
self.do_test(src, 'Assertion failed: 1 == false')
+ def test_exceptions(self):
+ src = '''
+ #include <stdio.h>
+ void thrower() {
+ printf("infunc...");
+ throw(99);
+ printf("FAIL");
+ }
+ int main() {
+ try {
+ printf("*throw...");
+ throw(1);
+ printf("FAIL");
+ } catch(...) {
+ printf("caught!");
+ }
+ try {
+ thrower();
+ } catch(...) {
+ printf("done!*\\n");
+ }
+ return 1;
+ }
+ '''
+ self.do_test(src, '*throw...caught!infunc...done!*')
+
def test_class(self):
src = '''
#include <stdio.h>