diff options
author | Alexander Ivchenko <alexander.ivchenko@intel.com> | 2014-06-11 16:20:54 +0400 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-06-11 15:57:57 -0700 |
commit | 68b01665b35849859f26f58f3044618b626abc2b (patch) | |
tree | 69b381f299e86534ba78d436ba193346e6a295ce | |
parent | 48082a0a6e2f74cdc2ad1820131eca7d00299b6d (diff) | |
download | bionic-68b01665b35849859f26f58f3044618b626abc2b.zip bionic-68b01665b35849859f26f58f3044618b626abc2b.tar.gz bionic-68b01665b35849859f26f58f3044618b626abc2b.tar.bz2 |
Fix mbrtoc32 test from tests/uchar_test.cpp for x86.
Without that fix the test fails with:
"error: comparison between signed and unsigned integer expressions" on x86,
due to the fact that char is signed on x86.
Change-Id: I44462d67c15c7e9b730ad5da52eb9c05e207d34b
Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
-rw-r--r-- | tests/uchar_test.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/uchar_test.cpp b/tests/uchar_test.cpp index 5f230f0..eca3c5e 100644 --- a/tests/uchar_test.cpp +++ b/tests/uchar_test.cpp @@ -161,9 +161,9 @@ TEST(uchar, mbrtoc16_zero_len) { #if HAVE_UCHAR char16_t out; - out = 'x'; + out = L'x'; ASSERT_EQ(0U, mbrtoc16(&out, "hello", 0, NULL)); - ASSERT_EQ('x', out); + ASSERT_EQ(L'x', out); ASSERT_EQ(0U, mbrtoc16(&out, "hello", 0, NULL)); ASSERT_EQ(0U, mbrtoc16(&out, "", 0, NULL)); @@ -324,14 +324,14 @@ TEST(uchar, mbrtoc32) { #if HAVE_UCHAR char32_t out[8]; - out[0] = 'x'; + out[0] = L'x'; ASSERT_EQ(0U, mbrtoc32(out, "hello", 0, NULL)); - ASSERT_EQ('x', out[0]); + ASSERT_EQ(static_cast<char32_t>(L'x'), out[0]); ASSERT_EQ(0U, mbrtoc32(out, "hello", 0, NULL)); ASSERT_EQ(0U, mbrtoc32(out, "", 0, NULL)); ASSERT_EQ(1U, mbrtoc32(out, "hello", 1, NULL)); - ASSERT_EQ(L'h', out[0]); + ASSERT_EQ(static_cast<char32_t>(L'h'), out[0]); ASSERT_EQ(0U, mbrtoc32(NULL, "hello", 0, NULL)); ASSERT_EQ(0U, mbrtoc32(NULL, "", 0, NULL)); @@ -344,7 +344,7 @@ TEST(uchar, mbrtoc32) { // 1-byte UTF-8. ASSERT_EQ(1U, mbrtoc32(out, "abcdef", 6, NULL)); - ASSERT_EQ(L'a', out[0]); + ASSERT_EQ(static_cast<char32_t>(L'a'), out[0]); // 2-byte UTF-8. ASSERT_EQ(2U, mbrtoc32(out, "\xc2\xa2" "cdef", 6, NULL)); ASSERT_EQ(static_cast<char32_t>(0x00a2), out[0]); |