diff options
Diffstat (limited to 'trunk/Examples/test-suite/csharp/exception_order_runme.cs')
-rw-r--r-- | trunk/Examples/test-suite/csharp/exception_order_runme.cs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/trunk/Examples/test-suite/csharp/exception_order_runme.cs b/trunk/Examples/test-suite/csharp/exception_order_runme.cs new file mode 100644 index 000000000..16b32983f --- /dev/null +++ b/trunk/Examples/test-suite/csharp/exception_order_runme.cs @@ -0,0 +1,48 @@ +using System; +using exception_orderNamespace; + +public class runme { + static void Main() { + A a = new A(); + + try { + a.foo(); + throw new Exception("missed exception"); + } catch (ApplicationException e) { + if (e.Message != "C++ E1 exception thrown") + throw new ApplicationException("bad exception order: " + e.Message); + } + + try { + a.bar(); + throw new Exception("missed exception"); + } catch (ApplicationException e) { + if (e.Message != "C++ E2 exception thrown") + throw new ApplicationException("bad exception order: " + e.Message); + } + + try { + a.foobar(); + throw new Exception("missed exception"); + } catch (ApplicationException e) { + if (e.Message != "postcatch unknown") + throw new ApplicationException("bad exception order: " + e.Message); + } + + try { + a.barfoo(1); + throw new Exception("missed exception"); + } catch (ApplicationException e) { + if (e.Message != "C++ E1 exception thrown") + throw new ApplicationException("bad exception order: " + e.Message); + } + + try { + a.barfoo(2); + throw new Exception("missed exception"); + } catch (ApplicationException e) { + if (e.Message != "C++ E2 * exception thrown") + throw new ApplicationException("bad exception order: " + e.Message); + } + } +} |