Imported Upstream version 5.16.0.100

Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-08-07 15:19:03 +00:00
parent 0a9828183b
commit 7d7f676260
4419 changed files with 170950 additions and 90273 deletions

View File

@@ -83,7 +83,7 @@ namespace System.IO.Tests
using (var bs = new BufferedStream(new MemoryStream()))
{
Assert.Equal(TaskStatus.Canceled, bs.ReadAsync(new byte[1], new CancellationToken(true)).AsTask().Status);
Assert.Equal(TaskStatus.Canceled, bs.WriteAsync(new byte[1], new CancellationToken(true)).Status);
Assert.Equal(TaskStatus.Canceled, bs.WriteAsync(new byte[1], new CancellationToken(true)).AsTask().Status);
}
}
}

View File

@@ -115,7 +115,7 @@ namespace System.IO.Tests
return Task.FromResult(10);
});
using (var totalNativeMemory = new NativeOwnedMemory(30))
using (var totalNativeMemory = new NativeMemoryManager(30))
{
Memory<byte> totalMemory = totalNativeMemory.Memory;
Memory<byte> targetMemory = totalMemory.Slice(5, 20);
@@ -174,7 +174,7 @@ namespace System.IO.Tests
return Task.CompletedTask;
});
using (var nativeMemory = new NativeOwnedMemory(10))
using (var nativeMemory = new NativeMemoryManager(10))
{
Memory<byte> memory = nativeMemory.Memory;
memory.Span[2] = 0;

View File

@@ -4,6 +4,7 @@
using Xunit;
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
@@ -11,7 +12,7 @@ using System.Threading.Tasks;
namespace System.IO.Tests
{
public partial class StringWriterTests
public partial class StringWriterTests : RemoteExecutorTestBase
{
static int[] iArrInvalidValues = new int[] { -1, -2, -100, -1000, -10000, -100000, -1000000, -10000000, -100000000, -1000000000, int.MinValue, short.MinValue };
static int[] iArrLargeValues = new int[] { int.MaxValue, int.MaxValue - 1, int.MaxValue / 2, int.MaxValue / 10, int.MaxValue / 100 };
@@ -291,10 +292,9 @@ namespace System.IO.Tests
[Fact]
public static void TestWriteMisc()
{
CultureInfo old = CultureInfo.CurrentCulture;
CultureInfo.CurrentCulture = new CultureInfo("en-US"); // floating-point formatting comparison depends on culture
try
RemoteInvoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-US"); // floating-point formatting comparison depends on culture
var sw = new StringWriter();
sw.Write(true);
@@ -308,11 +308,7 @@ namespace System.IO.Tests
sw.Write((ulong)ulong.MaxValue);
Assert.Equal("Truea1234.013452342.0123456-92233720368547758081234.5429496729518446744073709551615", sw.ToString());
}
finally
{
CultureInfo.CurrentCulture = old;
}
}).Dispose();
}
[Fact]
@@ -326,10 +322,9 @@ namespace System.IO.Tests
[Fact]
public static void TestWriteLineMisc()
{
CultureInfo old = CultureInfo.CurrentCulture;
CultureInfo.CurrentCulture = new CultureInfo("en-US"); // floating-point formatting comparison depends on culture
try
RemoteInvoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-US"); // floating-point formatting comparison depends on culture
var sw = new StringWriter();
sw.WriteLine((bool)false);
sw.WriteLine((char)'B');
@@ -342,11 +337,7 @@ namespace System.IO.Tests
Assert.Equal(
string.Format("False{0}B{0}987{0}875634{0}1.23457{0}45634563{0}18446744073709551615{0}", Environment.NewLine),
sw.ToString());
}
finally
{
CultureInfo.CurrentCulture = old;
}
}).Dispose();
}
[Fact]

View File

@@ -57,8 +57,8 @@
<Compile Include="StringReader\StringReader.CtorTests.cs" />
<Compile Include="StringWriter\StringWriterTests.netcoreapp.cs" Condition="'$(TargetGroup)' == 'netcoreapp'" />
<Compile Include="StringWriter\StringWriterTests.cs" />
<Compile Include="$(CommonTestPath)\System\Buffers\NativeOwnedMemory.cs" Condition="'$(TargetGroup)' == 'netcoreapp'">
<Link>Common\System\Buffers\NativeOwnedMemory.cs</Link>
<Compile Include="$(CommonTestPath)\System\Buffers\NativeMemoryManager.cs" Condition="'$(TargetGroup)' == 'netcoreapp'">
<Link>Common\System\Buffers\NativeMemoryManager.cs</Link>
</Compile>
<Compile Include="$(CommonTestPath)\System\IO\CallTrackingStream.cs">
<Link>Common\System\IO\CallTrackingStream.cs</Link>
@@ -77,6 +77,12 @@
<Compile Include="TextWriter\TextWriterTests.cs" />
<Compile Include="TextWriter\TextWriterTests.netcoreapp.cs" Condition="'$(TargetGroup)' == 'netcoreapp'" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
<Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
<Name>RemoteExecutorConsoleApp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />
</ItemGroup>