[System.ServiceModel] Prevent crash in Dispatcher.ListenerLoopManager… (#7136)
[mono-project.git] / mono / tests / switch.cs
blob8310684808d49065cb67e7f483ef8ca0dbff6936
1 public class Switch {
3 public static int test (int n) {
4 switch (n) {
5 case 0: return 1;
6 case 1: return 0;
7 case -1: return 2;
8 default:
9 return 0xff;
11 return 100;
14 const string long_str =
15 "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}partnerLinks";
17 // bug #54473
18 public static int test_string (string s) {
19 switch (s) {
20 case "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}partnerLinks":
21 return 1;
22 default:
23 return 0;
27 public static int Main () {
28 if (test(0) != 1)
29 return 1;
30 if (test(1) != 0)
31 return 2;
32 if (test(-1) != 2)
33 return 3;
34 if (test(3) != 0xff)
35 return 4;
36 if (test_string (long_str) != 1)
37 return 5;
38 return 0;