From 8f07e2711c5c474bb7646031ba64ba20e70fd203 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Wed, 18 Nov 2009 00:21:21 +0200 Subject: [PATCH] Added a few TODO test cases for #971 (Invalid number of characters (()) http://sourceforge.net/apps/trac/cppcheck/ticket/971 --- test/testpreprocessor.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 4e0de2eb8..193d620ad 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -1008,6 +1008,20 @@ private: "B(2);"; ASSERT_EQUALS("\n\n2,4;", OurPreprocessor::expandMacros(filedata)); } + + { + const char filedata[] = "#define A(x) (x)\n" + "#define B )A(\n" + "#define C )A(\n"; + TODO_ASSERT_EQUALS("\n\n\n", OurPreprocessor::expandMacros(filedata)); + } + + { + const char filedata[] = "#define A(x) (x*2)\n" + "#define B A(\n" + "foo B(i));\n"; + TODO_ASSERT_EQUALS("\n\nfoo ((i)*2);\n", OurPreprocessor::expandMacros(filedata)); + } } void macro_mismatch()