Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -419,6 +419,24 @@ public class BinaryWriterTest {
Assert.AreEqual (0, bytes [45], "test#47");
Assert.AreEqual (0, bytes [46], "test#48");
}
[Test]
public void WriteDecimalAndReadBack()
{
// This value is the same used in BinaryReader.ReadDecimal, which will be
// problematic if BinaryWriter or BinaryReader are endianness-confused.
Decimal writeDec = -18295873486192640;
using (var ms = new MemoryStream(32)) {
using (var bw = new BinaryWriter(ms, new UTF8Encoding(), true)) {
bw.Write(writeDec);
}
ms.Position = 0;
using (var br = new BinaryReader(ms)) {
Decimal readDec = br.ReadDecimal();
Assert.AreEqual (readDec, writeDec, "test#01");
}
}
}
[Test]
public void WriteFloat ()

View File

@@ -250,7 +250,7 @@ namespace MonoTests.System.IO
DirectoryInfo info = new DirectoryInfo (path);
Assert.IsFalse (info.Exists, "#1");
info.Create ();
Assert.IsFalse (info.Exists, "#2");
Assert.IsTrue (info.Exists, "#2");
info = new DirectoryInfo (path);
Assert.IsTrue (info.Exists, "#3");
} finally {

View File

@@ -282,14 +282,20 @@ namespace MonoTests.System {
[Test]
public void MemoryCopy_Simple ()
{
int a = 0xBC614E;
int b = 1;
uint a = 0xAABBCCDD;
uint b = 0;
unsafe {
Buffer.MemoryCopy (&a, &b, 4, 2);
}
Assert.AreEqual (0xBC614E, a, "#1");
Assert.AreEqual (0x614E, b, "#2");
Assert.AreEqual (0xAABBCCDD, a, "#1");
// Byte order affects this test; it determines if we
// copy the low (0xCCDD) or high (0xAABB) bytes.
if (BitConverter.IsLittleEndian) {
Assert.AreEqual (0x0000CCDD, b, "#2");
} else {
Assert.AreEqual (0xAABB0000, b, "#2");
}
}
}
}

View File

@@ -1 +1 @@
cfe087d7016cf448a122fee6dfccd92e7bae902c
94504b058a7249a3827d712dd6201a2676c5b6e2