Mark tests as not working under TARGET_JVM
[mono.git] / mcs / class / corlib / Test / System / TypeTest.cs
index 1189ddce487d9227f14b285dad40647217402856..70b07ff249cf5535f546c0e3aa598c00e8b684aa 100644 (file)
@@ -12,6 +12,7 @@ using System;
 using System.Collections;
 using System.IO;
 using System.Reflection;
+using System.Reflection.Emit;
 using System.Runtime.InteropServices;
 
 class NoNamespaceClass {
@@ -136,11 +137,16 @@ namespace MonoTests.System
                        Assert.AreEqual (typeof (ICloneable[][]).IsAssignableFrom (typeof (Duper[][])), true, "#12");
 
                        // Tests for vectors<->one dimensional arrays */
+#if TARGET_JVM // Lower bounds arrays are not supported for TARGET_JVM.
+                       Array arr1 = Array.CreateInstance (typeof (int), new int[] {1});
+                       Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr1.GetType ()), true, "#13");
+#else
                        Array arr1 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {0});
                        Array arr2 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {10});
 
                        Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr1.GetType ()), true, "#13");
                        Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr2.GetType ()), false, "#14");
+#endif // TARGET_JVM
 
                        // Test that arrays of enums can be cast to their base types
                        Assert.AreEqual (typeof (int[]).IsAssignableFrom (typeof (TypeCode[])), true, "#15");
@@ -206,6 +212,7 @@ namespace MonoTests.System
                }
 
                [Test]
+               [Category ("TargetJvmNotWorking")]
                public void TestGetPropertyImpl() {
                        // Test getting property that is exact
                        Assert.AreEqual (typeof (NewVTable), typeof (NewVTable).GetProperty ("Item", new Type[1] { typeof (Int32) }).DeclaringType, "#01");
@@ -217,6 +224,7 @@ namespace MonoTests.System
                        Assert.AreEqual (1, typeof (Derived1).GetProperties ().Length, "#03");
                }
 
+#if !TARGET_JVM // StructLayout not supported for TARGET_JVM
                [StructLayout(LayoutKind.Explicit, Pack = 4, Size = 64)]
                public class Class1 {
                }
@@ -241,6 +249,7 @@ namespace MonoTests.System
                        Assert.AreEqual (CharSet.Unicode, attr3.CharSet);
                }
 #endif
+#endif // TARGET_JVM
 
                [Test]
                public void Namespace () {
@@ -548,6 +557,33 @@ PublicKeyToken=b77a5c561934e089"));
                        Assert.IsNull (i);
                }
 
+#if !TARGET_JVM // Reflection.Emit is not supported for TARGET_JVM
+               [Test]
+               public void EqualsUnderlyingType ()
+               {
+                       AssemblyBuilderAccess access = AssemblyBuilderAccess.RunAndSave;
+                       TypeAttributes attribs = TypeAttributes.Public;
+
+                       AssemblyName name = new AssemblyName ();
+                       name.Name = "enumtest";
+                       AssemblyBuilder assembly = 
+                               AppDomain.CurrentDomain.DefineDynamicAssembly (
+                                                                                                                          name, access);
+
+                       ModuleBuilder module = assembly.DefineDynamicModule 
+                               ("m", "enumtest.dll");
+                       EnumBuilder e = module.DefineEnum ("E", attribs, typeof (int));
+
+                       Assert.IsTrue (typeof (int).Equals (e));
+               }
+#endif // TARGET_JVM
+
+               [Test]
+               public void GetElementType_Bug63841 ()
+               {
+                       Assert.IsNull (typeof (TheEnum).GetElementType (), "#1");
+               }
+
 #if NET_2_0
                [Test]
                public void FullNameGenerics ()