You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by GitBox <gi...@apache.org> on 2021/10/20 20:28:05 UTC

[GitHub] [orc] dongjoon-hyun commented on a change in pull request #943: ORC-1034: Fix the indexOf algorithm in FileDump.java

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



##########
File path: java/tools/src/test/org/apache/orc/tools/TestFileDump.java
##########
@@ -703,4 +703,12 @@ public void testHasNull() throws Exception {
     assumeTrue(!System.getProperty("os.name").startsWith("Windows"));
     TestFileDump.checkOutput(outputFilename, workDir + File.separator + outputFilename);
   }
+
+  @Test
+  public void testIndexOf() {
+    byte[] bytes = ("OO" + OrcFile.MAGIC).getBytes(StandardCharsets.UTF_8);
+    byte[] pattern = OrcFile.MAGIC.getBytes(StandardCharsets.UTF_8);
+
+    assertEquals(FileDump.indexOf(bytes, pattern, 1), 2);

Review comment:
       Oh, I missed this has a wrong argument order.
   Please check the argument order next time.
   In this context, `assertEquals` should have the expected value as the first argument.




-- 
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-unsubscribe@orc.apache.org

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