summaryrefslogtreecommitdiffstats
path: root/test/junit/com/jogamp/gluegen/PCPPTest.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-11-07 07:24:32 +0100
committerSven Gothel <[email protected]>2010-11-07 07:24:32 +0100
commite7fe471e5899cfb22d40234242c7baea738d87fc (patch)
treeac70667492abfda92da21dbbdd81835fcf04f946 /test/junit/com/jogamp/gluegen/PCPPTest.java
parented83567444bd803918b8904eb71b155d4eff2de4 (diff)
PCPP: Fix ifdef/ifndef, if, elif and endif correct ; Enhanced PCPP tests
Diffstat (limited to 'test/junit/com/jogamp/gluegen/PCPPTest.java')
-rw-r--r--test/junit/com/jogamp/gluegen/PCPPTest.java29
1 files changed, 25 insertions, 4 deletions
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);
+ }
}