Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1577)

Unified Diff: Source/wtf/text/TextCodecUTF8Test.cpp

Issue 23532016: Handle odd data lengths in UTF-16 decoder (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Simplify Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/text/TextCodecUTF8.cpp ('k') | Source/wtf/text/TextCodecUserDefined.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/TextCodecUTF8Test.cpp
diff --git a/Source/wtf/text/TextCodecUTF8Test.cpp b/Source/wtf/text/TextCodecUTF8Test.cpp
index 72c241210b56c01f31621dce19a09a7e9186a822..54f6a0ffdb407236ca96db94c914356ff1a2e17d 100644
--- a/Source/wtf/text/TextCodecUTF8Test.cpp
+++ b/Source/wtf/text/TextCodecUTF8Test.cpp
@@ -52,7 +52,7 @@ TEST(TextCodecUTF8, DecodeAscii)
size_t testCaseSize = sizeof(testCase) - 1;
bool sawError = false;
- const String& result = codec->decode(testCase, testCaseSize, true, false, sawError);
+ const String& result = codec->decode(testCase, testCaseSize, DataEOF, false, sawError);
EXPECT_FALSE(sawError);
ASSERT_EQ(testCaseSize, result.length());
for (size_t i = 0; i < testCaseSize; ++i) {
@@ -70,7 +70,7 @@ TEST(TextCodecUTF8, DecodeChineseCharacters)
size_t testCaseSize = sizeof(testCase) - 1;
bool sawError = false;
- const String& result = codec->decode(testCase, testCaseSize, true, false, sawError);
+ const String& result = codec->decode(testCase, testCaseSize, DataEOF, false, sawError);
EXPECT_FALSE(sawError);
ASSERT_EQ(2u, result.length());
EXPECT_EQ(0x6f22U, result[0]);
@@ -83,7 +83,7 @@ TEST(TextCodecUTF8, Decode0xFF)
OwnPtr<TextCodec> codec(newTextCodec(encoding));
bool sawError = false;
- const String& result = codec->decode("\xff", 1, true, false, sawError);
+ const String& result = codec->decode("\xff", 1, DataEOF, false, sawError);
EXPECT_TRUE(sawError);
ASSERT_EQ(1u, result.length());
EXPECT_EQ(0xFFFDU, result[0]);
« no previous file with comments | « Source/wtf/text/TextCodecUTF8.cpp ('k') | Source/wtf/text/TextCodecUserDefined.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698