This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Fix the locale get_one_wide test for windows and glibc
ClosedPublic

Authored by mstorsjo on Feb 14 2022, 3:39 PM.

Diff Detail

Event Timeline

mstorsjo requested review of this revision.Feb 14 2022, 3:39 PM
mstorsjo created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2022, 3:39 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
mstorsjo updated this revision to Diff 408750.Feb 15 2022, 1:07 AM

Retry the CI, rebased to an older version where there hopefully aren't any other unrelated CI failures.

SGTM but I'd like to understand why tm_wday can't be tested on Windows.

libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
68

Does Windows lack this tm member? If so please add a comment.

SGTM but I'd like to understand why tm_wday can't be tested on Windows.

Those tests try to parse a date string in a format that corresponds to what strftime("%c") produces. On Windows, the %c time format lacks the leading week day, which means that we must omit it from the input text string in the test, and after parsing it, tm_wday isn't filled in as it wasn't part of the string. I guess I should add a comment that explains this.

mstorsjo updated this revision to Diff 408916.Feb 15 2022, 9:16 AM

Added a comment to clarify the missing week day in the string and the ifdeffed out check for the tm_wday member.

Mordante accepted this revision as: Mordante.Feb 16 2022, 9:44 AM

LGTM!

ldionne accepted this revision.Feb 16 2022, 1:20 PM
This revision is now accepted and ready to land.Feb 16 2022, 1:20 PM
This revision was landed with ongoing or failed builds.Feb 17 2022, 12:55 AM
This revision was automatically updated to reflect the committed changes.