5 namespace ExceptionFilterTestLauncher
9 public static object newObject = null;
10 public static bool SubTest(int i)
12 return newObject.GetHashCode() == i;
15 public static bool HandleException(Exception e)
20 public static bool Test2(int i)
27 catch (Exception e) when (!HandleException(e))
33 static void Main(string[] args)
37 bool result = Test2(12345);
41 // Before bug 46661 was fixed, the when would cut the stack trace, so Test(int) wouldn't show up
42 if(!e.StackTrace.Contains("SubTest"))
43 throw new Exception("Stack trace doesn't reference SubTest function. Current stacktrace is " + e.StackTrace.ToString());
48 throw new Exception("Exception should have been caught!");