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

Unified Diff: net/base/host_port_pair_unittest.cc

Issue 732423002: Update from chromium https://crrev.com/304586 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « net/base/host_port_pair.cc ('k') | net/base/load_flags_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_port_pair_unittest.cc
diff --git a/net/base/host_port_pair_unittest.cc b/net/base/host_port_pair_unittest.cc
index 5b15db9477dc69ad75eda897edb24801a8b78700..2c97e9466563843a49594eeaba9055a4350d4e62 100644
--- a/net/base/host_port_pair_unittest.cc
+++ b/net/base/host_port_pair_unittest.cc
@@ -37,13 +37,19 @@ TEST(HostPortPairTest, Parsing) {
}
TEST(HostPortPairTest, BadString) {
- HostPortPair foo = HostPortPair::FromString("foo.com:2:3");
- EXPECT_TRUE(foo.host().empty());
- EXPECT_EQ(0, foo.port());
-
- HostPortPair bar = HostPortPair::FromString("bar.com:two");
- EXPECT_TRUE(bar.host().empty());
- EXPECT_EQ(0, bar.port());
+ const char* kBadStrings[] = {
+ "foo.com:2:3",
+ "bar.com:two",
+ "www.google.com:-1",
+ "127.0.0.1:65536",
+ "[2001:db8::42]:65536",
+ };
+
+ for (size_t index = 0; index < arraysize(kBadStrings); ++index) {
+ HostPortPair foo = HostPortPair::FromString(kBadStrings[index]);
+ EXPECT_TRUE(foo.host().empty());
+ EXPECT_EQ(0, foo.port());
+ }
}
TEST(HostPortPairTest, Emptiness) {
« no previous file with comments | « net/base/host_port_pair.cc ('k') | net/base/load_flags_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698