aboutsummaryrefslogtreecommitdiffstats
path: root/src/junit/com/jogamp/common/nio/TestStructAccessorEndian.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:06:47 +0200
committerSven Gothel <[email protected]>2014-07-03 16:06:47 +0200
commitdf9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch)
tree239ae276b82024b140428e6c0fe5d739fdd686a4 /src/junit/com/jogamp/common/nio/TestStructAccessorEndian.java
parenteb47aaba63e3b1bf55f274a0f338f1010a017ae4 (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/TestStructAccessorEndian.java')
-rw-r--r--src/junit/com/jogamp/common/nio/TestStructAccessorEndian.java28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/junit/com/jogamp/common/nio/TestStructAccessorEndian.java b/src/junit/com/jogamp/common/nio/TestStructAccessorEndian.java
index 62eccf0..967122e 100644
--- a/src/junit/com/jogamp/common/nio/TestStructAccessorEndian.java
+++ b/src/junit/com/jogamp/common/nio/TestStructAccessorEndian.java
@@ -5,6 +5,8 @@ import static java.lang.System.out;
import java.io.IOException;
import java.nio.ByteBuffer;
+import jogamp.common.os.PlatformPropsImpl;
+
import org.junit.Assert;
import org.junit.Test;
@@ -20,16 +22,16 @@ public class TestStructAccessorEndian extends JunitTracer {
@Test
public void testStructAccessorEndian1 () {
- 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 MachineDescription machine = Platform.getMachineDescription();
+ 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("CPU is: "+ (Platform.is32Bit()?"32":"64") + " bit");
out.println(machine.toString());
- long[] valuesSource = { 0x0123456789ABCDEFL, 0x8877665544332211L, 0xAFFEDEADBEEFAFFEL };
- ByteBuffer tst = Buffers.newDirectByteBuffer(Buffers.SIZEOF_LONG * valuesSource.length);
- StructAccessor acc = new StructAccessor(tst);
+ final long[] valuesSource = { 0x0123456789ABCDEFL, 0x8877665544332211L, 0xAFFEDEADBEEFAFFEL };
+ final ByteBuffer tst = Buffers.newDirectByteBuffer(Buffers.SIZEOF_LONG * valuesSource.length);
+ final StructAccessor acc = new StructAccessor(tst);
int i;
@@ -38,15 +40,15 @@ public class TestStructAccessorEndian extends JunitTracer {
}
for(i=0; i<valuesSource.length; i++) {
- long v = acc.getLongAt(i*8);
- long t = valuesSource[i];
+ final long v = acc.getLongAt(i*8);
+ final long t = valuesSource[i];
Assert.assertTrue("Value["+i+"] shall be 0x"+Long.toHexString(t)+", is: 0x"+Long.toHexString(v), t == v);
}
}
-
- public static void main(String args[]) throws IOException {
- String tstname = TestStructAccessorEndian.class.getName();
+
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestStructAccessorEndian.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
-
+
}