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

Side by Side Diff: net/base/net_util_unittest.cc

Issue 23726043: Added NetworkInterface::network_prefix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove LOG before commit Created 7 years, 3 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 | Annotate | Revision Log
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/base/net_util.h" 5 #include "net/base/net_util.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 3291 matching lines...) Expand 10 before | Expand all | Expand 10 after
3302 it->address.size() == kIPv6AddressSize) 3302 it->address.size() == kIPv6AddressSize)
3303 << "Invalid address of size " << it->address.size(); 3303 << "Invalid address of size " << it->address.size();
3304 bool all_zeroes = true; 3304 bool all_zeroes = true;
3305 for (size_t i = 0; i < it->address.size(); ++i) { 3305 for (size_t i = 0; i < it->address.size(); ++i) {
3306 if (it->address[i] != 0) { 3306 if (it->address[i] != 0) {
3307 all_zeroes = false; 3307 all_zeroes = false;
3308 break; 3308 break;
3309 } 3309 }
3310 } 3310 }
3311 EXPECT_FALSE(all_zeroes); 3311 EXPECT_FALSE(all_zeroes);
3312 // TODO remove before commit.
3313 LOG(WARNING) << IPAddressToString(it->address) << " " << it->network_prefix;
szym 2013/09/23 17:26:55 Don't forget to remove.
3314 EXPECT_GE(it->network_prefix, 1u);
3315 EXPECT_TRUE(it->address.size() != kIPv4AddressSize ||
3316 it->network_prefix <= 32u);
3312 } 3317 }
3313 } 3318 }
3314 3319
3315 static const base::FilePath::CharType* kSafePortableBasenames[] = { 3320 static const base::FilePath::CharType* kSafePortableBasenames[] = {
3316 FILE_PATH_LITERAL("a"), 3321 FILE_PATH_LITERAL("a"),
3317 FILE_PATH_LITERAL("a.txt"), 3322 FILE_PATH_LITERAL("a.txt"),
3318 FILE_PATH_LITERAL("a b.txt"), 3323 FILE_PATH_LITERAL("a b.txt"),
3319 FILE_PATH_LITERAL("a-b.txt"), 3324 FILE_PATH_LITERAL("a-b.txt"),
3320 FILE_PATH_LITERAL("My Computer"), 3325 FILE_PATH_LITERAL("My Computer"),
3321 FILE_PATH_LITERAL(" Computer"), 3326 FILE_PATH_LITERAL(" Computer"),
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
3468 TEST_P(NetUtilNonUniqueNameTest, IsHostnameNonUnique) { 3473 TEST_P(NetUtilNonUniqueNameTest, IsHostnameNonUnique) {
3469 const NonUniqueNameTestData& test_data = GetParam(); 3474 const NonUniqueNameTestData& test_data = GetParam();
3470 3475
3471 EXPECT_EQ(test_data.is_unique, IsUnique(test_data.hostname)); 3476 EXPECT_EQ(test_data.is_unique, IsUnique(test_data.hostname));
3472 } 3477 }
3473 3478
3474 INSTANTIATE_TEST_CASE_P(, NetUtilNonUniqueNameTest, 3479 INSTANTIATE_TEST_CASE_P(, NetUtilNonUniqueNameTest,
3475 testing::ValuesIn(kNonUniqueNameTestData)); 3480 testing::ValuesIn(kNonUniqueNameTestData));
3476 3481
3477 } // namespace net 3482 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698