Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ public static partial class PlatformDetection
//

private static bool IsLinux => RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
public static bool IsCentos6 => IsDistroAndVersion("centos", 6);
public static bool IsOpenSUSE => IsDistroAndVersion("opensuse");
public static bool IsUbuntu => IsDistroAndVersion("ubuntu");
public static bool IsDebian => IsDistroAndVersion("debian");
public static bool IsAlpine => IsDistroAndVersion("alpine");
public static bool IsDebian8 => IsDistroAndVersion("debian", 8);
public static bool IsDebian10 => IsDistroAndVersion("debian", 10);
public static bool IsUbuntu1404 => IsDistroAndVersion("ubuntu", 14, 4);
public static bool IsUbuntu1604 => IsDistroAndVersion("ubuntu", 16, 4);
public static bool IsUbuntu1704 => IsDistroAndVersion("ubuntu", 17, 4);
public static bool IsUbuntu1710 => IsDistroAndVersion("ubuntu", 17, 10);
Expand Down
8 changes: 4 additions & 4 deletions src/libraries/Common/tests/System/Drawing/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public static bool GetIsWindowsOrAtLeastLibgdiplus6()

public static bool GetRecentGdiPlusIsAvailable2()
{
// RedHat and Ubuntu 14.04, as well as Fedora 25 and OpenSUSE 4.22 are running outdated versions of libgdiplus
if (PlatformDetection.IsRedHatFamily || PlatformDetection.IsUbuntu1404 || PlatformDetection.IsFedora || PlatformDetection.IsOpenSUSE)
// RedHat as well as Fedora 25 and OpenSUSE 4.22 are running outdated versions of libgdiplus
if (PlatformDetection.IsRedHatFamily || PlatformDetection.IsFedora || PlatformDetection.IsOpenSUSE)
{
return false;
}
Expand Down Expand Up @@ -90,8 +90,8 @@ public static bool GetGdiPlusIsAvailableNotWindows7()

public static bool GetRecentGdiPlusIsAvailable()
{
// RedHat and Ubuntu 14.04 are running outdated versions of libgdiplus
if (PlatformDetection.IsRedHatFamily || PlatformDetection.IsUbuntu1404)
// RedHat is running outdated versions of libgdiplus
if (PlatformDetection.IsRedHatFamily)
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static IEnumerable<object[]> GetAbbreviatedDayName_TestData()
yield return new object[] { new CultureInfo("en-US").DateTimeFormat, englishAbbreviatedDayNames };
yield return new object[] { new DateTimeFormatInfo(), englishAbbreviatedDayNames };

if (!PlatformDetection.IsUbuntu || PlatformDetection.IsUbuntu1404)
if (!PlatformDetection.IsUbuntu)
{
yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, DateTimeFormatInfoData.FrFRAbbreviatedDayNames() };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static IEnumerable<object[]> GetAbbreviatedMonthName_TestData()
yield return new object[] { new CultureInfo("en-US").DateTimeFormat, englishAbbreviatedMonthNames };
yield return new object[] { new DateTimeFormatInfo(), englishAbbreviatedMonthNames };

if (!PlatformDetection.IsUbuntu || PlatformDetection.IsUbuntu1404)
if (!PlatformDetection.IsUbuntu)
{
yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, new string[] { "", "janv.", "f\u00E9vr.", "mars", "avr.", "mai", "juin", "juil.", "ao\u00FBt", "sept.", "oct.", "nov.", "d\u00E9c.", "" } };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static IEnumerable<object[]> GetDayName_TestData()
yield return new object[] { new CultureInfo("en-US").DateTimeFormat, englishDayNames };
yield return new object[] { new DateTimeFormatInfo(), englishDayNames };

if (!PlatformDetection.IsUbuntu || PlatformDetection.IsUbuntu1404)
if (!PlatformDetection.IsUbuntu)
{
yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, DateTimeFormatInfoData.FrFRDayNames() };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static IEnumerable<object[]> GetMonthName_TestData()
yield return new object[] { new DateTimeFormatInfo(), englishMonthNames };
yield return new object[] { new CultureInfo("en-US").DateTimeFormat, englishMonthNames };

if (!PlatformDetection.IsUbuntu || PlatformDetection.IsUbuntu1404)
if (!PlatformDetection.IsUbuntu)
{
yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, new string[] { "", "janvier", "f\u00E9vrier", "mars", "avril", "mai", "juin", "juillet", "ao\u00FBt", "septembre", "octobre", "novembre", "d\u00E9cembre", "" } };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ public static IEnumerable<object[]> CurrencyGroupSizes_TestData()
yield return new object[] { NumberFormatInfo.InvariantInfo, new int[] { 3 } };
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, new int[] { 3 } };

if ((!PlatformDetection.IsUbuntu || PlatformDetection.IsUbuntu1404)
&& !PlatformDetection.IsWindows7 && !PlatformDetection.IsWindows8x && !PlatformDetection.IsFedora)
if (!PlatformDetection.IsUbuntu && !PlatformDetection.IsWindows7 && !PlatformDetection.IsWindows8x && !PlatformDetection.IsFedora)
{
yield return new object[] { CultureInfo.GetCultureInfo("ur-IN").NumberFormat, new int[] { 3, 2 } };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ public static void ReadECDsaPrivateKey_BrainpoolP160r1_Pfx(byte[] pfxData)
}
catch (CryptographicException)
{
// Windows 7, Windows 8, Ubuntu 14, CentOS, macOS can fail. Verify known good platforms don't fail.
// Windows 7, Windows 8, CentOS, macOS can fail. Verify known good platforms don't fail.
Assert.False(PlatformDetection.IsWindows && PlatformDetection.WindowsVersion >= 10, "Is Windows 10");
Assert.False(PlatformDetection.IsUbuntu && !PlatformDetection.IsUbuntu1404, "Is Ubuntu 16.04 or up");
Assert.False(PlatformDetection.IsUbuntu, "Is Ubuntu");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ public static void TestKey_ECDsabrainpool_PublicKey(byte[] curveData, byte[] not
}
catch (CryptographicException)
{
// Windows 7, Windows 8, Ubuntu 14, CentOS can fail. Verify known good platforms don't fail.
// Windows 7, Windows 8, CentOS can fail. Verify known good platforms don't fail.
Assert.False(PlatformDetection.IsWindows && PlatformDetection.WindowsVersion >= 10);
Assert.False(PlatformDetection.IsUbuntu && !PlatformDetection.IsUbuntu1404);
Assert.False(PlatformDetection.IsUbuntu);
}
}

Expand Down Expand Up @@ -420,9 +420,9 @@ public static void TestECDsaPublicKey_BrainpoolP160r1_ValidatesSignature(byte[]
}
catch (CryptographicException)
{
// Windows 7, Windows 8, Ubuntu 14, CentOS can fail. Verify known good platforms don't fail.
// Windows 7, Windows 8, CentOS can fail. Verify known good platforms don't fail.
Assert.False(PlatformDetection.IsWindows && PlatformDetection.WindowsVersion >= 10);
Assert.False(PlatformDetection.IsUbuntu && !PlatformDetection.IsUbuntu1404);
Assert.False(PlatformDetection.IsUbuntu);
}
}

Expand Down