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

Unified Diff: net/base/dns_util_unittest.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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: net/base/dns_util_unittest.cc
diff --git a/net/base/dns_util_unittest.cc b/net/base/dns_util_unittest.cc
index d91753f4f736a5e64130711eff518462cdbde4c1..9303bc79b2cddb165111606944670e1773174e4c 100644
--- a/net/base/dns_util_unittest.cc
+++ b/net/base/dns_util_unittest.cc
@@ -7,8 +7,7 @@
namespace net {
-class DNSUtilTest : public testing::Test {
-};
+class DNSUtilTest : public testing::Test {};
// IncludeNUL converts a char* to a std::string and includes the terminating
// NUL in the result.
@@ -31,18 +30,41 @@ TEST_F(DNSUtilTest, DNSDomainFromDot) {
EXPECT_EQ(out, IncludeNUL("\003www\006google\003com"));
// Label is 63 chars: still valid
- EXPECT_TRUE(DNSDomainFromDot("123456789a123456789a123456789a123456789a123456789a123456789a123", &out));
- EXPECT_EQ(out, IncludeNUL("\077123456789a123456789a123456789a123456789a123456789a123456789a123"));
+ EXPECT_TRUE(DNSDomainFromDot(
+ "123456789a123456789a123456789a123456789a123456789a123456789a123", &out));
+ EXPECT_EQ(out,
+ IncludeNUL(
+ "\077123456789a123456789a123456789a123456789a123456789a12345678"
+ "9a123"));
// Label is too long: invalid
- EXPECT_FALSE(DNSDomainFromDot("123456789a123456789a123456789a123456789a123456789a123456789a1234", &out));
+ EXPECT_FALSE(DNSDomainFromDot(
+ "123456789a123456789a123456789a123456789a123456789a123456789a1234",
+ &out));
// 253 characters in the name: still valid
- EXPECT_TRUE(DNSDomainFromDot("123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123", &out));
- EXPECT_EQ(out, IncludeNUL("\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\011123456789\003123"));
+ EXPECT_TRUE(DNSDomainFromDot(
+ "123456789.123456789.123456789.123456789.123456789.123456789.123456789."
+ "123456789.123456789.123456789.123456789.123456789.123456789.123456789."
+ "123456789.123456789.123456789.123456789.123456789.123456789.123456789."
+ "123456789.123456789.123456789.123456789.123",
+ &out));
+ EXPECT_EQ(out,
+ IncludeNUL(
+ "\011123456789\011123456789\011123456789\011123456789\011123456"
+ "789\011123456789\011123456789\011123456789\011123456789\011123"
+ "456789\011123456789\011123456789\011123456789\011123456789\011"
+ "123456789\011123456789\011123456789\011123456789\011123456789"
+ "\011123456789\011123456789\011123456789\011123456789\011123456"
+ "789\011123456789\003123"));
// 254 characters in the name: invalid
- EXPECT_FALSE(DNSDomainFromDot("123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1234", &out));
+ EXPECT_FALSE(DNSDomainFromDot(
+ "123456789.123456789.123456789.123456789.123456789.123456789.123456789."
+ "123456789.123456789.123456789.123456789.123456789.123456789.123456789."
+ "123456789.123456789.123456789.123456789.123456789.123456789.123456789."
+ "123456789.123456789.123456789.123456789.1234",
+ &out));
// Zero length labels should be dropped.
EXPECT_TRUE(DNSDomainFromDot("www.google.com.", &out));
« no previous file with comments | « net/base/dns_util.cc ('k') | net/base/escape.cc » ('j') | net/base/mime_sniffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698