Imported Upstream version 5.4.0.167

Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-08-21 15:34:15 +00:00
parent e49d6f06c0
commit 536cd135cc
12856 changed files with 563812 additions and 223249 deletions

View File

@ -2,7 +2,8 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props" />
<PropertyGroup>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyKey>MSFT</AssemblyKey>
<IsNETCoreApp>true</IsNETCoreApp>
<IsUAP>true</IsUAP>
</PropertyGroup>

View File

@ -6,10 +6,6 @@
<ProjectGuid>{1714448C-211E-48C1-8B7E-4EE667D336A1}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants>
</PropertyGroup>
<!-- Help VS understand available configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='uap-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='uap-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Windows_NT-Debug|AnyCPU'" />
@ -50,6 +46,9 @@
</ItemGroup>
<ItemGroup Condition=" '$(TargetsWindows)' == 'true'">
<Compile Include="System\Net\NameResolutionPal.Windows.cs" />
<Compile Include="$(CommonPath)\System\Net\ContextAwareResult.Windows.cs">
<Link>Common\System\Net\ContextAwareResult.Windows.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\System\Net\IntPtrHelper.cs">
<Link>Common\System\Net\IntPtrHelper.cs</Link>
</Compile>
@ -117,18 +116,6 @@
<Link>Interop\Windows\Winsock\SafeFreeAddrInfo.cs</Link>
</Compile>
</ItemGroup>
<!-- Windows : Win32 only -->
<ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(TargetGroup)' != 'uap'">
<Compile Include="$(CommonPath)\System\Net\ContextAwareResult.Windows.cs">
<Link>Common\System\Net\ContextAwareResult.Windows.cs</Link>
</Compile>
</ItemGroup>
<!-- Windows : Win32 + WinRT -->
<ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(TargetGroup)' == 'uap'">
<Compile Include="$(CommonPath)\System\Net\ContextAwareResult.Uap.cs">
<Link>Common\System\Net\ContextAwareResult.Uap.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition=" '$(TargetsUnix)' == 'true' ">
<Compile Include="System\Net\NameResolutionPal.Unix.cs" />
<Compile Include="$(CommonPath)\System\Net\ByteOrder.cs">

View File

@ -417,7 +417,7 @@ namespace System.Net
Exception exception = castedResult.Result as Exception;
if (exception != null)
{
ExceptionDispatchInfo.Capture(exception).Throw();
ExceptionDispatchInfo.Throw(exception);
}
return (IPHostEntry)castedResult.Result;

View File

@ -11,7 +11,7 @@ namespace System.Net.NameResolution.Tests
public static class LoggingTest
{
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "NetEventSource is only part of .NET Core")]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework | TargetFrameworkMonikers.UapAot, "NetEventSource is only part of .NET Core and requires internal Reflection.")]
public static void EventSource_ExistsWithCorrectId()
{
Type esType = typeof(Dns).GetTypeInfo().Assembly.GetType("System.Net.NetEventSource", throwOnError: true, ignoreCase: false);

View File

@ -4,7 +4,6 @@
<PropertyGroup>
<ProjectGuid>{4FE5ECEE-ACC5-4558-A946-573426599B73}</ProjectGuid>
</PropertyGroup>
<!-- Help VS understand available configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Unix-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Unix-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" />

View File

@ -32,6 +32,17 @@ namespace System.Net.NameResolution.PalTests
Assert.NotNull(hostEntry.Aliases);
}
public static object[][] InvalidHostNames = new object[][] {
new object[] { ":" },
new object[] { "..." }
};
[Theory, MemberData(nameof(InvalidHostNames))]
public void GetHostByName_InvalidHostName_Throws(string hostName)
{
Assert.ThrowsAny<SocketException>(() => NameResolutionPal.GetHostByName(hostName));
}
[Fact]
public void GetHostByName_HostName()
{

View File

@ -6,8 +6,6 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<StringResourcesPath>../../src/Resources/Strings.resx</StringResourcesPath>
</PropertyGroup>
<!-- Help VS understand available configurations -->
<!-- Do not reference these assemblies from the TargetingPack since we are building part of the source code for tests. -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
@ -16,6 +14,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Unix-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" />
<!-- Do not reference these assemblies from the TargetingPack since we are building part of the source code for tests. -->
<ItemGroup>
<TargetingPackExclusions Include="System.Net.NameResolution" />
</ItemGroup>
@ -23,7 +22,6 @@
<Compile Include="..\..\src\System\Net\IPHostEntry.cs">
<Link>ProductionCode\System\Net\IPHostEntry.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="NameResolutionPalTests.cs" />
@ -67,10 +65,6 @@
<Compile Include="$(CommonPath)\System\Net\DebugSafeHandle.cs">
<Link>Common\System\Net\DebugSafeHandle.cs</Link>
</Compile>
<!-- Common -->
<Compile Include="$(CommonPath)\Microsoft\Win32\SafeHandles\SafeHandleZeroOrMinusOneIsInvalid.cs" Condition="'$(TargetGroup)' != 'netstandard' And '$(TargetGroup)' != 'netcoreapp'">
<Link>Common\Microsoft\Win32\SafeHandles\SafeHandleZeroOrMinusOneIsInvalid.cs</Link>
</Compile>
<!-- System.Net.Internals -->
<Compile Include="$(CommonPath)\System\Net\Internals\IPAddressExtensions.cs">
<Link>Common\System\Net\Internals\IPAddressExtensions.cs</Link>

View File

@ -0,0 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace System.Runtime.ExceptionServices
{
internal class ExceptionDispatchInfo
{
public static ExceptionDispatchInfo Capture(Exception source) => null;
public static void Throw(Exception source) => throw source;
public void Throw() => throw null;
}
}

View File

@ -13,6 +13,7 @@ namespace System.Net.NameResolution.Tests
public class InitializationTests
{
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "dotnet/corefx #17990")]
public void Dns_BeginGetHostAddresses_CallSocketInit_Ok()
{
NameResolutionPal.FakesReset();

View File

@ -5,9 +5,9 @@
<ProjectGuid>{239347DB-D566-48C9-9551-28AB3AD12EC3}</ProjectGuid>
<StringResourcesPath>../../src/Resources/Strings.resx</StringResourcesPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- Avoid warnings about type conflicts for types we're building in -->
<NoWarn>0436</NoWarn>
</PropertyGroup>
<!-- Help VS understand available configurations -->
<!-- Do not reference these assemblies from the TargetingPack since we are building part of the source code for tests. -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
@ -16,25 +16,24 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Unix-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" />
<!-- Do not reference these assemblies from the TargetingPack since we are building part of the source code for tests. -->
<ItemGroup>
<TargetingPackExclusions Include="System.Net.NameResolution" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
<ItemGroup>
<Compile Include="..\..\src\System\Net\IPHostEntry.cs">
<Link>ProductionCode\System\Net\IPHostEntry.cs</Link>
</Compile>
<Compile Include="..\..\src\System\Net\DNS.cs">
<Link>ProductionCode\System\Net\DNS.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="InitializationTest.cs" />
<Compile Include="XunitTestAssemblyAtrributes.cs" />
<!-- Fakes -->
<Compile Include="Fakes\FakeContextAwareResult.cs" />
<Compile Include="Fakes\FakeExceptionDispatchInfo.cs" />
<Compile Include="Fakes\FakeNameResolutionPal.cs" />
<Compile Include="Fakes\FakeNameResolutionUtilities.cs" />
<Compile Include="Fakes\FakeSocketExceptionFactory.cs" />