diff options
author | Sven Gothel <[email protected]> | 2011-07-17 16:41:29 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-07-17 16:41:29 +0200 |
commit | 546cd96a6bfc181cb2d9a7859f2dc9f69ec3a429 (patch) | |
tree | 6e446e3f6b36a40ff2c7f157e92563821cb28986 /src/junit | |
parent | 9a889948e7d649286ae0a473b49d14461c8981c5 (diff) |
Junit tests on ARM: Reducing some test/perf loops allowing to pass tests on low performance ARM
Diffstat (limited to 'src/junit')
5 files changed, 38 insertions, 8 deletions
diff --git a/src/junit/com/jogamp/common/util/IntIntHashMapTest.java b/src/junit/com/jogamp/common/util/IntIntHashMapTest.java index 04f2d67..09aff1c 100644 --- a/src/junit/com/jogamp/common/util/IntIntHashMapTest.java +++ b/src/junit/com/jogamp/common/util/IntIntHashMapTest.java @@ -37,6 +37,9 @@ import java.util.Iterator; import java.util.Map.Entry; import org.junit.BeforeClass; import org.junit.Test; + +import com.jogamp.common.os.Platform; + import static org.junit.Assert.*; import static java.lang.System.*; @@ -52,7 +55,7 @@ public class IntIntHashMapTest { @BeforeClass public static void init() { - iterations = 10000; + iterations = ( Platform.CPUType.ARM == Platform.CPU_TYPE ) ? 100 : 10000; pairs = new IntIntUniqueRndValues(iterations); } diff --git a/src/junit/com/jogamp/common/util/IntObjectHashMapTest.java b/src/junit/com/jogamp/common/util/IntObjectHashMapTest.java index 8c4d9c8..00de133 100644 --- a/src/junit/com/jogamp/common/util/IntObjectHashMapTest.java +++ b/src/junit/com/jogamp/common/util/IntObjectHashMapTest.java @@ -37,6 +37,9 @@ import java.util.Iterator; import java.util.Map.Entry; import org.junit.BeforeClass; import org.junit.Test; + +import com.jogamp.common.os.Platform; + import static org.junit.Assert.*; /** @@ -51,7 +54,7 @@ public class IntObjectHashMapTest { @BeforeClass public static void init() { - iterations = 10000; + iterations = ( Platform.getCPUType() == Platform.CPUType.ARM ) ? 100 : 10000; pairs = new IntIntObjUniqueRndValues(iterations); } diff --git a/src/junit/com/jogamp/common/util/LongIntHashMapTest.java b/src/junit/com/jogamp/common/util/LongIntHashMapTest.java index dccd8a3..239bef1 100644 --- a/src/junit/com/jogamp/common/util/LongIntHashMapTest.java +++ b/src/junit/com/jogamp/common/util/LongIntHashMapTest.java @@ -37,6 +37,9 @@ import java.util.HashMap; import java.util.Map.Entry; import org.junit.BeforeClass; import org.junit.Test; + +import com.jogamp.common.os.Platform; + import static org.junit.Assert.*; import static java.lang.System.*; @@ -52,7 +55,7 @@ public class LongIntHashMapTest { @BeforeClass public static void init() { - iterations = 10000; + iterations = ( Platform.getCPUType() == Platform.CPUType.ARM ) ? 100 : 10000; pairs = new LongIntUniqueRndValues(iterations); } diff --git a/src/junit/com/jogamp/common/util/TestIteratorIndexCORE.java b/src/junit/com/jogamp/common/util/TestIteratorIndexCORE.java index 0a3bd31..da797dc 100644 --- a/src/junit/com/jogamp/common/util/TestIteratorIndexCORE.java +++ b/src/junit/com/jogamp/common/util/TestIteratorIndexCORE.java @@ -37,10 +37,12 @@ import org.junit.BeforeClass; import org.junit.AfterClass; import org.junit.Test; +import com.jogamp.common.os.Platform; + public class TestIteratorIndexCORE { static int elems = 10; - static int loop = 9999999; + static int loop = ( Platform.getCPUType() == Platform.CPUType.ARM ) ? 100 : 9999999; public void populate(List l, int len) { while(len>0) { diff --git a/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java b/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java index c1cbb88..bee9b44 100644 --- a/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java +++ b/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java @@ -32,6 +32,8 @@ import java.io.IOException; import org.junit.Test; +import com.jogamp.common.os.Platform; + public class TestRecursiveLock01 { static final int YIELD_NONE = 0; @@ -210,28 +212,45 @@ public class TestRecursiveLock01 { // @Test public void testLockedObjectThreading2x10000() throws InterruptedException { System.err.println("++++ TestRecursiveLock01.testLockedObjectThreading2x10000"); - testLockedObjectImpl(2, 10000, 10000, YIELD_NONE); + if( Platform.getCPUType() == Platform.CPUType.ARM ) { + testLockedObjectImpl(2, 10, 10, YIELD_NONE); + } else { + testLockedObjectImpl(2, 10000, 10000, YIELD_NONE); + } System.err.println("---- TestRecursiveLock01.testLockedObjectThreading2x10000"); } @Test public void testLockedObjectThreading25x25Yield() throws InterruptedException { System.err.println("++++ TestRecursiveLock01.testLockedObjectThreading25x25-Yield"); - testLockedObjectImpl(25, 25, 100, YIELD_YIELD); + if( Platform.getCPUType() == Platform.CPUType.ARM ) { + testLockedObjectImpl(5, 25, 10, YIELD_YIELD); + } else { + testLockedObjectImpl(25, 25, 100, YIELD_YIELD); + } System.err.println("---- TestRecursiveLock01.testLockedObjectThreading25x25-Yield"); } // @Test public void testLockedObjectThreading25x25Sleep() throws InterruptedException { System.err.println("++++ TestRecursiveLock01.testLockedObjectThreading25x25-Sleep"); - testLockedObjectImpl(25, 25, 100, YIELD_SLEEP); + if( Platform.getCPUType() == Platform.CPUType.ARM ) { + testLockedObjectImpl(5, 25, 10, YIELD_SLEEP); + } else { + testLockedObjectImpl(25, 25, 100, YIELD_SLEEP); + } System.err.println("---- TestRecursiveLock01.testLockedObjectThreading25x25-Sleep"); } @Test public void testLockedObjectThreading25x25None() throws InterruptedException { System.err.println("++++ TestRecursiveLock01.testLockedObjectThreading25x25-None"); - testLockedObjectImpl(25, 25, 100, YIELD_NONE); + if( Platform.getCPUType() == Platform.CPUType.ARM ) { + testLockedObjectImpl(5, 25, 10, YIELD_NONE); + } else { + testLockedObjectImpl(25, 25, 100, YIELD_NONE); + } + System.err.println("---- TestRecursiveLock01.testLockedObjectThreading25x25-None"); } |