This is an archive of the discontinued LLVM Phabricator instance.

Fix VASprintfTest.cpp for Darwin, add checks
ClosedPublic

Authored by penryu on Aug 8 2017, 4:31 PM.

Details

Summary

The EncodingError test ensures that trying to encode a multibyte wchar
with a given codepage fails. If setlocale() fails, the encoding is
performed using the current locale, which may or may not fail.

This patch asserts that both setlocale() operations are successful, as
well as falling back to a widely available unibyte encoding for
non-Windows systems.

rdar://problem/33782806

Event Timeline

penryu created this revision.Aug 8 2017, 4:31 PM
penryu added a comment.Aug 8 2017, 4:36 PM

I'd prototyped this as simply prepending "DISABLED_" for non-Windows, but as this was designed as a temporary measure, I decided to ensure the same behavior was tested on Windows, and similar/equivalent behavior tested on other platforms.

zturner accepted this revision.Aug 8 2017, 9:16 PM
This revision is now accepted and ready to land.Aug 8 2017, 9:16 PM
penryu closed this revision.Aug 9 2017, 10:27 AM

Committed revision 310499.
Closing revision D36496 'Fix VASprintfTest.cpp for Darwin, add checks'...