OLD | NEW |
1 // Copyright (c) 2006-2008 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 // Test program to convert lists of integers into ranges, and vice versa. | 5 // Test program to convert lists of integers into ranges, and vice versa. |
6 | 6 |
7 #include "chunk_range.h" | 7 #include "chunk_range.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 // Test various configurations of chunk numbers. | 10 // Test various configurations of chunk numbers. |
11 TEST(SafeBrowsingChunkRangeTest, TestChunksToRangeString) { | 11 TEST(SafeBrowsingChunkRangeTest, TestChunksToRangeString) { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 EXPECT_TRUE(IsChunkInRange(7, ranges)); | 155 EXPECT_TRUE(IsChunkInRange(7, ranges)); |
156 EXPECT_TRUE(IsChunkInRange(300, ranges)); | 156 EXPECT_TRUE(IsChunkInRange(300, ranges)); |
157 EXPECT_TRUE(IsChunkInRange(555, ranges)); | 157 EXPECT_TRUE(IsChunkInRange(555, ranges)); |
158 EXPECT_TRUE(IsChunkInRange(1, ranges)); | 158 EXPECT_TRUE(IsChunkInRange(1, ranges)); |
159 EXPECT_TRUE(IsChunkInRange(1000, ranges)); | 159 EXPECT_TRUE(IsChunkInRange(1000, ranges)); |
160 | 160 |
161 EXPECT_FALSE(IsChunkInRange(11, ranges)); | 161 EXPECT_FALSE(IsChunkInRange(11, ranges)); |
162 EXPECT_FALSE(IsChunkInRange(990, ranges)); | 162 EXPECT_FALSE(IsChunkInRange(990, ranges)); |
163 EXPECT_FALSE(IsChunkInRange(2000, ranges)); | 163 EXPECT_FALSE(IsChunkInRange(2000, ranges)); |
164 } | 164 } |
OLD | NEW |