dongjoon-hyun commented on a change in pull request #934:
URL: https://github.com/apache/orc/pull/934#discussion_r740498834



##########
File path: c++/test/TestMurmur3.cc
##########
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Murmur3.hh"
+#include "wrap/gtest-wrapper.h"
+
+namespace orc {
+
+  // Same test as TestMurmur3#testHashCodeM3_64() in Java codes. Make sure the 
hash values
+  // are consistent between the Java client and C++ client.
+  // TODO(ORC-1025): Add exhaustive test on more strings.
+  TEST(TestMurmur3, testHash64) {
+    uint8_t origin[] = "It was the best of times, it was the worst of times,"
+                       " it was the age of wisdom, it was the age of 
foolishness,"
+                       " it was the epoch of belief, it was the epoch of 
incredulity,"
+                       " it was the season of Light, it was the season of 
Darkness,"
+                       " it was the spring of hope, it was the winter of 
despair,"
+                       " we had everything before us, we had nothing before 
us,"
+                       " we were all going direct to Heaven,"
+                       " we were all going direct the other way.";
+    uint32_t len = sizeof(origin) / sizeof(uint8_t) - 1;

Review comment:
       Unfortunately, this seems to break `CentOS 7` C++ compilation on old C++ 
versions.
   ```
   [ 75%] Building CXX object c++/test/CMakeFiles/orc-test.dir/TestMurmur3.cc.o
   /root/orc/c++/test/TestMurmur3.cc: In member function 'virtual void 
orc::TestMurmur3_testHash64_Test::TestBody()':
   /root/orc/c++/test/TestMurmur3.cc:36:53: error: conversion to 'uint32_t {aka 
unsigned int}' from 'long unsigned int' may alter its value [-Werror=conversion]
        uint32_t len = sizeof(origin) / sizeof(uint8_t) - 1;
                                                        ^
   cc1plus: all warnings being treated as errors
   make[2]: *** [c++/test/CMakeFiles/orc-test.dir/TestMurmur3.cc.o] Error 1
   make[1]: *** [c++/test/CMakeFiles/orc-test.dir/all] Error 2
   make: *** [all] Error 2
   FAILED centos7
   ```

##########
File path: c++/test/TestMurmur3.cc
##########
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Murmur3.hh"
+#include "wrap/gtest-wrapper.h"
+
+namespace orc {
+
+  // Same test as TestMurmur3#testHashCodeM3_64() in Java codes. Make sure the 
hash values
+  // are consistent between the Java client and C++ client.
+  // TODO(ORC-1025): Add exhaustive test on more strings.
+  TEST(TestMurmur3, testHash64) {
+    uint8_t origin[] = "It was the best of times, it was the worst of times,"
+                       " it was the age of wisdom, it was the age of 
foolishness,"
+                       " it was the epoch of belief, it was the epoch of 
incredulity,"
+                       " it was the season of Light, it was the season of 
Darkness,"
+                       " it was the spring of hope, it was the winter of 
despair,"
+                       " we had everything before us, we had nothing before 
us,"
+                       " we were all going direct to Heaven,"
+                       " we were all going direct the other way.";
+    uint32_t len = sizeof(origin) / sizeof(uint8_t) - 1;

Review comment:
       https://issues.apache.org/jira/browse/ORC-1043 is filed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@orc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to