grammar updates
[mono.git] / mono / tests / exception.cs
index acbaa5f8cac7ed092e87e3fe1405ce718e71a391..c60e9a3b500f501a926bd0fdf74874ef63065da2 100755 (executable)
@@ -2,21 +2,48 @@ using System;
 
 public class Ex {
 
+       int p;
+       
+       public static int test1 () {
+                Ex x = null;
+               
+               try {
+                       x.p = 1;
+               } catch (NullReferenceException) {
+                       return 0;
+               }
+               return 1;
+       }
+       
        public static int test (int a) {
                int res;
+               int fin = 0;
                try {
                        res = 10/a;
                } catch (DivideByZeroException ex) {
-                       res = 3;
+                       if (fin != 1)
+                               res = 34;
+                       else
+                               res = 33;
                } catch {
-                       res = 2;
+                       if (fin != 1)
+                               res = 24;
+                       else
+                               res = 22;
                } finally {
-                       res = 0;
+                       fin = 1;
                }
                return res;
        }
        public static int Main () {
-               return test (0);
+               if (test(1) != 10)
+                       return 1;
+               if (test(0) != 34)
+                       return 2;
+               if (test1() != 0)
+                       return 3;
+               
+               return 0;
        }
 }