Ensure the linker does not remove some types needed (thru reflection) for some test...
authorSebastien Pouliot <sebastien@xamarin.com>
Tue, 19 Mar 2013 18:06:45 +0000 (14:06 -0400)
committerSebastien Pouliot <sebastien@xamarin.com>
Tue, 19 Mar 2013 18:07:17 +0000 (14:07 -0400)
mcs/class/System/Test/System.ComponentModel.Design.Serialization/InstanceDescriptorTest.cs
mcs/class/System/Test/System.ComponentModel/TypeDescriptorTests.cs

index 7fe4c29dbf31c7a481226a7250c810356e389cba..16d12af943c993e9ac2a8cfbb46a474b760b2d86 100644 (file)
@@ -188,6 +188,10 @@ namespace MonoTests.System.ComponentModel.Design.Serialization {
                [Test]
                public void Property_Arguments_Mismatch ()
                {
+#if MOBILE
+                       // ensure the property is not linked out of the application since it make the test fails
+                       Assert.NotNull (Thread.CurrentPrincipal, "pre-test");
+#endif
                        PropertyInfo pi = typeof (Thread).GetProperty ("CurrentPrincipal");
 
                        InstanceDescriptor id = new InstanceDescriptor (pi, new object [] { url });
@@ -207,6 +211,10 @@ namespace MonoTests.System.ComponentModel.Design.Serialization {
                [Test]
                public void Property_Arguments_Null ()
                {
+#if MOBILE
+                       // ensure the property is not linked out of the application since it make the test fails
+                       Assert.NotNull (Thread.CurrentPrincipal, "pre-test");
+#endif
                        PropertyInfo pi = typeof (Thread).GetProperty ("CurrentPrincipal");
 
                        InstanceDescriptor id = new InstanceDescriptor (pi, null);
index 2fdd8db64d109efc49cba925b3c0c19db84036b8..a09776a9c00b41810928d26ee0e118948744c9de 100644 (file)
@@ -1465,6 +1465,10 @@ namespace MonoTests.System.ComponentModel
                [Test]
                public void GetProperties_Order ()
                {
+#if MOBILE
+                       // Component.Container will be be linked out (when using Link SDK) if unused
+                       Assert.Null (new Component ().Container, "pre-test");
+#endif
                        MyComponent com = new MyComponent (new MyContainer ());
 
                        PropertyDescriptorCollection col = TypeDescriptor.GetProperties (com);