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

Side by Side Diff: net/dns/host_cache_unittest.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/dns/dns_response_unittest.cc ('k') | net/ftp/ftp_directory_listing_parser.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 (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 "net/dns/host_cache.h" 5 #include "net/dns/host_cache.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 }, 353 },
354 { 354 {
355 HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 355 HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED,
356 HOST_RESOLVER_CANONNAME), 356 HOST_RESOLVER_CANONNAME),
357 HostCache::Key("host2", ADDRESS_FAMILY_UNSPECIFIED, 357 HostCache::Key("host2", ADDRESS_FAMILY_UNSPECIFIED,
358 HOST_RESOLVER_CANONNAME), 358 HOST_RESOLVER_CANONNAME),
359 -1 359 -1
360 }, 360 },
361 }; 361 };
362 362
363 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { 363 for (size_t i = 0; i < arraysize(tests); ++i) {
364 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]", i)); 364 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]", i));
365 365
366 const HostCache::Key& key1 = tests[i].key1; 366 const HostCache::Key& key1 = tests[i].key1;
367 const HostCache::Key& key2 = tests[i].key2; 367 const HostCache::Key& key2 = tests[i].key2;
368 368
369 switch (tests[i].expected_comparison) { 369 switch (tests[i].expected_comparison) {
370 case -1: 370 case -1:
371 EXPECT_TRUE(key1 < key2); 371 EXPECT_TRUE(key1 < key2);
372 EXPECT_FALSE(key2 < key1); 372 EXPECT_FALSE(key2 < key1);
373 break; 373 break;
374 case 0: 374 case 0:
375 EXPECT_FALSE(key1 < key2); 375 EXPECT_FALSE(key1 < key2);
376 EXPECT_FALSE(key2 < key1); 376 EXPECT_FALSE(key2 < key1);
377 break; 377 break;
378 case 1: 378 case 1:
379 EXPECT_FALSE(key1 < key2); 379 EXPECT_FALSE(key1 < key2);
380 EXPECT_TRUE(key2 < key1); 380 EXPECT_TRUE(key2 < key1);
381 break; 381 break;
382 default: 382 default:
383 FAIL() << "Invalid expectation. Can be only -1, 0, 1"; 383 FAIL() << "Invalid expectation. Can be only -1, 0, 1";
384 } 384 }
385 } 385 }
386 } 386 }
387 387
388 } // namespace net 388 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_response_unittest.cc ('k') | net/ftp/ftp_directory_listing_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698