From b26955b9f8220f51e5020e17fdb2a8c3523484a2 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Sun, 15 Mar 2009 16:05:23 +0200 Subject: [PATCH] Test case stringify2() added. --- test/testpreprocessor.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 362dc9c42..69374caf1 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -107,6 +107,7 @@ private: TEST_CASE(multi_character_character); TEST_CASE(stringify); + // TODO TEST_CASE(stringify2); TEST_CASE(ifdefwithfile); TEST_CASE(pragma); } @@ -751,6 +752,17 @@ private: ASSERT_EQUALS("\n\"abc\"", actual); } + void stringify2() + { + const char filedata[] = "#define A(x) g(#x)\n" + "A(abc);"; + + // expand macros.. + std::string actual = OurPreprocessor::expandMacros(filedata); + + ASSERT_EQUALS("\ng(\"abc\");", actual); + } + void pragma() { const char filedata[] = "#pragma once\n"