summaryrefslogtreecommitdiffstats
path: root/test/junit
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-07-07 14:37:53 +0200
committerSven Gothel <[email protected]>2010-07-07 14:37:53 +0200
commit5b6ecb0854825a624f82e63f3180c2e85d905f0f (patch)
tree994d047fdf7732bcdc5228a990d933913652060f /test/junit
parent8a95808d3762ee4645dd5de1f0b0844c254e8638 (diff)
parente125cd5b1a20221b338cc4f03810b3b8b69004c9 (diff)
Merge branch 'master' of github.com:mbien/gluegen
Diffstat (limited to 'test/junit')
-rw-r--r--test/junit/com/jogamp/common/nio/BuffersTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/junit/com/jogamp/common/nio/BuffersTest.java b/test/junit/com/jogamp/common/nio/BuffersTest.java
new file mode 100644
index 0000000..c5e5758
--- /dev/null
+++ b/test/junit/com/jogamp/common/nio/BuffersTest.java
@@ -0,0 +1,29 @@
+/*
+ * Created on Sunday, July 04 2010 20:00
+ */
+package com.jogamp.common.nio;
+
+import java.nio.IntBuffer;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * @author Michael Bien
+ */
+public class BuffersTest {
+
+ @Test
+ public void slice() {
+ IntBuffer buffer = Buffers.newDirectIntBuffer(6);
+ buffer.put(new int[]{1,2,3,4,5,6}).rewind();
+
+ IntBuffer threefour = (IntBuffer)Buffers.slice(buffer, 2, 2);
+
+ assertEquals(3, threefour.get(0));
+ assertEquals(4, threefour.get(1));
+ assertEquals(2, threefour.capacity());
+
+ }
+
+}