summaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-06-29 08:36:09 +0200
committerSven Gothel <[email protected]>2014-06-29 08:36:09 +0200
commitbd76d3fe74c518b509f86c38f8871bec7f5213a2 (patch)
tree8a0a597bc63938d9a22b590a76d03c3bbee59f1e /src/test/com/jogamp/opengl
parenta668ab82817c14c7b29052b1e6f892d19cb074ec (diff)
Bug 1027: Fix usage of atomic jar files (NEWT)
Issue was that 'com.jogamp.opengl.util.PNGPixelRect' was included in jogl-core.jar and that NEWT assumes PNG conversion is possible having this class available. However, PNGPixelRect requires 'jogamp.opengl.util.pngj' which is only included within jogl-util.jar. Moved PNGPixelRect from jogl-core.jar to jogl-util.jar. +++ Added manual test launch 'testnoawtatomics' in make/scripts/tests.sh to test atomic usage. Works now w/ com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT, showing that the window/application icon is _not_ set due to not having PNG* available.
Diffstat (limited to 'src/test/com/jogamp/opengl')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java3
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/UITestCase.java12
3 files changed, 15 insertions, 1 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
index db219b116..578a887d9 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
@@ -68,6 +68,7 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import jogamp.newt.DefaultEDTUtil;
+import jogamp.newt.driver.PNGIcon;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -217,7 +218,7 @@ public class TestGearsES2NEWT extends UITestCase {
}
pointerIcons[1] = _pointerIcon;
}
- {
+ if( PNGIcon.isAvailable() ) {
PointerIcon _pointerIcon = null;
final IOUtil.ClassResources res = new IOUtil.ClassResources(glWindow.getClass(), new String[] { "jogamp-pointer-64x64.png" } );
try {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java
index 800bef046..de824571e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java
@@ -203,6 +203,7 @@ public class TestRedSquareES2NEWT extends UITestCase {
loop_shutdown = true;
}
}
+ System.err.println("duration "+duration);
System.err.println("loops "+loops);
System.err.println("loop shutdown "+loop_shutdown);
System.err.println("forceES2 "+forceES2);
diff --git a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
index d37760ec3..e6958bc48 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
@@ -333,12 +333,24 @@ public abstract class UITestCase {
* If <code>null</code> the current working directory is being used.
*/
public void snapshot(int sn, String postSNDetail, GL gl, GLReadBufferUtil readBufferUtil, String fileSuffix, String destPath) {
+
final GLDrawable drawable = gl.getContext().getGLReadDrawable();
final String filename = getSnapshotFilename(sn, postSNDetail,
drawable.getChosenGLCapabilities(), drawable.getSurfaceWidth(), drawable.getSurfaceHeight(),
readBufferUtil.hasAlpha(), fileSuffix, destPath);
System.err.println(Thread.currentThread().getName()+": ** screenshot: "+filename);
gl.glFinish(); // just make sure rendering finished ..
+ try {
+ snapshot(gl, readBufferUtil, filename);
+ } catch (ClassNotFoundException cnfe) {
+ // Texture class belongs to jogl-util.jar which my not be included in test environment!
+ System.err.println("Caught ClassNotFoundException: "+cnfe.getMessage());
+ } catch (NoClassDefFoundError cnfe) {
+ // Texture class belongs to jogl-util.jar which my not be included in test environment!
+ System.err.println("Caught NoClassDefFoundError: "+cnfe.getMessage());
+ }
+ }
+ private void snapshot(GL gl, GLReadBufferUtil readBufferUtil, String filename) throws ClassNotFoundException, NoClassDefFoundError {
if(readBufferUtil.readPixels(gl, false)) {
readBufferUtil.write(new File(filename));
}