| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/tests/test_net_address_private.h" | 5 #include "ppapi/tests/test_net_address_private.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "ppapi/cpp/private/net_address_private.h" | 9 #include "ppapi/cpp/private/net_address_private.h" |
| 10 #include "ppapi/c/private/ppb_net_address_private.h" | 10 #include "ppapi/c/private/ppb_net_address_private.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 ASSERT_EQ(test_cases[i].expected_with_port, | 224 ASSERT_EQ(test_cases[i].expected_with_port, |
| 225 NetAddressPrivate::Describe(addr, true)); | 225 NetAddressPrivate::Describe(addr, true)); |
| 226 } | 226 } |
| 227 | 227 |
| 228 PASS(); | 228 PASS(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 std::string TestNetAddressPrivate::TestGetFamily() { | 231 std::string TestNetAddressPrivate::TestGetFamily() { |
| 232 uint8_t localhost_ip[4] = { 127, 0, 0, 1 }; | 232 uint8_t localhost_ip[4] = { 127, 0, 0, 1 }; |
| 233 PP_NetAddress_Private ipv4 = MakeIPv4NetAddress(localhost_ip, 80); | 233 PP_NetAddress_Private ipv4 = MakeIPv4NetAddress(localhost_ip, 80); |
| 234 ASSERT_EQ(NetAddressPrivate::GetFamily(ipv4), PP_NETADDRESSFAMILY_IPV4); | 234 ASSERT_EQ(NetAddressPrivate::GetFamily(ipv4), |
| 235 PP_NETADDRESSFAMILY_PRIVATE_IPV4); |
| 235 | 236 |
| 236 uint16_t ipv6_address[8] = { 0x1234, 0xabcd, 0, 0, 0xff, 0, 0, 0xcdef }; | 237 uint16_t ipv6_address[8] = { 0x1234, 0xabcd, 0, 0, 0xff, 0, 0, 0xcdef }; |
| 237 PP_NetAddress_Private ipv6 = MakeIPv6NetAddress(ipv6_address, 123, 0); | 238 PP_NetAddress_Private ipv6 = MakeIPv6NetAddress(ipv6_address, 123, 0); |
| 238 ASSERT_EQ(NetAddressPrivate::GetFamily(ipv6), PP_NETADDRESSFAMILY_IPV6); | 239 ASSERT_EQ(NetAddressPrivate::GetFamily(ipv6), |
| 240 PP_NETADDRESSFAMILY_PRIVATE_IPV6); |
| 239 | 241 |
| 240 PASS(); | 242 PASS(); |
| 241 } | 243 } |
| 242 | 244 |
| 243 std::string TestNetAddressPrivate::TestGetPort() { | 245 std::string TestNetAddressPrivate::TestGetPort() { |
| 244 uint8_t localhost_ip[4] = { 127, 0, 0, 1 }; | 246 uint8_t localhost_ip[4] = { 127, 0, 0, 1 }; |
| 245 PP_NetAddress_Private localhost_80 = MakeIPv4NetAddress(localhost_ip, 80); | 247 PP_NetAddress_Private localhost_80 = MakeIPv4NetAddress(localhost_ip, 80); |
| 246 ASSERT_EQ(NetAddressPrivate::GetPort(localhost_80), 80); | 248 ASSERT_EQ(NetAddressPrivate::GetPort(localhost_80), 80); |
| 247 | 249 |
| 248 uint16_t ipv6_address[8] = { 0x1234, 0xabcd, 0, 0, 0xff, 0, 0, 0xcdef }; | 250 uint16_t ipv6_address[8] = { 0x1234, 0xabcd, 0, 0, 0xff, 0, 0, 0xcdef }; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 312 |
| 311 PP_NetAddress_Private ipv6_123 = MakeIPv6NetAddress(ipv6_address, 0, 123); | 313 PP_NetAddress_Private ipv6_123 = MakeIPv6NetAddress(ipv6_address, 0, 123); |
| 312 ASSERT_EQ(NetAddressPrivate::GetScopeID(ipv6_123), 123); | 314 ASSERT_EQ(NetAddressPrivate::GetScopeID(ipv6_123), 123); |
| 313 | 315 |
| 314 PP_NetAddress_Private ipv6_max = | 316 PP_NetAddress_Private ipv6_max = |
| 315 MakeIPv6NetAddress(ipv6_address, 0, 0xFFFFFFFF); | 317 MakeIPv6NetAddress(ipv6_address, 0, 0xFFFFFFFF); |
| 316 ASSERT_EQ(NetAddressPrivate::GetScopeID(ipv6_max), 0xFFFFFFFF); | 318 ASSERT_EQ(NetAddressPrivate::GetScopeID(ipv6_max), 0xFFFFFFFF); |
| 317 | 319 |
| 318 PASS(); | 320 PASS(); |
| 319 } | 321 } |
| OLD | NEW |