Skip to content

Commit

Permalink
Add a murmurHash2 test case with input length greater than seven
Browse files Browse the repository at this point in the history
chars so that the loop that processes data as 64-bit integers is
executed.

Signed-off-by: Jonathan Albrecht <jonathan.albrecht@ibm.com>
  • Loading branch information
jonathan-albrecht-ibm committed Jun 18, 2024
1 parent 127f54a commit d480d2d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/common/common/hash_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ TEST(Hash, murmurHash2) {
EXPECT_EQ(16306510975912980159U, MurmurHash::murmurHash2("foo\nbar"));
EXPECT_EQ(12847078931730529320U, MurmurHash::murmurHash2("lyft"));
EXPECT_EQ(6142509188972423790U, MurmurHash::murmurHash2(""));
// Murmurhash2 handles the last zero to seven chars of the input as a special case
// so make sure there is a test with longer input.
EXPECT_EQ(15194079855121201171U, MurmurHash::murmurHash2("longer than seven chars"));
}

#if __GLIBCXX__ >= 20130411 && __GLIBCXX__ <= 20180726
Expand Down

0 comments on commit d480d2d

Please sign in to comment.