summaryrefslogtreecommitdiff
path: root/Examples/test-suite/csharp/rename_pcre_enum_runme.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/csharp/rename_pcre_enum_runme.cs')
-rw-r--r--Examples/test-suite/csharp/rename_pcre_enum_runme.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Examples/test-suite/csharp/rename_pcre_enum_runme.cs b/Examples/test-suite/csharp/rename_pcre_enum_runme.cs
new file mode 100644
index 000000000..0143eda33
--- /dev/null
+++ b/Examples/test-suite/csharp/rename_pcre_enum_runme.cs
@@ -0,0 +1,24 @@
+using System;
+using rename_pcre_enumNamespace;
+
+public class runme {
+ static void Main() {
+ Foo foo = Foo.First;
+ if ( foo == Foo.Second )
+ throw new Exception("Enum values should be different");
+
+ // Check that Foo_Max enum element was ignored.
+ int numFooEnumElements = Enum.GetValues(typeof(Foo)).Length;
+ if ( numFooEnumElements != 2 )
+ throw new Exception(String.Format("Enum should have 2 elements, not {0}",
+ numFooEnumElements));
+
+ BoundaryCondition bc = BoundaryCondition.MaxMax;
+ if ( (int)bc != 2 )
+ throw new Exception("Wrong enum value");
+
+ Colour c = Colour.red;
+ if ( c == Colour.blue )
+ throw new Exception("Enum values should be different");
+ }
+}