folly/Hash.h add a test to ensure different hashes
authorHans Fugal <fugalh@fb.com>
Thu, 18 Jul 2013 00:40:41 +0000 (17:40 -0700)
committerSara Golemon <sgolemon@fb.com>
Thu, 18 Jul 2013 18:55:35 +0000 (11:55 -0700)
commit8035fc11627f1739125066bee3951627adfce61e
tree9a2878a2859d57d6132cc657305bc1ffecb27d1d
parentb71e31a5fe51724cd9b05fbb4bbf87510f01e45f
folly/Hash.h add a test to ensure different hashes

Summary:
"Wouldn't this test case still pass if the hash function didn't depend on the value?

It would be nice to verify that different tuple values produce different hash values (or maybe there's another test that verifies that), especially since this is a tricky thing to get right."

I think there's not much chance of this failing since it's just leveraging hash_combine and that's already tested. But it's easy to add another sanity check, so here we are.

Test Plan: runtests

Reviewed By: tulloch@fb.com

FB internal diff: D890448

Blame Revision: D888796
folly/test/HashTest.cpp