aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/UtilsTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-12-21 13:34:24 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-21 21:06:44 +0000
commit889d521d8715f4934accb630097bc09bf7ad1a32 (patch)
tree6e41a72f078156cf8e5338ebd5165df191ab97fd /tests/UtilsTest.cpp
parent8957a1058e3937bc22192837d2fe87c4a8a047b7 (diff)
validate text during deserialization
Bug: 796473 Change-Id: I7b6a6c698a5b53c915ef6564852fa51ce7410a3e Reviewed-on: https://skia-review.googlesource.com/88520 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
Diffstat (limited to 'tests/UtilsTest.cpp')
-rw-r--r--tests/UtilsTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/UtilsTest.cpp b/tests/UtilsTest.cpp
index ed861c69a0..7e11f8478a 100644
--- a/tests/UtilsTest.cpp
+++ b/tests/UtilsTest.cpp
@@ -174,7 +174,7 @@ static void test_utf16(skiatest::Reporter* reporter) {
for (size_t i = 0; i < SK_ARRAY_COUNT(gUni); i++) {
size_t count = SkUTF16_FromUnichar(gUni[i], buf);
REPORTER_ASSERT(reporter, count == 2);
- size_t count2 = SkUTF16_CountUnichars(buf, 2);
+ size_t count2 = SkUTF16_CountUnichars(buf, 2 * sizeof(uint16_t));
REPORTER_ASSERT(reporter, count2 == 1);
const uint16_t* ptr = buf;
SkUnichar c = SkUTF16_NextUnichar(&ptr);
@@ -227,7 +227,7 @@ DEF_TEST(Utils, reporter) {
#define LEADING_FOUR_BYTE "\xF0"
#define INVALID_BYTE "\xFC"
static bool valid_utf8(const char* p, size_t l) {
- return SkUTF8_CountUnicharsWithError(p, l) >= 0;
+ return SkUTF8_CountUnichars(p, l) >= 0;
}
DEF_TEST(Utils_UTF8_ValidLength, r) {
const char* goodTestcases[] = {