diff options
author | Gil <mcg@google.com> | 2018-04-12 14:54:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 14:54:53 -0700 |
commit | 8876622b6fcebc21672bc263666b858b7e152b45 (patch) | |
tree | 053fe00a20207099c11c1464df25565a5f5cc3c6 /Firestore/core/test/firebase/firestore/util | |
parent | 1397e4ae72ea3b8d16a9b44ed1235caca47b3d9e (diff) |
Add clang-tidy checks for Firestore (#1078)
* Add a .clang-tidy configuration for Firestore C++
* Fix clang-tidy warnings
* typedef -> using
* const ref + rvalue ref -> pass by value
* NULL -> nullptr
* remove useless default initializations
* remove useless const value-type parameter declarations (definitions
can still use them)
* use auto instead of repeating types in a cast
* Fix typos
* Address use of static method through instance warnings
* Address use after move warnings
Diffstat (limited to 'Firestore/core/test/firebase/firestore/util')
-rw-r--r-- | Firestore/core/test/firebase/firestore/util/bits_test.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Firestore/core/test/firebase/firestore/util/bits_test.cc b/Firestore/core/test/firebase/firestore/util/bits_test.cc index cb0976b..572721f 100644 --- a/Firestore/core/test/firebase/firestore/util/bits_test.cc +++ b/Firestore/core/test/firebase/firestore/util/bits_test.cc @@ -69,16 +69,16 @@ TEST_F(BitsTest, Log2Random) { std::cout << "TestLog2Random" << std::endl; for (int i = 0; i < kNumIterations; i++) { - int maxbit = -1; + int max_bit = -1; uint32_t n = 0; while (!random_.OneIn(32u)) { int bit = static_cast<int>(random_.Uniform(32u)); n |= (1U << bit); - maxbit = std::max(bit, maxbit); + max_bit = std::max(bit, max_bit); } - EXPECT_EQ(maxbit, Bits::Log2Floor(n)); + EXPECT_EQ(max_bit, Bits::Log2Floor(n)); if (n != 0) { - EXPECT_EQ(maxbit, Bits::Log2FloorNonZero(n)); + EXPECT_EQ(max_bit, Bits::Log2FloorNonZero(n)); } } } @@ -87,16 +87,16 @@ TEST_F(BitsTest, Log2Random64) { std::cout << "TestLog2Random64" << std::endl; for (int i = 0; i < kNumIterations; i++) { - int maxbit = -1; + int max_bit = -1; uint64_t n = 0; while (!random_.OneIn(64u)) { int bit = static_cast<int>(random_.Uniform(64u)); n |= (1ULL << bit); - maxbit = std::max(bit, maxbit); + max_bit = std::max(bit, max_bit); } - EXPECT_EQ(maxbit, Bits::Log2Floor64(n)); + EXPECT_EQ(max_bit, Bits::Log2Floor64(n)); if (n != 0) { - EXPECT_EQ(maxbit, Bits::Log2FloorNonZero64(n)); + EXPECT_EQ(max_bit, Bits::Log2FloorNonZero64(n)); } } } |