static void Test3 ()
{
Console.WriteLine ("Test 3:");
+ bool catched_abort = false;
Driver.mre1.Reset ();
Driver.mre2.Reset ();
Environment.Exit (7);
} catch (ThreadAbortException e) {
Console.WriteLine ("TEST 3: aborted {0}", e);
+ catched_abort = true;
}
});
thread.Join ();
+ // Did we catch the abort
+ if (!catched_abort)
+ Environment.Exit (8);
+
//is StaticConstructor2 viable?
try {
IsStaticConstructor3Viable ();
Console.WriteLine ("StaticConstructor3 is viable");
/* A regular exception escaping the .cctor makes the type not usable */
- Environment.Exit (8);
+ Environment.Exit (9);
} catch (TypeInitializationException e) {
Console.WriteLine ("StaticConstructor3 not viable");
}
new StaticConstructor4 ();
Console.WriteLine ("IsStaticConstructor4Viable: Did it get to the end? {0} Did it catch an exception {1} and end of the finally block {2}", StaticConstructor4.gotToEnd, StaticConstructor4.caughtException, got_to_the_end_of_the_finally);
if (!StaticConstructor4.gotToEnd) /* the TAE must not land during a .cctor */
- Environment.Exit (9);
- if (StaticConstructor4.caughtException)
Environment.Exit (10);
+ if (StaticConstructor4.caughtException)
+ Environment.Exit (11);
}
static void Test4 ()
if (!got_to_the_end_of_the_finally) {
Console.WriteLine ("Did not get to the end of test 4 cctor");
- Environment.Exit (11);
+ Environment.Exit (12);
}
//is StaticConstructor4viable?
Console.WriteLine ("StaticConstructor4 is viable"); /* a TAE doesn't make a type unusable */
} catch (TypeInitializationException e) {
Console.WriteLine ("StaticConstructor4 not viable");
- Environment.Exit (12);
+ Environment.Exit (13);
}
}