From: Eyal Alalouf Date: Wed, 14 Mar 2007 10:47:05 +0000 (-0000) Subject: Mark tests as not working under TARGET_JVM X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=30c28c41d7859b7de6ecd7afb652468517048d12;hp=-c;p=mono.git Mark tests as not working under TARGET_JVM svn path=/trunk/mcs/; revision=74246 --- 30c28c41d7859b7de6ecd7afb652468517048d12 diff --combined mcs/class/corlib/Test/ChangeLog index dbca6f93afb,8d6605d3c21..631a60b5c0f --- a/mcs/class/corlib/Test/ChangeLog +++ b/mcs/class/corlib/Test/ChangeLog @@@ -1,11 -1,3 +1,15 @@@ - 200703-05 Eyal Alaluf ++2007-03-14 Eyal Alaluf ++ ++ * Mark tests as not working under TargetJvm ++ ++2007-03-05 Eyal Alaluf + + * Port tests to run under TARGET_JVM. + - 200703-05 Roei Erez ++2007-03-05 Roei Erez + + * StringTest.cs: add test for string properties. + 200702-20 Boris Kirzner * Mscorlib.Test20.sln, Mscorlib.Test20.vmwcsproj, diff --combined mcs/class/corlib/Test/Mscorlib.Test20.csproj index 24ce8488bcb,a2987fe9645..78f2b2846c1 --- a/mcs/class/corlib/Test/Mscorlib.Test20.csproj +++ b/mcs/class/corlib/Test/Mscorlib.Test20.csproj @@@ -24,7 -24,6 +24,7 @@@ TRACE;DEBUG;JAVA;NET_2_0;NET_1_1;TARGET_JVM prompt 4 + 67, 169, 168, 219, 414, 618, 628, 649, 672, 688 285212672 True False @@@ -39,7 -38,6 +39,7 @@@ TRACE;JAVA prompt 4 + 67, 169, 168, 219, 414, 618, 628, 649, 672, 688 285212672 false false @@@ -60,6 -58,6 +60,10 @@@ ++ ++ ..\..\lib\J2SE.Helpers.dll ++ False ++ @@@ -88,21 -86,34 +92,21 @@@ - - - - - - -- ++ - - - - - - - @@@ -116,12 -127,40 +120,12 @@@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@@ -132,6 -171,14 +136,6 @@@ - - - - - - - - @@@ -159,6 -206,6 +163,7 @@@ ++ @@@ -166,6 -213,10 +171,6 @@@ - - - - @@@ -178,9 -229,18 +183,9 @@@ Code - - Code - Code - - Code - - - Code - Code @@@ -251,6 -311,9 +256,6 @@@ Code - - Code - Code @@@ -278,12 -341,18 +283,12 @@@ Code - - Code - Code Code - - Code - Code @@@ -320,6 -389,9 +325,6 @@@ Code - - Code - Code @@@ -332,6 -404,9 +337,6 @@@ Code - - Code - Code @@@ -378,4 -453,4 +383,4 @@@ - + diff --combined mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs index 09e12a9eb79,3192530e0ee..95f034bb5b9 --- a/mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs +++ b/mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs @@@ -543,6 -543,6 +543,7 @@@ namespace MonoTests.System.Collections. } [Test] ++ [Category ("TargetJvmNotWorking")] // BUGBUG Very very slow on TARGET_JVM. public void SerializationTest() { for (int i = 0; i < 50; i++) @@@ -681,15 -681,6 +682,15 @@@ IDictionary d = new Dictionary (); d.Remove (null); } + + [Test] + public void IDictionary_IndexerGetNonExistingTest () + { + IDictionary d = new Dictionary (); + d.Add(1, 2); + Assert.IsNull(d[2]); + Assert.IsNull(d["foo"]); + } } } diff --combined mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs index fde491bf91e,8004600953f..a6951d9fe6c --- a/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs +++ b/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs @@@ -141,27 -141,6 +141,27 @@@ namespace MonoTests.System.Collections. newRange.InsertRange (newRange.Count, li); Assert.AreEqual (2, newRange.Count); } + + [Test] + public void InsertSelfTest() + { + List range = new List (5); + for (int i = 0; i < 5; ++ i) + range.Add (i); + + range.InsertRange(2, range); + Assert.AreEqual (10, range.Count); + Assert.AreEqual (0, range [0]); + Assert.AreEqual (1, range [1]); + Assert.AreEqual (0, range [2]); + Assert.AreEqual (1, range [3]); + Assert.AreEqual (2, range [4]); + Assert.AreEqual (3, range [5]); + Assert.AreEqual (4, range [6]); + Assert.AreEqual (2, range [7]); + Assert.AreEqual (3, range [8]); + Assert.AreEqual (4, range [9]); + } [Test, ExpectedException (typeof (ArgumentNullException))] public void InsertRangeNullTest () @@@ -186,29 -165,6 +186,29 @@@ Assert.AreEqual (1, l.IndexOf (200), "Could not find value"); } + + [Test, ExpectedException(typeof (ArgumentException))] + public void IList_InsertInvalidType () + { + IList list = _list1 as IList; + list.Insert(0, new object()); + } + + [Test, ExpectedException(typeof (ArgumentException))] + public void IList_AddInvalidType() + { + IList list = _list1 as IList; + list.Add(new object()); + } + + [Test] + public void IList_RemoveInvalidType() + { + IList list = _list1 as IList; + int nCount = list.Count; + list.Remove(new object()); + Assert.AreEqual(nCount, list.Count); + } [Test, ExpectedException (typeof (ArgumentOutOfRangeException))] public void IndexOfOutOfRangeTest () @@@ -321,6 -277,6 +321,7 @@@ } [Test] ++ [Category ("TargetJvmNotWorking")] public void SerializeTest () { List list = new List (); @@@ -328,7 -284,7 +329,11 @@@ list.Add (0); list.Add (7); ++#if TARGET_JVM ++ BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false); ++#else BinaryFormatter bf = new BinaryFormatter (); ++#endif // TARGET_JVM MemoryStream ms = new MemoryStream (); bf.Serialize (ms, list); @@@ -340,13 -296,13 +345,18 @@@ } [Test] ++ [Category ("TargetJvmNotWorking")] public void DeserializeTest () { MemoryStream ms = new MemoryStream (); ms.Write (_serializedList, 0, _serializedList.Length); ms.Position = 0; ++#if TARGET_JVM ++ BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false); ++#else BinaryFormatter bf = new BinaryFormatter (); ++#endif // TARGET_JVM List list = (List) bf.Deserialize (ms); Assert.AreEqual (3, list.Count, "#1"); Assert.AreEqual (5, list [0], "#2"); @@@ -1075,22 -1031,6 +1085,22 @@@ l.Sort (); // two element -> sort -> exception! } + + [Test] + void IList_Contains_InvalidType() + { + List list = new List(); + list.Add("foo"); + Assert.IsFalse (((IList)list).Contains(new object())); + } + + [Test] + void IList_IndexOf_InvalidType() + { + List list = new List(); + list.Add("foo"); + Assert.AreEqual (-1, ((IList)list).IndexOf(new object())); + } // for bug #77277 test case [Test] @@@ -1111,22 -1051,6 +1121,22 @@@ Assert.AreEqual (2, list.LastIndexOf (item0), "#4"); Assert.AreEqual (2, list.LastIndexOf (new EquatableClass (0)), "#5"); } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void SetItem_OutOfRange() + { + List list = new List(); + list[0] = "foo"; + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void SetItem_IList_OutOfRange() + { + IList list = new List(); + list[0] = "foo"; + } public class EquatableClass : IEquatable { diff --combined mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs index a810cf66bdc,a810cf66bdc..7343d515878 --- a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs +++ b/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs @@@ -138,9 -138,9 +138,6 @@@ namespace MonoTests.System.Collections }; [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif public void SerializationRoundtrip () { CaseInsensitiveHashCodeProvider enus = new CaseInsensitiveHashCodeProvider (new CultureInfo ("en-US")); @@@ -155,12 -155,12 +152,13 @@@ } [Test] --#if TARGET_JVM -- [Category ("NotWorking")] --#endif public void Deserialize () { ++#if TARGET_JVM ++ BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false); ++#else BinaryFormatter bf = new BinaryFormatter (); ++#endif // TARGET_JVM MemoryStream ms = new MemoryStream (serialized_en_us); CaseInsensitiveHashCodeProvider enus = (CaseInsensitiveHashCodeProvider) bf.Deserialize (ms); diff --combined mcs/class/corlib/Test/System.Collections/HashtableTest.cs index 2db98b7dc8d,2db98b7dc8d..e8c364ae500 --- a/mcs/class/corlib/Test/System.Collections/HashtableTest.cs +++ b/mcs/class/corlib/Test/System.Collections/HashtableTest.cs @@@ -411,9 -411,9 +411,6 @@@ public class HashtableTest : Assertion } [Test] --#if TARGET_JVM -- [Category ("NotWorking")] --#endif public void TestCopyTo() { { bool errorThrown = false; @@@ -502,6 -502,6 +499,13 @@@ h['b'] = 2; DictionaryEntry[] o = new DictionaryEntry[2]; h.CopyTo(o,0); ++#if TARGET_JVM // Hashtable is not an ordered collection! ++ if (o[0].Key.Equals('b')) { ++ DictionaryEntry v = o[0]; ++ o[0] = o[1]; ++ o[1] = v; ++ } ++#endif // TARGET_JVM AssertEquals("first copy fine.", 'a', o[0].Key); AssertEquals("first copy fine.", 1, o[0].Value); AssertEquals("second copy fine.", 'b', o[1].Key); @@@ -533,25 -533,25 +537,23 @@@ public void TestSerialization () { Hashtable table1 = new Hashtable(); Hashtable table2; -- Stream str = new MemoryStream (); ++ Stream str = new MemoryStream (); BinaryFormatter formatter = new BinaryFormatter(); for (int i = 0; i < 100; i++) -- table1[i] = "TestString Key: " + i.ToString(); -- -- formatter.Serialize (str, table1); -- str.Position = 0; -- table2 = (Hashtable) formatter.Deserialize (str); ++ table1[i] = "TestString Key: " + i.ToString(); ++ ++ formatter.Serialize (str, table1); ++ str.Position = 0; ++ table2 = (Hashtable) formatter.Deserialize (str); bool result; -- foreach (DictionaryEntry de in table1) ++ foreach (DictionaryEntry de in table1) AssertEquals (de.Value, table2 [de.Key]); } [Test] --#if TARGET_JVM -- [Category ("NotWorking")] --#endif ++ [Category ("TargetJvmNotWorking")] public void TestSerialization2 () { // Test from bug #70570 MemoryStream stream = new MemoryStream(); diff --combined mcs/class/corlib/Test/System.Globalization/CompareInfoTest.jvm.cs index 00000000000,00000000000..8b3d1457a62 new file mode 100644 --- /dev/null +++ b/mcs/class/corlib/Test/System.Globalization/CompareInfoTest.jvm.cs @@@ -1,0 -1,0 +1,690 @@@ ++// CompareInfoTest.cs - NUnit Test Cases for the ++// System.Globalization.CompareInfo class ++// ++// Dick Porter ++// Atsushi Enomoto ++// ++// (C) 2003-2005 Novell, Inc. http://www.novell.com ++// ++ ++using NUnit.Framework; ++using System; ++using System.Globalization; ++ ++namespace MonoTests.System.Globalization ++{ ++ ++[TestFixture] ++public class CompareInfoTest : Assertion ++{ ++ static bool doTest = Environment.GetEnvironmentVariable ("MONO_DISABLE_MANAGED_COLLATION") != "yes"; ++ ++ public CompareInfoTest() {} ++ ++ [Test] ++ public void Compare() ++ { ++ string s1 = "foo"; ++ ++ AssertEquals ("Compare two empty strings", 0, CultureInfo.InvariantCulture.CompareInfo.Compare ("", "")); ++ AssertEquals ("Compare string with empty string", 1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, "")); ++ AssertEquals ("Compare empty string with string", -1, CultureInfo.InvariantCulture.CompareInfo.Compare ("", s1)); ++ ++ AssertEquals ("Compare two empty strings, with 0 offsets", 0, CultureInfo.InvariantCulture.CompareInfo.Compare ("", 0, "", 0)); ++ AssertEquals ("Compare string with empty string, with 0 offsets", 1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, 0, "", 0)); ++ AssertEquals ("Compare empty string with string, with 0 offsets", -1, CultureInfo.InvariantCulture.CompareInfo.Compare ("", 0, s1, 0)); ++ ++ AssertEquals ("Compare two empty strings, with 0 offsets and specified lengths", 0, CultureInfo.InvariantCulture.CompareInfo.Compare ("", 0, "".Length, "", 0, "".Length)); ++ AssertEquals ("Compare string with empty string, with 0 offsets and specified lengths", 1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, 0, s1.Length, "", 0, "".Length)); ++ AssertEquals ("Compare empty string with string, with 0 offsets and specified lengths", -1, CultureInfo.InvariantCulture.CompareInfo.Compare ("", 0, "".Length, s1, 0, s1.Length)); ++ ++ AssertEquals ("Compare two strings, with offsets == string lengths", 0, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, s1.Length, s1, s1.Length)); ++ AssertEquals ("Compare two strings, with first offset == string length", -1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, s1.Length, s1, 0)); ++ AssertEquals ("Compare two strings, with second offset == string length", 1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, 0, s1, s1.Length)); ++ ++ AssertEquals ("Compare two strings, with zero lengths", 0, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, 0, 0, s1, 0, 0)); ++ AssertEquals ("Compare two strings, with first length zero", -1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, 0, 0, s1, 0, s1.Length)); ++ AssertEquals ("Compare strings, with second length zero", 1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, 0, s1.Length, s1, 0, 0)); ++ ++ } ++ ++ // Culture-sensitive collation tests ++ ++ CompareInfo invariant = CultureInfo.InvariantCulture.CompareInfo; ++ CompareInfo french = new CultureInfo ("fr").CompareInfo; ++ CompareInfo japanese = new CultureInfo ("ja").CompareInfo; ++ CompareInfo czech = new CultureInfo ("cs").CompareInfo; ++ CompareInfo hungarian = new CultureInfo ("hu").CompareInfo; ++ ++ CompareOptions ignoreCN = ++ CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase; ++ ++ void AssertCompare (string message, int result, string s1, string s2) ++ { ++ AssertCompare (message, result, s1, s2, CompareOptions.None); ++ } ++ ++ void AssertCompare (string message, int result, string s1, string s2, ++ CompareOptions opt) ++ { ++ AssertCompare (message, result, s1, s2, opt, invariant); ++ } ++ ++ void AssertCompare (string message, int result, string s1, string s2, ++ CompareOptions opt, CompareInfo ci) ++ { ++ int ret = ci.Compare (s1, s2, opt); ++ if (result == 0) ++ AssertEquals (message, 0, ret); ++ else if (result < 0) ++ Assert (message + String.Format ("(neg: {0})", ret), ret < 0); ++ else ++ Assert (message + String.Format ("(pos: {0})", ret), ret > 0); ++ } ++ ++ void AssertCompare (string message, int result, ++ string s1, int idx1, int len1, string s2, int idx2, int len2) ++ { ++ int ret = invariant.Compare (s1, idx1, len1, s2, idx2, len2); ++ if (result == 0) ++ AssertEquals (message, 0, ret); ++ else if (result < 0) ++ Assert (message, ret < 0); ++ else ++ Assert (message, ret > 0); ++ } ++ ++ void AssertCompare (string message, int result, ++ string s1, int idx1, int len1, string s2, int idx2, int len2, ++ CompareOptions opt, CompareInfo ci) ++ { ++ int ret = ci.Compare (s1, idx1, len1, s2, idx2, len2, opt); ++ if (result == 0) ++ AssertEquals (message, 0, ret); ++ else if (result < 0) ++ Assert (message, ret < 0); ++ else ++ Assert (message, ret > 0); ++ } ++ ++ void AssertIndexOf (string message, int expected, ++ string source, char target) ++ { ++ AssertEquals (message, expected, ++ invariant.IndexOf (source, target)); ++ } ++ ++ void AssertIndexOf (string message, int expected, string source, ++ char target, CompareOptions opt) ++ { ++ AssertEquals (message, expected, ++ invariant.IndexOf (source, target, opt)); ++ } ++ ++ void AssertIndexOf (string message, int expected, string source, ++ char target, int idx, int len, CompareOptions opt, CompareInfo ci) ++ { ++ AssertEquals (message, expected, ++ ci.IndexOf (source, target, idx, len, opt)); ++ } ++ ++ void AssertIndexOf (string message, int expected, ++ string source, string target) ++ { ++ AssertEquals (message, expected, ++ invariant.IndexOf (source, target)); ++ } ++ ++ void AssertIndexOf (string message, int expected, string source, ++ string target, CompareOptions opt) ++ { ++ AssertEquals (message, expected, ++ invariant.IndexOf (source, target, opt)); ++ } ++ ++ void AssertIndexOf (string message, int expected, string source, ++ string target, int idx, int len, CompareOptions opt, CompareInfo ci) ++ { ++ AssertEquals (message, expected, ++ ci.IndexOf (source, target, idx, len, opt)); ++ } ++ ++ void AssertLastIndexOf (string message, int expected, ++ string source, char target) ++ { ++ AssertEquals (message, expected, ++ invariant.LastIndexOf (source, target)); ++ } ++ ++ void AssertLastIndexOf (string message, int expected, string source, ++ char target, CompareOptions opt) ++ { ++ AssertEquals (message, expected, ++ invariant.LastIndexOf (source, target, opt)); ++ } ++ ++ void AssertLastIndexOf (string message, int expected, string source, ++ char target, int idx, int len) ++ { ++ AssertEquals (message, expected, ++ invariant.LastIndexOf (source, target, idx, len)); ++ } ++ ++ void AssertLastIndexOf (string message, int expected, string source, ++ char target, int idx, int len, CompareOptions opt, CompareInfo ci) ++ { ++ AssertEquals (message, expected, ++ ci.LastIndexOf (source, target, idx, len, opt)); ++ } ++ ++ void AssertLastIndexOf (string message, int expected, ++ string source, string target) ++ { ++ AssertEquals (message, expected, ++ invariant.LastIndexOf (source, target)); ++ } ++ ++ void AssertLastIndexOf (string message, int expected, string source, ++ string target, CompareOptions opt) ++ { ++ AssertEquals (message, expected, ++ invariant.LastIndexOf (source, target, opt)); ++ } ++ ++ void AssertLastIndexOf (string message, int expected, string source, ++ string target, int idx, int len) ++ { ++ AssertEquals (message, expected, ++ invariant.LastIndexOf (source, target, idx, len)); ++ } ++ ++ void AssertLastIndexOf (string message, int expected, string source, ++ string target, int idx, int len, CompareOptions opt, CompareInfo ci) ++ { ++ AssertEquals (message, expected, ++ ci.LastIndexOf (source, target, idx, len, opt)); ++ } ++ ++ void AssertIsPrefix (string message, bool expected, string source, ++ string target) ++ { ++ Assert (message, expected == invariant.IsPrefix ( ++ source, target)); ++ } ++ ++ void AssertIsPrefix (string message, bool expected, string source, ++ string target, CompareOptions opt) ++ { ++ Assert (message, expected == invariant.IsPrefix ( ++ source, target, opt)); ++ } ++ ++ void AssertIsSuffix (string message, bool expected, string source, ++ string target) ++ { ++ Assert (message, expected == invariant.IsSuffix ( ++ source, target)); ++ } ++ ++ void AssertIsSuffix (string message, bool expected, string source, ++ string target, CompareOptions opt) ++ { ++ Assert (message, expected == invariant.IsSuffix ( ++ source, target, opt)); ++ } ++ ++ [Test] ++#if NET_2_0 ++ [Category ("NotDotNet")] ++#endif ++ public void CultureSensitiveCompare () ++ { ++ if (!doTest) ++ return; ++ ++ AssertCompare ("#1", -1, "1", "2"); ++ AssertCompare ("#2", 1, "A", "a"); ++ AssertCompare ("#3", 0, "A", "a", CompareOptions.IgnoreCase); ++ AssertCompare ("#6", 1, "12", "1"); ++// BUG in .NET 2.0: See GetSortKey() test that assures sortkeys for "AE" and ++// "\u00C6" are equivalent. ++ AssertCompare ("#7", 0, "AE", "\u00C6"); ++ AssertCompare ("#8", 0, "AB\u01c0C", "A\u01c0B\u01c0C", CompareOptions.IgnoreSymbols); ++// BUG in .NET 2.0: ditto. ++ AssertCompare ("#9", 0, "A\u0304", "\u0100"); ++ AssertCompare ("#10", 1, "ABCABC", 5, 1, "1", 0, 1, CompareOptions.IgnoreCase, invariant); ++ AssertCompare ("#11", 0, "-d:NET_2_0", 0, 1, "-", 0, 1); ++ ++// BUG in .NET 2.0: ditto. ++ AssertCompare ("#12", 0, "ae", "\u00E6"); ++ AssertCompare ("#13", 0, "\u00E6", "ae"); ++ AssertCompare ("#14", 0, "\u00E6s", 0, 1, "ae", 0, 2); ++ ++ // target is "empty" (in culture-sensitive context). ++// BUG in .NET 2.0: \u3007 is totally-ignored character as a GetSortKey() ++// result, while it is not in Compare(). ++ AssertCompare ("#17", 0, String.Empty, "\u3007"); ++ AssertCompare ("#18", 1, "A", "\u3007"); ++ AssertCompare ("#19", 1, "ABC", "\u3007"); ++ ++ // shift weight comparison ++ AssertCompare ("#20", 1, "--start", "--"); ++ // expansion ++// BUG in .NET 2.0: the same 00C6/00E6 issue. ++ AssertCompare ("#21", -1, "\u00E6", "aes"); ++ ++// bug #78748 ++ AssertCompare ("#22", -1, "++)", "+-+)"); ++ AssertCompare ("#23", -1, "+-+)", "+-+-)"); ++ AssertCompare ("#24", 1, "+-+-)", "++)"); ++ // BUG in .NET: it returns 1 ++ AssertCompare ("#25", -1, "+-+-)", "-+-+)"); ++ AssertCompare ("#26", -1, "+-+)", "-+-+)"); ++ AssertCompare ("#27", -1, "++)", "-+-+)"); ++ } ++ ++ [Test] ++#if NET_2_0 ++ [Category ("NotDotNet")] ++#endif ++ public void CompareSpecialWeight () ++ { ++ if (!doTest) ++ return; ++ ++ // Japanese (in invariant) ++// BUG in .NET 2.0 : half-width kana should be bigger. ++ AssertCompare ("#1", 1, "\u30D1\u30FC\u30B9", "\uFF8A\uFF9F\uFF70\uFF7D"); ++ AssertCompare ("#4", 1, "\u3042\u309D", "\u3042\u3042"); ++ AssertCompare ("#5", 0, "\u3042\u309D", "\u3042\u3042", CompareOptions.IgnoreNonSpace); ++ ++ // extender in target ++// BUG in .NET 2.0 : an extender should result in bigger sortkey ++ AssertCompare ("#7", -1, "\u30D1\u30A2", "\u30D1\u30FC"); ++ AssertCompare ("#8", 0, "\u30D1\u30A2", "\u30D1\u30FC", CompareOptions.IgnoreNonSpace); ++ // extender in source ++// BUG in .NET 2.0 : vice versa ++ AssertCompare ("#9", 1, "\u30D1\u30FC", "\u30D1\u30A2"); ++ AssertCompare ("#10", 0, "\u30D1\u30FC", "\u30D1\u30A2", CompareOptions.IgnoreNonSpace); ++ } ++ ++ [Test] ++ public void IndexOfChar () ++ { ++ if (!doTest) ++ return; ++ ++ AssertIndexOf ("#1", -1, "ABC", '1'); ++ AssertIndexOf ("#2", 2, "ABCABC", 'c', CompareOptions.IgnoreCase); ++ AssertIndexOf ("#4", 4, "ABCDE", '\u0117', ignoreCN); ++ AssertIndexOf ("#5", 1, "ABCABC", 'B', 1, 5, CompareOptions.IgnoreCase, invariant); ++ AssertIndexOf ("#6", 4, "ABCABC", 'B', 2, 4, CompareOptions.IgnoreCase, invariant); ++ } ++ ++ [Test] ++ [Category ("NotDotNet")] ++ public void IndexOfCharMSBug () ++ { ++ if (!doTest) ++ return; ++ ++ AssertIndexOf ("#1", 0, "\u00E6", 'a'); ++ } ++ ++ [Test] ++ public void LastIndexOfChar () ++ { ++ if (!doTest) ++ return; ++ ++ AssertLastIndexOf ("#1", -1, "ABC", '1'); ++ AssertLastIndexOf ("#2", 5, "ABCABC", 'c', CompareOptions.IgnoreCase); ++ AssertLastIndexOf ("#4", 4, "ABCDE", '\u0117', ignoreCN); ++ AssertLastIndexOf ("#5", 1, "ABCABC", 'B', 3, 3); ++ AssertLastIndexOf ("#6", 4, "ABCABC", 'B', 4, 4); ++ AssertLastIndexOf ("#7", -1, "ABCABC", 'B', 5, 1); ++ AssertLastIndexOf ("#11", 0, "\\", '\\'); ++ AssertEquals ("#11en", 0, new CultureInfo ("en").CompareInfo.LastIndexOf ("\\", '\\')); ++ AssertEquals ("#11ja", 0, new CultureInfo ("ja").CompareInfo.LastIndexOf ("\\", '\\')); ++ AssertLastIndexOf ("#12", 8, "/system/web", 'w'); ++ AssertEquals ("#12sv", 8, new CultureInfo ("sv").CompareInfo.LastIndexOf ("/system/web", 'w')); ++ } ++ ++ [Test] ++ [Category ("NotDotNet")] ++ public void LastIndexOfCharMSBug () ++ { ++ if (!doTest) ++ return; ++ ++ AssertIndexOf ("#1", 0, "\u00E6", 'a'); ++ } ++ ++ [Test] ++#if NET_2_0 ++ [Category ("NotDotNet")] ++#endif ++ public void IsPrefix () ++ { ++ if (!doTest) ++ return; ++ ++ AssertIsPrefix ("#1", false, "ABC", "c", CompareOptions.IgnoreCase); ++ AssertIsPrefix ("#2", false, "BC", "c", CompareOptions.IgnoreCase); ++ AssertIsPrefix ("#3", true, "C", "c", CompareOptions.IgnoreCase); ++ AssertIsPrefix ("#4", true, "EDCBA", "\u0117", ignoreCN); ++ AssertIsPrefix ("#5", true, "ABC", "AB", CompareOptions.IgnoreCase); ++// BUG in .NET 2.0 : see GetSortKey() test (mentioned above). ++ AssertIsPrefix ("#6", true, "ae", "\u00E6", CompareOptions.None); ++ AssertIsPrefix ("#7", true, "\u00E6", "ae", CompareOptions.None); ++ ++// BUG in .NET 2.0 : see GetSortKey() test (mentioned above). ++ AssertIsPrefix ("#8", true, "\u00E6", "a", CompareOptions.None); ++ AssertIsPrefix ("#9", true, "\u00E6s", "ae", CompareOptions.None); ++ AssertIsPrefix ("#10", false, "\u00E6", "aes", CompareOptions.None); ++ AssertIsPrefix ("#11", true, "--start", "--", CompareOptions.None); ++ AssertIsPrefix ("#12", true, "-d:NET_1_1", "-", CompareOptions.None); ++ AssertIsPrefix ("#13", false, "-d:NET_1_1", "@", CompareOptions.None); ++ // U+3007 is completely ignored character. ++ AssertIsPrefix ("#14", true, "\uff21\uff21", "\uff21", CompareOptions.None); ++// BUG in .NET 2.0 : see \u3007 issue (mentioned above). ++ AssertIsPrefix ("#15", true, "\uff21\uff21", "\u3007\uff21", CompareOptions.None); ++ AssertIsPrefix ("#16", true, "\uff21\uff21", "\uff21\u3007", CompareOptions.None); ++ AssertIsPrefix ("#17", true, "\\b\\a a", "\\b\\a a"); ++ Assert ("#17en", new CultureInfo ("en").CompareInfo.IsPrefix ("\\b\\a a", "\\b\\a a")); ++ Assert ("#17ja", new CultureInfo ("ja").CompareInfo.IsPrefix ("\\b\\a a", "\\b\\a a")); ++ } ++ ++ [Test] ++ public void IsPrefixSpecialWeight () ++ { ++ if (!doTest) ++ return; ++ ++ // Japanese (in invariant) ++ AssertIsPrefix ("#1", false, "\u30D1\u30FC\u30B9", "\uFF8A\uFF9F\uFF70\uFF7D"); ++ AssertIsPrefix ("#2-2", false, "\u30D1\u30FC\u30B9", "\uFF8A\uFF9F\uFF70\uFF7D"); ++ AssertIsPrefix ("#3-2", false, "\uFF80\uFF9E\uFF72\uFF8C\uFF9E", ++ "\u30C0\u30A4\u30D6"); ++ AssertIsPrefix ("#4", false, "\u3042\u309D", "\u3042\u3042"); ++ ++ // extender in target ++ AssertIsPrefix ("#7", false, "\u30D1\u30A2", "\u30D1\u30FC"); ++ // extender in source ++ AssertIsPrefix ("#9", false, "\u30D1\u30FC", "\u30D1\u30A2"); ++ ++ // empty suffix always matches the source. ++ AssertIsPrefix ("#11", true, "", ""); ++ AssertIsPrefix ("#12", true, "/test.css", ""); ++ ++ // bug #76243 ++ AssertIsPrefix ("#13", false, "\u00e4_", "a"); ++ } ++ ++ [Test] ++#if NET_2_0 ++ [Category ("NotDotNet")] ++#endif ++ public void IsSuffix () ++ { ++ if (!doTest) ++ return; ++ ++ AssertIsSuffix ("#1", true, "ABC", "c", CompareOptions.IgnoreCase); ++ AssertIsSuffix ("#2", true, "BC", "c", CompareOptions.IgnoreCase); ++ AssertIsSuffix ("#3", false, "CBA", "c", CompareOptions.IgnoreCase); ++ AssertIsSuffix ("#4", true, "ABCDE", "\u0117", CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase); ++ AssertIsSuffix ("#5", false, "\u00E6", "a", CompareOptions.None); ++// BUG in .NET 2.0 : see GetSortKey() test (mentioned above). ++ AssertIsSuffix ("#6", true, "\u00E6", "ae", CompareOptions.None); ++ AssertIsSuffix ("#7", true, "ae", "\u00E6", CompareOptions.None); ++ AssertIsSuffix ("#8", false, "e", "\u00E6", CompareOptions.None); ++ // U+3007 is completely ignored character. ++ AssertIsSuffix ("#9", true, "\uff21\uff21", "\uff21", CompareOptions.None); ++// BUG in .NET 2.0 : see \u3007 issue (mentioned above). ++ AssertIsSuffix ("#10", true, "\uff21\uff21", "\u3007\uff21", CompareOptions.None); ++ AssertIsSuffix ("#11", true, "\uff21\uff21", "\uff21\u3007", CompareOptions.None); ++ // extender in target ++ AssertIsSuffix ("#12", false, "\u30D1\u30A2", "\u30D1\u30FC"); ++ AssertIsSuffix ("#13", true, "\u30D1\u30A2", "\u30D1\u30FC", CompareOptions.IgnoreNonSpace); ++ // extender in source ++ AssertIsSuffix ("#14", false, "\u30D1\u30FC", "\u30D1\u30A2"); ++ AssertIsSuffix ("#15", true, "\u30D1\u30FC", "\u30D1\u30A2", CompareOptions.IgnoreNonSpace); ++ // optimization sanity check ++ AssertIsSuffix ("#16", true, ++ "/configuration/system.runtime.remoting", ++ "system.runtime.remoting"); ++ ++ // empty suffix always matches the source. ++ AssertIsSuffix ("#17", true, "", ""); ++ AssertIsSuffix ("#18", true, "/test.css", ""); ++ AssertIsSuffix ("#19", true, "/test.css", "/test.css"); ++ AssertIsSuffix ("#20", true, "\\b\\a a", "\\b\\a a"); ++ Assert ("#20en", new CultureInfo ("en").CompareInfo.IsSuffix ("\\b\\a a", "\\b\\a a")); ++ Assert ("#20ja", new CultureInfo ("ja").CompareInfo.IsSuffix ("\\b\\a a", "\\b\\a a")); ++ } ++ ++ [Test] ++ [Category ("NotDotNet")] ++ [Category ("NotWorking")] ++ public void IsSuffixMSBug () ++ { ++ if (!doTest) ++ return; ++ ++ AssertIsSuffix ("#1", true, "\u00E6", "e", CompareOptions.None); ++ } ++ ++ [Test] ++#if NET_2_0 ++ [Category ("NotDotNet")] ++#endif ++ public void IndexOfString () ++ { ++ if (!doTest) ++ return; ++ ++ AssertIndexOf ("#1", -1, "ABC", "1", CompareOptions.None); ++ AssertIndexOf ("#2", 2, "ABCABC", "c", CompareOptions.IgnoreCase); ++ AssertIndexOf ("#4", 4, "ABCDE", "\u0117", CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase); ++ AssertIndexOf ("#5", 1, "ABCABC", "BC", CompareOptions.IgnoreCase); ++ AssertIndexOf ("#6", 1, "BBCBBC", "BC", CompareOptions.IgnoreCase); ++ AssertIndexOf ("#7", -1, "ABCDEF", "BCD", 0, 3, CompareOptions.IgnoreCase, invariant); ++ AssertIndexOf ("#8", 0, "-ABC", "-", CompareOptions.None); ++ AssertIndexOf ("#9", 0, "--ABC", "--", CompareOptions.None); ++ AssertIndexOf ("#10", -1, "--ABC", "--", 1, 2, CompareOptions.None, invariant); ++// BUG in .NET 2.0 : see GetSortKey() test (mentioned above). ++ AssertIndexOf ("#11", 0, "AE", "\u00C6", CompareOptions.None); ++ // U+3007 is completely ignored character. ++ AssertIndexOf ("#12", 0, "\uff21\uff21", "\uff21", CompareOptions.None); ++// BUG in .NET 2.0 : see \u3007 issue (mentioned above). ++ AssertIndexOf ("#13", 0, "\uff21\uff21", "\u3007\uff21", CompareOptions.None); ++ AssertIndexOf ("#14", 0, "\uff21\uff21", "\uff21\u3007", CompareOptions.None); ++ AssertIndexOf ("#15", 0, "\uff21\uff21", "\u3007", CompareOptions.None); ++ AssertIndexOf ("#15-2", 1, "\u3007\uff21", "\uff21", CompareOptions.None); ++ // target is "empty" (in culture-sensitive context). ++ AssertIndexOf ("#16", -1, String.Empty, "\u3007"); ++// BUG in .NET 2.0 : see \u3007 issue (mentioned above). ++ AssertIndexOf ("#17", 0, "A", "\u3007"); ++ AssertIndexOf ("#18", 0, "ABC", "\u3007"); ++ ++ AssertIndexOf ("#19", 0, "\\b\\a a", "\\b\\a a"); ++ AssertEquals ("#19en", 0, new CultureInfo ("en").CompareInfo.IndexOf ("\\b\\a a", "\\b\\a a")); ++ AssertEquals ("#19ja", 0, new CultureInfo ("ja").CompareInfo.IndexOf ("\\b\\a a", "\\b\\a a")); ++ } ++ ++ [Test] ++ public void IndexOfSpecialWeight () ++ { ++ if (!doTest) ++ return; ++ ++ // Japanese (in invariant) ++ AssertIndexOf ("#1", -1, "\u30D1\u30FC\u30B9", "\uFF8A\uFF9F\uFF70\uFF7D"); ++ // extender in target ++ AssertIndexOf ("#1-2", -1, "\u30D1\u30A2", "\u30D1\u30FC"); ++ // extender in source ++ AssertIndexOf ("#2-2", -1, "\u30D1\u30FC\u30B9", "\uFF8A\uFF9F\uFF70\uFF7D"); ++ AssertIndexOf ("#4", -1, "\u3042\u309D", "\u3042\u3042"); ++ } ++ ++ [Test] ++#if NET_2_0 ++ [Category ("NotDotNet")] ++#endif ++ public void LastIndexOfString () ++ { ++ if (!doTest) ++ return; ++ ++ AssertLastIndexOf ("#1", -1, "ABC", "1", CompareOptions.None); ++ AssertLastIndexOf ("#2", 5, "ABCABC", "c", CompareOptions.IgnoreCase); ++ AssertLastIndexOf ("#4", 4, "ABCDE", "\u0117", CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase); ++ AssertLastIndexOf ("#5", 4, "ABCABC", "BC", CompareOptions.IgnoreCase); ++ AssertLastIndexOf ("#6", 4, "BBCBBC", "BC", CompareOptions.IgnoreCase); ++ AssertLastIndexOf ("#7", 1, "original", "rig", CompareOptions.None); ++// BUG in .NET 2.0 : see GetSortKey() test (mentioned above). ++ AssertLastIndexOf ("#8", 0, "\u00E6", "ae", CompareOptions.None); ++ AssertLastIndexOf ("#9", 0, "-ABC", "-", CompareOptions.None); ++ AssertLastIndexOf ("#10", 0, "--ABC", "--", CompareOptions.None); ++ AssertLastIndexOf ("#11", -1, "--ABC", "--", 2, 2, CompareOptions.None, invariant); ++ AssertLastIndexOf ("#12", -1, "--ABC", "--", 4, 2, CompareOptions.None, invariant); ++// BUG in .NET 2.0 : see GetSortKey() test (mentioned above). ++ AssertLastIndexOf ("#13", 0, "AE", "\u00C6", CompareOptions.None); ++ // U+3007 is completely ignored character. ++ AssertLastIndexOf ("#14", 1, "\uff21\uff21", "\uff21", CompareOptions.None); ++// BUG in .NET 2.0 : see \u3007 issue (mentioned above). ++ AssertLastIndexOf ("#15", 1, "\uff21\uff21", "\u3007\uff21", CompareOptions.None); ++ AssertLastIndexOf ("#16", 1, "\uff21\uff21", "\uff21\u3007", CompareOptions.None); ++ AssertLastIndexOf ("#17", 1, "\uff21\uff21", "\u3007", CompareOptions.None); ++ AssertLastIndexOf ("#18", 1, "\u3007\uff21", "\uff21", CompareOptions.None); ++ AssertLastIndexOf ("#19", 0, "\\b\\a a", "\\b\\a a"); ++ AssertEquals ("#19en", 0, new CultureInfo ("en").CompareInfo.LastIndexOf ("\\b\\a a", "\\b\\a a")); ++ AssertEquals ("#19ja", 0, new CultureInfo ("ja").CompareInfo.LastIndexOf ("\\b\\a a", "\\b\\a a")); ++ // bug #80612 ++ AssertLastIndexOf ("#20", 8, "/system/web", "w"); ++ AssertEquals ("#20sv", 8, new CultureInfo ("sv").CompareInfo.LastIndexOf ("/system/web", "w")); ++ } ++ ++ [Test] ++ public void LastIndexOfSpecialWeight () ++ { ++ if (!doTest) ++ return; ++ ++ // Japanese (in invariant) ++ AssertLastIndexOf ("#1", -1, "\u30D1\u30FC\u30B9", "\uFF8A\uFF9F\uFF70\uFF7D"); ++ // extender in target ++ AssertLastIndexOf ("#1-2", -1, "\u30D1\u30A2", "\u30D1\u30FC"); ++ // extender in source ++ AssertLastIndexOf ("#4", -1, "\u3042\u309D", "\u3042\u3042"); ++ } ++ ++ [Test] ++ public void LastIndexOfOrdinalString () ++ { ++ if (!doTest) ++ return; ++ ++ AssertLastIndexOf ("#1", -1, "ABC", "1", CompareOptions.Ordinal); ++ AssertLastIndexOf ("#2", 5, "ABCABC", "C", CompareOptions.Ordinal); ++ AssertLastIndexOf ("#3", -1, "ABCABC", "\uFF22", CompareOptions.Ordinal); ++ AssertLastIndexOf ("#4", 4, "ABCABC", "BC", CompareOptions.Ordinal); ++ AssertLastIndexOf ("#5", 4, "BBCBBC", "BC", CompareOptions.Ordinal); ++ AssertLastIndexOf ("#6", 1, "original", "rig", CompareOptions.Ordinal); ++ AssertLastIndexOf ("#7", 0, "\\b\\a a", "\\b\\a a", CompareOptions.Ordinal); ++ } ++ ++ [Test] ++ [Category ("TargetJvmNotWorking")] ++ // for bug #76702 ++ public void NullCharacter () ++ { ++ AssertEquals ("#1", -1, "MONO".IndexOf ("\0\0\0")); ++ AssertEquals ("#2", -1, "MONO".LastIndexOf ("\0\0\0")); ++ AssertEquals ("#3", 1, "MONO".CompareTo ("\0\0\0")); ++ } ++ ++ [Test] ++ [Category ("NotDotNet")] ++ // MS.NET treats it as equivalent, while in IndexOf() it does not match. ++ public void NullCharacterWeird () ++ { ++ AssertEquals ("#4", -1, "MONO".CompareTo ("MONO\0\0\0")); ++ } ++ ++#if NET_2_0 ++ [Test] ++ [Category ("NotDotNet")] ++ public void OrdinalIgnoreCaseCompare () ++ { ++ if (!doTest) ++ return; ++ ++ // matches ++// BUG in .NET 2.0 : see GetSortKey() test (mentioned above). ++ AssertCompare ("#1", 0, "AE", "\u00C6", CompareOptions.None); ++// BUG in .NET 2.0 : It raises inappropriate ArgumentException. ++ // should not match since it is Ordinal ++ AssertCompare ("#2", -133, "AE", "\u00C6", CompareOptions.OrdinalIgnoreCase); ++ ++ AssertCompare ("#3", 1, "AE", "\u00E6", CompareOptions.None); ++ // matches ++ AssertCompare ("#4", 0, "AE", "\u00E6", CompareOptions.IgnoreCase); ++ // should not match since it is Ordinal ++ AssertCompare ("#5", -133, "AE", "\u00E6", CompareOptions.OrdinalIgnoreCase); ++ ++ AssertCompare ("#6", 0, "AE", "ae", CompareOptions.OrdinalIgnoreCase); ++ AssertCompare ("#7", 0, "aE", "ae", CompareOptions.OrdinalIgnoreCase); ++ AssertCompare ("#8", 0, "aE", "ae", CompareOptions.OrdinalIgnoreCase); ++ AssertCompare ("#9", 0, "ae", "ae", CompareOptions.OrdinalIgnoreCase); ++ AssertCompare ("#10", 0, "AE", "AE", CompareOptions.OrdinalIgnoreCase); ++ AssertCompare ("#11", 0, "aE", "AE", CompareOptions.OrdinalIgnoreCase); ++ AssertCompare ("#12", 0, "aE", "AE", CompareOptions.OrdinalIgnoreCase); ++ AssertCompare ("#13", 0, "ae", "AE", CompareOptions.OrdinalIgnoreCase); ++ AssertCompare ("#14", 0, "ola", "OLA", CompareOptions.OrdinalIgnoreCase); ++ } ++ ++ [Test] ++ public void OrdinalIgnoreCaseIndexOf () ++ { ++ AssertIndexOf ("#1-1", 0, "ABC", "abc", CompareOptions.OrdinalIgnoreCase); ++ AssertIndexOf ("#1-2", -1, "AEBECE", "\u00E6", CompareOptions.OrdinalIgnoreCase); ++ AssertIndexOf ("#1-3", -1, "@_@", "`_`", CompareOptions.OrdinalIgnoreCase); ++ } ++ ++ [Test] ++ public void OrdinalIgnoreCaseIndexOfChar () ++ { ++ AssertIndexOf ("#2-1", 0, "ABC", 'a', CompareOptions.OrdinalIgnoreCase); ++ AssertIndexOf ("#2-2", -1, "AEBECE", '\u00C0', CompareOptions.OrdinalIgnoreCase); ++ AssertIndexOf ("#2-3", -1, "@_@", '`', CompareOptions.OrdinalIgnoreCase); ++ } ++ ++ [Test] ++ public void OrdinalIgnoreCaseLastIndexOf () ++ { ++ AssertLastIndexOf ("#1-1", 0, "ABC", "abc", CompareOptions.OrdinalIgnoreCase); ++ AssertLastIndexOf ("#1-2", -1, "AEBECE", "\u00E6", CompareOptions.OrdinalIgnoreCase); ++ AssertLastIndexOf ("#1-3", -1, "@_@", "`_`", CompareOptions.OrdinalIgnoreCase); ++ AssertLastIndexOf ("#1-4", 1, "ABCDE", "bc", CompareOptions.OrdinalIgnoreCase); ++ AssertLastIndexOf ("#1-5", -1, "BBBBB", "ab", CompareOptions.OrdinalIgnoreCase); ++ } ++ ++ [Test] ++ public void OrdinalIgnoreCaseLastIndexOfChar () ++ { ++ AssertLastIndexOf ("#2-1", 0, "ABC", 'a', CompareOptions.OrdinalIgnoreCase); ++ AssertLastIndexOf ("#2-2", -1, "AEBECE", '\u00C0', CompareOptions.OrdinalIgnoreCase); ++ AssertLastIndexOf ("#2-3", -1, "@_@", '`', CompareOptions.OrdinalIgnoreCase); ++ } ++ ++ [Test] // bug #80865 ++ public void IsPrefixOrdinalIgnoreCase () ++ { ++ Assert ("aaaa".StartsWith ("A", StringComparison.OrdinalIgnoreCase)); ++ } ++#endif ++} ++ ++} diff --combined mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs index 2738195a502,2738195a502..bf8aa36c1d7 --- a/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs +++ b/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs @@@ -39,6 -39,6 +39,7 @@@ namespace MonoTests.System.Globalizatio } [Test] ++ [Category ("TargetJvmNotWorking")] //OptionalCalendars not yet supported for TARGET_JVM. // make sure that all CultureInfo holds non-null calendars. public void OptionalCalendars () { diff --combined mcs/class/corlib/Test/System.Globalization/DaylightTimeTest.cs index 664249597e2,664249597e2..76edd4cff51 --- a/mcs/class/corlib/Test/System.Globalization/DaylightTimeTest.cs +++ b/mcs/class/corlib/Test/System.Globalization/DaylightTimeTest.cs @@@ -78,7 -78,7 +78,11 @@@ namespace MonoTests.System.Globalizatio public void DeserializeKnownValue () { MemoryStream ms = new MemoryStream (serialized_daylighttime); ++#if TARGET_JVM ++ BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false); ++#else BinaryFormatter bf = new BinaryFormatter (); ++#endif // TARGET_JVM DaylightTime dt = (DaylightTime) bf.Deserialize (ms); Assert.AreEqual (DateTime.MinValue, dt.Start, "Start"); Assert.AreEqual (DateTime.MaxValue, dt.End, "End"); diff --combined mcs/class/corlib/Test/System.IO/BinaryReaderTest.cs index 211c07d520d,211c07d520d..5661fef921c --- a/mcs/class/corlib/Test/System.IO/BinaryReaderTest.cs +++ b/mcs/class/corlib/Test/System.IO/BinaryReaderTest.cs @@@ -1063,9 -1063,9 +1063,6 @@@ namespace MonoTests.System.I [Test] [ExpectedException(typeof(EndOfStreamException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif public void ReadDecimalException () { MemoryStream stream = new MemoryStream (new byte [] {0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0 ,87, 98, 0, 0, 0, 0, 0}); @@@ -1234,9 -1234,9 +1231,6 @@@ } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif public void ReadSingle () { MemoryStream stream = new MemoryStream (new byte [] {65, 200, 0, 0, 0, 1, 2, 3, 4}); diff --combined mcs/class/corlib/Test/System.IO/BinaryWriterTest.cs index fc63e4c750d,fc63e4c750d..118874e0ff3 --- a/mcs/class/corlib/Test/System.IO/BinaryWriterTest.cs +++ b/mcs/class/corlib/Test/System.IO/BinaryWriterTest.cs @@@ -411,9 -411,9 +411,6 @@@ public class BinaryWriterTest : Asserti } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif public void WriteFloat () { MemoryStream stream = new MemoryStream (); diff --combined mcs/class/corlib/Test/System.IO/DirectoryInfoTest.cs index 1b615b63caa,1b615b63caa..f2b4f36c0e3 --- a/mcs/class/corlib/Test/System.IO/DirectoryInfoTest.cs +++ b/mcs/class/corlib/Test/System.IO/DirectoryInfoTest.cs @@@ -612,9 -612,9 +612,6 @@@ namespace MonoTests.System.I } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif public void DirectoryNameWithSpace () { // check for Unix platforms - see FAQ for more details @@@ -679,40 -679,40 +676,32 @@@ AssertEquals ("test#12", 0, time.Second); } -- [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Test] ++ [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM public void LastAccessTime () { DirectoryInfo info = new DirectoryInfo (TempFolder); info.LastAccessTime = DateTime.Now; } -- [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Test] ++ [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM public void LastAccessTimeUtc () { DirectoryInfo info = new DirectoryInfo (TempFolder); info.LastAccessTimeUtc = DateTime.Now; } -- [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Test] ++ [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM public void CreationTime () { DirectoryInfo info = new DirectoryInfo (TempFolder); info.CreationTime = DateTime.Now; } -- [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Test] ++ [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM public void CreationTimeUtc () { DirectoryInfo info = new DirectoryInfo (TempFolder); diff --combined mcs/class/corlib/Test/System.IO/DirectoryTest.cs index 2db033fc1db,f2d4a3c105e..4311d691e69 --- a/mcs/class/corlib/Test/System.IO/DirectoryTest.cs +++ b/mcs/class/corlib/Test/System.IO/DirectoryTest.cs @@@ -250,7 -250,6 +250,7 @@@ public class DirectoryTes Assert.IsFalse (Directory.Exists (null as string)); } +#if !TARGET_JVM // We don't support yet the Process class. [Test] [Category("NotDotNet")] public void ExistsAccessDenied () @@@ -271,13 -270,12 +271,11 @@@ Directory.Delete (path); } } +#endif [Test] ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM [ExpectedException(typeof(ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif public void GetCreationTimeException1 () { Directory.GetCreationTime (null as string); @@@ -285,9 -283,9 +283,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeException2 () { Directory.GetCreationTime (""); @@@ -297,9 -295,9 +293,7 @@@ #if !NET_2_0 [ExpectedException(typeof(IOException))] #endif --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeException_NonExistingPath () { string path = TempFolder + DSC + "DirectoryTest.GetCreationTime.1"; @@@ -323,9 -321,9 +317,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeException4 () { Directory.GetCreationTime (" "); @@@ -333,9 -331,9 +325,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeException5 () { Directory.GetCreationTime (Path.InvalidPathChars [0].ToString ()); @@@ -343,9 -341,9 +333,7 @@@ [Test] [ExpectedException(typeof(ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeUtcException1 () { Directory.GetCreationTimeUtc (null as string); @@@ -353,9 -351,9 +341,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeUtcException2 () { Directory.GetCreationTimeUtc (""); @@@ -365,9 -363,9 +351,7 @@@ #if !NET_2_0 [ExpectedException (typeof (IOException))] #endif --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeUtc_NonExistingPath () { string path = TempFolder + DSC + "DirectoryTest.GetCreationTimeUtc.1"; @@@ -391,9 -389,9 +375,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeUtcException4 () { Directory.GetCreationTimeUtc (" "); @@@ -401,9 -399,9 +383,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeUtcException5 () { Directory.GetCreationTime (Path.InvalidPathChars [0].ToString ()); @@@ -411,9 -409,9 +391,7 @@@ [Test] [ExpectedException(typeof(ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTime_Null () { Directory.GetLastAccessTime (null as string); @@@ -421,9 -419,9 +399,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeException2 () { Directory.GetLastAccessTime (""); @@@ -433,9 -431,9 +409,7 @@@ #if !NET_2_0 [ExpectedException (typeof (IOException))] #endif --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTime_NonExistingPath () { string path = TempFolder + DSC + "DirectoryTest.GetLastAccessTime.1"; @@@ -460,9 -458,9 +434,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeException4 () { Directory.GetLastAccessTime (" "); @@@ -470,9 -468,9 +442,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeException5 () { Directory.GetLastAccessTime (Path.InvalidPathChars [0].ToString ()); @@@ -480,9 -478,9 +450,7 @@@ [Test] [ExpectedException(typeof(ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeUtc_Null () { Directory.GetLastAccessTimeUtc (null as string); @@@ -490,9 -488,9 +458,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeUtcException2 () { Directory.GetLastAccessTimeUtc (""); @@@ -502,9 -500,9 +468,7 @@@ #if !NET_2_0 [ExpectedException (typeof (IOException))] #endif --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeUtc_NonExistingPath () { string path = TempFolder + DSC + "DirectoryTest.GetLastAccessTimeUtc.1"; @@@ -527,9 -525,9 +491,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeUtcException4 () { Directory.GetLastAccessTimeUtc (" "); @@@ -537,9 -535,9 +499,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeUtcException5 () { Directory.GetLastAccessTimeUtc (Path.InvalidPathChars [0].ToString ()); @@@ -781,9 -779,9 +741,7 @@@ } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM public void CreationTime () { // check for Unix platforms - see FAQ for more details @@@ -837,9 -835,9 +795,7 @@@ } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM public void LastAccessTime () { string path = TempFolder + DSC + "DirectoryTest.AccessTime.1"; @@@ -1061,9 -1059,9 +1017,7 @@@ [Test] [ExpectedException(typeof(ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeException1 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1072,9 -1070,9 +1026,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeException2 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1083,9 -1081,9 +1035,7 @@@ [Test] [ExpectedException(typeof(FileNotFoundException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeException3 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1100,9 -1098,9 +1050,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeException4 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1111,9 -1109,9 +1059,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeException5 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1139,9 -1137,9 +1085,7 @@@ [Test] [ExpectedException(typeof(ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeUtcException1 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1150,9 -1148,9 +1094,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeUtcException2 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1161,9 -1159,9 +1103,7 @@@ [Test] [ExpectedException(typeof(FileNotFoundException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeUtcException3 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1178,9 -1176,9 +1118,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeUtcException4 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1189,9 -1187,9 +1127,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeUtcException5 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1216,9 -1214,9 +1152,7 @@@ [Test] [ExpectedException(typeof(ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeException1 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1227,9 -1225,9 +1161,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeException2 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1238,9 -1236,9 +1170,7 @@@ [Test] [ExpectedException(typeof(FileNotFoundException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeException3 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1256,9 -1254,9 +1186,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeException4 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1267,9 -1265,9 +1195,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeException5 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1296,9 -1294,9 +1222,7 @@@ [Test] [ExpectedException(typeof(ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeUtcException1 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1307,9 -1305,9 +1231,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeUtcException2 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1318,9 -1316,9 +1240,7 @@@ [Test] [ExpectedException(typeof(FileNotFoundException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeUtcException3 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1337,9 -1335,9 +1257,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeUtcException4 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); @@@ -1348,9 -1346,9 +1266,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeUtcException5 () { DateTime time = new DateTime (2003, 4, 6, 6, 4, 2); diff --combined mcs/class/corlib/Test/System.IO/FileInfoTest.cs index d2a2fd6e360,d2a2fd6e360..809647d6b66 --- a/mcs/class/corlib/Test/System.IO/FileInfoTest.cs +++ b/mcs/class/corlib/Test/System.IO/FileInfoTest.cs @@@ -632,9 -632,9 +632,7 @@@ namespace MonoTests.System.I [Test] [ExpectedException(typeof (IOException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // File sharing not supported for TARGET_JVM public void OpenReadIOException () { string path = TempFolder + DSC + "FIT.OpenReadIOException.Test"; diff --combined mcs/class/corlib/Test/System.IO/FileStreamTest.cs index f39861c86a6,507d4e97f3f..0d7b6d258f8 --- a/mcs/class/corlib/Test/System.IO/FileStreamTest.cs +++ b/mcs/class/corlib/Test/System.IO/FileStreamTest.cs @@@ -698,7 -698,6 +698,7 @@@ namespace MonoTests.System.I } } +#if !TARGET_JVM // No support IntPtr file handles under TARGET_JVM [Test, ExpectedException (typeof (IOException))] public void CtorIOException2 () { @@@ -710,9 -709,7 +710,9 @@@ stream.Close (); } } +#endif // TARGET_JVM + [Category("TargetJvmNotSupported")] // File sharing not supported for TARGET_JVM [Test, ExpectedException (typeof (IOException))] public void CtorIOException () { @@@ -760,49 -757,41 +760,49 @@@ } [Test] + [Category("TargetJvmNotSupported")] // File sharing not supported for TARGET_JVM [ExpectedException (typeof (IOException))] public void CtorAccess1Read2Write () { string fn = Path.Combine (TempFolder, "temp"); - FileStream fs = null; + FileStream fs1 = null; + FileStream fs2 = null; try { if (!File.Exists (fn)) { using (TextWriter tw = File.CreateText (fn)) { tw.Write ("FOO"); } } - fs = new FileStream (fn, FileMode.Open, FileAccess.Read); - fs = new FileStream (fn, FileMode.Create, FileAccess.Write); + fs1 = new FileStream (fn, FileMode.Open, FileAccess.Read); + fs2 = new FileStream (fn, FileMode.Create, FileAccess.Write); } finally { - if (fs != null) - fs.Close (); + if (fs1 != null) + fs1.Close (); + if (fs2 != null) + fs2.Close (); if (File.Exists (fn)) File.Delete (fn); } } [Test] + [Category("TargetJvmNotSupported")] // File sharing not supported for TARGET_JVM [ExpectedException (typeof (IOException))] public void CtorAccess1Write2Write () { string fn = Path.Combine (TempFolder, "temp"); - FileStream fs = null; + FileStream fs1 = null; + FileStream fs2 = null; try { if (File.Exists (fn)) File.Delete (fn); - fs = new FileStream (fn, FileMode.Create, FileAccess.Write); - fs = new FileStream (fn, FileMode.Create, FileAccess.Write); + fs1 = new FileStream (fn, FileMode.Create, FileAccess.Write); + fs2 = new FileStream (fn, FileMode.Create, FileAccess.Write); } finally { - if (fs != null) - fs.Close (); + if (fs1 != null) + fs1.Close (); + if (fs2 != null) + fs2.Close (); if (File.Exists (fn)) File.Delete (fn); } @@@ -983,9 -972,6 +983,7 @@@ DeleteFile (path); } - #if TARGET_JVM // File locking is not implemented. - [Category ("NotWorking")] - #endif ++ [Category("TargetJvmNotSupported")] // File locking not supported for TARGET_JVM public void TestLock () { string path = TempFolder + Path.DirectorySeparatorChar + "TestLock"; @@@ -1274,7 -1260,6 +1272,7 @@@ } } +#if !TARGET_JVM // No support IntPtr file handles under TARGET_JVM // Check that the stream is flushed even when it doesn't own the // handle [Test] @@@ -1294,7 -1279,6 +1292,7 @@@ Assert.AreEqual ((int) '1', s.ReadByte ()); s.Close (); } +#endif // TARGET_JVM private void DeleteFile (string path) { @@@ -1410,14 -1394,12 +1408,14 @@@ } } +#if !TARGET_JVM // No support IntPtr file handles under TARGET_JVM [Test] [ExpectedException (typeof (ArgumentException))] public void Constructor_InvalidFileHandle () { new FileStream ((IntPtr) (-1L), FileAccess.Read); } +#endif // TARGET_JVM [Test] public void PositionAfterSetLength () @@@ -1456,7 -1438,6 +1454,7 @@@ } [Test] + [Category("TargetJvmNotSupported")] // Async IO not supported for TARGET_JVM [ExpectedException (typeof (ObjectDisposedException))] public void BeginRead_Disposed () { @@@ -1468,7 -1449,6 +1466,7 @@@ } [Test] + [Category("TargetJvmNotSupported")] // Async IO not supported for TARGET_JVM [ExpectedException (typeof (ObjectDisposedException))] public void BeginWrite_Disposed () { @@@ -1480,7 -1460,6 +1478,7 @@@ } [Test] + [Category("TargetJvmNotSupported")] // File locking not supported for TARGET_JVM [ExpectedException (typeof (ObjectDisposedException))] public void Lock_Disposed () { @@@ -1492,7 -1471,6 +1490,7 @@@ } [Test] + [Category("TargetJvmNotSupported")] // File locking not supported for TARGET_JVM [ExpectedException (typeof (ObjectDisposedException))] public void Unlock_Disposed () { @@@ -1556,7 -1534,6 +1554,7 @@@ } #if NET_2_0 + [Category("TargetJvmNotSupported")] // FileOptions.DeleteOnClose not supported for TARGET_JVM [Test] public void DeleteOnClose () { string path = TempFolder + DSC + "created.txt"; diff --combined mcs/class/corlib/Test/System.IO/FileSystemInfoTest.cs index 78ccf617302,78ccf617302..43efdf5e669 --- a/mcs/class/corlib/Test/System.IO/FileSystemInfoTest.cs +++ b/mcs/class/corlib/Test/System.IO/FileSystemInfoTest.cs @@@ -69,9 -69,9 +69,7 @@@ namespace MonoTests.System.I } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM public void CreationTimeFile () { string path = TempFolder + DSC + "FSIT.CreationTime.Test"; @@@ -124,9 -124,9 +122,7 @@@ } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM public void CreationTimeDirectory () { string path = TempFolder + DSC + "FSIT.CreationTimeDirectory.Test"; @@@ -168,9 -168,9 +164,7 @@@ } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM public void CreationTimeNoFileOrDirectory () { string path = TempFolder + DSC + "FSIT.CreationTimeNoFile.Test"; @@@ -220,9 -220,9 +214,7 @@@ } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM public void DefaultLastAccessTime () { string path = TempFolder + DSC + "FSIT.DefaultLastAccessTime.Test"; @@@ -246,9 -246,9 +238,7 @@@ } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM public void LastAccessTime () { string path = TempFolder + DSC + "FSIT.LastAccessTime.Test"; @@@ -292,9 -292,9 +282,7 @@@ } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM public void DefaultLastWriteTime () { string path = TempFolder + DSC + "FSIT.DefaultLastWriteTime.Test"; diff --combined mcs/class/corlib/Test/System.IO/FileTest.cs index f66c6b41e8e,f66c6b41e8e..97b51bfd331 --- a/mcs/class/corlib/Test/System.IO/FileTest.cs +++ b/mcs/class/corlib/Test/System.IO/FileTest.cs @@@ -587,9 -587,9 +587,7 @@@ namespace MonoTests.System.I } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void TestGetCreationTime () { string path = TempFolder + Path.DirectorySeparatorChar + "baz"; @@@ -606,9 -606,9 +604,7 @@@ // Setting the creation time on Unix is not possible [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void CreationTime () { int platform = (int) Environment.OSVersion.Platform; @@@ -653,9 -653,9 +649,7 @@@ } [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void LastAccessTime () { string path = TempFolder + Path.DirectorySeparatorChar + "lastAccessTime"; @@@ -751,9 -751,9 +745,7 @@@ [Test] [ExpectedException(typeof(ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeException1 () { File.GetCreationTime (null as string); @@@ -761,9 -761,9 +753,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeException2 () { File.GetCreationTime (""); @@@ -773,9 -773,9 +763,7 @@@ #if !NET_2_0 [ExpectedException(typeof(IOException))] #endif --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTime_NonExistingPath () { string path = TempFolder + Path.DirectorySeparatorChar + "GetCreationTimeException3"; @@@ -795,9 -795,9 +783,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeException4 () { File.GetCreationTime (" "); @@@ -805,9 -805,9 +791,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeException5 () { File.GetCreationTime (Path.InvalidPathChars [0].ToString ()); @@@ -815,9 -815,9 +799,7 @@@ [Test] [ExpectedException(typeof(ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeUtcException1 () { File.GetCreationTimeUtc (null as string); @@@ -825,9 -825,9 +807,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeUtcException2 () { File.GetCreationTimeUtc (""); @@@ -837,9 -837,9 +817,7 @@@ #if !NET_2_0 [ExpectedException (typeof (IOException))] #endif --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeUtc_NonExistingPath () { string path = TempFolder + Path.DirectorySeparatorChar + "GetCreationTimeUtcException3"; @@@ -858,9 -858,9 +836,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeUtcException4 () { File.GetCreationTimeUtc (" "); @@@ -868,9 -868,9 +844,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM public void GetCreationTimeUtcException5 () { File.GetCreationTime (Path.InvalidPathChars [0].ToString ()); @@@ -878,9 -878,9 +852,7 @@@ [Test] [ExpectedException(typeof(ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeException1 () { File.GetLastAccessTime (null as string); @@@ -888,9 -888,9 +860,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeException2 () { File.GetLastAccessTime (""); @@@ -900,9 -900,9 +870,7 @@@ #if !NET_2_0 [ExpectedException (typeof (IOException))] #endif --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTime_NonExistingPath () { string path = TempFolder + Path.DirectorySeparatorChar + "GetLastAccessTimeException3"; @@@ -922,9 -922,9 +890,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeException4 () { File.GetLastAccessTime (" "); @@@ -932,9 -932,9 +898,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeException5 () { File.GetLastAccessTime (Path.InvalidPathChars [0].ToString ()); @@@ -942,9 -942,9 +906,7 @@@ [Test] [ExpectedException(typeof(ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeUtcException1 () { File.GetLastAccessTimeUtc (null as string); @@@ -952,9 -952,9 +914,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeUtcException2 () { File.GetLastAccessTimeUtc (""); @@@ -964,9 -964,9 +924,7 @@@ #if !NET_2_0 [ExpectedException (typeof (IOException))] #endif --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeUtc_NonExistingPath () { string path = TempFolder + Path.DirectorySeparatorChar + "GetLastAccessTimeUtcException3"; @@@ -985,9 -985,9 +943,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeUtcException4 () { File.GetLastAccessTimeUtc (" "); @@@ -995,9 -995,9 +951,7 @@@ [Test] [ExpectedException(typeof(ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM public void GetLastAccessTimeUtcException5 () { File.GetLastAccessTimeUtc (Path.InvalidPathChars [0].ToString ()); @@@ -1120,9 -1120,9 +1074,7 @@@ [Test] [ExpectedException(typeof (ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeArgumentNullException1 () { File.SetCreationTime (null as string, new DateTime (2000, 12, 12, 11, 59, 59)); @@@ -1130,9 -1130,9 +1082,7 @@@ [Test] [ExpectedException(typeof (ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeArgumenException1 () { File.SetCreationTime ("", new DateTime (2000, 12, 12, 11, 59, 59)); @@@ -1140,9 -1140,9 +1090,7 @@@ [Test] [ExpectedException(typeof (ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeArgumenException2 () { File.SetCreationTime (" ", new DateTime (2000, 12, 12, 11, 59, 59)); @@@ -1150,9 -1150,9 +1098,7 @@@ [Test] // On Unix there are no invalid path chars. --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeArgumenException3 () { if (Path.InvalidPathChars.Length > 1) { @@@ -1169,9 -1169,9 +1115,7 @@@ [Test] [ExpectedException(typeof (FileNotFoundException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeFileNotFoundException1 () { string path = TempFolder + Path.DirectorySeparatorChar + "SetCreationTimeFileNotFoundException1"; @@@ -1200,9 -1200,9 +1144,7 @@@ [Test] [ExpectedException(typeof (IOException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeIOException1 () { string path = TempFolder + Path.DirectorySeparatorChar + "CreationTimeIOException1"; @@@ -1220,9 -1220,9 +1162,7 @@@ [Test] [ExpectedException(typeof (ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeUtcArgumentNullException1 () { File.SetCreationTimeUtc (null as string, new DateTime (2000, 12, 12, 11, 59, 59)); @@@ -1230,9 -1230,9 +1170,7 @@@ [Test] [ExpectedException(typeof (ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeUtcArgumenException1 () { File.SetCreationTimeUtc ("", new DateTime (2000, 12, 12, 11, 59, 59)); @@@ -1240,9 -1240,9 +1178,7 @@@ [Test] [ExpectedException(typeof (ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeUtcArgumenException2 () { File.SetCreationTimeUtc (" ", new DateTime (2000, 12, 12, 11, 59, 59)); @@@ -1250,9 -1250,9 +1186,7 @@@ [Test] // On Unix there are no invalid path chars. --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeUtcArgumentException3 () { if (Path.InvalidPathChars.Length > 1) { @@@ -1269,9 -1269,9 +1203,7 @@@ [Test] [ExpectedException(typeof (FileNotFoundException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeUtcFileNotFoundException1 () { string path = TempFolder + Path.DirectorySeparatorChar + "SetCreationTimeUtcFileNotFoundException1"; @@@ -1300,9 -1300,9 +1232,7 @@@ [Test] [ExpectedException(typeof (IOException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM public void SetCreationTimeUtcIOException1 () { string path = TempFolder + Path.DirectorySeparatorChar + "SetCreationTimeUtcIOException1"; @@@ -1322,9 -1322,9 +1252,7 @@@ [Test] [ExpectedException(typeof (ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeArgumentNullException1 () { File.SetLastAccessTime (null as string, new DateTime (2000, 12, 12, 11, 59, 59)); @@@ -1332,9 -1332,9 +1260,7 @@@ [Test] [ExpectedException(typeof (ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeArgumenException1 () { File.SetLastAccessTime ("", new DateTime (2000, 12, 12, 11, 59, 59)); @@@ -1342,9 -1342,9 +1268,7 @@@ [Test] [ExpectedException(typeof (ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeArgumenException2 () { File.SetLastAccessTime (" ", new DateTime (2000, 12, 12, 11, 59, 59)); @@@ -1352,9 -1352,9 +1276,7 @@@ [Test] // On Unix there are no invalid path chars. --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeArgumenException3 () { if (Path.InvalidPathChars.Length > 1) { @@@ -1371,9 -1371,9 +1293,7 @@@ [Test] [ExpectedException(typeof (FileNotFoundException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeFileNotFoundException1 () { string path = TempFolder + Path.DirectorySeparatorChar + "SetLastAccessTimeFileNotFoundException1"; @@@ -1402,9 -1402,9 +1322,7 @@@ [Test] [ExpectedException(typeof (IOException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeIOException1 () { string path = TempFolder + Path.DirectorySeparatorChar + "LastAccessIOException1"; @@@ -1422,9 -1422,9 +1340,7 @@@ [Test] [ExpectedException(typeof (ArgumentNullException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeUtcArgumentNullException1 () { File.SetLastAccessTimeUtc (null as string, new DateTime (2000, 12, 12, 11, 59, 59)); @@@ -1432,9 -1432,9 +1348,7 @@@ [Test] [ExpectedException(typeof (ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetCLastAccessTimeUtcArgumenException1 () { File.SetLastAccessTimeUtc ("", new DateTime (2000, 12, 12, 11, 59, 59)); @@@ -1442,9 -1442,9 +1356,7 @@@ [Test] [ExpectedException(typeof (ArgumentException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeUtcArgumenException2 () { File.SetLastAccessTimeUtc (" ", new DateTime (2000, 12, 12, 11, 59, 59)); @@@ -1452,9 -1452,9 +1364,7 @@@ [Test] // On Unix there are no invalid path chars. --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeUtcArgumenException3 () { if (Path.InvalidPathChars.Length > 1) { @@@ -1471,9 -1471,9 +1381,7 @@@ [Test] [ExpectedException(typeof (FileNotFoundException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeUtcFileNotFoundException1 () { string path = TempFolder + Path.DirectorySeparatorChar + "SetLastAccessTimeUtcFileNotFoundException1"; @@@ -1502,9 -1502,9 +1410,7 @@@ [Test] [ExpectedException(typeof (IOException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif ++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM public void SetLastAccessTimeUtcIOException1 () { string path = TempFolder + Path.DirectorySeparatorChar + "SetLastAccessTimeUtcIOException1"; @@@ -1589,9 -1589,9 +1495,6 @@@ [Test] [ExpectedException(typeof (IOException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif public void SetLastWriteTimeIOException1 () { string path = TempFolder + Path.DirectorySeparatorChar + "LastWriteTimeIOException1"; @@@ -1674,9 -1674,9 +1577,6 @@@ // [Test] [ExpectedException(typeof (IOException))] --#if TARGET_JVM -- [Category("NotWorking")] --#endif public void SetLastWriteTimeUtcIOException1 () { string path = TempFolder + Path.DirectorySeparatorChar + "SetLastWriteTimeUtcIOException1"; @@@ -1684,7 -1684,7 +1584,7 @@@ FileStream stream = null; try { stream = File.Create (path); -- File.SetLastAccessTimeUtc (path, new DateTime (1000, 12, 12, 11, 59, 59)); ++ File.SetLastWriteTimeUtc (path, new DateTime (1000, 12, 12, 11, 59, 59)); } finally { if (stream != null) stream.Close (); diff --combined mcs/class/corlib/Test/System.IO/PathTest.cs index da6cc6da192,da6cc6da192..3d490f661f7 --- a/mcs/class/corlib/Test/System.IO/PathTest.cs +++ b/mcs/class/corlib/Test/System.IO/PathTest.cs @@@ -650,13 -650,13 +650,11 @@@ namespace MonoTests.System.I [Test] public void WindowsSystem32_76191 () { --#if !TARGET_JVM // check for Unix platforms - see FAQ for more details // http://www.mono-project.com/FAQ:_Technical#How_to_detect_the_execution_platform_.3F int platform = (int) Environment.OSVersion.Platform; if ((platform == 4) || (platform == 128)) return; --#endif string curdir = Directory.GetCurrentDirectory (); try { @@@ -677,13 -677,13 +675,11 @@@ [Test] public void WindowsSystem32_77007 () { --#if !TARGET_JVM // check for Unix platforms - see FAQ for more details // http://www.mono-project.com/FAQ:_Technical#How_to_detect_the_execution_platform_.3F int platform = (int) Environment.OSVersion.Platform; if ((platform == 4) || (platform == 128)) return; --#endif string curdir = Directory.GetCurrentDirectory (); try { diff --combined mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs index 8468da6e430,73b29df048d..b46c8604459 --- a/mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs @@@ -13,9 -13,7 +13,9 @@@ using System using System.Configuration.Assemblies; using System.IO; using System.Reflection; +#if !TARGET_JVM using System.Reflection.Emit; +#endif using System.Runtime.Serialization; using System.Threading; using System.Globalization; @@@ -53,7 -51,7 +53,9 @@@ public class AssemblyNameTest private string tempDir = Path.Combine (Path.GetTempPath (), "MonoTests.System.Reflection.AssemblyNameTest"); ++#if !TARGET_JVM // Thread.GetDomain is not supported for TARGET_JVM. private AppDomain domain; ++#endif // TARGET_JVM // created with "sn -o test.snk test.txt" static byte[] publicKey = { 0x07, 0x02, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x52, 0x53, 0x41, 0x32, 0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x3D, 0xBD, 0x72, 0x08, 0xC6, 0x2B, 0x0E, 0xA8, 0xC1, 0xC0, 0x58, 0x07, 0x2B, 0x63, 0x5F, 0x7C, 0x9A, 0xBD, 0xCB, 0x22, 0xDB, 0x20, 0xB2, 0xA9, 0xDA, 0xDA, 0xEF, 0xE8, 0x00, 0x64, 0x2F, 0x5D, 0x8D, 0xEB, 0x78, 0x02, 0xF7, 0xA5, 0x36, 0x77, 0x28, 0xD7, 0x55, 0x8D, 0x14, 0x68, 0xDB, 0xEB, 0x24, 0x09, 0xD0, 0x2B, 0x13, 0x1B, 0x92, 0x6E, 0x2E, 0x59, 0x54, 0x4A, 0xAC, 0x18, 0xCF, 0xC9, 0x09, 0x02, 0x3F, 0x4F, 0xA8, 0x3E, 0x94, 0x00, 0x1F, 0xC2, 0xF1, 0x1A, 0x27, 0x47, 0x7D, 0x10, 0x84, 0xF5, 0x14, 0xB8, 0x61, 0x62, 0x1A, 0x0C, 0x66, 0xAB, 0xD2, 0x4C, 0x4B, 0x9F, 0xC9, 0x0F, 0x3C, 0xD8, 0x92, 0x0F, 0xF5, 0xFF, 0xCE, 0xD7, 0x6E, 0x5C, 0x6F, 0xB1, 0xF5, 0x7D, 0xD3, 0x56, 0xF9, 0x67, 0x27, 0xA4, 0xA5, 0x48, 0x5B, 0x07, 0x93, 0x44, 0x00, 0x4A, 0xF8, 0xFF, 0xA4, 0xCB, 0x73, 0xC0, 0x6A, 0x62, 0xB4, 0xB7, 0xC8, 0x92, 0x58, 0x87, 0xCD, 0x07, @@@ -75,7 -73,7 +77,9 @@@ Directory.CreateDirectory (tempDir); ++#if !TARGET_JVM // Thread.GetDomain is not supported for TARGET_JVM. domain = Thread.GetDomain (); ++#endif // TARGET_JVM } [TearDown] @@@ -298,7 -296,6 +302,7 @@@ return assemblyName; } +#if !TARGET_JVM // Reflection.Emit is not supported for TARGET_JVM. private Assembly GenerateAssembly (AssemblyName name) { AssemblyBuilder ab = domain.DefineDynamicAssembly ( @@@ -382,7 -379,6 +386,7 @@@ Assert.AreEqual ("1.2.65535.65535", ab.GetName ().Version.ToString (), "1.2.0.0 dynamic"); #endif } +#endif // TARGET_JVM [Test] public void HashAlgorithm () @@@ -473,7 -469,6 +477,7 @@@ AssertEqualsByteArrays ("PublicToken", an.GetPublicKeyToken (), dsAssemblyName.GetPublicKeyToken ()); } +#if !TARGET_JVM // Assemblyname.GetObjectData not implemented yet for TARGET_JVM [Test] [ExpectedException (typeof (ArgumentNullException))] public void GetObjectData_Null () @@@ -481,7 -476,6 +485,7 @@@ AssemblyName an = new AssemblyName (); an.GetObjectData (null, new StreamingContext (StreamingContextStates.All)); } +#endif // TARGET_JVM [Test] #if NET_2_0 @@@ -600,6 -594,6 +604,7 @@@ } [Test] ++ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM. public void Ctor2 () { const string assemblyName = "TestAssembly"; @@@ -644,6 -638,6 +649,7 @@@ } [Test] ++ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM. public void Ctor5 () { const string assemblyName = "TestAssembly"; diff --combined mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs index f5e700ce598,2f9068e80da..85972ebafcb --- a/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs @@@ -35,9 -35,7 +35,9 @@@ using System.Configuration.Assemblies using System.Globalization; using System.IO; using System.Reflection; +#if !TARGET_JVM using System.Reflection.Emit; +#endif using System.Runtime.Serialization; using System.Security; @@@ -85,18 -83,16 +85,18 @@@ namespace MonoTests.System.Reflectio string fname = AppDomain.CurrentDomain.FriendlyName; if (fname.EndsWith (".dll")) { // nunit-console Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly"); -#if NET_2_0 +#if NET_2_0 && !TARGET_JVM // IsDefaultAppDomain not supported for TARGET_JVM Assert.IsFalse (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain"); #endif } else { // gnunit Assert.IsNotNull (Assembly.GetEntryAssembly (), "GetEntryAssembly"); -#if NET_2_0 +#if NET_2_0 && !TARGET_JVM // IsDefaultAppDomain not supported for TARGET_JVM Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain"); #endif } } + +#if !TARGET_JVM // ManifestModule not supported under TARGET_JVM. #if NET_2_0 [Category ("NotWorking")] #endif @@@ -145,7 -141,6 +145,7 @@@ Assert.AreEqual ("v1.1.4322", corlib_test.ImageRuntimeVersion, "ImageRuntimeVersion"); #endif } +#endif [Test] public void GetAssembly () @@@ -155,6 -150,6 +155,7 @@@ } [Test] ++ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM [ExpectedException (typeof (ArgumentNullException))] public void GetFile_Null () { @@@ -162,6 -157,6 +163,7 @@@ } [Test] ++ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM [ExpectedException (typeof (ArgumentException))] public void GetFile_Empty () { @@@ -169,6 -164,6 +171,7 @@@ } [Test] ++ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM public void GetFiles_False () { Assembly corlib = typeof (int).Assembly; @@@ -181,6 -176,6 +184,7 @@@ } [Test] ++ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM public void GetFiles_True () { Assembly corlib = typeof (int).Assembly; @@@ -256,7 -251,6 +260,7 @@@ Assertion.Fail ("Was not able to load any corlib test"); } +#if !TARGET_JVM // GetObjectData currently not implemented for Assembly. [Test] [ExpectedException (typeof (ArgumentNullException))] public void GetObjectData_Null () @@@ -264,7 -258,6 +268,7 @@@ Assembly corlib = typeof (int).Assembly; corlib.GetObjectData (null, new StreamingContext (StreamingContextStates.All)); } +#endif // TARGET_JVM [Test] public void GetReferencedAssemblies () @@@ -286,7 -279,6 +290,7 @@@ } } +#if !TARGET_JVM // Reflection.Emit is not supported. [Test] public void Location_Empty() { string assemblyFileName = Path.Combine ( @@@ -905,7 -897,6 +909,7 @@@ Directory.Delete (outdir, true); } +#endif // TARGET_JVM [Serializable ()] private class AssemblyResolveHandler diff --combined mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs index ba8cea1433f,e5af6da9a31..3c953d6d2c7 --- a/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs @@@ -86,6 -86,6 +86,7 @@@ namespace MonoTests.System.Reflectio } [Test] ++ [Category ("TargetJvmNotWorking")] public void ReturnTypePseudoCustomAttributes () { MethodInfo mi = typeof (MethodInfoTest).GetMethod ("ReturnTypeMarshalAs"); @@@ -277,7 -277,7 +278,7 @@@ } public void MakeGenericMethodArgsMismatchFoo () {} - + [Test] [ExpectedException (typeof (ArgumentException))] public void MakeGenericMethodArgsMismatch () diff --combined mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs index 3835254c392,baa20a6c13e..4267754c6bc --- a/mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs @@@ -10,9 -10,7 +10,9 @@@ using System; using System.Threading; using System.Reflection; +#if !TARGET_JVM using System.Reflection.Emit; +#endif // TARGET_JVM using System.Runtime.InteropServices; using NUnit.Framework; @@@ -63,7 -61,7 +63,7 @@@ public class ParameterInfoTest : Assert public static void paramMethod (int i, [In] int j, [Out] int k, [Optional] int l, [In,Out] int m, [DefaultParameterValue (ParamEnum.Foo)] ParamEnum n) { } --#if !TARGET_JVM ++#if !TARGET_JVM // No support for extern methods in TARGET_JVM [DllImport ("foo")] public extern static void marshalAsMethod ( [MarshalAs(UnmanagedType.Bool)]int p0, @@@ -87,6 -85,6 +87,7 @@@ AssertEquals (1, info[3].GetCustomAttributes (typeof (OptionalAttribute), true).Length); AssertEquals (2, info[4].GetCustomAttributes (true).Length); ++#if !TARGET_JVM // No support for extern methods in TARGET_JVM ParameterInfo[] pi = typeof (ParameterInfoTest).GetMethod ("marshalAsMethod").GetParameters (); MarshalAsAttribute attr; @@@ -101,6 -99,6 +102,7 @@@ AssertEquals (UnmanagedType.CustomMarshaler, attr.Value); AssertEquals ("5", attr.MarshalCookie); AssertEquals (typeof (Marshal1), Type.GetType (attr.MarshalType)); ++#endif } #endif } diff --combined mcs/class/corlib/Test/System.Runtime.Remoting.Contexts/SynchronizationAttributeTest.cs index ba69ed0503b,ba69ed0503b..d0b31f1a8a8 --- a/mcs/class/corlib/Test/System.Runtime.Remoting.Contexts/SynchronizationAttributeTest.cs +++ b/mcs/class/corlib/Test/System.Runtime.Remoting.Contexts/SynchronizationAttributeTest.cs @@@ -107,7 -107,7 +107,11 @@@ namespace MonoTests.System.Runtime.Remo public void DeserializeKnownValue () { MemoryStream ms = new MemoryStream (serialized_sync_attr); ++#if TARGET_JVM ++ BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false); ++#else BinaryFormatter bf = new BinaryFormatter (); ++#endif // TARGET_JVM SynchronizationAttribute sa = (SynchronizationAttribute) bf.Deserialize (ms); Assert.IsTrue (sa.IsReEntrant, "IsReEntrant"); Assert.IsFalse (sa.Locked, "Locked"); diff --combined mcs/class/corlib/Test/System.Text/EncodingInfoTest.cs index eab01ffedee,eab01ffedee..36b9bec17d8 --- a/mcs/class/corlib/Test/System.Text/EncodingInfoTest.cs +++ b/mcs/class/corlib/Test/System.Text/EncodingInfoTest.cs @@@ -22,9 -22,9 +22,6 @@@ namespace MonoTests.System.Tex public class EncodingInfoTest { [Test] --#if TARGET_JVM -- [Category("NotWorking")] --#endif // The purpose of this test is to make sure that // new encodings added to I18N are also listed in the // returned array from Encoding.GetEncodings() so that diff --combined mcs/class/corlib/Test/System.Threading/MutexTest.cs index e1de7e96796,9f3706df929..6b3289c33ba --- a/mcs/class/corlib/Test/System.Threading/MutexTest.cs +++ b/mcs/class/corlib/Test/System.Threading/MutexTest.cs @@@ -25,11 -25,11 +25,11 @@@ namespace MonoTests.System.Threadin this.id = id; this.mut = mut; } - public void wait() + public void Wait() { mut.WaitOne(); } - public void signal() + public void Signal() { mut.ReleaseMutex(); } @@@ -47,7 -47,7 +47,7 @@@ public void WithoutWait() { this.marker = this.id; - this.signal(); + this.Signal(); } @@@ -55,15 -55,15 +55,15 @@@ { while (this.marker<100) { - this.wait(); + this.Wait(); this.marker++; - this.signal(); + this.Signal(); } } public void WaitAndForget() { - this.wait(); + this.Wait(); this.marker = id; } public void WaitAndWait() @@@ -161,6 -161,6 +161,7 @@@ } [Test] ++ [Category("TargetJvmNotSupported")] // IntPtr native handles are not supported for TARGET_JVM. public void TestHandle() { Mutex Sem = new Mutex(); diff --combined mcs/class/corlib/Test/System/ActivatorTest.cs index e9f794b7262,3a074240657..34d3b97d27e --- a/mcs/class/corlib/Test/System/ActivatorTest.cs +++ b/mcs/class/corlib/Test/System/ActivatorTest.cs @@@ -13,9 -13,7 +13,9 @@@ using System using System.Globalization; using System.IO; using System.Reflection; +#if !TARGET_JVM // Reflection.Emit not supported for TARGET_JVM using System.Reflection.Emit; +#endif using System.Runtime.InteropServices; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; @@@ -119,7 -117,6 +119,7 @@@ namespace MonoTests.System Assert.AreEqual (7, objCOMTest.Id, "#A05"); } +#if !TARGET_JVM // Reflection.Emit not supported for TARGET_JVM [Test] [ExpectedException (typeof (MissingMethodException))] public void CreateInstance_TypeBuilder () @@@ -142,7 -139,6 +142,7 @@@ { Activator.CreateInstance (typeof (ArgIterator), null); } +#endif // TARGET_JVM [Test] [ExpectedException (typeof (NotSupportedException))] @@@ -151,14 -147,12 +151,14 @@@ Activator.CreateInstance (typeof (void), null); } +#if !TARGET_JVM // RuntimeArgumentHandle not supported for TARGET_JVM [Test] [ExpectedException (typeof (NotSupportedException))] public void CreateInstance_RuntimeArgumentHandle () { Activator.CreateInstance (typeof (RuntimeArgumentHandle), null); } +#endif // TARGET_JVM [Test] [ExpectedException (typeof (NotSupportedException))] @@@ -186,6 -180,6 +186,7 @@@ #else [ExpectedException(typeof(MemberAccessException))] #endif ++ [Category ("TargetJvmNotWorking")] public void CreateInstanceAbstract2 () { Activator.CreateInstance (typeof (Type), true); @@@ -211,6 -205,6 +212,7 @@@ #else [ExpectedException (typeof (MemberAccessException))] #endif ++ [Category ("TargetJvmNotWorking")] public void CreateInstanceAbstract5 () { Activator.CreateInstance (typeof (Type), BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, null, CultureInfo.InvariantCulture, null); @@@ -218,6 -212,6 +220,7 @@@ #if NET_2_0 [Test] ++ [Category ("TargetJvmNotWorking")] public void CreateInstance_Nullable () { Assert.AreEqual (5, Activator.CreateInstance (typeof (Nullable), new object [] { 5 })); @@@ -237,6 -231,6 +240,7 @@@ [Test] [ExpectedException (typeof (ArgumentNullException))] ++ [Category ("TargetJvmNotWorking")] public void GetObject_UrlNull () { Activator.GetObject (typeof (COMTest), null); @@@ -291,6 -285,6 +295,7 @@@ } [Test] ++ [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning public void Unification_FromFx10 () { Unification (String.Format (CorlibPermissionPattern, fx10version)); @@@ -298,6 -292,6 +303,7 @@@ } [Test] ++ [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning public void Unification_FromFx11 () { Unification (String.Format (CorlibPermissionPattern, fx11version)); @@@ -305,6 -299,6 +311,7 @@@ } [Test] ++ [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning public void Unification_FromFx20 () { Unification (String.Format (CorlibPermissionPattern, fx20version)); @@@ -312,6 -306,6 +319,7 @@@ } [Test] ++ [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning public void Unification_FromFx99_Corlib () { Unification (String.Format (CorlibPermissionPattern, "9.99.999.9999")); @@@ -322,6 -316,6 +330,7 @@@ #if NET_2_0 [Test] ++ [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning [Category ("NotWorking")] public void Unification_FromFx99_System () { diff --combined mcs/class/corlib/Test/System/AppDomainSetupTest.cs index 60a9a3bf2bb,60a9a3bf2bb..b27b6d0381a --- a/mcs/class/corlib/Test/System/AppDomainSetupTest.cs +++ b/mcs/class/corlib/Test/System/AppDomainSetupTest.cs @@@ -33,6 -33,6 +33,7 @@@ namespace MonoTests.Syste } [Test] ++ [Category ("TargetJvmNotWorking")] public void ConfigurationFile_Relative_ApplicationBase () { string fileName = "blar.config"; @@@ -54,6 -54,6 +55,7 @@@ [Test] [ExpectedException (typeof (MemberAccessException))] // The ApplicationBase must be set before retrieving this property ++ [Category ("TargetJvmNotWorking")] public void ConfigurationFile_Relative_NoApplicationBase () { AppDomainSetup setup = new AppDomainSetup(); @@@ -74,6 -74,6 +76,7 @@@ } [Test] ++ [Category ("TargetJvmNotWorking")] public void ApplicationBase1 () { string expected_path = tmpPath.Replace(@"\", @"/"); @@@ -101,6 -101,6 +104,7 @@@ } [Test] ++ [Category ("TargetJvmNotWorking")] public void ApplicationBase2 () { AppDomainSetup setup = new AppDomainSetup (); @@@ -109,6 -109,6 +113,7 @@@ } [Test] ++ [Category ("TargetJvmNotWorking")] public void ApplicationBase3 () { AppDomainSetup setup = new AppDomainSetup (); @@@ -118,6 -118,6 +123,7 @@@ } [Test] ++ [Category ("TargetJvmNotWorking")] public void ApplicationBase4 () { AppDomainSetup setup = new AppDomainSetup (); @@@ -145,6 -145,6 +151,7 @@@ } [Test] ++ [Category ("TargetJvmNotWorking")] public void ApplicationBase5 () { // This is failing because of (probably) a windows-ism, so don't worry @@@ -173,6 -173,6 +180,7 @@@ } [Test] ++ [Category ("TargetJvmNotWorking")] public void ApplicationBase6 () { AppDomainSetup setup = new AppDomainSetup (); diff --combined mcs/class/corlib/Test/System/ArrayTest.cs index 9fce407fbdb,9fce407fbdb..04c59de5e41 --- a/mcs/class/corlib/Test/System/ArrayTest.cs +++ b/mcs/class/corlib/Test/System/ArrayTest.cs @@@ -470,6 -470,6 +470,11 @@@ public class ArrayTest : Assertio } catch (ArgumentException) { errorThrown = true; } ++#if TARGET_JVM // This is really implementation dependent behaviour. ++ catch (RankException) { ++ errorThrown = true; ++ } ++#endif // TARGET_JVM Assert("#E62", errorThrown); } { @@@ -630,6 -630,6 +635,7 @@@ Assert("#F03b", errorThrown); } #endif ++#if !TARGET_JVM // Arrays lower bounds are not supported for TARGET_JVM { bool errorThrown = false; try { @@@ -639,6 -639,6 +645,7 @@@ } Assert("#F04", errorThrown); } ++#endif // TARGET_JVM { bool errorThrown = false; try { @@@ -649,6 -649,6 +656,7 @@@ } Assert("#F05", errorThrown); } ++#if !TARGET_JVM // CreateInstance with lower bounds not supported for TARGET_JVM { bool errorThrown = false; try { @@@ -691,6 -691,6 +699,7 @@@ Type szarrayType = new int [10].GetType (); Assert (szarrayType == (Array.CreateInstance (typeof (int), new int[] {1}, new int[] {0})).GetType ()); Assert (szarrayType != (Array.CreateInstance (typeof (int), new int[] {1}, new int[] {1})).GetType ()); ++#endif // TARGET_JVM } [Test] @@@ -765,6 -765,6 +774,7 @@@ } [Test] ++ [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM public void TestGetEnumeratorNonZeroLowerBounds() { int[] myLengthsArray = new int[2] { 3, 5 }; int[] myBoundsArray = new int[2] { 2, 3 }; @@@ -793,6 -793,6 +803,7 @@@ } [Test] ++ [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM public void TestIList_Add () { int[] myLengthsArray = new int[2] { 3, 5 }; int[] myBoundsArray = new int[2] { 2, 3 }; @@@ -813,6 -813,6 +824,7 @@@ } [Test] ++ [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM public void TestIList_Insert () { int[] myLengthsArray = new int[2] { 3, 5 }; int[] myBoundsArray = new int[2] { 2, 3 }; @@@ -833,6 -833,6 +845,7 @@@ } [Test] ++ [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM public void TestIList_Remove () { int[] myLengthsArray = new int[2] { 3, 5 }; int[] myBoundsArray = new int[2] { 2, 3 }; @@@ -853,6 -853,6 +866,7 @@@ } [Test] ++ [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM public void TestIList_RemoveAt () { int[] myLengthsArray = new int[2] { 3, 5 }; int[] myBoundsArray = new int[2] { 2, 3 }; @@@ -873,6 -873,6 +887,7 @@@ } [Test] ++ [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM public void TestIList_Contains () { int[] myLengthsArray = new int[2] { 3, 5 }; int[] myBoundsArray = new int[2] { 2, 3 }; @@@ -898,6 -898,6 +913,7 @@@ } [Test] ++ [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM public void TestIList_IndexOf () { int[] myLengthsArray = new int[2] { 3, 5 }; int[] myBoundsArray = new int[2] { 2, 3 }; @@@ -2784,6 -2784,6 +2800,7 @@@ } ++#if !TARGET_JVM // BugBUG: T[] is not yet ICollection under TARGET_JVM [Test] // From bug #80563 public void ICollectionNull () @@@ -2808,6 -2808,6 +2825,7 @@@ test = new List(test); AssertEquals ("array with test", test.Contains (null), false); } ++#endif // TARGET_JVM #endif #region Bug 80299 diff --combined mcs/class/corlib/Test/System/BadImageFormatExceptionTest.cs index 0c3cadf6755,0c3cadf6755..66eb43aebbb --- a/mcs/class/corlib/Test/System/BadImageFormatExceptionTest.cs +++ b/mcs/class/corlib/Test/System/BadImageFormatExceptionTest.cs @@@ -64,8 -64,8 +64,12 @@@ namespace MonoTests.Syste Assert.IsNotNull (bif.Message, "#4"); Assert.AreEqual ("message", bif.Message, "#5"); Assert.IsNull (bif.FusionLog, "#6"); ++#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM ++ Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName + ": message"), "#7"); ++#else Assert.AreEqual (bif.GetType ().FullName + ": message", bif.ToString (), "#7"); ++#endif // TARGET_JVM } [Test] @@@ -81,8 -81,8 +85,12 @@@ Assert.IsNotNull (bif.Message, "#4"); Assert.AreEqual (string.Empty, bif.Message, "#5"); Assert.IsNull (bif.FusionLog, "#6"); ++#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM ++ Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": "), "#7"); ++#else Assert.AreEqual (bif.GetType ().FullName + ": ", bif.ToString (), "#7"); ++#endif // TARGET_JVM } [Test] @@@ -127,8 -127,8 +135,12 @@@ Assert.IsNotNull (bif.Message, "#5"); Assert.AreEqual ("message", bif.Message, "#6"); Assert.IsNull (bif.FusionLog, "#7"); ++#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM ++ Assert.IsTrue (bif.ToString ().IndexOf (ame.GetType ().FullName + ": something") != -1, "#8"); ++#else Assert.AreEqual (bif.GetType ().FullName + ": message ---> " + ame.GetType ().FullName + ": something", bif.ToString (), "#8"); ++#endif // TARGET_JVM } [Test] @@@ -146,8 -146,8 +158,12 @@@ Assert.IsNotNull (bif.Message, "#5"); Assert.AreEqual (string.Empty, bif.Message, "#6"); Assert.IsNull (bif.FusionLog, "#7"); ++#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM ++ Assert.IsTrue (bif.ToString ().IndexOf (ame.GetType ().FullName + ": something") != -1, "#8"); ++#else Assert.AreEqual (bif.GetType ().FullName + ": ---> " + ame.GetType ().FullName + ": something", bif.ToString (), "#8"); ++#endif // TARGET_JVM } [Test] @@@ -172,7 -172,7 +188,9 @@@ Assert.IsNull (bif.FusionLog, "#7"); Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName), "#8"); Assert.IsTrue (bif.ToString ().IndexOf ("---> " + ame.GetType ().FullName) != -1, "#9"); ++#if !TARGET_JVM // ToString always has a stack trace under TARGET_JVM Assert.IsFalse (bif.ToString ().IndexOf (Environment.NewLine) != -1, "#10"); ++#endif // TARGET_JVM } [Test] @@@ -189,8 -189,8 +207,12 @@@ Assert.IsNotNull (bif.Message, "#4"); Assert.AreEqual ("message", bif.Message, "#5"); Assert.IsNull (bif.FusionLog, "#6"); ++#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM ++ Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": message"), "#7"); ++#else Assert.AreEqual (bif.GetType ().FullName + ": message", bif.ToString (), "#7"); ++#endif // TARGET_JVM } [Test] @@@ -234,8 -234,8 +256,12 @@@ Assert.IsNotNull (bif.Message, "#5"); Assert.AreEqual ("message", bif.Message, "#6"); Assert.IsNull (bif.FusionLog, "#7"); ++#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM ++ Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": message"), "#8"); ++#else Assert.AreEqual (bif.GetType ().FullName + ": message", bif.ToString (), "#8"); ++#endif // TARGET_JVM } [Test] @@@ -252,8 -252,8 +278,12 @@@ Assert.IsNotNull (bif.Message, "#A4"); Assert.AreEqual ("message", bif.Message, "#A5"); Assert.IsNull (bif.FusionLog, "#A6"); ++#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM ++ Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": message"), "#A7"); ++#else Assert.AreEqual (bif.GetType ().FullName + ": message", bif.ToString (), "#A7"); ++#endif // TARGET_JVM bif = new BadImageFormatException (string.Empty, (string) null); @@@ -265,8 -265,8 +295,12 @@@ Assert.IsNotNull (bif.Message, "#B4"); Assert.AreEqual (string.Empty, bif.Message, "#B5"); Assert.IsNull (bif.FusionLog, "#B6"); ++#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM ++ Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": "), "#B7"); ++#else Assert.AreEqual (bif.GetType ().FullName + ": ", bif.ToString (), "#B7"); ++#endif // TARGET_JVM } [Test] @@@ -284,7 -284,7 +318,11 @@@ Assert.IsNotNull (bif.Message, "#5"); Assert.AreEqual (string.Empty, bif.Message, "#6"); Assert.IsNull (bif.FusionLog, "#7"); ++#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM ++ Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": "), "#8"); ++#else Assert.AreEqual (bif.GetType ().FullName + ": ", bif.ToString (), "#8"); ++#endif // TARGET_JVM } [Test] @@@ -308,7 -308,7 +346,9 @@@ Assert.IsNull (bif.FusionLog, "#5"); Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName + ": "), "#6"); ++#if !TARGET_JVM // ToString always has a stack trace under TARGET_JVM Assert.IsFalse (bif.ToString ().IndexOf (Environment.NewLine) != -1, "#7"); ++#endif // TARGET_JVM } [Test] @@@ -372,7 -372,7 +412,9 @@@ Assert.IsNull (bif.FusionLog, "#B6"); Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName + ": "), "#B7"); ++#if !TARGET_JVM // ToString always has a stack trace under TARGET_JVM Assert.IsFalse (bif.ToString ().IndexOf (Environment.NewLine) != -1, "#B8"); ++#endif // TARGET_JVM Assert.IsTrue (bif.ToString ().IndexOf ("''") != -1, "#B9"); } } diff --combined mcs/class/corlib/Test/System/ConvertTest.cs index c3e7e0ca0bd,c3e7e0ca0bd..a294a1ff82c --- a/mcs/class/corlib/Test/System/ConvertTest.cs +++ b/mcs/class/corlib/Test/System/ConvertTest.cs @@@ -2855,6 -2855,6 +2855,7 @@@ namespace MonoTests.System [Test] [ExpectedException (typeof (FormatException))] ++ [Category ("TargetJvmNotWorking")] public void FormatBase64CharArray_OnlyWhitespace () { Convert.FromBase64CharArray (new char[3] {' ', @@@ -2984,6 -2984,6 +2985,7 @@@ } [Test] ++ [Category ("TargetJvmNotWorking")] public void FromBase64_Empty () { AssertEquals (new byte[0], Convert.FromBase64String (string.Empty)); diff --combined mcs/class/corlib/Test/System/DecimalTest.cs index afd3b973d2e,afd3b973d2e..3bddac2e7db --- a/mcs/class/corlib/Test/System/DecimalTest.cs +++ b/mcs/class/corlib/Test/System/DecimalTest.cs @@@ -694,7 -694,7 +694,7 @@@ namespace MonoTests.System Assert(1.2345678901234e-14 == (double)d); d = new Decimal(1.2342278901234e-25); -- Assert((decimal)d == 1.234e-25m); ++ AssertEquals("A10", d, 1.234e-25m); // test exceptions try diff --combined mcs/class/corlib/Test/System/DecimalTest2.cs index 4df2d39b7e5,4df2d39b7e5..e963f05c230 --- a/mcs/class/corlib/Test/System/DecimalTest2.cs +++ b/mcs/class/corlib/Test/System/DecimalTest2.cs @@@ -138,8 -138,8 +138,8 @@@ namespace MonoTests.Syste public void TestRemainder() { Assert((decimal)Decimal.Remainder(3.6m, 1.3m) == 1.0m); -- Assert((decimal)Decimal.Remainder(79228162514264337593543950335m , -- 27703302467091960609331879.53200m) == 24420760848422211464106753m); ++ AssertEquals("A02", Decimal.Remainder(79228162514264337593543950335m, ++ 27703302467091960609331879.53200m), 24420760848422211464106753m); Assert((decimal)Decimal.Remainder(45937986975432m, 43987453m) == 42334506m); @@@ -281,9 -281,9 +281,9 @@@ Fail("" + errOp + " wrong multiplications, " + errOverflow + " wrong overflows"); } } -- -- // MS 1.x is being less precise than Mono (2 cases). MS 2.0 is correct. -- // Mono doesn't produce the same result for (i==21/j==3) ++ ++ // MS 1.x is being less precise than Mono (2 cases). MS 2.0 is correct. ++ // Mono doesn't produce the same result for (i==21/j==3) public void TestDiv() { decimal[] args = auto_build2; diff --combined mcs/class/corlib/Test/System/TimeZoneTest.cs index 0c23887b223,0c23887b223..8a1bf1aff5c --- a/mcs/class/corlib/Test/System/TimeZoneTest.cs +++ b/mcs/class/corlib/Test/System/TimeZoneTest.cs @@@ -162,6 -162,6 +162,7 @@@ public class TimeZoneTest : TestCase } [Test] ++ [Category ("TargetJvmNotWorking")] public void CurrentTimeZone_SerializationRoundtrip () { TimeZone tz = TimeZone.CurrentTimeZone; diff --combined mcs/class/corlib/Test/System/TypeTest.cs index 6387581c99e,1189ddce487..70b07ff249c --- a/mcs/class/corlib/Test/System/TypeTest.cs +++ b/mcs/class/corlib/Test/System/TypeTest.cs @@@ -12,7 -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 { @@@ -137,11 -136,11 +137,16 @@@ namespace MonoTests.Syste 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"); @@@ -207,6 -206,6 +212,7 @@@ } [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"); @@@ -218,7 -217,6 +224,7 @@@ 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 { } @@@ -243,7 -241,6 +249,7 @@@ Assert.AreEqual (CharSet.Unicode, attr3.CharSet); } #endif +#endif // TARGET_JVM [Test] public void Namespace () { @@@ -551,31 -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 ()