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

Unified Diff: components/safe_browsing_db/v4_store_unittest.cc

Issue 2145163003: PVer4: Keep track of the smallest hashes not their sizes. Replace counters with iterators. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@01_read_map_from_disk
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/safe_browsing_db/v4_store_unittest.cc
diff --git a/components/safe_browsing_db/v4_store_unittest.cc b/components/safe_browsing_db/v4_store_unittest.cc
index 6f91a7f03a369ee8aff20d48aba9d5306d28ee87..bd5dba8c52fa57e27ce25a29a387e3117ac9692d 100644
--- a/components/safe_browsing_db/v4_store_unittest.cc
+++ b/components/safe_browsing_db/v4_store_unittest.cc
@@ -179,11 +179,11 @@ TEST_F(V4StoreTest, TestAddUnlumpedHashes) {
TEST_F(V4StoreTest, TestGetNextSmallestPrefixSizeWithEmptyPrefixMap) {
HashPrefixMap prefix_map;
- CounterMap counter_map;
- V4Store::InitializeCounterMap(prefix_map, &counter_map);
+ IteratorMap iterator_map;
+ V4Store::InitializeIteratorMap(prefix_map, &iterator_map);
PrefixSize prefix_size;
- EXPECT_FALSE(V4Store::GetNextSmallestPrefixSize(prefix_map, counter_map,
+ EXPECT_FALSE(V4Store::GetNextSmallestPrefixSize(prefix_map, iterator_map,
&prefix_size));
}
@@ -193,11 +193,11 @@ TEST_F(V4StoreTest, TestGetNextSmallestPrefixSize) {
V4Store::AddUnlumpedHashes(5, "-----0000054321abcde", &prefix_map));
EXPECT_EQ(APPLY_UPDATE_SUCCESS,
V4Store::AddUnlumpedHashes(4, "-----0000054321abcde", &prefix_map));
- CounterMap counter_map;
- V4Store::InitializeCounterMap(prefix_map, &counter_map);
+ IteratorMap iterator_map;
+ V4Store::InitializeIteratorMap(prefix_map, &iterator_map);
PrefixSize prefix_size;
- EXPECT_TRUE(V4Store::GetNextSmallestPrefixSize(prefix_map, counter_map,
+ EXPECT_TRUE(V4Store::GetNextSmallestPrefixSize(prefix_map, iterator_map,
&prefix_size));
EXPECT_EQ(4u, prefix_size);
}
@@ -208,14 +208,14 @@ TEST_F(V4StoreTest, TestGetNextUnmergedPrefix) {
V4Store::AddUnlumpedHashes(5, "-----0000054321abcde", &prefix_map));
EXPECT_EQ(APPLY_UPDATE_SUCCESS,
V4Store::AddUnlumpedHashes(4, "-----0000054321abcde", &prefix_map));
- CounterMap counter_map;
- V4Store::InitializeCounterMap(prefix_map, &counter_map);
+ IteratorMap iterator_map;
+ V4Store::InitializeIteratorMap(prefix_map, &iterator_map);
PrefixSize prefix_size;
- EXPECT_TRUE(V4Store::GetNextSmallestPrefixSize(prefix_map, counter_map,
+ EXPECT_TRUE(V4Store::GetNextSmallestPrefixSize(prefix_map, iterator_map,
&prefix_size));
const HashPrefix& prefix = V4Store::GetNextUnmergedPrefixForSize(
- prefix_size, prefix_map, counter_map);
+ prefix_size, prefix_map, iterator_map);
EXPECT_EQ("----", prefix);
}
« components/safe_browsing_db/v4_store.cc ('K') | « components/safe_browsing_db/v4_store.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698