Index: test/unittests/base/functional-unittest.cc |
diff --git a/test/unittests/base/functional-unittest.cc b/test/unittests/base/functional-unittest.cc |
index 4015485a88d1d0dfb38ca50a424f09c0b4af69a7..d15aa5df042c8f9c403cdda1217f69438d897c7b 100644 |
--- a/test/unittests/base/functional-unittest.cc |
+++ b/test/unittests/base/functional-unittest.cc |
@@ -82,10 +82,8 @@ TYPED_TEST(FunctionalTest, HashIsStateless) { |
TYPED_TEST(FunctionalTest, HashIsOkish) { |
- const size_t kValues = 128; |
- const size_t kMinHashes = kValues / 4; |
std::set<TypeParam> vs; |
- while (vs.size() != kValues) { |
+ for (size_t i = 0; i < 128; ++i) { |
TypeParam v; |
this->rng()->NextBytes(&v, sizeof(v)); |
vs.insert(v); |
@@ -95,7 +93,7 @@ TYPED_TEST(FunctionalTest, HashIsOkish) { |
hash<TypeParam> h; |
hs.insert(h(v)); |
} |
- EXPECT_LE(kMinHashes, hs.size()); |
+ EXPECT_LE(vs.size() / 4u, hs.size()); |
} |