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

Unified Diff: third_party/WebKit/Source/wtf/text/TextCodecReplacementTest.cpp

Issue 1611343002: wtf reformat test Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pydent Created 4 years, 11 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
Index: third_party/WebKit/Source/wtf/text/TextCodecReplacementTest.cpp
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecReplacementTest.cpp b/third_party/WebKit/Source/wtf/text/TextCodecReplacementTest.cpp
index 835b69c45b2d759ec6087c3397c5574025bec3ca..375ba8f932fa99989a7c2784208a95642bd7b6f0 100644
--- a/third_party/WebKit/Source/wtf/text/TextCodecReplacementTest.cpp
+++ b/third_party/WebKit/Source/wtf/text/TextCodecReplacementTest.cpp
@@ -19,44 +19,43 @@ namespace {
// Just one example, others are listed in the codec implementation.
const char* replacementAlias = "iso-2022-kr";
-TEST(TextCodecReplacement, Aliases)
-{
- // "replacement" is not a valid alias for itself
- EXPECT_FALSE(TextEncoding("replacement").isValid());
- EXPECT_FALSE(TextEncoding("rEpLaCeMeNt").isValid());
-
- EXPECT_TRUE(TextEncoding(replacementAlias).isValid());
- EXPECT_STREQ("replacement", TextEncoding(replacementAlias).name());
+TEST(TextCodecReplacement, Aliases) {
+ // "replacement" is not a valid alias for itself
+ EXPECT_FALSE(TextEncoding("replacement").isValid());
+ EXPECT_FALSE(TextEncoding("rEpLaCeMeNt").isValid());
+
+ EXPECT_TRUE(TextEncoding(replacementAlias).isValid());
+ EXPECT_STREQ("replacement", TextEncoding(replacementAlias).name());
}
-TEST(TextCodecReplacement, DecodesToFFFD)
-{
- TextEncoding encoding(replacementAlias);
- OwnPtr<TextCodec> codec(newTextCodec(encoding));
+TEST(TextCodecReplacement, DecodesToFFFD) {
+ TextEncoding encoding(replacementAlias);
+ OwnPtr<TextCodec> codec(newTextCodec(encoding));
- bool sawError = false;
- const char testCase[] = "hello world";
- size_t testCaseSize = sizeof(testCase) - 1;
+ bool sawError = false;
+ const char testCase[] = "hello world";
+ size_t testCaseSize = sizeof(testCase) - 1;
- const String result = codec->decode(testCase, testCaseSize, DataEOF, false, sawError);
- EXPECT_TRUE(sawError);
- ASSERT_EQ(1u, result.length());
- EXPECT_EQ(0xFFFDU, result[0]);
+ const String result =
+ codec->decode(testCase, testCaseSize, DataEOF, false, sawError);
+ EXPECT_TRUE(sawError);
+ ASSERT_EQ(1u, result.length());
+ EXPECT_EQ(0xFFFDU, result[0]);
}
-TEST(TextCodecReplacement, EncodesToUTF8)
-{
- TextEncoding encoding(replacementAlias);
- OwnPtr<TextCodec> codec(newTextCodec(encoding));
+TEST(TextCodecReplacement, EncodesToUTF8) {
+ TextEncoding encoding(replacementAlias);
+ OwnPtr<TextCodec> codec(newTextCodec(encoding));
- // "Kanji" in Chinese characters.
- const UChar testCase[] = { 0x6F22, 0x5B57 };
- size_t testCaseSize = WTF_ARRAY_LENGTH(testCase);
- CString result = codec->encode(testCase, testCaseSize, QuestionMarksForUnencodables);
+ // "Kanji" in Chinese characters.
+ const UChar testCase[] = {0x6F22, 0x5B57};
+ size_t testCaseSize = WTF_ARRAY_LENGTH(testCase);
+ CString result =
+ codec->encode(testCase, testCaseSize, QuestionMarksForUnencodables);
- EXPECT_STREQ("\xE6\xBC\xA2\xE5\xAD\x97", result.data());
+ EXPECT_STREQ("\xE6\xBC\xA2\xE5\xAD\x97", result.data());
}
-} // namespace
+} // namespace
-} // namespace WTF
+} // namespace WTF
« no previous file with comments | « third_party/WebKit/Source/wtf/text/TextCodecReplacement.cpp ('k') | third_party/WebKit/Source/wtf/text/TextCodecUTF16.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698