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

Unified Diff: net/base/ip_address_unittest.cc

Issue 1708483002: Revert of Make IP Address related functions return the empty string when used on an invalid address. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « net/base/ip_address_number_unittest.cc ('k') | net/base/ip_endpoint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/ip_address_unittest.cc
diff --git a/net/base/ip_address_unittest.cc b/net/base/ip_address_unittest.cc
index b08d10a74fdb15868b62a9c179034b4ba2afd39e..ad3db3e28b245281d2aa7aff5b4231ed7394ae18 100644
--- a/net/base/ip_address_unittest.cc
+++ b/net/base/ip_address_unittest.cc
@@ -94,14 +94,6 @@
uint8_t addr3[16] = {0xFE, 0xDC, 0xBA, 0x98};
IPAddress ip_address3(addr3);
EXPECT_EQ("fedc:ba98::", ip_address3.ToString());
-
- // ToString() shouldn't crash on invalid addresses.
- uint8_t addr4[2];
- IPAddress ip_address4(addr4);
- EXPECT_EQ("", ip_address4.ToString());
-
- IPAddress ip_address5;
- EXPECT_EQ("", ip_address5.ToString());
}
// Test that invalid IP literals fail to parse.
@@ -186,10 +178,6 @@
IPAddress address3;
EXPECT_TRUE(address3.AssignFromIPLiteral("fedc:ba98::"));
EXPECT_EQ("[fedc:ba98::]:8080", IPAddressToStringWithPort(address3, 8080));
-
- // ToString() shouldn't crash on invalid addresses.
- IPAddress address4;
- EXPECT_EQ("", IPAddressToStringWithPort(address4, 8080));
}
TEST(IPAddressTest, IPAddressToPackedString) {
« no previous file with comments | « net/base/ip_address_number_unittest.cc ('k') | net/base/ip_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698