diff options
author | Miguel de Icaza <miguel@gnome.org> | 2003-10-15 08:26:44 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2003-10-15 08:26:44 +0400 |
commit | 48ed348569c24c6e631c4dd9daaf0a0c56fc69df (patch) | |
tree | e4a2119d2240234c39b6c307163a18cc1a5f0157 /mcs/tests/test-49.cs | |
parent | fea49b13440e28380035be0961faa778963cbb81 (diff) |
2003-10-15 Miguel de Icaza <miguel@ximian.com>
* test-49.cs: Improved test with input from bug #48761
svn path=/trunk/mcs/; revision=19065
Diffstat (limited to 'mcs/tests/test-49.cs')
-rwxr-xr-x | mcs/tests/test-49.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mcs/tests/test-49.cs b/mcs/tests/test-49.cs index 3cef3539c1d..0c557b0e4a4 100755 --- a/mcs/tests/test-49.cs +++ b/mcs/tests/test-49.cs @@ -447,6 +447,42 @@ class X { return 2; } } + + public enum TestEnum : long { + a, b, c + } + + public static int testSwitchEnumLong (TestEnum c) + { + + switch (c) { + case TestEnum.a: + return 10; + + case TestEnum.b: + return 20; + + case TestEnum.c: + return 30; + + default: + return 40; + } + + } + + static int test_long_enum_switch () + { + if (testSwitchEnumLong (TestEnum.a) != 10) + return 1; + if (testSwitchEnumLong (TestEnum.b) != 20) + return 2; + if (testSwitchEnumLong (TestEnum.c) != 30) + return 3; + if (testSwitchEnumLong ((TestEnum)5) != 40) + return 4; + return 0; + } static int Main () { @@ -554,6 +590,9 @@ class X { if (test_casts (0) != 1) return 41; + if (test_long_enum_switch () != 0) + return 42; + Console.WriteLine ("All tests pass"); return 0; } |