X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Ftests%2Fstatic-constructor.cs;h=89df82d896672aee64d806b09379011edd315430;hb=824b01d4fc38d6f44caef08039865be205418a9c;hp=9d91534d264280707eb9807394482b09edc8f1b2;hpb=b84546d273a18c53aeb74181345ee7fab6c09ce4;p=mono.git diff --git a/mono/tests/static-constructor.cs b/mono/tests/static-constructor.cs index 9d91534d264..89df82d8966 100644 --- a/mono/tests/static-constructor.cs +++ b/mono/tests/static-constructor.cs @@ -52,8 +52,8 @@ public class Tests { ConstructorInfo con1 = typeof (A).GetConstructor (BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type [1] { typeof (int) }, null); ConstructorInfo con2 = typeof (B).GetConstructor (BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type [1] { typeof (int) }, null); - con1.Invoke (null, new Object [] { 0 }); - con2.Invoke (null, new Object [] { 0 }); + con1.Invoke (new Object [] { 0 }); + con2.Invoke (new Object [] { 0 }); // Test what happens when static initialization throws an exception // First start a thread which will trigger the initialization @@ -65,7 +65,7 @@ public class Tests { // While the thread waits, trigger initialization on this thread too so this // thread will wait for the other thread to finish initialization try { - Run (); + Run2 (); return 1; } catch (TypeInitializationException ex) { @@ -73,7 +73,7 @@ public class Tests { // Try again synchronously try { - Run (); + Run2 (); return 1; } catch (TypeInitializationException ex) { @@ -83,6 +83,15 @@ public class Tests { } private static void Run () { + try { + StaticInitFails.foo (); + } + catch (Exception) { + } + } + + private static void Run2 () { StaticInitFails.foo (); } + }