- 200703-05 Eyal Alaluf <eyala@mainsoft.com>
++2007-03-14 Eyal Alaluf <eyala@mainsoft.com>
++
++ * Mark tests as not working under TargetJvm
++
++2007-03-05 Eyal Alaluf <eyala@mainsoft.com>
+
+ * Port tests to run under TARGET_JVM.
+
- 200703-05 Roei Erez <roeie@mainsoft.com>
++2007-03-05 Roei Erez <roeie@mainsoft.com>
+
+ * StringTest.cs: add test for string properties.
+
200702-20 Boris Kirzner <borisk@mainsoft.com>
* Mscorlib.Test20.sln, Mscorlib.Test20.vmwcsproj,
<Reference Include="System.Data" />\r
<Reference Include="System.Runtime.Remoting" />\r
<Reference Include="System.Xml" />\r
++ <Reference Include="J2SE.Helpers" >\r
++ <HintPath>..\..\lib\J2SE.Helpers.dll</HintPath>\r
++ <Private>False</Private>\r
++ </Reference>\r
</ItemGroup>\r
<ItemGroup>\r
<Content Include="resources\AFile.txt" />\r
<Compile Include="System.Collections\ReadOnlyCollectionBaseTest.cs" />\r
<Compile Include="System.Collections\SortedListTest.cs" />\r
<Compile Include="System.Collections\StackTest.cs" />\r
- <Compile Include="System.Diagnostics\DebugTest.cs" />\r
- <Compile Include="System.Diagnostics\StackFrameCas.cs" />\r
- <Compile Include="System.Diagnostics\StackFrameTest.cs" />\r
- <Compile Include="System.Diagnostics\StackTraceCas.cs" />\r
- <Compile Include="System.Diagnostics\StackTraceTest.cs" />\r
- <Compile Include="System.Diagnostics\TextWriterTraceListenerTest.cs" />\r
<Compile Include="System.Globalization\CalendarTest.cs" />\r
-- <Compile Include="System.Globalization\CompareInfoTest.cs" />\r
++ <Compile Include="System.Globalization\CompareInfoTest.jvm.cs" />\r
<Compile Include="System.Globalization\CultureInfoTest.cs" />\r
<Compile Include="System.Globalization\DateTimeFormatInfoTest.cs" />\r
<Compile Include="System.Globalization\DaylightTimeTest.cs" />\r
<Compile Include="System.Text\EncoderReplacementFallbackBufferTest.cs" />\r
<Compile Include="System.Text\EncoderReplacementFallbackTest.cs" />\r
<Compile Include="System.Text\EncoderTest.cs" />\r
++ <Compile Include="System.Text\EncodingTest.cs" />\r
<Compile Include="System.Text\EncodingInfoTest.cs" />\r
<Compile Include="System.Text\StringBuilderTest.cs" />\r
<Compile Include="System.Text\TestEncoding.cs" />\r
}
[Test]
++ [Category ("TargetJvmNotWorking")] // BUGBUG Very very slow on TARGET_JVM.
public void SerializationTest()
{
for (int i = 0; i < 50; i++)
}
[Test]
++ [Category ("TargetJvmNotWorking")]
public void SerializeTest ()
{
List <int> list = new List <int> ();
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);
}
[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<int> list = (List<int>) bf.Deserialize (ms);
Assert.AreEqual (3, list.Count, "#1");
Assert.AreEqual (5, list [0], "#2");
};
[Test]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
public void SerializationRoundtrip ()
{
CaseInsensitiveHashCodeProvider enus = new CaseInsensitiveHashCodeProvider (new CultureInfo ("en-US"));
}
[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);
}\r
\r
[Test]\r
--#if TARGET_JVM\r
-- [Category ("NotWorking")]\r
--#endif\r
public void TestCopyTo() {\r
{\r
bool errorThrown = false;\r
h['b'] = 2;\r
DictionaryEntry[] o = new DictionaryEntry[2];\r
h.CopyTo(o,0);\r
++#if TARGET_JVM // Hashtable is not an ordered collection!\r
++ if (o[0].Key.Equals('b')) {\r
++ DictionaryEntry v = o[0];\r
++ o[0] = o[1];\r
++ o[1] = v;\r
++ }\r
++#endif // TARGET_JVM\r
AssertEquals("first copy fine.", 'a', o[0].Key);\r
AssertEquals("first copy fine.", 1, o[0].Value);\r
AssertEquals("second copy fine.", 'b', o[1].Key);\r
public void TestSerialization () {\r
Hashtable table1 = new Hashtable();\r
Hashtable table2;\r
-- Stream str = new MemoryStream ();
++ Stream str = new MemoryStream ();\r
BinaryFormatter formatter = new BinaryFormatter();\r
\r
for (int i = 0; i < 100; i++)\r
-- table1[i] = "TestString Key: " + i.ToString();
--
-- formatter.Serialize (str, table1);
-- str.Position = 0;
-- table2 = (Hashtable) formatter.Deserialize (str);
++ table1[i] = "TestString Key: " + i.ToString();\r
++ \r
++ formatter.Serialize (str, table1);\r
++ str.Position = 0;\r
++ table2 = (Hashtable) formatter.Deserialize (str);\r
\r
bool result;\r
-- foreach (DictionaryEntry de in table1)
++ foreach (DictionaryEntry de in table1)\r
AssertEquals (de.Value, table2 [de.Key]);\r
}\r
\r
[Test]\r
--#if TARGET_JVM\r
-- [Category ("NotWorking")]\r
--#endif\r
++ [Category ("TargetJvmNotWorking")]\r
public void TestSerialization2 () {\r
// Test from bug #70570\r
MemoryStream stream = new MemoryStream();\r
--- /dev/null
--- /dev/null
++// CompareInfoTest.cs - NUnit Test Cases for the
++// System.Globalization.CompareInfo class
++//
++// Dick Porter <dick@ximian.com>
++// Atsushi Enomoto <atsushi@ximian.com>
++//
++// (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
++}
++
++}
}
[Test]
++ [Category ("TargetJvmNotWorking")] //OptionalCalendars not yet supported for TARGET_JVM.
// make sure that all CultureInfo holds non-null calendars.
public void OptionalCalendars ()
{
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");
[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});
}
[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});
}
[Test]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
public void WriteFloat ()
{
MemoryStream stream = new MemoryStream ();
}
[Test]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
public void DirectoryNameWithSpace ()
{
// check for Unix platforms - see FAQ for more details
AssertEquals ("test#12", 0, time.Second);
}
-- [Test]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif
++ [Test]
++ [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM
public void LastAccessTime ()
{
DirectoryInfo info = new DirectoryInfo (TempFolder);
info.LastAccessTime = DateTime.Now;
}
-- [Test]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif
++ [Test]
++ [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM
public void LastAccessTimeUtc ()
{
DirectoryInfo info = new DirectoryInfo (TempFolder);
info.LastAccessTimeUtc = DateTime.Now;
}
-- [Test]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif
++ [Test]
++ [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM
public void CreationTime ()
{
DirectoryInfo info = new DirectoryInfo (TempFolder);
info.CreationTime = DateTime.Now;
}
-- [Test]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif
++ [Test]
++ [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM
public void CreationTimeUtc ()
{
DirectoryInfo info = new DirectoryInfo (TempFolder);
Directory.Delete (path);\r
}\r
}\r
+#endif\r
\r
[Test]\r
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
[ExpectedException(typeof(ArgumentNullException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif \r
public void GetCreationTimeException1 ()\r
{\r
Directory.GetCreationTime (null as string);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeException2 ()\r
{\r
Directory.GetCreationTime ("");\r
#if !NET_2_0\r
[ExpectedException(typeof(IOException))]\r
#endif\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeException_NonExistingPath ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.GetCreationTime.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeException4 ()\r
{\r
Directory.GetCreationTime (" ");\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeException5 ()\r
{\r
Directory.GetCreationTime (Path.InvalidPathChars [0].ToString ());\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtcException1 ()\r
{\r
Directory.GetCreationTimeUtc (null as string);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtcException2 ()\r
{\r
Directory.GetCreationTimeUtc ("");\r
#if !NET_2_0\r
[ExpectedException (typeof (IOException))]\r
#endif\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtc_NonExistingPath ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.GetCreationTimeUtc.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtcException4 ()\r
{\r
Directory.GetCreationTimeUtc (" ");\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtcException5 ()\r
{\r
Directory.GetCreationTime (Path.InvalidPathChars [0].ToString ());\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTime_Null ()\r
{\r
Directory.GetLastAccessTime (null as string);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeException2 ()\r
{\r
Directory.GetLastAccessTime ("");\r
#if !NET_2_0\r
[ExpectedException (typeof (IOException))]\r
#endif\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTime_NonExistingPath ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.GetLastAccessTime.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeException4 ()\r
{\r
Directory.GetLastAccessTime (" ");\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeException5 ()\r
{\r
Directory.GetLastAccessTime (Path.InvalidPathChars [0].ToString ());\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtc_Null ()\r
{\r
Directory.GetLastAccessTimeUtc (null as string);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtcException2 ()\r
{\r
Directory.GetLastAccessTimeUtc ("");\r
#if !NET_2_0\r
[ExpectedException (typeof (IOException))]\r
#endif\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtc_NonExistingPath ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.GetLastAccessTimeUtc.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtcException4 ()\r
{\r
Directory.GetLastAccessTimeUtc (" ");\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtcException5 ()\r
{\r
Directory.GetLastAccessTimeUtc (Path.InvalidPathChars [0].ToString ());\r
}\r
\r
[Test]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM\r
public void CreationTime ()\r
{\r
// check for Unix platforms - see FAQ for more details\r
}\r
\r
[Test]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM\r
public void LastAccessTime ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.AccessTime.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException1 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException2 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(FileNotFoundException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException3 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException4 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException5 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException1 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException2 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(FileNotFoundException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException3 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException4 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException5 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException1 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException2 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(FileNotFoundException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException3 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException4 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException5 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException1 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException2 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(FileNotFoundException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException3 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException4 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
--#if TARGET_JVM\r
-- [Category("NotWorking")]\r
--#endif\r
++ [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException5 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
[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";
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";
}
[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";
}
[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";
}
[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";
}
[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";
}
[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";
}
[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";
}
[Test]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void TestGetCreationTime ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "baz";
// 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;
}
[Test]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void LastAccessTime ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "lastAccessTime";
[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);
[Test]
[ExpectedException(typeof(ArgumentException))]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeException2 ()
{
File.GetCreationTime ("");
#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";
[Test]
[ExpectedException(typeof(ArgumentException))]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeException4 ()
{
File.GetCreationTime (" ");
[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 ());
[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);
[Test]
[ExpectedException(typeof(ArgumentException))]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeUtcException2 ()
{
File.GetCreationTimeUtc ("");
#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";
[Test]
[ExpectedException(typeof(ArgumentException))]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
++ [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeUtcException4 ()
{
File.GetCreationTimeUtc (" ");
[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 ());
[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);
[Test]
[ExpectedException(typeof(ArgumentException))]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeException2 ()
{
File.GetLastAccessTime ("");
#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";
[Test]
[ExpectedException(typeof(ArgumentException))]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeException4 ()
{
File.GetLastAccessTime (" ");
[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 ());
[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);
[Test]
[ExpectedException(typeof(ArgumentException))]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeUtcException2 ()
{
File.GetLastAccessTimeUtc ("");
#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";
[Test]
[ExpectedException(typeof(ArgumentException))]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
++ [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeUtcException4 ()
{
File.GetLastAccessTimeUtc (" ");
[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 ());
[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));
[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));
[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));
[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) {
[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";
[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";
[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));
[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));
[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));
[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) {
[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";
[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";
[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));
[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));
[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));
[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) {
[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";
[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";
[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));
[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));
[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));
[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) {
[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";
[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";
[Test]
[ExpectedException(typeof (IOException))]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
public void SetLastWriteTimeIOException1 ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "LastWriteTimeIOException1";
//
[Test]
[ExpectedException(typeof (IOException))]
--#if TARGET_JVM
-- [Category("NotWorking")]
--#endif
public void SetLastWriteTimeUtcIOException1 ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetLastWriteTimeUtcIOException1";
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 ();
[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 {
[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 {
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,
Directory.CreateDirectory (tempDir);
++#if !TARGET_JVM // Thread.GetDomain is not supported for TARGET_JVM.
domain = Thread.GetDomain ();
++#endif // TARGET_JVM
}
[TearDown]
}
[Test]
++ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM.
public void Ctor2 ()
{
const string assemblyName = "TestAssembly";
}
[Test]
++ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM.
public void Ctor5 ()
{
const string assemblyName = "TestAssembly";
}
[Test]
++ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM
[ExpectedException (typeof (ArgumentNullException))]
public void GetFile_Null ()
{
}
[Test]
++ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM
[ExpectedException (typeof (ArgumentException))]
public void GetFile_Empty ()
{
}
[Test]
++ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM
public void GetFiles_False ()
{
Assembly corlib = typeof (int).Assembly;
}
[Test]
++ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM
public void GetFiles_True ()
{
Assembly corlib = typeof (int).Assembly;
}
[Test]
++ [Category ("TargetJvmNotWorking")]
public void ReturnTypePseudoCustomAttributes () {
MethodInfo mi = typeof (MethodInfoTest).GetMethod ("ReturnTypeMarshalAs");
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,
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;
AssertEquals (UnmanagedType.CustomMarshaler, attr.Value);
AssertEquals ("5", attr.MarshalCookie);
AssertEquals (typeof (Marshal1), Type.GetType (attr.MarshalType));
++#endif
}
#endif
}
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");
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
}\r
\r
[Test]\r
++ [Category("TargetJvmNotSupported")] // IntPtr native handles are not supported for TARGET_JVM.\r
public void TestHandle()\r
{\r
Mutex Sem = new Mutex();\r
#else
[ExpectedException(typeof(MemberAccessException))]
#endif
++ [Category ("TargetJvmNotWorking")]
public void CreateInstanceAbstract2 ()
{
Activator.CreateInstance (typeof (Type), true);
#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);
#if NET_2_0
[Test]
++ [Category ("TargetJvmNotWorking")]
public void CreateInstance_Nullable ()
{
Assert.AreEqual (5, Activator.CreateInstance (typeof (Nullable<int>), new object [] { 5 }));
[Test]
[ExpectedException (typeof (ArgumentNullException))]
++ [Category ("TargetJvmNotWorking")]
public void GetObject_UrlNull ()
{
Activator.GetObject (typeof (COMTest), null);
}
[Test]
++ [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
public void Unification_FromFx10 ()
{
Unification (String.Format (CorlibPermissionPattern, fx10version));
}
[Test]
++ [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
public void Unification_FromFx11 ()
{
Unification (String.Format (CorlibPermissionPattern, fx11version));
}
[Test]
++ [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
public void Unification_FromFx20 ()
{
Unification (String.Format (CorlibPermissionPattern, fx20version));
}
[Test]
++ [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
public void Unification_FromFx99_Corlib ()
{
Unification (String.Format (CorlibPermissionPattern, "9.99.999.9999"));
#if NET_2_0
[Test]
++ [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
[Category ("NotWorking")]
public void Unification_FromFx99_System ()
{
}
[Test]
++ [Category ("TargetJvmNotWorking")]
public void ConfigurationFile_Relative_ApplicationBase ()
{
string fileName = "blar.config";
[Test]
[ExpectedException (typeof (MemberAccessException))] // The ApplicationBase must be set before retrieving this property
++ [Category ("TargetJvmNotWorking")]
public void ConfigurationFile_Relative_NoApplicationBase ()
{
AppDomainSetup setup = new AppDomainSetup();
}
[Test]
++ [Category ("TargetJvmNotWorking")]
public void ApplicationBase1 ()
{
string expected_path = tmpPath.Replace(@"\", @"/");
}
[Test]
++ [Category ("TargetJvmNotWorking")]
public void ApplicationBase2 ()
{
AppDomainSetup setup = new AppDomainSetup ();
}
[Test]
++ [Category ("TargetJvmNotWorking")]
public void ApplicationBase3 ()
{
AppDomainSetup setup = new AppDomainSetup ();
}
[Test]
++ [Category ("TargetJvmNotWorking")]
public void ApplicationBase4 ()
{
AppDomainSetup setup = new AppDomainSetup ();
}
[Test]
++ [Category ("TargetJvmNotWorking")]
public void ApplicationBase5 ()
{
// This is failing because of (probably) a windows-ism, so don't worry
}
[Test]
++ [Category ("TargetJvmNotWorking")]
public void ApplicationBase6 ()
{
AppDomainSetup setup = new AppDomainSetup ();
} catch (ArgumentException) {
errorThrown = true;
}
++#if TARGET_JVM // This is really implementation dependent behaviour.
++ catch (RankException) {
++ errorThrown = true;
++ }
++#endif // TARGET_JVM
Assert("#E62", errorThrown);
}
{
Assert("#F03b", errorThrown);
}
#endif
++#if !TARGET_JVM // Arrays lower bounds are not supported for TARGET_JVM
{
bool errorThrown = false;
try {
}
Assert("#F04", errorThrown);
}
++#endif // TARGET_JVM
{
bool errorThrown = false;
try {
}
Assert("#F05", errorThrown);
}
++#if !TARGET_JVM // CreateInstance with lower bounds not supported for TARGET_JVM
{
bool errorThrown = false;
try {
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]
}
[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 };
}
[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 };
}
[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 };
}
[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 };
}
[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 };
}
[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 };
}
[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 };
}
++#if !TARGET_JVM // BugBUG: T[] is not yet ICollection<T> under TARGET_JVM
[Test]
// From bug #80563
public void ICollectionNull ()
test = new List<object>(test);
AssertEquals ("array with test", test.Contains (null), false);
}
++#endif // TARGET_JVM
#endif
#region Bug 80299
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]
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]
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]
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]
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]
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]
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]
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);
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]
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]
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]
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");
}
}
[Test]
[ExpectedException (typeof (FormatException))]
++ [Category ("TargetJvmNotWorking")]
public void FormatBase64CharArray_OnlyWhitespace ()
{
Convert.FromBase64CharArray (new char[3] {' ',
}
[Test]
++ [Category ("TargetJvmNotWorking")]
public void FromBase64_Empty ()
{
AssertEquals (new byte[0], Convert.FromBase64String (string.Empty));
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
public void TestRemainder()\r
{\r
Assert((decimal)Decimal.Remainder(3.6m, 1.3m) == 1.0m);\r
-- Assert((decimal)Decimal.Remainder(79228162514264337593543950335m , \r
-- 27703302467091960609331879.53200m) == 24420760848422211464106753m);\r
++ AssertEquals("A02", Decimal.Remainder(79228162514264337593543950335m, \r
++ 27703302467091960609331879.53200m), 24420760848422211464106753m);\r
\r
Assert((decimal)Decimal.Remainder(45937986975432m, 43987453m)\r
== 42334506m);\r
Fail("" + errOp + " wrong multiplications, " + errOverflow + " wrong overflows");\r
}\r
}\r
--
-- // 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)
++\r
++ // MS 1.x is being less precise than Mono (2 cases). MS 2.0 is correct.\r
++ // Mono doesn't produce the same result for (i==21/j==3)\r
public void TestDiv()\r
{\r
decimal[] args = auto_build2;\r
}
[Test]
++ [Category ("TargetJvmNotWorking")]
public void CurrentTimeZone_SerializationRoundtrip ()
{
TimeZone tz = TimeZone.CurrentTimeZone;
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");
}
[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");
Assert.IsNull (i);
}
++#if !TARGET_JVM // Reflection.Emit is not supported for TARGET_JVM
+ [Test]
+ public void EqualsUnderlyingType ()
+ {
+ AssemblyBuilderAccess access = AssemblyBuilderAccess.RunAndSave;
+ TypeAttributes attribs = TypeAttributes.Public;
+
+ AssemblyName name = new AssemblyName ();
+ name.Name = "enumtest";
+ AssemblyBuilder assembly =
+ AppDomain.CurrentDomain.DefineDynamicAssembly (
+ name, access);
+
+ ModuleBuilder module = assembly.DefineDynamicModule
+ ("m", "enumtest.dll");
+ EnumBuilder e = module.DefineEnum ("E", attribs, typeof (int));
+
+ Assert.IsTrue (typeof (int).Equals (e));
+ }
++#endif // TARGET_JVM
+
+ [Test]
+ public void GetElementType_Bug63841 ()
+ {
+ Assert.IsNull (typeof (TheEnum).GetElementType (), "#1");
+ }
+
#if NET_2_0
[Test]
public void FullNameGenerics ()