You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/05/17 07:29:57 UTC

[GitHub] nkurihar commented on a change in pull request #1795: Fix C++ MurmurHash3 algorithm

nkurihar commented on a change in pull request #1795: Fix C++ MurmurHash3 algorithm
URL: https://github.com/apache/incubator-pulsar/pull/1795#discussion_r188861733
 
 

 ##########
 File path: pulsar-client-cpp/tests/HashTest.cc
 ##########
 @@ -58,10 +58,18 @@ TEST(HashTest, testJavaStringHash) {
 
 TEST(HashTest, testMurmur3_32Hash) {
     Murmur3_32Hash hash;
+    std::string k1 = "k1";
+    std::string k2 = "k2";
     std::string key1 = "key1";
     std::string key2 = "key2";
+    std::string key01 = "key01";
+    std::string key02 = "key02";
 
     // Same value as Java client
+    ASSERT_EQ(2110152746, hash.makeHash(k1));
+    ASSERT_EQ(1479966664, hash.makeHash(k2));
 
 Review comment:
   What is the purpose of adding these test cases(k1, k2, key01, key02)?
   If you want to compare more values with Java client, I think you should add the same test cases to [HashTest.java](https://github.com/apache/incubator-pulsar/blob/8d159efa5a4f25191fade5a9fddb45a245ef2e6b/pulsar-client/src/test/java/org/apache/pulsar/client/impl/HashTest.java#L41-L48) ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services