summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2022-10-12 22:00:21 +0200
committerLinus Groh <mail@linusgroh.de>2022-10-14 13:01:13 +0200
commita650c74b27cae619eac102b8bdcbae642af1eaf1 (patch)
treeaa93b04866c0c188ff182ee5b43d3a6c1283cb3c /Tests
parent31bd5b1a023124d960d79d5ace7e29b6d0a696d2 (diff)
downloadserenity-a650c74b27cae619eac102b8bdcbae642af1eaf1.zip
AK+Toolchain: Make char and wchar_t behave on AARCH64
By default char and wchar_t are unsigned on AARCH64. This fixes a bunch of related compiler errors.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/LibC/TestWchar.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Tests/LibC/TestWchar.cpp b/Tests/LibC/TestWchar.cpp
index 86a3e61692..db445e485e 100644
--- a/Tests/LibC/TestWchar.cpp
+++ b/Tests/LibC/TestWchar.cpp
@@ -239,17 +239,17 @@ TEST_CASE(mbrtowc)
// Ensure that we can parse normal ASCII characters.
ret = mbrtowc(&wc, "Hello", 5, &state);
EXPECT_EQ(ret, 1ul);
- EXPECT_EQ(wc, 'H');
+ EXPECT_EQ(wc, static_cast<wchar_t>('H'));
// Try two three-byte codepoints (™™), only one of which should be consumed.
ret = mbrtowc(&wc, "\xe2\x84\xa2\xe2\x84\xa2", 6, &state);
EXPECT_EQ(ret, 3ul);
- EXPECT_EQ(wc, 0x2122);
+ EXPECT_EQ(wc, static_cast<wchar_t>(0x2122));
// Try a null character, which should return 0 and reset the state to the initial state.
ret = mbrtowc(&wc, "\x00\x00", 2, &state);
EXPECT_EQ(ret, 0ul);
- EXPECT_EQ(wc, 0);
+ EXPECT_EQ(wc, static_cast<wchar_t>(0));
EXPECT_NE(mbsinit(&state), 0);
// Try an incomplete multibyte character.
@@ -262,7 +262,7 @@ TEST_CASE(mbrtowc)
// Finish the previous multibyte character.
ret = mbrtowc(&wc, "\xa2", 1, &state);
EXPECT_EQ(ret, 1ul);
- EXPECT_EQ(wc, 0x2122);
+ EXPECT_EQ(wc, static_cast<wchar_t>(0x2122));
// Try an invalid multibyte sequence.
// Reset the state afterwards because the effects are undefined.
@@ -550,17 +550,17 @@ TEST_CASE(mbtowc)
// Ensure that we can parse normal ASCII characters.
ret = mbtowc(&wc, "Hello", 5);
EXPECT_EQ(ret, 1);
- EXPECT_EQ(wc, 'H');
+ EXPECT_EQ(wc, static_cast<wchar_t>('H'));
// Try two three-byte codepoints (™™), only one of which should be consumed.
ret = mbtowc(&wc, "\xe2\x84\xa2\xe2\x84\xa2", 6);
EXPECT_EQ(ret, 3);
- EXPECT_EQ(wc, 0x2122);
+ EXPECT_EQ(wc, static_cast<wchar_t>(0x2122));
// Try a null character, which should return 0.
ret = mbtowc(&wc, "\x00\x00", 2);
EXPECT_EQ(ret, 0);
- EXPECT_EQ(wc, 0);
+ EXPECT_EQ(wc, static_cast<wchar_t>(0));
// Try an incomplete multibyte character.
ret = mbtowc(&wc, "\xe2\x84", 2);