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

Fix and enable Globalization tests that differ based on OS and culture #4625

Merged
merged 5 commits into from
Nov 24, 2015

Conversation

eerhardt
Copy link
Member

There were a few tests that were disabled and/or had TODO comments in them to clean their handling of culture and OS differences. I've cleaned them up following the established pattern in other tests.

Fix #3243

@ellismg @tarekgh

}

[DllImport("ntdll.dll")]
private static extern int RtlGetVersion(out RTL_OSVERSIONINFOEX lpVersionInformation);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this API intended to be kernel mode and it is not nice to call it from the user mode even if it is working. I would suggest you use IsWindowsVersionOrGreater instead

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the function that the new OSDescription API is going to use, according to #4334.

If the function will work for the product, then it should be OK to call in the tests, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I didn't know that. I am fine then.

@tarekgh
Copy link
Member

tarekgh commented Nov 21, 2015

beside my comment, everything else LGTM

[Theory]
[InlineData("en-US")]
[InlineData("br-FR")]
public void TestLocale(string localeName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I appreciate the complexities of br-FR's calendar rule, I'm wondering if we couldn't help clarity by having some more fixed points called out in something like

[Theory]
[InlineData("en-US", CalendarWeekRule.FirstDay)]
[InlineData("fr-FR", CalendarWeekRule.SomeConst)]
[InlineData("ja-JP", CalendarWeekRule.SomeConst)]
public void VerifyCalendarWeekRule(string localeName, CalendarWeekRule expected)
{
...

just so that we can get breadth-at-a-glance.

Then have br-FR and maybe a couple other complex cases in another test method group.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steveharter added this test, so he can comment as he wants.

IMO, adding more cultures won't really help increase the coverage since we are getting this data from ICU. We just need to test that we are getting the values correctly from ICU. Also, adding more cultures increases the chance that we will get conflicting values between all the differing systems we are testing on.

I think the two cultures are sufficient for testing coverage, so the question becomes, should I split the test back out into 2 separate Facts instead of using a Theory.

eerhardt added a commit that referenced this pull request Nov 24, 2015
Fix and enable Globalization tests that differ based on OS and culture
@eerhardt eerhardt merged commit 093de55 into dotnet:master Nov 24, 2015
@eerhardt eerhardt deleted the Fix3243 branch November 24, 2015 15:47
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
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.

6 participants