From 8b3e5b94bcd3167278eb972b2be37086d3bd2996 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 31 Dec 2012 14:52:36 +0100 Subject: PrimitiveStack: Add 'void position(int)' to set new position. Add test case w/ initialSizeElem:=0. --- .../com/jogamp/common/util/TestFloatStack01.java | 78 ++++++++++++++++------ 1 file changed, 57 insertions(+), 21 deletions(-) (limited to 'src/junit/com/jogamp/common/util') diff --git a/src/junit/com/jogamp/common/util/TestFloatStack01.java b/src/junit/com/jogamp/common/util/TestFloatStack01.java index 0a2b077..90ac2e0 100644 --- a/src/junit/com/jogamp/common/util/TestFloatStack01.java +++ b/src/junit/com/jogamp/common/util/TestFloatStack01.java @@ -51,15 +51,28 @@ public class /*testname*/TestFloatStack01/*testname*/ extends JunitTracer { @Test - public void test01PrimitiveArray() { + public void test01PrimitiveArray_I32_G02() { + final int initialSizeElem = 32; + final int growSizeElem = 2; + testPrimitiveArrayImpl(initialSizeElem, growSizeElem); + } + + @Test + public void test02PrimitiveArray_I00_G32() { + final int initialSizeElem = 0; + final int growSizeElem = 32; + testPrimitiveArrayImpl(initialSizeElem, growSizeElem); + } + + static private final boolean VERBOSE = false; + + private void testPrimitiveArrayImpl(int initialSizeElem, int growSizeElem) { final int compNum = 3; /*value*/float/*value*/[] e0 = new /*value*/float/*value*/[] { 0, 1, 2 }; /*value*/float/*value*/[] e1 = new /*value*/float/*value*/[] { 3, 4, 5 }; - final int initialSizeElem = 32; - final int growSizeElem = 2; final int totalSizeElem = initialSizeElem+2*growSizeElem; final int initialSizeComp = initialSizeElem*compNum; @@ -72,27 +85,38 @@ public class /*testname*/TestFloatStack01/*testname*/ extends JunitTracer { // // PUT // - + if(VERBOSE) { + System.err.println("0: "+fs0); + } for(int i=0; i