Merge "Use 0 instead of NULL for comparison to char16_t" am: 6a79e8113a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1949458 Change-Id: Ibabb4553adbe965cedf7866e1fa3b08f758eaece
This commit is contained in:
commit
dc4af935d5
1 changed files with 2 additions and 3 deletions
|
|
@ -100,7 +100,7 @@ TEST_F(UnicodeTest, UTF8toUTF16Normal) {
|
||||||
0xF0, 0x90, 0x80, 0x80, // U+10000, 2 UTF-16 character
|
0xF0, 0x90, 0x80, 0x80, // U+10000, 2 UTF-16 character
|
||||||
};
|
};
|
||||||
|
|
||||||
char16_t output[1 + 1 + 1 + 2 + 1]; // Room for NULL
|
char16_t output[1 + 1 + 1 + 2 + 1]; // Room for null
|
||||||
|
|
||||||
utf8_to_utf16(str, sizeof(str), output, sizeof(output) / sizeof(output[0]));
|
utf8_to_utf16(str, sizeof(str), output, sizeof(output) / sizeof(output[0]));
|
||||||
|
|
||||||
|
|
@ -114,8 +114,7 @@ TEST_F(UnicodeTest, UTF8toUTF16Normal) {
|
||||||
<< "should be first half of surrogate U+10000";
|
<< "should be first half of surrogate U+10000";
|
||||||
EXPECT_EQ(0xDC00, output[4])
|
EXPECT_EQ(0xDC00, output[4])
|
||||||
<< "should be second half of surrogate U+10000";
|
<< "should be second half of surrogate U+10000";
|
||||||
EXPECT_EQ(NULL, output[5])
|
EXPECT_EQ(0, output[5]) << "should be null terminated";
|
||||||
<< "should be NULL terminated";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(UnicodeTest, strstr16EmptyTarget) {
|
TEST_F(UnicodeTest, strstr16EmptyTarget) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue