Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Throw exception if culture data does not exist in icu #47301

Merged
merged 27 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
164db20
[wasm] Throw exception if culture data does not exist in icu
tqiu8 Jan 9, 2021
fd96d0c
add lines
tqiu8 Jan 9, 2021
68a4fa3
add lines
tqiu8 Jan 9, 2021
82759a8
remove blank spaces
tqiu8 Jan 9, 2021
d92afab
Add check for culture data in ICU
tqiu8 Jan 22, 2021
df4d910
include documentation link in exception message
tqiu8 Jan 22, 2021
7167047
Add PredefinedOnly to Windows
tqiu8 Jan 22, 2021
7c677dc
move checks outside of CultureData.cs
tqiu8 Jan 22, 2021
53151f8
Add test for predefined culture env var
tqiu8 Jan 25, 2021
42c85fb
switch test to remoteexecutor
tqiu8 Jan 25, 2021
e0f14e8
try catch for all culture not supported exceptions
tqiu8 Jan 27, 2021
bb3f356
Fix test failures: Check for RegionInfo first before creating culture…
tqiu8 Feb 8, 2021
e894382
add another condition to env var test
tqiu8 Feb 8, 2021
462f7ad
fix conditional theory
tqiu8 Feb 9, 2021
18faed1
fix TypeConverter test failures
tqiu8 Feb 10, 2021
ef75159
change assembly test data to pl-PL to avoid culturenotfound exception
tqiu8 Feb 16, 2021
8cdeb96
Merge branch 'culture-dt-fix' of github.com:tqiu8/runtime into cultur…
tqiu8 Mar 2, 2021
84b8429
remove exception filters from tests and add additional parameter to t…
tqiu8 Mar 2, 2021
f8163f7
move exception out of CreateCulturedata
tqiu8 Mar 4, 2021
451a3ad
remove else block
tqiu8 Mar 4, 2021
0bc3a5c
remove redundant methods
tqiu8 Mar 4, 2021
c40d610
revert logic in nls
tqiu8 Mar 4, 2021
eeeda5f
Update src/libraries/System.Reflection.MetadataLoadContext/tests/src/…
tqiu8 Mar 5, 2021
b956ca6
Merge branch 'master' into culture-dt-fix
tqiu8 Mar 5, 2021
3b065d2
Merge branch 'culture-dt-fix' of github.com:tqiu8/runtime into cultur…
tqiu8 Mar 5, 2021
0aab18e
fix invariant tests
tqiu8 Mar 9, 2021
23842ee
remove aggressive inlining
tqiu8 Mar 10, 2021
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 @@ -28,6 +28,7 @@ public static partial class PlatformDetection
public static bool IsNetBSD => RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"));
public static bool IsiOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS"));
public static bool IstvOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS"));
public static bool IsMacCatalyst => RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST"));
public static bool Isillumos => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ILLUMOS"));
public static bool IsSolaris => RuntimeInformation.IsOSPlatform(OSPlatform.Create("SOLARIS"));
public static bool IsBrowser => RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"));
Expand All @@ -49,6 +50,9 @@ public static partial class PlatformDetection
public static bool IsThreadingSupported => !IsBrowser;
public static bool IsBinaryFormatterSupported => !IsBrowser;

public static bool IsSpeedOptimized => !IsSizeOptimized;
public static bool IsSizeOptimized => IsBrowser || IsAndroid || IsiOS || IstvOS;

public static bool IsBrowserDomSupported => GetIsBrowserDomSupported();
public static bool IsNotBrowserDomSupported => !IsBrowserDomSupported;

Expand Down Expand Up @@ -132,7 +136,7 @@ public static bool IsNonZeroLowerBoundArraySupported
(IsOpenSslSupported &&
(OpenSslVersion.Major >= 1 && (OpenSslVersion.Minor >= 1 || OpenSslVersion.Build >= 2)));

public static bool SupportsClientAlpn => SupportsAlpn || IsOSX || IsiOS || IstvOS;
public static bool SupportsClientAlpn => SupportsAlpn || IsOSX || IsMacCatalyst || IsiOS || IstvOS;

