From e7fe471e5899cfb22d40234242c7baea738d87fc Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sun, 7 Nov 2010 07:24:32 +0100
Subject: PCPP: Fix ifdef/ifndef, if, elif and endif correct ; Enhanced PCPP
 tests

---
 test/junit/com/jogamp/gluegen/PCPPTest.java | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)

(limited to 'test/junit/com/jogamp/gluegen/PCPPTest.java')

diff --git a/test/junit/com/jogamp/gluegen/PCPPTest.java b/test/junit/com/jogamp/gluegen/PCPPTest.java
index c1f12ab..fc59f9a 100644
--- a/test/junit/com/jogamp/gluegen/PCPPTest.java
+++ b/test/junit/com/jogamp/gluegen/PCPPTest.java
@@ -47,7 +47,7 @@ public class PCPPTest {
     @Test
     public void pcppMacroDefinitionTest() throws FileNotFoundException, IOException {
         
-        PCPP pp = new PCPP(Collections.<String>emptyList());
+        PCPP pp = new PCPP(Collections.<String>emptyList(), false);
         ByteArrayOutputStream output = new ByteArrayOutputStream();
         pp.setOut(output);
 
@@ -58,12 +58,30 @@ public class PCPPTest {
 
         String expected =   "# 1 \"pcpptest.h\""+
                             "# define CL_SCHAR_MIN (-127-1)"+
-                            " cl_char  __attribute__(( aligned(2))) s[ 2];"+
-                            "# 7 \"pcpptest.h\"";
+                            "# define __YES__ 1"+
+                            "# 16 \"pcpptest.h\""+
+                            "# 26 \"pcpptest.h\""+
+                            "# 36 \"pcpptest.h\""+
+                            " cl_char  GOOD_A;"+
+                            " int GOOD_B;"+
+                            " int GOOD_C;"+
+                            "# 40 \"pcpptest.h\"";
+
         output.flush();
         String result = output.toString();
         output.close();
 
+        System.err.println("Expected: ");
+        System.err.println("-------------------------------");
+        System.err.println(killWhitespace(expected));
+        System.err.println("-------------------------------");
+        System.err.println();
+        System.err.println("Result: ");
+        System.err.println("-------------------------------");
+        System.err.println(killWhitespace(result));
+        System.err.println("-------------------------------");
+        System.err.println();
+
         assertEquals(killWhitespace(expected), killWhitespace(result));
 
     }
@@ -72,5 +90,8 @@ public class PCPPTest {
         return a.replaceAll("\\p{javaWhitespace}+", "");
     }
 
-
+    public static void main(String args[]) throws IOException {
+        String tstname = PCPPTest.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
 }
-- 
cgit v1.2.3