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

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

Issue 1162973005: Stop including ip_address_number.h from net_util.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 5 years, 6 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
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/base/ip_pattern.h" 5 #include "net/base/ip_pattern.h"
6 6
7 #include "net/base/ip_address_number.h"
7 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
8 9
9 namespace net { 10 namespace net {
10 11
11 namespace { 12 namespace {
12 13
13 bool IsValidPattern(const std::string& pattern_text) { 14 bool IsValidPattern(const std::string& pattern_text) {
14 IPPattern pattern; 15 IPPattern pattern;
15 return pattern.ParsePattern(pattern_text); 16 return pattern.ParsePattern(pattern_text);
16 } 17 }
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 EXPECT_FALSE(IsValidPattern("1.2.3.4.5")); // Too long 152 EXPECT_FALSE(IsValidPattern("1.2.3.4.5")); // Too long
152 EXPECT_FALSE(IsValidPattern("1.2.3")); // Too short 153 EXPECT_FALSE(IsValidPattern("1.2.3")); // Too short
153 EXPECT_FALSE(IsValidPattern("1.2.3.A")); // Non-decimal. 154 EXPECT_FALSE(IsValidPattern("1.2.3.A")); // Non-decimal.
154 EXPECT_FALSE(IsValidPattern("1.A.3.4")); // Non-decimal 155 EXPECT_FALSE(IsValidPattern("1.A.3.4")); // Non-decimal
155 EXPECT_FALSE(IsValidPattern("1.256.3.4")); // Out of range 156 EXPECT_FALSE(IsValidPattern("1.256.3.4")); // Out of range
156 } 157 }
157 158
158 } // namespace 159 } // namespace
159 160
160 } // namespace net 161 } // namespace net
OLDNEW
« no previous file with comments | « net/base/ip_pattern.h ('k') | net/base/net_util.h » ('j') | net/base/net_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698