projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #5428 from kumpera/wasm-support-p2
[mono.git]
/
mono
/
tests
/
unhandled-exception-4.cs
diff --git
a/mono/tests/unhandled-exception-4.cs
b/mono/tests/unhandled-exception-4.cs
index 9658316854b390467d7e4e297c77688167f4f1ff..4a85514e58bf8f9e7ee11817ef455cf4b16e471e 100644
(file)
--- a/
mono/tests/unhandled-exception-4.cs
+++ b/
mono/tests/unhandled-exception-4.cs
@@
-9,9
+9,12
@@
class CustomException : Exception
class Driver
{
class Driver
{
- /* expected exit code:
0
*/
+ /* expected exit code:
255
*/
static void Main (string[] args)
{
static void Main (string[] args)
{
+ if (Environment.GetEnvironmentVariable ("TEST_UNHANDLED_EXCEPTION_HANDLER") != null)
+ AppDomain.CurrentDomain.UnhandledException += (s, e) => {};
+
ManualResetEvent mre = new ManualResetEvent (false);
var t = Task.Factory.StartNew (new Action (() => { try { throw new CustomException (); } finally { mre.Set (); } }));
ManualResetEvent mre = new ManualResetEvent (false);
var t = Task.Factory.StartNew (new Action (() => { try { throw new CustomException (); } finally { mre.Set (); } }));
@@
-23,13
+26,16
@@
class Driver
t.Wait ();
Environment.Exit (5);
} catch (AggregateException ae) {
t.Wait ();
Environment.Exit (5);
} catch (AggregateException ae) {
- if (!(ae.InnerExceptions [0] is CustomException))
- Environment.Exit (4);
+ Console.WriteLine (ae);
+ if (ae.InnerExceptions [0] is CustomException) {
+ /* expected behaviour */
+ Environment.Exit (255);
+ }
} catch (Exception ex) {
Console.WriteLine (ex);
Environment.Exit (3);
}
} catch (Exception ex) {
Console.WriteLine (ex);
Environment.Exit (3);
}
- Environment.Exit (
0
);
+ Environment.Exit (
6
);
}
}
}
}