Skip to content

Commit dd1e245

Browse files
committed
Test for !Windows instead excluding several Unix-flavors
Cf. #34633 (comment)
1 parent 89a7c5a commit dd1e245

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libraries/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void TryGetAddrInfo_LocalHost(bool justAddresses)
5151
public void TryGetAddrInfo_EmptyHost(bool justAddresses)
5252
{
5353
SocketError error = NameResolutionPal.TryGetAddrInfo("", justAddresses, AddressFamily.Unspecified, out string hostName, out string[] aliases, out IPAddress[] addresses, out int nativeErrorCode);
54-
if (error == SocketError.HostNotFound && (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()))
54+
if (error == SocketError.HostNotFound && !OperatingSystem.IsWindows())
5555
{
5656
// On Unix, we are not guaranteed to be able to resove the local host. The ability to do so depends on the
5757
// machine configurations, which varies by distro and is often inconsistent.
@@ -78,7 +78,7 @@ public void TryGetAddrInfo_HostName(bool justAddresses)
7878
Assert.NotNull(hostName);
7979

8080
SocketError error = NameResolutionPal.TryGetAddrInfo(hostName, justAddresses, AddressFamily.Unspecified, out hostName, out string[] aliases, out IPAddress[] addresses, out int nativeErrorCode);
81-
if (error == SocketError.HostNotFound && (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()))
81+
if (error == SocketError.HostNotFound && !OperatingSystem.IsWindows())
8282
{
8383
// On Unix, we are not guaranteed to be able to resove the local host. The ability to do so depends on the
8484
// machine configurations, which varies by distro and is often inconsistent.
@@ -289,7 +289,7 @@ public async Task GetAddrInfoAsync_EmptyHost(bool justAddresses)
289289
{
290290
SocketError error = ex.SocketErrorCode;
291291

292-
if (error == SocketError.HostNotFound && (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()))
292+
if (error == SocketError.HostNotFound && !OperatingSystem.IsWindows())
293293
{
294294
// On Unix, we are not guaranteed to be able to resove the local host. The ability to do so depends on the
295295
// machine configurations, which varies by distro and is often inconsistent.
@@ -339,7 +339,7 @@ public async Task GetAddrInfoAsync_HostName(bool justAddresses)
339339
{
340340
SocketError error = ex.SocketErrorCode;
341341

342-
if (error == SocketError.HostNotFound && (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()))
342+
if (error == SocketError.HostNotFound && !OperatingSystem.IsWindows())
343343
{
344344
// On Unix, we are not guaranteed to be able to resove the local host. The ability to do so depends on the
345345
// machine configurations, which varies by distro and is often inconsistent.

0 commit comments

Comments
 (0)