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=0ea41d6afbeda9304c8257560e165740be2d4027;p=mono.git Mark tests as not working under TARGET_JVM svn path=/trunk/mcs/; revision=74246 --- diff --git a/mcs/class/corlib/Test/ChangeLog b/mcs/class/corlib/Test/ChangeLog index dbca6f93afb..631a60b5c0f 100644 --- a/mcs/class/corlib/Test/ChangeLog +++ b/mcs/class/corlib/Test/ChangeLog @@ -1,8 +1,12 @@ -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. diff --git a/mcs/class/corlib/Test/Mscorlib.Test20.csproj b/mcs/class/corlib/Test/Mscorlib.Test20.csproj index 24ce8488bcb..78f2b2846c1 100644 --- a/mcs/class/corlib/Test/Mscorlib.Test20.csproj +++ b/mcs/class/corlib/Test/Mscorlib.Test20.csproj @@ -60,6 +60,10 @@ + + ..\..\lib\J2SE.Helpers.dll + False + @@ -89,7 +93,7 @@ - + @@ -159,6 +163,7 @@ + diff --git a/mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs b/mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs index 09e12a9eb79..95f034bb5b9 100644 --- a/mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs +++ b/mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs @@ -543,6 +543,7 @@ namespace MonoTests.System.Collections.Generic { } [Test] + [Category ("TargetJvmNotWorking")] // BUGBUG Very very slow on TARGET_JVM. public void SerializationTest() { for (int i = 0; i < 50; i++) diff --git a/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs b/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs index fde491bf91e..a6951d9fe6c 100644 --- a/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs +++ b/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs @@ -321,6 +321,7 @@ namespace MonoTests.System.Collections.Generic { } [Test] + [Category ("TargetJvmNotWorking")] public void SerializeTest () { List list = new List (); @@ -328,7 +329,11 @@ namespace MonoTests.System.Collections.Generic { 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 +345,18 @@ namespace MonoTests.System.Collections.Generic { } [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"); diff --git a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs b/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs index a810cf66bdc..7343d515878 100644 --- a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs +++ b/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs @@ -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 +152,13 @@ namespace MonoTests.System.Collections { } [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 --git a/mcs/class/corlib/Test/System.Collections/HashtableTest.cs b/mcs/class/corlib/Test/System.Collections/HashtableTest.cs index 2db98b7dc8d..e8c364ae500 100644 --- a/mcs/class/corlib/Test/System.Collections/HashtableTest.cs +++ b/mcs/class/corlib/Test/System.Collections/HashtableTest.cs @@ -411,9 +411,6 @@ public class HashtableTest : Assertion { } [Test] -#if TARGET_JVM - [Category ("NotWorking")] -#endif public void TestCopyTo() { { bool errorThrown = false; @@ -502,6 +499,13 @@ public class HashtableTest : Assertion { 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 +537,23 @@ public class HashtableTest : Assertion { 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 --git a/mcs/class/corlib/Test/System.Globalization/CompareInfoTest.jvm.cs b/mcs/class/corlib/Test/System.Globalization/CompareInfoTest.jvm.cs new file mode 100644 index 00000000000..8b3d1457a62 --- /dev/null +++ b/mcs/class/corlib/Test/System.Globalization/CompareInfoTest.jvm.cs @@ -0,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 --git a/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs b/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs index 2738195a502..bf8aa36c1d7 100644 --- a/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs +++ b/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs @@ -39,6 +39,7 @@ namespace MonoTests.System.Globalization } [Test] + [Category ("TargetJvmNotWorking")] //OptionalCalendars not yet supported for TARGET_JVM. // make sure that all CultureInfo holds non-null calendars. public void OptionalCalendars () { diff --git a/mcs/class/corlib/Test/System.Globalization/DaylightTimeTest.cs b/mcs/class/corlib/Test/System.Globalization/DaylightTimeTest.cs index 664249597e2..76edd4cff51 100644 --- a/mcs/class/corlib/Test/System.Globalization/DaylightTimeTest.cs +++ b/mcs/class/corlib/Test/System.Globalization/DaylightTimeTest.cs @@ -78,7 +78,11 @@ namespace MonoTests.System.Globalization { 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 --git a/mcs/class/corlib/Test/System.IO/BinaryReaderTest.cs b/mcs/class/corlib/Test/System.IO/BinaryReaderTest.cs index 211c07d520d..5661fef921c 100644 --- a/mcs/class/corlib/Test/System.IO/BinaryReaderTest.cs +++ b/mcs/class/corlib/Test/System.IO/BinaryReaderTest.cs @@ -1063,9 +1063,6 @@ namespace MonoTests.System.IO [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 +1231,6 @@ namespace MonoTests.System.IO } [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 --git a/mcs/class/corlib/Test/System.IO/BinaryWriterTest.cs b/mcs/class/corlib/Test/System.IO/BinaryWriterTest.cs index fc63e4c750d..118874e0ff3 100644 --- a/mcs/class/corlib/Test/System.IO/BinaryWriterTest.cs +++ b/mcs/class/corlib/Test/System.IO/BinaryWriterTest.cs @@ -411,9 +411,6 @@ public class BinaryWriterTest : Assertion { } [Test] -#if TARGET_JVM - [Category("NotWorking")] -#endif public void WriteFloat () { MemoryStream stream = new MemoryStream (); diff --git a/mcs/class/corlib/Test/System.IO/DirectoryInfoTest.cs b/mcs/class/corlib/Test/System.IO/DirectoryInfoTest.cs index 1b615b63caa..f2b4f36c0e3 100644 --- a/mcs/class/corlib/Test/System.IO/DirectoryInfoTest.cs +++ b/mcs/class/corlib/Test/System.IO/DirectoryInfoTest.cs @@ -612,9 +612,6 @@ namespace MonoTests.System.IO } [Test] -#if TARGET_JVM - [Category("NotWorking")] -#endif public void DirectoryNameWithSpace () { // check for Unix platforms - see FAQ for more details @@ -679,40 +676,32 @@ namespace MonoTests.System.IO 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 --git a/mcs/class/corlib/Test/System.IO/DirectoryTest.cs b/mcs/class/corlib/Test/System.IO/DirectoryTest.cs index 2db033fc1db..4311d691e69 100644 --- a/mcs/class/corlib/Test/System.IO/DirectoryTest.cs +++ b/mcs/class/corlib/Test/System.IO/DirectoryTest.cs @@ -274,10 +274,8 @@ public class DirectoryTest #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,7 @@ public class DirectoryTest [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 +293,7 @@ public class DirectoryTest #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 +317,7 @@ public class DirectoryTest [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 +325,7 @@ public class DirectoryTest [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 +333,7 @@ public class DirectoryTest [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 +341,7 @@ public class DirectoryTest [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 +351,7 @@ public class DirectoryTest #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 +375,7 @@ public class DirectoryTest [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 +383,7 @@ public class DirectoryTest [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 +391,7 @@ public class DirectoryTest [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 +399,7 @@ public class DirectoryTest [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 +409,7 @@ public class DirectoryTest #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 +434,7 @@ public class DirectoryTest [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 +442,7 @@ public class DirectoryTest [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 +450,7 @@ public class DirectoryTest [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 +458,7 @@ public class DirectoryTest [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 +468,7 @@ public class DirectoryTest #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 +491,7 @@ public class DirectoryTest [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 +499,7 @@ public class DirectoryTest [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 +741,7 @@ public class DirectoryTest } [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 +795,7 @@ public class DirectoryTest } [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 +1017,7 @@ public class DirectoryTest [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 +1026,7 @@ public class DirectoryTest [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 +1035,7 @@ public class DirectoryTest [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 +1050,7 @@ public class DirectoryTest [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 +1059,7 @@ public class DirectoryTest [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 +1085,7 @@ public class DirectoryTest [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 +1094,7 @@ public class DirectoryTest [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 +1103,7 @@ public class DirectoryTest [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 +1118,7 @@ public class DirectoryTest [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 +1127,7 @@ public class DirectoryTest [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 +1152,7 @@ public class DirectoryTest [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 +1161,7 @@ public class DirectoryTest [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 +1170,7 @@ public class DirectoryTest [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 +1186,7 @@ public class DirectoryTest [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 +1195,7 @@ public class DirectoryTest [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 +1222,7 @@ public class DirectoryTest [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 +1231,7 @@ public class DirectoryTest [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 +1240,7 @@ public class DirectoryTest [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 +1257,7 @@ public class DirectoryTest [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 +1266,7 @@ public class DirectoryTest [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 --git a/mcs/class/corlib/Test/System.IO/FileInfoTest.cs b/mcs/class/corlib/Test/System.IO/FileInfoTest.cs index d2a2fd6e360..809647d6b66 100644 --- a/mcs/class/corlib/Test/System.IO/FileInfoTest.cs +++ b/mcs/class/corlib/Test/System.IO/FileInfoTest.cs @@ -632,9 +632,7 @@ namespace MonoTests.System.IO [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 --git a/mcs/class/corlib/Test/System.IO/FileStreamTest.cs b/mcs/class/corlib/Test/System.IO/FileStreamTest.cs index f39861c86a6..0d7b6d258f8 100644 --- a/mcs/class/corlib/Test/System.IO/FileStreamTest.cs +++ b/mcs/class/corlib/Test/System.IO/FileStreamTest.cs @@ -983,9 +983,7 @@ namespace MonoTests.System.IO 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"; diff --git a/mcs/class/corlib/Test/System.IO/FileSystemInfoTest.cs b/mcs/class/corlib/Test/System.IO/FileSystemInfoTest.cs index 78ccf617302..43efdf5e669 100644 --- a/mcs/class/corlib/Test/System.IO/FileSystemInfoTest.cs +++ b/mcs/class/corlib/Test/System.IO/FileSystemInfoTest.cs @@ -69,9 +69,7 @@ namespace MonoTests.System.IO } [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 +122,7 @@ namespace MonoTests.System.IO } [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 +164,7 @@ namespace MonoTests.System.IO } [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 +214,7 @@ namespace MonoTests.System.IO } [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 +238,7 @@ namespace MonoTests.System.IO } [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 +282,7 @@ namespace MonoTests.System.IO } [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 --git a/mcs/class/corlib/Test/System.IO/FileTest.cs b/mcs/class/corlib/Test/System.IO/FileTest.cs index f66c6b41e8e..97b51bfd331 100644 --- a/mcs/class/corlib/Test/System.IO/FileTest.cs +++ b/mcs/class/corlib/Test/System.IO/FileTest.cs @@ -587,9 +587,7 @@ namespace MonoTests.System.IO } [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 +604,7 @@ namespace MonoTests.System.IO // 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 +649,7 @@ namespace MonoTests.System.IO } [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 +745,7 @@ namespace MonoTests.System.IO [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 +753,7 @@ namespace MonoTests.System.IO [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 +763,7 @@ namespace MonoTests.System.IO #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 +783,7 @@ namespace MonoTests.System.IO [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 +791,7 @@ namespace MonoTests.System.IO [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 +799,7 @@ namespace MonoTests.System.IO [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 +807,7 @@ namespace MonoTests.System.IO [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 +817,7 @@ namespace MonoTests.System.IO #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 +836,7 @@ namespace MonoTests.System.IO [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 +844,7 @@ namespace MonoTests.System.IO [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 +852,7 @@ namespace MonoTests.System.IO [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 +860,7 @@ namespace MonoTests.System.IO [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 +870,7 @@ namespace MonoTests.System.IO #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 +890,7 @@ namespace MonoTests.System.IO [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 +898,7 @@ namespace MonoTests.System.IO [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 +906,7 @@ namespace MonoTests.System.IO [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 +914,7 @@ namespace MonoTests.System.IO [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 +924,7 @@ namespace MonoTests.System.IO #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 +943,7 @@ namespace MonoTests.System.IO [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 +951,7 @@ namespace MonoTests.System.IO [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 +1074,7 @@ namespace MonoTests.System.IO [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 +1082,7 @@ namespace MonoTests.System.IO [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 +1090,7 @@ namespace MonoTests.System.IO [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 +1098,7 @@ namespace MonoTests.System.IO [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 +1115,7 @@ namespace MonoTests.System.IO [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 +1144,7 @@ namespace MonoTests.System.IO [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 +1162,7 @@ namespace MonoTests.System.IO [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 +1170,7 @@ namespace MonoTests.System.IO [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 +1178,7 @@ namespace MonoTests.System.IO [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 +1186,7 @@ namespace MonoTests.System.IO [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 +1203,7 @@ namespace MonoTests.System.IO [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 +1232,7 @@ namespace MonoTests.System.IO [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 +1252,7 @@ namespace MonoTests.System.IO [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 +1260,7 @@ namespace MonoTests.System.IO [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 +1268,7 @@ namespace MonoTests.System.IO [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 +1276,7 @@ namespace MonoTests.System.IO [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 +1293,7 @@ namespace MonoTests.System.IO [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 +1322,7 @@ namespace MonoTests.System.IO [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 +1340,7 @@ namespace MonoTests.System.IO [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 +1348,7 @@ namespace MonoTests.System.IO [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 +1356,7 @@ namespace MonoTests.System.IO [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 +1364,7 @@ namespace MonoTests.System.IO [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 +1381,7 @@ namespace MonoTests.System.IO [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 +1410,7 @@ namespace MonoTests.System.IO [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 +1495,6 @@ namespace MonoTests.System.IO [Test] [ExpectedException(typeof (IOException))] -#if TARGET_JVM - [Category("NotWorking")] -#endif public void SetLastWriteTimeIOException1 () { string path = TempFolder + Path.DirectorySeparatorChar + "LastWriteTimeIOException1"; @@ -1674,9 +1577,6 @@ namespace MonoTests.System.IO // [Test] [ExpectedException(typeof (IOException))] -#if TARGET_JVM - [Category("NotWorking")] -#endif public void SetLastWriteTimeUtcIOException1 () { string path = TempFolder + Path.DirectorySeparatorChar + "SetLastWriteTimeUtcIOException1"; @@ -1684,7 +1584,7 @@ namespace MonoTests.System.IO 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 --git a/mcs/class/corlib/Test/System.IO/PathTest.cs b/mcs/class/corlib/Test/System.IO/PathTest.cs index da6cc6da192..3d490f661f7 100644 --- a/mcs/class/corlib/Test/System.IO/PathTest.cs +++ b/mcs/class/corlib/Test/System.IO/PathTest.cs @@ -650,13 +650,11 @@ namespace MonoTests.System.IO [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 +675,11 @@ namespace MonoTests.System.IO [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 --git a/mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs b/mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs index 8468da6e430..b46c8604459 100644 --- a/mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs @@ -53,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 +77,9 @@ public class AssemblyNameTest { Directory.CreateDirectory (tempDir); +#if !TARGET_JVM // Thread.GetDomain is not supported for TARGET_JVM. domain = Thread.GetDomain (); +#endif // TARGET_JVM } [TearDown] @@ -600,6 +604,7 @@ public class AssemblyNameTest { } [Test] + [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM. public void Ctor2 () { const string assemblyName = "TestAssembly"; @@ -644,6 +649,7 @@ public class AssemblyNameTest { } [Test] + [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM. public void Ctor5 () { const string assemblyName = "TestAssembly"; diff --git a/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs b/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs index f5e700ce598..85972ebafcb 100644 --- a/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs @@ -155,6 +155,7 @@ namespace MonoTests.System.Reflection } [Test] + [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM [ExpectedException (typeof (ArgumentNullException))] public void GetFile_Null () { @@ -162,6 +163,7 @@ namespace MonoTests.System.Reflection } [Test] + [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM [ExpectedException (typeof (ArgumentException))] public void GetFile_Empty () { @@ -169,6 +171,7 @@ namespace MonoTests.System.Reflection } [Test] + [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM public void GetFiles_False () { Assembly corlib = typeof (int).Assembly; @@ -181,6 +184,7 @@ namespace MonoTests.System.Reflection } [Test] + [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM public void GetFiles_True () { Assembly corlib = typeof (int).Assembly; diff --git a/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs b/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs index ba8cea1433f..3c953d6d2c7 100644 --- a/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs @@ -86,6 +86,7 @@ namespace MonoTests.System.Reflection } [Test] + [Category ("TargetJvmNotWorking")] public void ReturnTypePseudoCustomAttributes () { MethodInfo mi = typeof (MethodInfoTest).GetMethod ("ReturnTypeMarshalAs"); diff --git a/mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs b/mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs index 3835254c392..4267754c6bc 100644 --- a/mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs @@ -63,7 +63,7 @@ public class ParameterInfoTest : Assertion 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 +87,7 @@ public class ParameterInfoTest : Assertion 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 +102,7 @@ public class ParameterInfoTest : Assertion AssertEquals (UnmanagedType.CustomMarshaler, attr.Value); AssertEquals ("5", attr.MarshalCookie); AssertEquals (typeof (Marshal1), Type.GetType (attr.MarshalType)); +#endif } #endif } diff --git a/mcs/class/corlib/Test/System.Runtime.Remoting.Contexts/SynchronizationAttributeTest.cs b/mcs/class/corlib/Test/System.Runtime.Remoting.Contexts/SynchronizationAttributeTest.cs index ba69ed0503b..d0b31f1a8a8 100644 --- 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,11 @@ namespace MonoTests.System.Runtime.Remoting.Contexts { 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 --git a/mcs/class/corlib/Test/System.Text/EncodingInfoTest.cs b/mcs/class/corlib/Test/System.Text/EncodingInfoTest.cs index eab01ffedee..36b9bec17d8 100644 --- a/mcs/class/corlib/Test/System.Text/EncodingInfoTest.cs +++ b/mcs/class/corlib/Test/System.Text/EncodingInfoTest.cs @@ -22,9 +22,6 @@ namespace MonoTests.System.Text 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 --git a/mcs/class/corlib/Test/System.Threading/MutexTest.cs b/mcs/class/corlib/Test/System.Threading/MutexTest.cs index e1de7e96796..6b3289c33ba 100644 --- a/mcs/class/corlib/Test/System.Threading/MutexTest.cs +++ b/mcs/class/corlib/Test/System.Threading/MutexTest.cs @@ -161,6 +161,7 @@ namespace MonoTests.System.Threading } [Test] + [Category("TargetJvmNotSupported")] // IntPtr native handles are not supported for TARGET_JVM. public void TestHandle() { Mutex Sem = new Mutex(); diff --git a/mcs/class/corlib/Test/System/ActivatorTest.cs b/mcs/class/corlib/Test/System/ActivatorTest.cs index e9f794b7262..34d3b97d27e 100644 --- a/mcs/class/corlib/Test/System/ActivatorTest.cs +++ b/mcs/class/corlib/Test/System/ActivatorTest.cs @@ -186,6 +186,7 @@ namespace MonoTests.System { #else [ExpectedException(typeof(MemberAccessException))] #endif + [Category ("TargetJvmNotWorking")] public void CreateInstanceAbstract2 () { Activator.CreateInstance (typeof (Type), true); @@ -211,6 +212,7 @@ namespace MonoTests.System { #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 +220,7 @@ namespace MonoTests.System { #if NET_2_0 [Test] + [Category ("TargetJvmNotWorking")] public void CreateInstance_Nullable () { Assert.AreEqual (5, Activator.CreateInstance (typeof (Nullable), new object [] { 5 })); @@ -237,6 +240,7 @@ namespace MonoTests.System { [Test] [ExpectedException (typeof (ArgumentNullException))] + [Category ("TargetJvmNotWorking")] public void GetObject_UrlNull () { Activator.GetObject (typeof (COMTest), null); @@ -291,6 +295,7 @@ namespace MonoTests.System { } [Test] + [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning public void Unification_FromFx10 () { Unification (String.Format (CorlibPermissionPattern, fx10version)); @@ -298,6 +303,7 @@ namespace MonoTests.System { } [Test] + [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning public void Unification_FromFx11 () { Unification (String.Format (CorlibPermissionPattern, fx11version)); @@ -305,6 +311,7 @@ namespace MonoTests.System { } [Test] + [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning public void Unification_FromFx20 () { Unification (String.Format (CorlibPermissionPattern, fx20version)); @@ -312,6 +319,7 @@ namespace MonoTests.System { } [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 +330,7 @@ namespace MonoTests.System { #if NET_2_0 [Test] + [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning [Category ("NotWorking")] public void Unification_FromFx99_System () { diff --git a/mcs/class/corlib/Test/System/AppDomainSetupTest.cs b/mcs/class/corlib/Test/System/AppDomainSetupTest.cs index 60a9a3bf2bb..b27b6d0381a 100644 --- a/mcs/class/corlib/Test/System/AppDomainSetupTest.cs +++ b/mcs/class/corlib/Test/System/AppDomainSetupTest.cs @@ -33,6 +33,7 @@ namespace MonoTests.System } [Test] + [Category ("TargetJvmNotWorking")] public void ConfigurationFile_Relative_ApplicationBase () { string fileName = "blar.config"; @@ -54,6 +55,7 @@ namespace MonoTests.System [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 +76,7 @@ namespace MonoTests.System } [Test] + [Category ("TargetJvmNotWorking")] public void ApplicationBase1 () { string expected_path = tmpPath.Replace(@"\", @"/"); @@ -101,6 +104,7 @@ namespace MonoTests.System } [Test] + [Category ("TargetJvmNotWorking")] public void ApplicationBase2 () { AppDomainSetup setup = new AppDomainSetup (); @@ -109,6 +113,7 @@ namespace MonoTests.System } [Test] + [Category ("TargetJvmNotWorking")] public void ApplicationBase3 () { AppDomainSetup setup = new AppDomainSetup (); @@ -118,6 +123,7 @@ namespace MonoTests.System } [Test] + [Category ("TargetJvmNotWorking")] public void ApplicationBase4 () { AppDomainSetup setup = new AppDomainSetup (); @@ -145,6 +151,7 @@ namespace MonoTests.System } [Test] + [Category ("TargetJvmNotWorking")] public void ApplicationBase5 () { // This is failing because of (probably) a windows-ism, so don't worry @@ -173,6 +180,7 @@ namespace MonoTests.System } [Test] + [Category ("TargetJvmNotWorking")] public void ApplicationBase6 () { AppDomainSetup setup = new AppDomainSetup (); diff --git a/mcs/class/corlib/Test/System/ArrayTest.cs b/mcs/class/corlib/Test/System/ArrayTest.cs index 9fce407fbdb..04c59de5e41 100644 --- a/mcs/class/corlib/Test/System/ArrayTest.cs +++ b/mcs/class/corlib/Test/System/ArrayTest.cs @@ -470,6 +470,11 @@ public class ArrayTest : Assertion } 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 +635,7 @@ public class ArrayTest : Assertion Assert("#F03b", errorThrown); } #endif +#if !TARGET_JVM // Arrays lower bounds are not supported for TARGET_JVM { bool errorThrown = false; try { @@ -639,6 +645,7 @@ public class ArrayTest : Assertion } Assert("#F04", errorThrown); } +#endif // TARGET_JVM { bool errorThrown = false; try { @@ -649,6 +656,7 @@ public class ArrayTest : Assertion } Assert("#F05", errorThrown); } +#if !TARGET_JVM // CreateInstance with lower bounds not supported for TARGET_JVM { bool errorThrown = false; try { @@ -691,6 +699,7 @@ public class ArrayTest : Assertion 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 +774,7 @@ public class ArrayTest : Assertion } [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 +803,7 @@ public class ArrayTest : Assertion } [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 +824,7 @@ public class ArrayTest : Assertion } [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 +845,7 @@ public class ArrayTest : Assertion } [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 +866,7 @@ public class ArrayTest : Assertion } [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 +887,7 @@ public class ArrayTest : Assertion } [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 +913,7 @@ public class ArrayTest : Assertion } [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 +2800,7 @@ public class ArrayTest : Assertion } +#if !TARGET_JVM // BugBUG: T[] is not yet ICollection under TARGET_JVM [Test] // From bug #80563 public void ICollectionNull () @@ -2808,6 +2825,7 @@ public class ArrayTest : Assertion test = new List(test); AssertEquals ("array with test", test.Contains (null), false); } +#endif // TARGET_JVM #endif #region Bug 80299 diff --git a/mcs/class/corlib/Test/System/BadImageFormatExceptionTest.cs b/mcs/class/corlib/Test/System/BadImageFormatExceptionTest.cs index 0c3cadf6755..66eb43aebbb 100644 --- a/mcs/class/corlib/Test/System/BadImageFormatExceptionTest.cs +++ b/mcs/class/corlib/Test/System/BadImageFormatExceptionTest.cs @@ -64,8 +64,12 @@ namespace MonoTests.System 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 +85,12 @@ namespace MonoTests.System 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 +135,12 @@ namespace MonoTests.System 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 +158,12 @@ namespace MonoTests.System 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 +188,9 @@ namespace MonoTests.System 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 +207,12 @@ namespace MonoTests.System 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 +256,12 @@ namespace MonoTests.System 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 +278,12 @@ namespace MonoTests.System 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 +295,12 @@ namespace MonoTests.System 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 +318,11 @@ namespace MonoTests.System 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 +346,9 @@ namespace MonoTests.System 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 +412,9 @@ namespace MonoTests.System 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 --git a/mcs/class/corlib/Test/System/ConvertTest.cs b/mcs/class/corlib/Test/System/ConvertTest.cs index c3e7e0ca0bd..a294a1ff82c 100644 --- a/mcs/class/corlib/Test/System/ConvertTest.cs +++ b/mcs/class/corlib/Test/System/ConvertTest.cs @@ -2855,6 +2855,7 @@ namespace MonoTests.System { [Test] [ExpectedException (typeof (FormatException))] + [Category ("TargetJvmNotWorking")] public void FormatBase64CharArray_OnlyWhitespace () { Convert.FromBase64CharArray (new char[3] {' ', @@ -2984,6 +2985,7 @@ namespace MonoTests.System { } [Test] + [Category ("TargetJvmNotWorking")] public void FromBase64_Empty () { AssertEquals (new byte[0], Convert.FromBase64String (string.Empty)); diff --git a/mcs/class/corlib/Test/System/DecimalTest.cs b/mcs/class/corlib/Test/System/DecimalTest.cs index afd3b973d2e..3bddac2e7db 100644 --- a/mcs/class/corlib/Test/System/DecimalTest.cs +++ b/mcs/class/corlib/Test/System/DecimalTest.cs @@ -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 --git a/mcs/class/corlib/Test/System/DecimalTest2.cs b/mcs/class/corlib/Test/System/DecimalTest2.cs index 4df2d39b7e5..e963f05c230 100644 --- a/mcs/class/corlib/Test/System/DecimalTest2.cs +++ b/mcs/class/corlib/Test/System/DecimalTest2.cs @@ -138,8 +138,8 @@ namespace MonoTests.System 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 @@ namespace MonoTests.System 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 --git a/mcs/class/corlib/Test/System/TimeZoneTest.cs b/mcs/class/corlib/Test/System/TimeZoneTest.cs index 0c23887b223..8a1bf1aff5c 100644 --- a/mcs/class/corlib/Test/System/TimeZoneTest.cs +++ b/mcs/class/corlib/Test/System/TimeZoneTest.cs @@ -162,6 +162,7 @@ public class TimeZoneTest : TestCase { } [Test] + [Category ("TargetJvmNotWorking")] public void CurrentTimeZone_SerializationRoundtrip () { TimeZone tz = TimeZone.CurrentTimeZone; diff --git a/mcs/class/corlib/Test/System/TypeTest.cs b/mcs/class/corlib/Test/System/TypeTest.cs index 6387581c99e..70b07ff249c 100644 --- a/mcs/class/corlib/Test/System/TypeTest.cs +++ b/mcs/class/corlib/Test/System/TypeTest.cs @@ -137,11 +137,16 @@ namespace MonoTests.System Assert.AreEqual (typeof (ICloneable[][]).IsAssignableFrom (typeof (Duper[][])), true, "#12"); // Tests for vectors<->one dimensional arrays */ +#if TARGET_JVM // Lower bounds arrays are not supported for TARGET_JVM. + Array arr1 = Array.CreateInstance (typeof (int), new int[] {1}); + Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr1.GetType ()), true, "#13"); +#else Array arr1 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {0}); Array arr2 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {10}); Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr1.GetType ()), true, "#13"); Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr2.GetType ()), false, "#14"); +#endif // TARGET_JVM // Test that arrays of enums can be cast to their base types Assert.AreEqual (typeof (int[]).IsAssignableFrom (typeof (TypeCode[])), true, "#15"); @@ -207,6 +212,7 @@ namespace MonoTests.System } [Test] + [Category ("TargetJvmNotWorking")] public void TestGetPropertyImpl() { // Test getting property that is exact Assert.AreEqual (typeof (NewVTable), typeof (NewVTable).GetProperty ("Item", new Type[1] { typeof (Int32) }).DeclaringType, "#01"); @@ -551,6 +557,7 @@ PublicKeyToken=b77a5c561934e089")); Assert.IsNull (i); } +#if !TARGET_JVM // Reflection.Emit is not supported for TARGET_JVM [Test] public void EqualsUnderlyingType () { @@ -569,6 +576,7 @@ PublicKeyToken=b77a5c561934e089")); Assert.IsTrue (typeof (int).Equals (e)); } +#endif // TARGET_JVM [Test] public void GetElementType_Bug63841 ()