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

Unified Diff: components/rappor/bloom_filter_unittest.cc

Issue 1090683003: Alternative Multi-dimensional Rappor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use 64-bit shift Created 5 years, 8 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
« no previous file with comments | « components/rappor/bloom_filter.cc ('k') | components/rappor/rappor_metric.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/rappor/bloom_filter_unittest.cc
diff --git a/components/rappor/bloom_filter_unittest.cc b/components/rappor/bloom_filter_unittest.cc
index 25f965f8402835ea354ea5f5f391a839baa9d456..a7ca069a6e4ecdb16caf316664161d1a1b00bcd8 100644
--- a/components/rappor/bloom_filter_unittest.cc
+++ b/components/rappor/bloom_filter_unittest.cc
@@ -51,4 +51,15 @@ TEST(BloomFilterTest, HugeFilter) {
EXPECT_EQ(1, CountBits(filter.bytes()));
}
+TEST(BloomFilterTest, GetBloomBitsSmall) {
+ uint64_t bytes_from_get = internal::GetBloomBits(1u, 4u, 0u, "Bar");
+ EXPECT_EQ(0xa8u, bytes_from_get);
+}
+
+TEST(BloomFilterTest, GetBloomBitsLarge) {
+ // Make sure that a 64-bit bloom filter can set the full range of bits.
+ uint64_t bytes_from_get = internal::GetBloomBits(8u, 1024u, 0u, "Bar");
+ EXPECT_EQ(0xffffffffffffffffu, bytes_from_get);
+}
+
} // namespace rappor
« no previous file with comments | « components/rappor/bloom_filter.cc ('k') | components/rappor/rappor_metric.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698