From 6d85470b2cb58670fd326b66ccbb396e24139014 Mon Sep 17 00:00:00 2001
From: Julien Gouesse <gouessej@orange.fr>
Date: Wed, 20 Mar 2013 02:50:28 +0100
Subject: Handles indexed PNGs

---
 .../util/texture/TestPNGTextureFromFileNEWT.java   |  68 +++++++++++++++++++++
 .../jogl/util/texture/test-ntscP301-160x90.png     | Bin 0 -> 1898 bytes
 .../jogl/util/texture/test-ntscP401-160x90.png     | Bin 0 -> 1911 bytes
 3 files changed, 68 insertions(+)
 create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/util/texture/test-ntscP301-160x90.png
 create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/util/texture/test-ntscP401-160x90.png

(limited to 'src/test')

diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java
index fe21f86a9..15a0eec50 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java
@@ -64,6 +64,10 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
     InputStream testTextureStreamN;
     InputStream testTextureStreamI;
     InputStream testTextureStreamIG;
+    InputStream testTextureStreamPRGB;
+    InputStream testTextureStreamPRGBA;/*
+    InputStream testTextureStreamNRGBA;
+    InputStream testTextureStreamIRGBA;*/
 
     @Before
     public void initTest() throws IOException {
@@ -87,6 +91,30 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
             testTextureStreamIG = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStreamIG);
         }
+        {
+            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP301-160x90.png");
+            Assert.assertNotNull(testTextureUrlConn);
+            testTextureStreamPRGB = testTextureUrlConn.getInputStream();
+            Assert.assertNotNull(testTextureStreamPRGB);
+        }
+        {
+            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP401-160x90.png");
+            Assert.assertNotNull(testTextureUrlConn);
+            testTextureStreamPRGBA = testTextureUrlConn.getInputStream();
+            Assert.assertNotNull(testTextureStreamPRGBA);
+        }
+        /*{
+            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN401-160x90.png");
+            Assert.assertNotNull(testTextureUrlConn);
+            testTextureStreamNRGBA = testTextureUrlConn.getInputStream();
+            Assert.assertNotNull(testTextureStreamNRGBA);
+        }
+        {
+            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI401-160x90.png");
+            Assert.assertNotNull(testTextureUrlConn);
+            testTextureStreamIRGBA = testTextureUrlConn.getInputStream();
+            Assert.assertNotNull(testTextureStreamIRGBA);
+        }*/
     }
 
     @After
@@ -95,6 +123,10 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
         testTextureStreamN = null;
         testTextureStreamI = null;
         testTextureStreamIG = null;
+        testTextureStreamPRGB = null;
+        testTextureStreamPRGBA = null;/*
+        testTextureStreamNRGBA = null;
+        testTextureStreamIRGBA = null;*/
     }
 
     public void testImpl(boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
@@ -190,6 +222,42 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
         testImpl(false, testTextureStreamIG);        
     }
     
+    @Test
+    public void testTestPRGB_PNGJLoaderGL2() throws InterruptedException, IOException {
+        testImpl(true, testTextureStreamPRGB);        
+    }    
+    @Test
+    public void testTestPRGB_PNGJLoaderES2() throws InterruptedException, IOException {
+        testImpl(false, testTextureStreamPRGB);        
+    }
+    
+    @Test
+    public void testTestPRGBA_PNGJLoaderGL2() throws InterruptedException, IOException {
+        testImpl(true, testTextureStreamPRGBA);        
+    }    
+    @Test
+    public void testTestPRGBA_PNGJLoaderES2() throws InterruptedException, IOException {
+        testImpl(false, testTextureStreamPRGBA);        
+    }
+    
+    /*@Test
+    public void testTestNRGBA_PNGJLoaderGL2() throws InterruptedException, IOException {
+        testImpl(true, testTextureStreamNRGBA);        
+    }    
+    @Test
+    public void testTestNRGBA_PNGJLoaderES2() throws InterruptedException, IOException {
+        testImpl(false, testTextureStreamNRGBA);        
+    }
+    
+    @Test
+    public void testTestIRGBA_PNGJLoaderGL2() throws InterruptedException, IOException {
+        testImpl(true, testTextureStreamIRGBA);        
+    }    
+    @Test
+    public void testTestIRGBA_PNGJLoaderES2() throws InterruptedException, IOException {
+        testImpl(false, testTextureStreamIRGBA);        
+    }*/
+    
     public static void main(String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/test-ntscP301-160x90.png b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/test-ntscP301-160x90.png
new file mode 100644
index 000000000..32e7f0042
Binary files /dev/null and b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/test-ntscP301-160x90.png differ
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/test-ntscP401-160x90.png b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/test-ntscP401-160x90.png
new file mode 100644
index 000000000..55405ee89
Binary files /dev/null and b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/test-ntscP401-160x90.png differ
-- 
cgit v1.2.3