diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
commit | df9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch) | |
tree | 239ae276b82024b140428e6c0fe5d739fdd686a4 /src/junit/com/jogamp/common/nio/TestPointerBufferEndian.java | |
parent | eb47aaba63e3b1bf55f274a0f338f1010a017ae4 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/junit/com/jogamp/common/nio/TestPointerBufferEndian.java')
-rw-r--r-- | src/junit/com/jogamp/common/nio/TestPointerBufferEndian.java | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/junit/com/jogamp/common/nio/TestPointerBufferEndian.java b/src/junit/com/jogamp/common/nio/TestPointerBufferEndian.java index 3a1c584..49a470f 100644 --- a/src/junit/com/jogamp/common/nio/TestPointerBufferEndian.java +++ b/src/junit/com/jogamp/common/nio/TestPointerBufferEndian.java @@ -3,6 +3,8 @@ package com.jogamp.common.nio; import java.io.IOException; +import jogamp.common.os.PlatformPropsImpl; + import com.jogamp.common.os.*; import com.jogamp.junit.util.JunitTracer; @@ -17,24 +19,24 @@ import org.junit.runners.MethodSorters; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TestPointerBufferEndian extends JunitTracer { - protected void testImpl (boolean direct) { + protected void testImpl (final boolean direct) { final MachineDescription machine = Platform.getMachineDescription(); - int bitsPtr = machine.pointerSizeInBytes() * 8; - String bitsProp = System.getProperty("sun.arch.data.model"); - out.println("OS: <"+Platform.OS+"> CPU: <"+Platform.ARCH+"> Bits: <"+bitsPtr+"/"+bitsProp+">"); + final int bitsPtr = machine.pointerSizeInBytes() * 8; + final String bitsProp = System.getProperty("sun.arch.data.model"); + out.println("OS: <"+PlatformPropsImpl.OS+"> CPU: <"+PlatformPropsImpl.ARCH+"> Bits: <"+bitsPtr+"/"+bitsProp+">"); out.println(machine.toString()); - long[] valuesSource = { 0x0123456789ABCDEFL, 0x8877665544332211L, 0xAFFEDEADBEEFAFFEL }; - long[] values32Bit = { 0x0000000089ABCDEFL, 0x0000000044332211L, 0x00000000BEEFAFFEL }; + final long[] valuesSource = { 0x0123456789ABCDEFL, 0x8877665544332211L, 0xAFFEDEADBEEFAFFEL }; + final long[] values32Bit = { 0x0000000089ABCDEFL, 0x0000000044332211L, 0x00000000BEEFAFFEL }; - PointerBuffer ptr = direct ? PointerBuffer.allocateDirect(3) : PointerBuffer.allocate(valuesSource.length); + final PointerBuffer ptr = direct ? PointerBuffer.allocateDirect(3) : PointerBuffer.allocate(valuesSource.length); ptr.put(valuesSource, 0, valuesSource.length); ptr.rewind(); int i=0; while(ptr.hasRemaining()) { - long v = ptr.get() ; - long t = Platform.is32Bit() ? values32Bit[i] : valuesSource[i]; + final long v = ptr.get() ; + final long t = Platform.is32Bit() ? values32Bit[i] : valuesSource[i]; Assert.assertTrue("Value["+i+"] shall be 0x"+Long.toHexString(t)+", is: 0x"+Long.toHexString(v), t == v); i++; } @@ -50,9 +52,9 @@ public class TestPointerBufferEndian extends JunitTracer { public void testIndirect () { testImpl (false); } - - public static void main(String args[]) throws IOException { - String tstname = TestPointerBufferEndian.class.getName(); + + public static void main(final String args[]) throws IOException { + final String tstname = TestPointerBufferEndian.class.getName(); org.junit.runner.JUnitCore.main(tstname); - } + } } |