Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Fix globalization tests to work with setting customization #24052

Merged

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented Sep 14, 2017

We used new CultureInfo in many places to check the NumberFormatInfo properties values. these tests can fail if the user customized the user settings on the running machine. The fix here is to use GetCultureInfo which always ignore the change in the settings and return the original values we need to test against.

We used new CultureInfo in many places to check the NumberFormatInfo properties values . these tests can fail if the user customized the  user settings on the running machine. The fix here is to use GetCultureInfo which always ignore the change in the settings and return the original values we need to test against.
@tarekgh
Copy link
Member Author

tarekgh commented Sep 14, 2017

This change should fix the failures in the globalization tests reported in the issue #23992

@mellinoe
Copy link
Contributor

Interesting, so CultureInfo.GetCultureInfo() is different from new CultureInfo() -- I wouldn't have guessed that myself. Looks good to me if that indeed has the desired effect.

@tarekgh
Copy link
Member Author

tarekgh commented Sep 14, 2017

Interesting, so CultureInfo.GetCultureInfo() is different from new CultureInfo()

Yes, CultureInfo.GetCultureInfo creates a culture with disabling the user overrides. it is similar to new CultureInfo(name, false). CultureInfo.GetCultureInfo is useful for caching too so we don't create a new object every time but the created object will be read only.

@tarekgh tarekgh merged commit 708c20a into dotnet:master Sep 15, 2017
@karelz karelz added this to the 2.1.0 milestone Oct 11, 2017
@tarekgh tarekgh deleted the FixGlobalizationTestsWithUserOverrides branch October 27, 2017 17:49
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…refx#24052)

We used new CultureInfo in many places to check the NumberFormatInfo properties values . these tests can fail if the user customized the  user settings on the running machine. The fix here is to use GetCultureInfo which always ignore the change in the settings and return the original values we need to test against.

Commit migrated from dotnet/corefx@708c20a
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants