Lines Matching refs:forString

153 TEST(IPAddressTest, forString) {  in TEST()  argument
156 EXPECT_FALSE(IPAddress::forString("not_an_ip", &ip)); in TEST()
157 EXPECT_FALSE(IPAddress::forString("not_an_ip", nullptr)); in TEST()
158 EXPECT_EQ(IPAddress(), IPAddress::forString("not_an_ip")); in TEST()
160 EXPECT_EQ(IPAddress(IPV4_ANY), IPAddress::forString("0.0.0.0")); in TEST()
161 EXPECT_EQ(IPAddress(IPV4_ONES), IPAddress::forString("255.255.255.255")); in TEST()
162 EXPECT_EQ(IPAddress(IPV4_LOOPBACK), IPAddress::forString("127.0.0.1")); in TEST()
164 EXPECT_EQ(IPAddress(IPV6_ANY), IPAddress::forString("::")); in TEST()
165 EXPECT_EQ(IPAddress(IPV6_ANY), IPAddress::forString("::0")); in TEST()
166 EXPECT_EQ(IPAddress(IPV6_ANY), IPAddress::forString("0::")); in TEST()
167 EXPECT_EQ(IPAddress(IPV6_LOOPBACK), IPAddress::forString("::1")); in TEST()
168 EXPECT_EQ(IPAddress(IPV6_LOOPBACK), IPAddress::forString("0::1")); in TEST()
169 EXPECT_EQ(IPAddress(FE80_1), IPAddress::forString("fe80::1")); in TEST()
170 EXPECT_EQ(IPAddress(FE80_1, 22), IPAddress::forString("fe80::1%22")); in TEST()
172 EXPECT_EQ(IPAddress(FE80_1, 1), IPAddress::forString("fe80::1%lo")); in TEST()
175 TEST(IPPrefixTest, forString) { in TEST() argument
178 EXPECT_FALSE(IPPrefix::forString("", &prefix)); in TEST()
179 EXPECT_FALSE(IPPrefix::forString("invalid", &prefix)); in TEST()
180 EXPECT_FALSE(IPPrefix::forString("192.0.2.0", &prefix)); in TEST()
181 EXPECT_FALSE(IPPrefix::forString("2001::db8::", &prefix)); in TEST()
183 EXPECT_FALSE(IPPrefix::forString("2001:db8::/", &prefix)); in TEST()
184 EXPECT_FALSE(IPPrefix::forString("2001:db8:://32", &prefix)); in TEST()
185 EXPECT_FALSE(IPPrefix::forString("2001:db8::/32z", &prefix)); in TEST()
186 EXPECT_FALSE(IPPrefix::forString("2001:db8::/32/", &prefix)); in TEST()
187 EXPECT_FALSE(IPPrefix::forString("2001:db8::/0x20", &prefix)); in TEST()
188 EXPECT_FALSE(IPPrefix::forString("2001:db8:: /32", &prefix)); in TEST()
189 EXPECT_FALSE(IPPrefix::forString("2001:db8::/ 32", &prefix)); in TEST()
190 EXPECT_FALSE(IPPrefix::forString(" 2001:db8::/32", &prefix)); in TEST()
191 EXPECT_FALSE(IPPrefix::forString("2001:db8::/32 ", &prefix)); in TEST()
192 EXPECT_FALSE(IPPrefix::forString("2001:db8::/+32", &prefix)); in TEST()
194 EXPECT_FALSE(IPPrefix::forString("192.0.2.0/33", &prefix)); in TEST()
195 EXPECT_FALSE(IPPrefix::forString("2001:db8::/129", &prefix)); in TEST()
196 EXPECT_FALSE(IPPrefix::forString("192.0.2.0/-1", &prefix)); in TEST()
197 EXPECT_FALSE(IPPrefix::forString("2001:db8::/-1", &prefix)); in TEST()
199 EXPECT_TRUE(IPPrefix::forString("2001:db8::/32", &prefix)); in TEST()
201 EXPECT_EQ(IPPrefix(IPAddress::forString("2001:db8::"), 32), prefix); in TEST()
203 EXPECT_EQ(IPPrefix(), IPPrefix::forString("invalid")); in TEST()
205 EXPECT_EQ("0.0.0.0/0", IPPrefix::forString("0.0.0.0/0").toString()); in TEST()
206 EXPECT_EQ("::/0", IPPrefix::forString("::/0").toString()); in TEST()
207 EXPECT_EQ("192.0.2.128/25", IPPrefix::forString("192.0.2.131/25").toString()); in TEST()
209 IPPrefix::forString("2001:db8:1:2:3:4:5:6/126").toString()); in TEST()
426 EXPECT_TRUE(IPAddress::forString(expectation.ip, &ip)) in TEST()
430 EXPECT_TRUE(IPAddress::forString(expectation.ipTruncated, &ipTruncated)) in TEST()
559 IPPrefix a = IPPrefix::forString(expectation.prefix); in TEST()
560 IPPrefix b = IPPrefix::forString(expectation.otherPrefix); in TEST()
622 IPPrefix a = IPPrefix::forString(expectation.prefix); in TEST()
623 IPAddress b = IPAddress::forString(expectation.address); in TEST()
650 {LT, IPPrefix(IPAddress(IPV4_ANY), 0), IPPrefix(IPAddress::forString("0.0.0.1"))}, in TEST()
651 {LT, IPPrefix(IPAddress(IPV4_ANY), 1), IPPrefix(IPAddress::forString("0.0.0.1"))}, in TEST()
652 {LT, IPPrefix(IPAddress(IPV4_ANY), 24), IPPrefix(IPAddress::forString("0.0.0.1"))}, in TEST()