private static Lazy<bool> s_supportsTls10 = new Lazy<bool>(GetTls10Support);
private static Lazy<bool> s_supportsTls11 = new Lazy<bool>(GetTls11Support);
Expand Down Expand Up @@ -280,8 +284,8 @@ private static bool OpenSslGetTlsSupport(SslProtocols protocol)

private static bool GetTls10Support()
{
// on Windows and macOS TLS1.0/1.1 are supported.
if (IsWindows || IsOSXLike)
// on Windows, macOS, and Android TLS1.0/1.1 are supported.
if (IsWindows || IsOSXLike || IsAndroid)
{
return true;
}
Expand All @@ -291,13 +295,13 @@ private static bool GetTls10Support()

private static bool GetTls11Support()
{
// on Windows and macOS TLS1.0/1.1 are supported.
// on Windows, macOS, and Android TLS1.0/1.1 are supported.
// TLS 1.1 and 1.2 can work on Windows7 but it is not enabled by default.
if (IsWindows)
{
return !IsWindows7;
}
else if (IsOSXLike)
else if (IsOSXLike || IsAndroid)
{
return true;
}
Expand Down Expand Up @@ -339,7 +343,7 @@ private static bool GetTls13Support()
// The build number is approximation.
return IsWindows10Version2004Build19573OrGreater;
}
else if (IsOSX || IsiOS || IstvOS)
else if (IsOSX || IsMacCatalyst || IsiOS || IstvOS)
{
// [ActiveIssue("https://github.com/dotnet/runtime/issues/1979")]
return false;
Expand Down
3 changes: 1 addition & 2 deletions src/libraries/Common/tests/Tests/System/StringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2567,8 +2567,7 @@ public void Equals_Encyclopaedia_ReturnsExpected(StringComparison comparison, bo
{
string source = "encyclop\u00e6dia";
string target = "encyclopaedia";

using (new ThreadCultureChange("se-SE"))
tqiu8 marked this conversation as resolved.
Show resolved Hide resolved
using (new ThreadCultureChange(PlatformDetection.IsBrowser ?"pl-PL" : "se-SE"))
{
Assert.Equal(expected, string.Equals(source, target, comparison));
Assert.Equal(expected, source.AsSpan().Equals(target.AsSpan(), comparison));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ public override IEnumerable<ConvertTest> ConvertFromTestData()
yield return ConvertTest.Valid("nl-B", new CultureInfo("nl--B"), CultureInfo.InvariantCulture);
yield return ConvertTest.Valid("nl-B", new CultureInfo("nl--B"), new CultureInfo("en-US"));
}

yield return ConvertTest.Valid("Afrikaans", new CultureInfo("af"));
if (PlatformDetection.IsNotBrowser)
{
yield return ConvertTest.Valid("Afrikaans", new CultureInfo("af"));
}

yield return ConvertTest.CantConvertFrom(CultureInfo.CurrentCulture);
yield return ConvertTest.CantConvertFrom(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,11 @@ public static IEnumerable<object[]> Compare_TestData()
yield return new object[] { s_hungarianCompare, "dzsdzs", "ddzs", CompareOptions.None, useNls ? 0 : -1 };
yield return new object[] { s_invariantCompare, "Test's", "Tests", CompareOptions.None, useNls ? 1 : -1 };
yield return new object[] { new CultureInfo("de-DE").CompareInfo, "\u00DC", "UE", CompareOptions.None, -1 };
yield return new object[] { new CultureInfo("de-DE_phoneb").CompareInfo, "\u00DC", "UE", CompareOptions.None, useNls ? 0 : -1 };
yield return new object[] { new CultureInfo("es-ES_tradnl").CompareInfo, "llegar", "lugar", CompareOptions.None, useNls ? 1 : -1 };
if (PlatformDetection.IsNotBrowser)
{
yield return new object[] { new CultureInfo("de-DE_phoneb").CompareInfo, "\u00DC", "UE", CompareOptions.None, useNls ? 0 : -1 };
yield return new object[] { new CultureInfo("es-ES_tradnl").CompareInfo, "llegar", "lugar", CompareOptions.None, useNls ? 1 : -1 };
}
}

// There is a regression in Windows 190xx version with the Kana comparison. Avoid running this test there.
Expand Down
Loading