aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wchar_test.cpp
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2014-05-08 23:21:01 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2014-05-09 00:57:47 +0800
commita5c6b2ecb55afd75630cbe38dd2b88172cfa304d (patch)
tree3cd3f255d1d1491c7b9578e057951897add71aa7 /tests/wchar_test.cpp
parent100168abff75f41c0179a77777f0aef622f7ed9f (diff)
downloadandroid_bionic-a5c6b2ecb55afd75630cbe38dd2b88172cfa304d.tar.gz
android_bionic-a5c6b2ecb55afd75630cbe38dd2b88172cfa304d.tar.bz2
android_bionic-a5c6b2ecb55afd75630cbe38dd2b88172cfa304d.zip
wchar_test.cpp: fix error between comparison signed and unsigned integer
when compile the cts package with aarch64 gcc4.9, will get following error: bionic/tests/wchar_test.cpp:253:3: required from here external/gtest/include/gtest/gtest.h:1448:16: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] this change fix it by using static_cast<wchar_t> as suggested by Calin Juravle Change-Id: I7fb9506e7b84b8a12b9d003458d4f0e78554c3cd Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Diffstat (limited to 'tests/wchar_test.cpp')
-rw-r--r--tests/wchar_test.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp
index a92ac9d65..0d15f21eb 100644
--- a/tests/wchar_test.cpp
+++ b/tests/wchar_test.cpp
@@ -250,13 +250,13 @@ TEST(wchar, mbrtowc) {
ASSERT_EQ(L'a', out[0]);
// 2-byte UTF-8.
ASSERT_EQ(2U, mbrtowc(out, "\xc2\xa2" "cdef", 6, NULL));
- ASSERT_EQ(0x00a2, out[0]);
+ ASSERT_EQ(static_cast<wchar_t>(0x00a2), out[0]);
// 3-byte UTF-8.
ASSERT_EQ(3U, mbrtowc(out, "\xe2\x82\xac" "def", 6, NULL));
- ASSERT_EQ(0x20ac, out[0]);
+ ASSERT_EQ(static_cast<wchar_t>(0x20ac), out[0]);
// 4-byte UTF-8.
ASSERT_EQ(4U, mbrtowc(out, "\xf0\xa4\xad\xa2" "ef", 6, NULL));
- ASSERT_EQ(0x24b62, out[0]);
+ ASSERT_EQ(static_cast<wchar_t>(0x24b62), out[0]);
#if __BIONIC__ // glibc allows this.
// Illegal 5-byte UTF-8.
ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf8\xa1\xa2\xa3\xa4" "f", 6, NULL));