Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / tests / gtest-167.cs
1 // Conditional attribute class test
2 #define DEBUG
3
4 using System;
5 using System.Diagnostics;
6
7 [Conditional("DEBUG")]
8 public class TestAttribute : Attribute {}
9
10 [Conditional("RELEASE")]
11 public class TestNotAttribute : Attribute {}
12
13 [Conditional("A")]
14 [Conditional("DEBUG")]    
15 [Conditional("B")]
16 public class TestMultiAttribute : Attribute {}
17     
18 // TestAttribute is included
19 [Test]                          
20 class Class1 {}
21     
22 // TestNotAttribute is not included
23 [TestNot]                       
24 class Class2 {}
25
26 // Is included    
27 [TestMulti]
28 class Class3 {}
29
30
31 public class TestClass
32 {
33     public static int Main ()
34     {
35         if (Attribute.GetCustomAttributes (typeof (Class1)).Length != 1)
36                 return 1;
37
38         if (Attribute.GetCustomAttributes (typeof (Class2)).Length != 0)
39                 return 1;
40
41         if (Attribute.GetCustomAttributes (typeof (Class3)).Length != 1)
42                 return 1;
43         
44         Console.WriteLine ("OK");
45         return 0;
46     }
47 }