Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / custom-attr.cs
index 40dbae17ddb9c93060eeef27c4b87577892b720a..b8d35607ae6dc3411731a31bead8c26b96274408 100644 (file)
@@ -49,6 +49,10 @@ namespace Test {
        [X, Z, Serializable]
        class Y {
        }
+
+       [My("arg\0string\0with\0nuls")]
+       class NulTests {
+       }
                        
        [My("testclass")]
        [My2("testclass", 22)]
@@ -99,6 +103,17 @@ namespace Test {
                        if (typeof (Y).GetCustomAttributes (typeof (ZInterface), true).Length != 1)
                                return 5;
 
+                       if (!typeof (Y).IsDefined (typeof (ZInterface), true))
+                               return 6;
+
+                       // Test that synthetic methods have no attributes
+                       if (typeof(int[,]).GetConstructor (new Type [] { typeof (int), typeof (int) }).GetCustomAttributes (true).Length != 0)
+                               return 7;
+
+                       // Test that nuls are preserved (see Xamarin bug 5732)
+                       if (((MyAttribute)typeof (NulTests).GetCustomAttributes (true)[0]).val != "arg\0string\0with\0nuls")
+                               return 8;
+
                        return 0;
                }
        }