[bcl] Mobile profiles fixes
authorMarek Safar <marek.safar@gmail.com>
Wed, 6 May 2015 15:11:02 +0000 (17:11 +0200)
committerMarek Safar <marek.safar@gmail.com>
Wed, 6 May 2015 15:11:33 +0000 (17:11 +0200)
external/referencesource
mcs/class/System.Data/Test/Mono.Data.SqlExpressions/DataColumnExpressionTest.cs
mcs/class/System.Data/Test/System.Data/DataSetTest.cs
mcs/class/System.Data/Test/System.Data/DataTableTest.cs
mcs/class/System.XML/System.Xml.Xsl/XslCompiledTransform_Mobile.cs
mcs/class/System.XML/Test/System.Xml.Xsl/XslCompiledTransformTests.cs
mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs
mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs
mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs
mcs/class/corlib/Test/System/TypeTest.cs

index 8d65dc5494fdbd9069376c2e7117cdb1c4aa581c..f4b94800676070a94c32e4f2b1bcd2cbf00f50b5 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 8d65dc5494fdbd9069376c2e7117cdb1c4aa581c
+Subproject commit f4b94800676070a94c32e4f2b1bcd2cbf00f50b5
index 217a30dce28d876cfcf56466daee4d61c5486fc8..84d958a752fcd55813680e894224727d155c1dc1 100644 (file)
@@ -120,18 +120,24 @@ namespace Monotests_Mono.Data.SqlExpressions
        [TestFixture]
        public class DataColumnCharTest
        {
-               private static DataTable _dt = new DataTable();
+               DataTable _dt;
 
-               [Test]
-               public void Test1 ()
+               [SetUp]
+               public void Setup ()
                {
+                       _dt = new DataTable();
+
                        _dt.Columns.Add(new DataColumn("a", typeof(char)));
 
                        AddData('1');
                        AddData('2');
                        AddData('3');
                        AddData('A');
+               }
 
+               [Test]
+               public void Test1 ()
+               {
                        Assert.AreEqual (true, FindRow("'A'"), "Test1-1 failed");
                        Assert.AreEqual (true, FindRow("65"), "Test1-2 failed");
                        Assert.AreEqual (true, FindRow("'1'"), "Test1-3 failed");
@@ -143,13 +149,14 @@ namespace Monotests_Mono.Data.SqlExpressions
                {
                        FindRow("'65'");
                }
+
                [Test]
                public void Test3 ()
                {
                        Assert.AreEqual (false, FindRow ("1"), "Test3-1 failed");
                }
 
-               private static bool FindRow(string f)
+               private bool FindRow(string f)
                {
                        string filter = string.Format("a = {0}", f);
 
@@ -161,7 +168,7 @@ namespace Monotests_Mono.Data.SqlExpressions
                                return true;
                }
 
-               private static void AddData(char a)
+               private void AddData(char a)
                {
                        DataRow row = _dt.NewRow();
                        row["a"] = a;
index 3fbebc38fe2161a31094cda68499bd2854ee450c..560620c3c2a145b950445cc2976533cf251b9134 100644 (file)
@@ -58,6 +58,7 @@ namespace MonoTests.System.Data
                public void Setup () {
                        currentCultureBackup = Thread.CurrentThread.CurrentCulture;
                        Thread.CurrentThread.CurrentCulture = new CultureInfo ("fi-FI");
+                       MyDataSet.count = 0;
                }
 
                //[SetUp]
@@ -2565,7 +2566,7 @@ namespace MonoTests.System.Data
 
         public  class MyDataSet:DataSet {
 
-            public static int count = 0;
+            public static int count;
                                                                                                     
              public MyDataSet() {
 
index 0f2d40ad39a66bceda31268280f56e33d6bd6227..3d8ec00cb189960384f70b3f28f87eafd0b57278 100644 (file)
@@ -54,6 +54,12 @@ namespace MonoTests.System.Data
        [TestFixture]
        public class DataTableTest :  DataSetAssertion
        {
+               [SetUp]
+               public void Setup ()
+               {
+                       MyDataTable.count = 0;
+               }
+
                string EOL = Environment.NewLine;
 
                [Test]
@@ -4173,7 +4179,7 @@ namespace MonoTests.System.Data
 
        public  class MyDataTable : DataTable
        {
-               public static int count = 0;
+               public static int count;
 
                public MyDataTable()
                {
index 896f3e204ce255074fdb76a397b527c727ec517d..808fa1ace2823ced7f8d6f457b77a147170f417f 100644 (file)
@@ -36,6 +36,7 @@ using System.Runtime.InteropServices;
 using System.Security;
 using System.Security.Policy;
 using System.Xml.XPath;
+using System.Xml.XmlConfiguration;
 
 namespace System.Xml.Xsl
 {
@@ -173,18 +174,18 @@ namespace System.Xml.Xsl
 
                public void Load (XmlReader stylesheet)
                {
-                       Load (stylesheet, null, null);
+                       Load (stylesheet, XsltSettings.Default, XsltConfigSection.CreateDefaultResolver());
                }
 
                public void Load (IXPathNavigable stylesheet)
                {
-                       Load (stylesheet.CreateNavigator(), null, null);
+                       Load (stylesheet.CreateNavigator(), XsltSettings.Default, XsltConfigSection.CreateDefaultResolver());
                }
 
                public void Load (IXPathNavigable stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
                {
-                       if (!settings.EnableDocumentFunction)
-                               throw new NotSupportedException ("'document' function cannot be disabled on this framework because it just runs XslTransform which does not support XsltSettings");
+//                     if (!settings.EnableDocumentFunction)
+//                             throw new NotSupportedException ("'document' function cannot be disabled on this framework because it just runs XslTransform which does not support XsltSettings");
                        if (settings.EnableScript)
                                throw new NotSupportedException ("'msxsl:script' element is not supported on this framework because it does not support run-time code generation");
                        impl.Load (stylesheet, stylesheetResolver);
index 6a68818450b53654f6102bc7107b69d229fdb0a9..aa333328d962b5cf0d7640c6500f03d266c21e83 100644 (file)
@@ -36,6 +36,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void MSXslNodeSetAcceptsNodeSet ()
                {
                        string xsl = @"<xsl:stylesheet version='1.0'
@@ -57,6 +58,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void MSXslNodeSetAcceptsEmptyString ()
                {
                        string xsl = @"<xsl:stylesheet version='1.0'
@@ -135,14 +137,19 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
                        t.Load (new XmlTextReader (new StringReader (xsl)));
 
                        var source = "<?xml version='1.0' encoding='utf-8' ?><Node><Name>123</Name></Node>";
+#if MOBILE
+                       var expected = "<?xml version=\"1.0\" encoding=\"utf-16\"?><Node name=\"123\"></Node>";
+#else
                        var expected = "<?xml version=\"1.0\" encoding=\"utf-16\"?><Node name=\"123\" />";
-
+#endif
                        StringWriter sw = new StringWriter ();
-                       t.Transform (new XPathDocument (new XmlTextReader (new StringReader (source))), null, sw);
+                       var xp = new XPathDocument (new XmlTextReader (new StringReader (source)));
+                       t.Transform (xp, null, sw);
                        Assert.AreEqual (expected, sw.ToString ());
                }
                
                [Test] // bug 2917
+               [Category ("MobileNotWorking")]
                public void XslOutputSettings ()
                {
                        XslCompiledTransform xslCompiledTransform = new XslCompiledTransform();
index 129ee6d0bcc4693cafca827dad552fc5a012101c..892e722b990fa64a107f6d39bb74115f4a87be96 100644 (file)
@@ -633,7 +633,7 @@ namespace MonoTests.System.Collections.Generic {
                        }
                }
 
-#if !MONO
+#if !MOBILE
                [Test]
                public void SerializationCompatibilty ()
                {
index 852282a8a1f39753c390f64d61187819370f2969..6ef6cd49e7c17b18b8e38fda4e22408984ab1562 100644 (file)
@@ -347,30 +347,26 @@ namespace MonoTests.System.Reflection
                        Assert.AreEqual (UnmanagedType.ByValTStr, attr.Value, "#E2");
                        Assert.AreEqual (100, attr.SizeConst, "#E3");
 
+#if FEATURE_COMINTEROP
                        attrs = typeof (Class2).GetField ("f3").GetCustomAttributes (true);
                        Assert.AreEqual (1, attrs.Length, "#F1");
                        attr = (MarshalAsAttribute) attrs [0];
-#if FEATURE_COMINTEROP
                        Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#F2");
-#endif
+
                        Assert.AreEqual ("5", attr.MarshalCookie, "#F3");
                        Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#F4");
 
                        attrs = typeof (Class3).GetField ("f3").GetCustomAttributes (false);
                        Assert.AreEqual (1, attrs.Length, "#G1");
                        attr = (MarshalAsAttribute) attrs [0];
-#if FEATURE_COMINTEROP
                        Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#G2");
-#endif
                        Assert.AreEqual ("5", attr.MarshalCookie, "#G3");
                        Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#G4");
 
                        attrs = typeof (Class3).GetField ("f3").GetCustomAttributes (true);
                        Assert.AreEqual (1, attrs.Length, "#H1");
                        attr = (MarshalAsAttribute) attrs [0];
-#if FEATURE_COMINTEROP
                        Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#H2");
-#endif
                        Assert.AreEqual ("5", attr.MarshalCookie, "#H3");
                        Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#H4");
 
@@ -378,11 +374,10 @@ namespace MonoTests.System.Reflection
                        attrs = typeof (Class2).GetField ("f3").GetCustomAttributes (true);
                        Assert.AreEqual (1, attrs.Length, "#I1");
                        attr = (MarshalAsAttribute) attrs [0];
-#if FEATURE_COMINTEROP
                        Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#I2");
-#endif
                        Assert.AreEqual ("5", attr.MarshalCookie, "#I3");
                        Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#I4");
+#endif
                }
 
                // Disable "field not used warning", this is intended.
index c37ffea83ee0ef8863964386de58a77365e9bb50..88690944df3851ad2a9d846b0fbbae50723d8eb5 100644 (file)
@@ -90,6 +90,7 @@ namespace MonoTests.System.Resources
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                [ExpectedException (typeof (BadImageFormatException))]
                public void ConstructorString_Bad ()
                {
index b308e9eed298f9c6ef85a5bf7631d9adc46fb648..9f87bcd74d19a29f1b4e41b2d7171f2c1af2835c 100644 (file)
@@ -3058,6 +3058,9 @@ namespace MonoTests.System
                }
 
                [Test]
+#if MONOTOUCH
+               [ExpectedException (typeof (NotSupportedException))]
+#endif
                public void MakeGenericType_NestedUserDefinedType ()
                {
                        Type ut = new UserType (new UserType (typeof (int)));
@@ -3072,6 +3075,9 @@ namespace MonoTests.System
                }
                
                [Test]
+#if MONOTOUCH
+               [ExpectedException (typeof (NotSupportedException))]
+#endif
                public void TestMakeGenericType_UserDefinedType_DotNet20SP1 () 
                {
                        Type ut = new UserType(typeof(int));