X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Ftests%2Funhandled-exception-2.cs;h=cb05c269fd82c0f31e220092d8744d70dc519868;hb=6e17b26ef522006054976d29fa77e71638af73f5;hp=7c9cc6999fa7ca5ea9611c442f376c49cd78b785;hpb=3bc22b19614835c73c42101eaf58de6f666ef81a;p=mono.git diff --git a/mono/tests/unhandled-exception-2.cs b/mono/tests/unhandled-exception-2.cs index 7c9cc6999fa..cb05c269fd8 100644 --- a/mono/tests/unhandled-exception-2.cs +++ b/mono/tests/unhandled-exception-2.cs @@ -9,9 +9,12 @@ class CustomException : Exception class Driver { - /* expected exit code: 0 */ + /* expected exit code: 255 */ static void Main (string[] args) { + if (Environment.GetEnvironmentVariable ("TEST_UNHANDLED_EXCEPTION_HANDLER") != null) + AppDomain.CurrentDomain.UnhandledException += (s, e) => {}; + ManualResetEvent mre = new ManualResetEvent (false); var a = new Action (() => { try { throw new CustomException (); } finally { mre.Set (); } }); @@ -24,11 +27,13 @@ class Driver a.EndInvoke (ares); Environment.Exit (4); } catch (CustomException) { + /* expected behaviour */ + Environment.Exit (255); } catch (Exception ex) { Console.WriteLine (ex); Environment.Exit (3); } - Environment.Exit (0); + Environment.Exit (5); } }