Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gtest-335.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e8632fff0a84c48e3e933508ca50752db573e9ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using System;

public class TestClass
{
	public static bool Test_1 ()
	{
		DayOfWeek? testEnum = DayOfWeek.Monday;
		switch (testEnum) {
			case DayOfWeek.Monday:
				return true;
		}
		return false;
	}
	
	public static bool Test_2 ()
	{
		DayOfWeek? testEnum = null;
		switch (testEnum) {
			case DayOfWeek.Monday:
				return false;
			case null:
				return true;
			default:
				return false;
		}
	}

	public static bool Test_3 ()
	{
		DayOfWeek? testEnum = null;
		switch (testEnum) {
			case DayOfWeek.Monday:
				return false;
			default:
				return true;
		}
	}

	public static bool Test_4 ()
	{
		DayOfWeek? testEnum = DayOfWeek.Monday;
		switch (testEnum) {
		}
		return true;
	}
	
	public static bool Test_5 ()
	{
		DayOfWeek? testEnum = DayOfWeek.Wednesday;
		switch (testEnum) {
			case DayOfWeek.Monday:
				return false;
			case DayOfWeek.Wednesday:
				goto case null;
			case null:
				return true;
			default:
				return false;
		}
	}
	
	static int Test_6 ()
	{
		switch ((int?)null){
		case 1:
			break;
		case null:
			return 1;
		default:
			return 3;
		}
		return 2;
	}
	
	public static int Main()
	{
		if (!Test_1 ())
			return 1;
		if (!Test_2 ())
			return 2;
		if (!Test_3 ())
			return 3;
		if (!Test_4 ())
			return 4;
		if (!Test_5 ())
			return 5;
		if (Test_6 () != 1)
			return 6;

		Console.WriteLine ("OK");
		return 0;
	}
}