From a5c6b2ecb55afd75630cbe38dd2b88172cfa304d Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Thu, 8 May 2014 23:21:01 +0800 Subject: [PATCH] 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 as suggested by Calin Juravle Change-Id: I7fb9506e7b84b8a12b9d003458d4f0e78554c3cd Signed-off-by: Yongqin Liu --- tests/wchar_test.cpp | 6 +++--- 1 file 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(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(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(0x24b62), out[0]); #if __BIONIC__ // glibc allows this. // Illegal 5-byte UTF-8. ASSERT_EQ(static_cast(-1), mbrtowc(out, "\xf8\xa1\xa2\xa3\xa4" "f", 6, NULL));