2009-02-10 Jeffrey Stedfast <fejj@novell.com>
[mono-project/dkf.git] / mcs / tests / gtest-167.cs
blob304cec422b950ff3f153067b8ccf43741d7274cf
1 // Conditional attribute class test
2 #define DEBUG
4 using System;
5 using System.Diagnostics;
7 [Conditional("DEBUG")]
8 public class TestAttribute : Attribute {}
10 [Conditional("RELEASE")]
11 public class TestNotAttribute : Attribute {}
13 [Conditional("A")]
14 [Conditional("DEBUG")]
15 [Conditional("B")]
16 public class TestMultiAttribute : Attribute {}
18 // TestAttribute is included
19 [Test]
20 class Class1 {}
22 // TestNotAttribute is not included
23 [TestNot]
24 class Class2 {}
26 // Is included
27 [TestMulti]
28 class Class3 {}
31 public class TestClass
33 public static int Main ()
35 if (Attribute.GetCustomAttributes (typeof (Class1)).Length != 1)
36 return 1;
38 if (Attribute.GetCustomAttributes (typeof (Class2)).Length != 0)
39 return 1;
41 if (Attribute.GetCustomAttributes (typeof (Class3)).Length != 1)
42 return 1;
44 Console.WriteLine ("OK");
45 return 0;