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

Unified Diff: test/unittests/base/functional-unittest.cc

Issue 635733002: Further improve hashing of pointers and integers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Also fix HashIsOkish test. Created 6 years, 2 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 | « src/base/functional.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « src/base/functional.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698