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

Side by Side Diff: components/rappor/bloom_filter_unittest.cc

Issue 1551433002: Switch to standard integer types in components/, part 3 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 4 years, 12 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
« no previous file with comments | « components/rappor/bloom_filter.cc ('k') | components/rappor/byte_vector_utils.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/rappor/bloom_filter.h" 5 #include "components/rappor/bloom_filter.h"
6 6
7 #include <stdint.h>
8
7 #include "components/rappor/byte_vector_utils.h" 9 #include "components/rappor/byte_vector_utils.h"
8 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
9 11
10 namespace rappor { 12 namespace rappor {
11 13
12 TEST(BloomFilterTest, TinyFilter) { 14 TEST(BloomFilterTest, TinyFilter) {
13 BloomFilter filter(1u, 4u, 0u); 15 BloomFilter filter(1u, 4u, 0u);
14 16
15 // Size is 1 and it's initially empty 17 // Size is 1 and it's initially empty
16 EXPECT_EQ(1u, filter.bytes().size()); 18 EXPECT_EQ(1u, filter.bytes().size());
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 EXPECT_EQ(0xa8u, bytes_from_get); 58 EXPECT_EQ(0xa8u, bytes_from_get);
57 } 59 }
58 60
59 TEST(BloomFilterTest, GetBloomBitsLarge) { 61 TEST(BloomFilterTest, GetBloomBitsLarge) {
60 // Make sure that a 64-bit bloom filter can set the full range of bits. 62 // Make sure that a 64-bit bloom filter can set the full range of bits.
61 uint64_t bytes_from_get = internal::GetBloomBits(8u, 1024u, 0u, "Bar"); 63 uint64_t bytes_from_get = internal::GetBloomBits(8u, 1024u, 0u, "Bar");
62 EXPECT_EQ(0xffffffffffffffffu, bytes_from_get); 64 EXPECT_EQ(0xffffffffffffffffu, bytes_from_get);
63 } 65 }
64 66
65 } // namespace rappor 67 } // namespace rappor
OLDNEW
« no previous file with comments | « components/rappor/bloom_filter.cc ('k') | components/rappor/byte_vector_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698