mongodb/mongo — pull request #452 by allanbank (2013-07-15 01:20:06+00:00)
Title: SERVER-10203: Add tests/test vectors for the long values created by hashed indexes.

For hashed indexes there is exactly 1 test case to ensure hashing of the index is consistent across platforms.

```cpp
struct HasherUnitTest : public StartupTest {
void run() {
// Hard-coded check to ensure the hash function is consistent across platforms
BSONObj o = BSON( "check" << 42 );
verify( BSONElementHasher::hash64( o.firstElement(), 0 ) == -944302157085130861LL );
}
} hasherUnitTest;
```

This seems a little "under specified" to me. I created a more complete test suite of "test vectors" to ensure future changes that modify the hashing indexes will be more likely to get caught.