summaryrefslogtreecommitdiffstats
path: root/src/junit
diff options
context:
space:
mode:
Diffstat (limited to 'src/junit')
-rwxr-xr-xsrc/junit/com/jogamp/test/junit/jogl/glu/TestGluUnprojectDouble.java29
-rwxr-xr-xsrc/junit/com/jogamp/test/junit/jogl/glu/TestGluUnprojectFloat.java30
2 files changed, 59 insertions, 0 deletions
diff --git a/src/junit/com/jogamp/test/junit/jogl/glu/TestGluUnprojectDouble.java b/src/junit/com/jogamp/test/junit/jogl/glu/TestGluUnprojectDouble.java
new file mode 100755
index 000000000..bc37e1395
--- /dev/null
+++ b/src/junit/com/jogamp/test/junit/jogl/glu/TestGluUnprojectDouble.java
@@ -0,0 +1,29 @@
+package com.jogamp.test.junit.jogl.glu;
+
+import javax.media.opengl.glu.GLU;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author Julien Gouesse
+ */
+public class TestGluUnprojectDouble {
+
+ @Test
+ public void test(){
+ final GLU glu = new GLU();
+ final int[] pickedPoint = new int[]{400,300};
+ final double pickedPointDepth = 0;
+ final double[] sceneModelViewValues = new double[]{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
+ final double[] projectionValues = new double[]{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
+ final int[] viewport = new int[]{0,0,800,600};
+ final double[] objCoords = new double[]{Double.NaN,Double.NaN,Double.NaN};
+ glu.gluUnProject(pickedPoint[0], pickedPoint[1], pickedPointDepth, sceneModelViewValues, 0, projectionValues, 0, viewport, 0, objCoords, 0);
+ Assert.assertTrue(!Double.isNaN(objCoords[0])&&!Double.isNaN(objCoords[1])&&!Double.isNaN(objCoords[2]));
+ }
+
+ public static void main(String args[]) {
+ org.junit.runner.JUnitCore.main(TestGluUnprojectDouble.class.getName());
+ }
+}
diff --git a/src/junit/com/jogamp/test/junit/jogl/glu/TestGluUnprojectFloat.java b/src/junit/com/jogamp/test/junit/jogl/glu/TestGluUnprojectFloat.java
new file mode 100755
index 000000000..01cda2201
--- /dev/null
+++ b/src/junit/com/jogamp/test/junit/jogl/glu/TestGluUnprojectFloat.java
@@ -0,0 +1,30 @@
+package com.jogamp.test.junit.jogl.glu;
+
+import javax.media.opengl.glu.GLU;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author Julien Gouesse
+ */
+public class TestGluUnprojectFloat {
+
+
+ @Test
+ public void test(){
+ final GLU glu = new GLU();
+ final int[] pickedPoint = new int[]{400,300};
+ final float pickedPointDepth = 0;
+ final float[] sceneModelViewValues = new float[]{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
+ final float[] projectionValues = new float[]{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
+ final int[] viewport = new int[]{0,0,800,600};
+ final float[] objCoords = new float[]{Float.NaN,Float.NaN,Float.NaN};
+ glu.gluUnProject(pickedPoint[0], pickedPoint[1], pickedPointDepth, sceneModelViewValues, 0, projectionValues, 0, viewport, 0, objCoords, 0);
+ Assert.assertTrue(!Double.isNaN(objCoords[0])&&!Double.isNaN(objCoords[1])&&!Double.isNaN(objCoords[2]));
+ }
+
+ public static void main(String args[]) {
+ org.junit.runner.JUnitCore.main(TestGluUnprojectFloat.class.getName());
+ }
+}