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

Side by Side Diff: net/disk_cache/blockfile/bitmap_unittest.cc

Issue 121643003: Reorganize net/disk_cache into backend specific directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ios breakage Created 6 years, 9 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
« no previous file with comments | « net/disk_cache/blockfile/bitmap.cc ('k') | net/disk_cache/blockfile/block_bitmaps_v3.h » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/disk_cache/bitmap.h" 5 #include "net/disk_cache/blockfile/bitmap.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 TEST(BitmapTest, OverAllocate) { 8 TEST(BitmapTest, OverAllocate) {
9 // Test that we don't over allocate on boundaries. 9 // Test that we don't over allocate on boundaries.
10 disk_cache::Bitmap map32(32, false); 10 disk_cache::Bitmap map32(32, false);
11 EXPECT_EQ(1, map32.ArraySize()); 11 EXPECT_EQ(1, map32.ArraySize());
12 12
13 disk_cache::Bitmap map64(64, false); 13 disk_cache::Bitmap map64(64, false);
14 EXPECT_EQ(2, map64.ArraySize()); 14 EXPECT_EQ(2, map64.ArraySize());
15 } 15 }
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 bitmap.SetMapElement(11, 0xff); 284 bitmap.SetMapElement(11, 0xff);
285 285
286 index = 0; 286 index = 0;
287 EXPECT_EQ(16, bitmap.FindBits(&index, 500, true)); 287 EXPECT_EQ(16, bitmap.FindBits(&index, 500, true));
288 EXPECT_EQ(344, index); 288 EXPECT_EQ(344, index);
289 289
290 index = 0; 290 index = 0;
291 EXPECT_EQ(4, bitmap.FindBits(&index, 348, true)); 291 EXPECT_EQ(4, bitmap.FindBits(&index, 348, true));
292 EXPECT_EQ(344, index); 292 EXPECT_EQ(344, index);
293 } 293 }
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/bitmap.cc ('k') | net/disk_cache/blockfile/block_bitmaps_v3.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698