# HG changeset patch # User Doug Simon # Date 1375886147 -7200 # Node ID 4172b595e374248dfa6367a99de1870830e339ff # Parent 2d4df4c43ae20e83b35aaa68085e3e1dba814137 more CRC32 intrinsification tests diff -r 2d4df4c43ae2 -r 4172b595e374 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CRC32SubstitutionsTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CRC32SubstitutionsTest.java Wed Aug 07 16:35:16 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CRC32SubstitutionsTest.java Wed Aug 07 16:35:47 2013 +0200 @@ -48,15 +48,18 @@ test("update", "some string".getBytes()); } - public static long updateBytes(byte[] input) { + public static long updateBytes(byte[] input, int offset, int length) { CRC32 crc = new CRC32(); - crc.update(input, 0, input.length); + crc.update(input, offset, length); return crc.getValue(); } @Test public void test2() { - test("updateBytes", "some string".getBytes()); + byte[] buf = "some string".getBytes(); + int off = 0; + int len = buf.length; + test("updateBytes", buf, off, len); } @Test @@ -65,7 +68,10 @@ InputStream s = CRC32SubstitutionsTest.class.getResourceAsStream(classfileName); byte[] buf = new byte[s.available()]; new DataInputStream(s).readFully(buf); - test("updateBytes", buf); + test("updateBytes", buf, 0, buf.length); + for (int offset = 1; offset < buf.length; offset++) { + test("updateBytes", buf, offset, buf.length - offset); + } } }