Tue Aug 21 18:54:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / tests / exception3.cs
1 using System;
2
3 public class MyEx : Exception {
4         public MyEx () {}
5 }
6
7 public class Ex {
8
9         public static int test (int a) {
10                 int res;
11                 int fin = 0;
12                 try {
13                         res = 10/a;
14                         throw new MyEx ();
15                 } catch (DivideByZeroException ex) {
16                         if (fin != 1)
17                                 res = 34;
18                         else
19                                 res = 33;
20                 } finally {
21                         fin = 1;
22                 }
23                 return res;
24         }
25         public static int Main () {
26                 int catched = 0;
27                 try {
28                         test (1);
29                 } catch (MyEx ex) {
30                         catched = 1;
31                 }
32                 if (catched != 1)
33                         return 2;
34                 if (test(0) != 33)
35                         return 3;
36                 return 0;
37         }
38 }
39
40