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

Side by Side Diff: net/quic/quic_socket_address_coder_test.cc

Issue 662553002: Convert ARRAYSIZE_UNSAFE -> arraysize in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « net/quic/iovector_test.cc ('k') | net/quic/quic_utils_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "net/quic/quic_socket_address_coder.h" 5 #include "net/quic/quic_socket_address_coder.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 using std::string; 9 using std::string;
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 uint16 port; 93 uint16 port;
94 } test_case[] = { 94 } test_case[] = {
95 { "93.184.216.119", 0x1234 }, 95 { "93.184.216.119", 0x1234 },
96 { "199.204.44.194", 80 }, 96 { "199.204.44.194", 80 },
97 { "149.20.4.69", 443 }, 97 { "149.20.4.69", 443 },
98 { "127.0.0.1", 8080 }, 98 { "127.0.0.1", 8080 },
99 { "2001:700:300:1800::", 0x5678 }, 99 { "2001:700:300:1800::", 0x5678 },
100 { "::1", 65534 }, 100 { "::1", 65534 },
101 }; 101 };
102 102
103 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_case); i++) { 103 for (size_t i = 0; i < arraysize(test_case); i++) {
104 IPAddressNumber ip; 104 IPAddressNumber ip;
105 ASSERT_TRUE(ParseIPLiteralToNumber(test_case[i].ip_literal, &ip)); 105 ASSERT_TRUE(ParseIPLiteralToNumber(test_case[i].ip_literal, &ip));
106 QuicSocketAddressCoder encoder(IPEndPoint(ip, test_case[i].port)); 106 QuicSocketAddressCoder encoder(IPEndPoint(ip, test_case[i].port));
107 string serialized = encoder.Encode(); 107 string serialized = encoder.Encode();
108 108
109 QuicSocketAddressCoder decoder; 109 QuicSocketAddressCoder decoder;
110 ASSERT_TRUE(decoder.Decode(serialized.data(), serialized.length())); 110 ASSERT_TRUE(decoder.Decode(serialized.data(), serialized.length()));
111 EXPECT_EQ(encoder.ip(), decoder.ip()); 111 EXPECT_EQ(encoder.ip(), decoder.ip());
112 EXPECT_EQ(encoder.port(), decoder.port()); 112 EXPECT_EQ(encoder.port(), decoder.port());
113 } 113 }
114 } 114 }
115 115
116 } // namespace test 116 } // namespace test
117 } // namespace net 117 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/iovector_test.cc ('k') | net/quic/quic_utils_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698