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

Unified Diff: webrtc/base/ipaddress_unittest.cc

Issue 2445933003: Fix "IsLoopbackIp" to cover all loopback addresses; not just 127.0.0.1. (Closed)
Patch Set: Created 4 years, 2 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 | « webrtc/base/ipaddress.cc ('k') | webrtc/p2p/base/turnport_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/ipaddress_unittest.cc
diff --git a/webrtc/base/ipaddress_unittest.cc b/webrtc/base/ipaddress_unittest.cc
index cbe8f2654806ba697d00fac29f92dafad693dd2f..802b47b28e2fa1188ca48e2f1b38b1d9640116d9 100644
--- a/webrtc/base/ipaddress_unittest.cc
+++ b/webrtc/base/ipaddress_unittest.cc
@@ -575,6 +575,9 @@ TEST(IPAddressTest, TestIsLoopback) {
EXPECT_FALSE(IPIsLoopback(IPAddress(kIPv4MappedPublicAddr)));
EXPECT_TRUE(IPIsLoopback(IPAddress(INADDR_LOOPBACK)));
+ // Try an address in the loopback range (127.0.0.0/8) other than the typical
+ // 127.0.0.1.
+ EXPECT_TRUE(IPIsLoopback(IPAddress(0x7f010203)));
EXPECT_TRUE(IPIsLoopback(IPAddress(in6addr_loopback)));
}
« no previous file with comments | « webrtc/base/ipaddress.cc ('k') | webrtc/p2p/base/turnport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698