[tests] Make failures more descriptive and fix XA
[mono.git] / mcs / class / corlib / Test / System.Reflection / ModuleTest.cs
index 98500228c2d3d3e2b11b949299d72494691a492d..04c941a9526990a454ac899564955ff30a3ca82a 100644 (file)
@@ -10,7 +10,9 @@
 using System;
 using System.Threading;
 using System.Reflection;
+#if !MONOTOUCH
 using System.Reflection.Emit;
+#endif
 using System.Runtime.Serialization;
 using System.IO;
 using System.Collections;
@@ -91,7 +93,7 @@ public class ModuleTest
        }
 
        // Some of these tests overlap with the tests for ModuleBuilder
-
+#if !MONOTOUCH
        [Test]
        [Category("NotDotNet")] // path length can cause suprious failures
        public void TestGlobalData () {
@@ -151,8 +153,8 @@ public class ModuleTest
                Assert.IsNull (m2.GetField ("DATA"), "#B3");
                Assert.IsNull (m2.GetField ("DATA", BindingFlags.Public), "#B4");
        }
+#endif
 
-#if NET_2_0
        [Test]
        public void ResolveType ()
        {
@@ -191,19 +193,19 @@ public class ModuleTest
 
                try {
                        module.ResolveMethod (1234);
-                       Assert.Fail ();
+                       Assert.Fail ("1234");
                } catch (ArgumentException) {
                }
 
                try {
                        module.ResolveMethod (t.MetadataToken);
-                       Assert.Fail ();
+                       Assert.Fail ("MetadataToken");
                } catch (ArgumentException) {
                }
 
                try {
-                       module.ResolveMethod (t.GetMethod ("ResolveMethod").MetadataToken + 10000);
-                       Assert.Fail ();
+                       module.ResolveMethod (t.GetMethod ("ResolveMethod").MetadataToken + 100000);
+                       Assert.Fail ("GetMethod");
                } catch (ArgumentOutOfRangeException) {
                }
        }
@@ -301,7 +303,6 @@ public class ModuleTest
                MethodBase res = mod.ResolveMethod (method.MetadataToken);
                Assert.AreEqual (method, res, "#1");
        }
-#endif
 
        [Test]
        public void FindTypes ()
@@ -327,8 +328,9 @@ public class ModuleTest
                Module m = typeof (ModuleTest).Module;
                m.GetObjectData (null, new StreamingContext (StreamingContextStates.All));
        }
-
+#if !MONOTOUCH
        [Test]
+       [Category ("AndroidNotWorking")] // Mono.CompilerServices.SymbolWriter not available for Xamarin.Android
        public void GetTypes ()
        {
                AssemblyName newName = new AssemblyName ();
@@ -353,7 +355,7 @@ public class ModuleTest
                Assert.AreEqual (1, types.Count);
                Assert.AreEqual ("Foo", ((Type)(types [0])).Name);
        }
-
+#endif
        class FindTypesTestFirstClass {
        }