Lines Matching full:addr

37   SocketAddress addr;  in TEST()  local
38 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
39 EXPECT_EQ(IPAddress(), addr.ipaddr()); in TEST()
40 EXPECT_EQ(0, addr.port()); in TEST()
41 EXPECT_EQ("", addr.hostname()); in TEST()
45 SocketAddress addr(IPAddress(0x01020304), 5678); in TEST() local
46 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
47 EXPECT_EQ(IPAddress(0x01020304U), addr.ipaddr()); in TEST()
48 EXPECT_EQ(5678, addr.port()); in TEST()
49 EXPECT_EQ("", addr.hostname()); in TEST()
50 EXPECT_EQ("1.2.3.4:5678", addr.ToString()); in TEST()
54 SocketAddress addr("1.2.3.4", 5678); in TEST() local
55 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
56 EXPECT_EQ(IPAddress(0x01020304U), addr.ipaddr()); in TEST()
57 EXPECT_EQ(5678, addr.port()); in TEST()
58 EXPECT_EQ("1.2.3.4", addr.hostname()); in TEST()
59 EXPECT_EQ("1.2.3.4:5678", addr.ToString()); in TEST()
75 SocketAddress addr("255.255.255.255", 5678); in TEST() local
76 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
77 EXPECT_EQ(IPAddress(0xFFFFFFFFU), addr.ipaddr()); in TEST()
78 EXPECT_EQ(5678, addr.port()); in TEST()
79 EXPECT_EQ("255.255.255.255", addr.hostname()); in TEST()
80 EXPECT_EQ("255.255.255.255:5678", addr.ToString()); in TEST()
84 SocketAddress addr("a.b.com", 5678); in TEST() local
85 EXPECT_TRUE(addr.IsUnresolvedIP()); in TEST()
86 EXPECT_EQ(IPAddress(), addr.ipaddr()); in TEST()
87 EXPECT_EQ(5678, addr.port()); in TEST()
88 EXPECT_EQ("a.b.com", addr.hostname()); in TEST()
89 EXPECT_EQ("a.b.com:5678", addr.ToString()); in TEST()
94 SocketAddress addr(from); in TEST() local
95 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
96 EXPECT_EQ(IPAddress(0x01020304U), addr.ipaddr()); in TEST()
97 EXPECT_EQ(5678, addr.port()); in TEST()
98 EXPECT_EQ("1.2.3.4", addr.hostname()); in TEST()
99 EXPECT_EQ("1.2.3.4:5678", addr.ToString()); in TEST()
104 SocketAddress addr(IPAddress(0x88888888), 9999); in TEST() local
105 addr = from; in TEST()
106 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
107 EXPECT_EQ(IPAddress(0x01020304U), addr.ipaddr()); in TEST()
108 EXPECT_EQ(5678, addr.port()); in TEST()
109 EXPECT_EQ("1.2.3.4", addr.hostname()); in TEST()
110 EXPECT_EQ("1.2.3.4:5678", addr.ToString()); in TEST()
114 SocketAddress addr(IPAddress(0x88888888), 9999); in TEST() local
115 addr.SetIP(IPAddress(0x01020304)); in TEST()
116 addr.SetPort(5678); in TEST()
117 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
118 EXPECT_EQ(IPAddress(0x01020304U), addr.ipaddr()); in TEST()
119 EXPECT_EQ(5678, addr.port()); in TEST()
120 EXPECT_EQ("", addr.hostname()); in TEST()
121 EXPECT_EQ("1.2.3.4:5678", addr.ToString()); in TEST()
125 SocketAddress addr(IPAddress(0x88888888), 9999); in TEST() local
126 addr.SetIP("1.2.3.4"); in TEST()
127 addr.SetPort(5678); in TEST()
128 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
129 EXPECT_EQ(IPAddress(0x01020304U), addr.ipaddr()); in TEST()
130 EXPECT_EQ(5678, addr.port()); in TEST()
131 EXPECT_EQ("1.2.3.4", addr.hostname()); in TEST()
132 EXPECT_EQ("1.2.3.4:5678", addr.ToString()); in TEST()
136 SocketAddress addr(IPAddress(0x88888888), 9999); in TEST() local
137 addr.SetIP("a.b.com"); in TEST()
138 addr.SetPort(5678); in TEST()
139 EXPECT_TRUE(addr.IsUnresolvedIP()); in TEST()
140 EXPECT_EQ(IPAddress(), addr.ipaddr()); in TEST()
141 EXPECT_EQ(5678, addr.port()); in TEST()
142 EXPECT_EQ("a.b.com", addr.hostname()); in TEST()
143 EXPECT_EQ("a.b.com:5678", addr.ToString()); in TEST()
144 addr.SetResolvedIP(IPAddress(0x01020304)); in TEST()
145 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
146 EXPECT_EQ(IPAddress(0x01020304U), addr.ipaddr()); in TEST()
147 EXPECT_EQ("a.b.com", addr.hostname()); in TEST()
148 EXPECT_EQ("a.b.com:5678", addr.ToString()); in TEST()
152 SocketAddress addr; in TEST() local
153 EXPECT_TRUE(addr.FromString("1.2.3.4:5678")); in TEST()
154 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
155 EXPECT_EQ(IPAddress(0x01020304U), addr.ipaddr()); in TEST()
156 EXPECT_EQ(5678, addr.port()); in TEST()
157 EXPECT_EQ("1.2.3.4", addr.hostname()); in TEST()
158 EXPECT_EQ("1.2.3.4:5678", addr.ToString()); in TEST()
162 SocketAddress addr; in TEST() local
163 EXPECT_TRUE(addr.FromString(kTestV6AddrFullString)); in TEST()
164 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
165 EXPECT_EQ(5678, addr.port()); in TEST()
166 EXPECT_EQ(kTestV6AddrString, addr.hostname()); in TEST()
167 EXPECT_EQ(kTestV6AddrFullString, addr.ToString()); in TEST()
171 SocketAddress addr; in TEST() local
172 EXPECT_TRUE(addr.FromString("a.b.com:5678")); in TEST()
173 EXPECT_TRUE(addr.IsUnresolvedIP()); in TEST()
174 EXPECT_EQ(IPAddress(), addr.ipaddr()); in TEST()
175 EXPECT_EQ(5678, addr.port()); in TEST()
176 EXPECT_EQ("a.b.com", addr.hostname()); in TEST()
177 EXPECT_EQ("a.b.com:5678", addr.ToString()); in TEST()
181 SocketAddress from("1.2.3.4", 5678), addr; in TEST() local
184 EXPECT_TRUE(addr.FromSockAddr(addr_in)); in TEST()
185 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
186 EXPECT_EQ(IPAddress(0x01020304U), addr.ipaddr()); in TEST()
187 EXPECT_EQ(5678, addr.port()); in TEST()
188 EXPECT_EQ("", addr.hostname()); in TEST()
189 EXPECT_EQ("1.2.3.4:5678", addr.ToString()); in TEST()
193 SocketAddress from("1.2.3.4", 5678), addr; in TEST() local
196 EXPECT_TRUE(SocketAddressFromSockAddrStorage(addr_storage, &addr)); in TEST()
197 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
198 EXPECT_EQ(IPAddress(0x01020304U), addr.ipaddr()); in TEST()
199 EXPECT_EQ(5678, addr.port()); in TEST()
200 EXPECT_EQ("", addr.hostname()); in TEST()
201 EXPECT_EQ("1.2.3.4:5678", addr.ToString()); in TEST()
203 addr.Clear(); in TEST()
205 EXPECT_TRUE(SocketAddressFromSockAddrStorage(addr_storage, &addr)); in TEST()
206 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
207 EXPECT_EQ(IPAddress(kMappedV4Addr), addr.ipaddr()); in TEST()
208 EXPECT_EQ(5678, addr.port()); in TEST()
209 EXPECT_EQ("", addr.hostname()); in TEST()
210 EXPECT_EQ("[::ffff:1.2.3.4]:5678", addr.ToString()); in TEST()
212 addr.Clear(); in TEST()
217 EXPECT_TRUE(SocketAddressFromSockAddrStorage(addr_storage, &addr)); in TEST()
218 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
219 EXPECT_EQ(IPAddress(kTestV6Addr), addr.ipaddr()); in TEST()
220 EXPECT_EQ(5678, addr.port()); in TEST()
221 EXPECT_EQ("", addr.hostname()); in TEST()
222 EXPECT_EQ(kTestV6AddrFullString, addr.ToString()); in TEST()
223 EXPECT_EQ(6, addr.scope_id()); in TEST()
225 addr.Clear(); in TEST()
227 EXPECT_TRUE(SocketAddressFromSockAddrStorage(addr_storage, &addr)); in TEST()
228 EXPECT_FALSE(addr.IsUnresolvedIP()); in TEST()
229 EXPECT_EQ(IPAddress(kTestV6Addr), addr.ipaddr()); in TEST()
230 EXPECT_EQ(5678, addr.port()); in TEST()
231 EXPECT_EQ("", addr.hostname()); in TEST()
232 EXPECT_EQ(kTestV6AddrFullString, addr.ToString()); in TEST()
233 EXPECT_EQ(6, addr.scope_id()); in TEST()
235 addr = from; in TEST()
237 EXPECT_FALSE(SocketAddressFromSockAddrStorage(addr_storage, &addr)); in TEST()
238 EXPECT_EQ(from, addr); in TEST()