glcpp/tests: Add a test for #if defined (identifier)
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 19 Jun 2010 06:04:44 +0000 (23:04 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 21 Jun 2010 19:41:05 +0000 (12:41 -0700)
Previously we only tested #if defined identifier (without parenthesis).

glcpp/tests/065-if-defined-parens.c [new file with mode: 0644]
glcpp/tests/065-if-defined-parens.c.expected [new file with mode: 0644]

diff --git a/glcpp/tests/065-if-defined-parens.c b/glcpp/tests/065-if-defined-parens.c
new file mode 100644 (file)
index 0000000..48aa0f8
--- /dev/null
@@ -0,0 +1,17 @@
+#if defined(foo)
+failure_1
+#else
+success_1
+#endif
+#define foo
+#if defined ( foo )
+success_2
+#else
+failure_2
+#endif
+#undef foo
+#if defined (foo)
+failure_3
+#else
+success_3
+#endif
diff --git a/glcpp/tests/065-if-defined-parens.c.expected b/glcpp/tests/065-if-defined-parens.c.expected
new file mode 100644 (file)
index 0000000..3f01955
--- /dev/null
@@ -0,0 +1,18 @@
+
+
+
+success_1
+
+
+
+success_2
+
+
+
+
+
+
+
+success_3
+
+