# HG changeset patch # User Doug Simon # Date 1407266140 -7200 # Node ID 4e2178dc81fb2a4d1f0fd859cbff3a5b24721a46 # Parent a53c26c989d0570fdd9dab6c9ec35cea64dce9e2 consolidated graal.hotspot.jdk8.test into graal.hotspot.test diff -r a53c26c989d0 -r 4e2178dc81fb graal/com.oracle.graal.hotspot.jdk8.test/src/com/oracle/graal/hotspot/jdk8/test/CRC32UpdateByteBufferSubstitutionTest.java --- a/graal/com.oracle.graal.hotspot.jdk8.test/src/com/oracle/graal/hotspot/jdk8/test/CRC32UpdateByteBufferSubstitutionTest.java Tue Aug 05 20:57:38 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.hotspot.jdk8.test; - -import java.io.*; -import java.nio.*; -import java.util.zip.*; - -import org.junit.*; - -import com.oracle.graal.compiler.test.*; - -/** - * Tests compiled call to {@link CRC32#updateByteBuffer(int, long, int, int)}. - */ -@SuppressWarnings("javadoc") -public class CRC32UpdateByteBufferSubstitutionTest extends GraalCompilerTest { - - public static long updateByteBuffer(ByteBuffer buffer) { - CRC32 crc = new CRC32(); - buffer.rewind(); - crc.update(buffer); - return crc.getValue(); - } - - @Test - public void test1() throws Throwable { - String classfileName = CRC32UpdateByteBufferSubstitutionTest.class.getSimpleName().replace('.', '/') + ".class"; - InputStream s = CRC32UpdateByteBufferSubstitutionTest.class.getResourceAsStream(classfileName); - byte[] buf = new byte[s.available()]; - new DataInputStream(s).readFully(buf); - - ByteBuffer directBuf = ByteBuffer.allocateDirect(buf.length); - directBuf.put(buf); - ByteBuffer heapBuf = ByteBuffer.wrap(buf); - - test("updateByteBuffer", directBuf); - test("updateByteBuffer", heapBuf); - } -} diff -r a53c26c989d0 -r 4e2178dc81fb 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 Tue Aug 05 20:57:38 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CRC32SubstitutionsTest.java Tue Aug 05 21:15:40 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.hotspot.test; import java.io.*; +import java.nio.*; import java.util.zip.*; import org.junit.*; @@ -74,4 +75,26 @@ } } + public static long updateByteBuffer(ByteBuffer buffer) { + CRC32 crc = new CRC32(); + buffer.rewind(); + crc.update(buffer); + return crc.getValue(); + } + + @Test + public void test4() throws Throwable { + String classfileName = CRC32SubstitutionsTest.class.getSimpleName().replace('.', '/') + ".class"; + InputStream s = CRC32SubstitutionsTest.class.getResourceAsStream(classfileName); + byte[] buf = new byte[s.available()]; + new DataInputStream(s).readFully(buf); + + ByteBuffer directBuf = ByteBuffer.allocateDirect(buf.length); + directBuf.put(buf); + ByteBuffer heapBuf = ByteBuffer.wrap(buf); + + test("updateByteBuffer", directBuf); + test("updateByteBuffer", heapBuf); + } + } diff -r a53c26c989d0 -r 4e2178dc81fb mx/projects --- a/mx/projects Tue Aug 05 20:57:38 2014 +0200 +++ b/mx/projects Tue Aug 05 21:15:40 2014 +0200 @@ -318,14 +318,6 @@ project@com.oracle.graal.hotspot.test@javaCompliance=1.8 project@com.oracle.graal.hotspot.test@workingSets=Graal,HotSpot,Test -# graal.hotspot.jdk8.test -project@com.oracle.graal.hotspot.jdk8.test@subDir=graal -project@com.oracle.graal.hotspot.jdk8.test@sourceDirs=src -project@com.oracle.graal.hotspot.jdk8.test@dependencies=com.oracle.graal.compiler.test -project@com.oracle.graal.hotspot.jdk8.test@checkstyle=com.oracle.graal.graph -project@com.oracle.graal.hotspot.jdk8.test@javaCompliance=1.8 -project@com.oracle.graal.hotspot.jdk8.test@workingSets=Graal,HotSpot,Test - # graal.hotspot.amd64.test project@com.oracle.graal.hotspot.amd64.test@subDir=graal project@com.oracle.graal.hotspot.amd64.test@sourceDirs=src