diff options
author | Pavel Labath <labath@google.com> | 2017-02-17 13:27:50 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-02-17 13:27:50 +0000 |
commit | 6673afb2dccb926be18331df8b1d35c0d2c5bbfa (patch) | |
tree | 9f013d266f45726a5f9ab42ca33d77c4bc482053 | |
parent | fb0d22d6454a9b55e6c9219c5e06646c9707889a (diff) | |
download | bcm5719-llvm-6673afb2dccb926be18331df8b1d35c0d2c5bbfa.tar.gz bcm5719-llvm-6673afb2dccb926be18331df8b1d35c0d2c5bbfa.zip |
Fix VASprintfTest on darwin
The way of injecting an error into the printf call was not working on
darwin - the C library still happily format the character. It only
returns an error after we use a wide character that does not fit into a
single byte, so switch the test to use that.
llvm-svn: 295443
-rw-r--r-- | lldb/unittests/Utility/VASprintfTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/unittests/Utility/VASprintfTest.cpp b/lldb/unittests/Utility/VASprintfTest.cpp index 73a43dd300b..0b440942eb5 100644 --- a/lldb/unittests/Utility/VASprintfTest.cpp +++ b/lldb/unittests/Utility/VASprintfTest.cpp @@ -49,11 +49,11 @@ TEST(VASprintfTest, EncodingError) { setlocale(LC_ALL, ".932"); wchar_t Invalid[2]; - Invalid[0] = 129; + Invalid[0] = 0x100; Invalid[1] = 0; llvm::SmallString<32> Buffer; EXPECT_FALSE(Sprintf(Buffer, "%ls", Invalid)); EXPECT_EQ("<Encoding error>", Buffer); - setlocale(LC_CTYPE, Current.c_str()); + setlocale(LC_ALL, Current.c_str()); } |