[corlib] Make Marshal.BufferToBSTR(Array, int) non-public again (#5670)
[mono.git] / mcs / tests / gtest-335.cs
1 using System;
2
3 public class TestClass
4 {
5         public static bool Test_1 ()
6         {
7                 DayOfWeek? testEnum = DayOfWeek.Monday;
8                 switch (testEnum) {
9                         case DayOfWeek.Monday:
10                                 return true;
11                 }
12                 return false;
13         }
14         
15         public static bool Test_2 ()
16         {
17                 DayOfWeek? testEnum = null;
18                 switch (testEnum) {
19                         case DayOfWeek.Monday:
20                                 return false;
21                         case null:
22                                 return true;
23                         default:
24                                 return false;
25                 }
26         }
27
28         public static bool Test_3 ()
29         {
30                 DayOfWeek? testEnum = null;
31                 switch (testEnum) {
32                         case DayOfWeek.Monday:
33                                 return false;
34                         default:
35                                 return true;
36                 }
37         }
38
39         public static bool Test_4 ()
40         {
41                 DayOfWeek? testEnum = DayOfWeek.Monday;
42                 switch (testEnum) {
43                 }
44                 return true;
45         }
46         
47         public static bool Test_5 ()
48         {
49                 DayOfWeek? testEnum = DayOfWeek.Wednesday;
50                 switch (testEnum) {
51                         case DayOfWeek.Monday:
52                                 return false;
53                         case DayOfWeek.Wednesday:
54                                 goto case null;
55                         case null:
56                                 return true;
57                         default:
58                                 return false;
59                 }
60         }
61         
62         static int Test_6 ()
63         {
64                 switch ((int?)null){
65                 case 1:
66                         break;
67                 case null:
68                         return 1;
69                 default:
70                         return 3;
71                 }
72                 return 2;
73         }
74         
75         public static int Main()
76         {
77                 if (!Test_1 ())
78                         return 1;
79                 if (!Test_2 ())
80                         return 2;
81                 if (!Test_3 ())
82                         return 3;
83                 if (!Test_4 ())
84                         return 4;
85                 if (!Test_5 ())
86                         return 5;
87                 if (Test_6 () != 1)
88                         return 6;
89
90                 Console.WriteLine ("OK");
91                 return 0;
92         }
93 }