Added test case preprocessor_doublesharp, executed ./runastyle for errormessage.h

This commit is contained in:
Reijo Tomperi 2009-01-19 21:45:59 +00:00
parent 2b2152919f
commit df5adc5f4f
2 changed files with 376 additions and 358 deletions

View File

@ -78,6 +78,7 @@ private:
TEST_CASE(string1);
TEST_CASE(string2);
TEST_CASE(preprocessor_undef);
// TODO TEST_CASE(preprocessor_doublesharp);
TEST_CASE(preprocessor_include_in_str);
}
@ -523,6 +524,23 @@ private:
ASSERT_EQUALS("\n\n\nchar b=0;\n", Preprocessor::expandMacros(filedata));
}
void preprocessor_doublesharp()
{
const char filedata[] = "#define TEST(var,val) var = val\n"
"TEST(foo,20);\n";
// Compare results..
ASSERT_EQUALS("\nfoo=20;\n", Preprocessor::expandMacros(filedata));
const char filedata2[] = "#define TEST(var,val) var##_##val = val\n"
"TEST(foo,20);\n";
// Compare results..
ASSERT_EQUALS("\nfoo_20=20;\n", Preprocessor::expandMacros(filedata2));
}
void preprocessor_include_in_str()
{
const char filedata[] = "int main()\n"