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 ()