| 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) {
|
|
|