[PATCH] D47395: [libcxx] [test] Remove nonportable locale assumption in basic.ios.members/narrow.pass.cpp

Billy Robert O'Neal III via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 25 14:51:29 PDT 2018


BillyONeal created this revision.
BillyONeal added reviewers: EricWF, mclow.lists.

I'm not sure if libcxx is asserting UTF-8 here; but on Windows the full char value is always passed through in its entirety, since the default codepage is something like Windows-1252. The replacement character is only used for non-chars there; and that should be a more portable test everywhere.


https://reviews.llvm.org/D47395

Files:
  test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp


Index: test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp
===================================================================
--- test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp
+++ test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp
@@ -18,7 +18,7 @@
 
 int main()
 {
-    const std::ios ios(0);
-    assert(ios.narrow('c', '*') == 'c');
-    assert(ios.narrow('\xFE', '*') == '*');
+    const std::wios ios(0);
+    assert(ios.narrow(L'c', '*') == 'c');
+    assert(ios.narrow(L'\u203C', '*') == '*');
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47395.148675.patch
Type: text/x-patch
Size: 581 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180525/5ea85783/attachment.bin>


More information about the cfe-commits mailing list