diff options
author | Sven Gothel <[email protected]> | 2010-03-31 22:36:49 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-03-31 22:36:49 +0200 |
commit | 73829c38665c57052bf703ae58a2bd1dc7dc4625 (patch) | |
tree | 88a68954170fcaefc5b1417702a1df9d9e8bd589 /src/java/com/sun | |
parent | 84e5ba7a4821469f43c0f4bbeaa8e383b203d050 (diff) |
Buffer heritage added. Migrated old runtime tests.
Diffstat (limited to 'src/java/com/sun')
-rw-r--r-- | src/java/com/sun/gluegen/test/TestPointerBufferEndian.java | 41 | ||||
-rw-r--r-- | src/java/com/sun/gluegen/test/TestStructAccessorEndian.java | 41 |
2 files changed, 0 insertions, 82 deletions
diff --git a/src/java/com/sun/gluegen/test/TestPointerBufferEndian.java b/src/java/com/sun/gluegen/test/TestPointerBufferEndian.java deleted file mode 100644 index 96e4e87..0000000 --- a/src/java/com/sun/gluegen/test/TestPointerBufferEndian.java +++ /dev/null @@ -1,41 +0,0 @@ - -package com.sun.gluegen.test; - -import com.jogamp.gluegen.runtime.*; -import java.nio.*; - -public class TestPointerBufferEndian { - public static void main (String[] args) { - boolean direct = args.length>0 && args[0].equals("-direct"); - boolean ok = true; - int bitsPtr = Platform.getPointerSizeInBits(); - String bitsProp = System.getProperty("sun.arch.data.model"); - String os = System.getProperty("os.name"); - String cpu = System.getProperty("os.arch"); - System.out.println("OS: <"+os+"> CPU: <"+cpu+"> Bits: <"+bitsPtr+"/"+bitsProp+">"); - System.out.println("CPU is: "+ (Platform.is32Bit()?"32":"64") + " bit"); - System.out.println("Buffer is in: "+ (Platform.isLittleEndian()?"little":"big") + " endian"); - PointerBuffer ptr = direct ? PointerBuffer.allocateDirect(3) : PointerBuffer.allocate(3); - ptr.put(0, 0x0123456789ABCDEFL); - ptr.put(1, 0x8877665544332211L); - ptr.put(2, 0xAFFEDEADBEEFAFFEL); - long v = ptr.get(0); - if( 0x0123456789ABCDEFL != v ) { - System.out.println("Err[0] shall 0x0123456789ABCDEF, is: "+Long.toHexString(v)); - ok=false; - } - v = ptr.get(1); - if( 0x8877665544332211L != v ) { - System.out.println("Err[1] shall 0x8877665544332211, is: "+Long.toHexString(v)); - ok=false; - } - v = ptr.get(2); - if( 0xAFFEDEADBEEFAFFEL != v ) { - System.out.println("Err[2] shall 0xAFFEDEADBEEFAFFE, is: "+Long.toHexString(v)); - ok=false; - } - if(!ok) { - throw new RuntimeException("Long conversion failure"); - } - } -} diff --git a/src/java/com/sun/gluegen/test/TestStructAccessorEndian.java b/src/java/com/sun/gluegen/test/TestStructAccessorEndian.java deleted file mode 100644 index 7202056..0000000 --- a/src/java/com/sun/gluegen/test/TestStructAccessorEndian.java +++ /dev/null @@ -1,41 +0,0 @@ - -package com.sun.gluegen.test; - -import com.jogamp.gluegen.runtime.*; -import java.nio.*; - -public class TestStructAccessorEndian { - public static void main (String args[]) { - boolean ok = true; - int bitsPtr = Platform.getPointerSizeInBits(); - String bitsProp = System.getProperty("sun.arch.data.model"); - String os = System.getProperty("os.name"); - String cpu = System.getProperty("os.arch"); - System.out.println("OS: <"+os+"> CPU: <"+cpu+"> Bits: <"+bitsPtr+"/"+bitsProp+">"); - System.out.println("CPU is: "+ (Platform.is32Bit()?"32":"64") + " bit"); - System.out.println("Buffer is in: "+ (Platform.isLittleEndian()?"little":"big") + " endian"); - ByteBuffer tst = Buffers.newDirectByteBuffer(Buffers.SIZEOF_LONG * 3); - StructAccessor acc = new StructAccessor(tst); - acc.setLongAt(0, 0x0123456789ABCDEFL); - acc.setLongAt(1, 0x8877665544332211L); - acc.setLongAt(2, 0xAFFEDEADBEEFAFFEL); - long v = acc.getLongAt(0); - if( 0x0123456789ABCDEFL != v ) { - System.out.println("Err[0] shall 0x0123456789ABCDEF, is: "+Long.toHexString(v)); - ok=false; - } - v = acc.getLongAt(1); - if( 0x8877665544332211L != v ) { - System.out.println("Err[1] shall 0x8877665544332211, is: "+Long.toHexString(v)); - ok=false; - } - v = acc.getLongAt(2); - if( 0xAFFEDEADBEEFAFFEL != v ) { - System.out.println("Err[2] shall 0xAFFEDEADBEEFAFFE, is: "+Long.toHexString(v)); - ok=false; - } - if(!ok) { - throw new RuntimeException("Long conversion failure"); - } - } -} |