From bac0e371e373bc51b1b3c575d0a46e324c36bc4f Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 18 Jun 2010 23:04:44 -0700 Subject: [PATCH] glcpp/tests: Add a test for #if defined (identifier) Previously we only tested #if defined identifier (without parenthesis). --- glcpp/tests/065-if-defined-parens.c | 17 +++++++++++++++++ glcpp/tests/065-if-defined-parens.c.expected | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 glcpp/tests/065-if-defined-parens.c create mode 100644 glcpp/tests/065-if-defined-parens.c.expected diff --git a/glcpp/tests/065-if-defined-parens.c b/glcpp/tests/065-if-defined-parens.c new file mode 100644 index 00000000000..48aa0f8c3ef --- /dev/null +++ b/glcpp/tests/065-if-defined-parens.c @@ -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 index 00000000000..3f01955ee40 --- /dev/null +++ b/glcpp/tests/065-if-defined-parens.c.expected @@ -0,0 +1,18 @@ + + + +success_1 + + + +success_2 + + + + + + + +success_3 + + -- 2.30.2