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 |