Make unicode_charlist a vector

This commit is contained in:
patrick96
2023-05-10 16:11:52 +02:00
committed by Patrick Ziegler
parent c86519f077
commit 5e5a0a7c4d
3 changed files with 36 additions and 23 deletions

View File

@ -193,8 +193,8 @@ TEST_P(Utf8ToUCS4AsciiTest, correctness) {
ASSERT_EQ(str.size(), result_list.size());
int i = 0;
for (const auto& unicode_char : result_list) {
for (size_t i = 0; i < str.size(); i++) {
const auto& unicode_char = result_list[i];
auto c = str[i];
// Matches the single byte character
@ -203,8 +203,6 @@ TEST_P(Utf8ToUCS4AsciiTest, correctness) {
EXPECT_EQ(i, unicode_char.offset);
// Only takes a single byte
EXPECT_EQ(1, unicode_char.length);
i++;
}
}
@ -266,5 +264,6 @@ TEST_P(Utf8ToUCS4InvalidTest, correctness) {
const auto str = GetParam();
bool success = string_util::utf8_to_ucs4(str.c_str(), result_list);
EXPECT_FALSE(success);
EXPECT_EQ(0, result_list.size());
}
// }}}