add TODO for #elif inside #if 0 processing, also for #if 1

This commit is contained in:
Greg Hewgill 2011-03-01 20:17:54 +13:00
parent 2efb2efaca
commit baf50c6db1
1 changed files with 25 additions and 0 deletions

View File

@ -95,6 +95,7 @@ private:
TEST_CASE(if0_exclude);
TEST_CASE(if0_whitespace);
TEST_CASE(if0_else);
TEST_CASE(if0_elif);
// Don't handle include in a #if 0 block
TEST_CASE(if0_include_1);
@ -687,6 +688,30 @@ private:
"#endif\n"
"C\n");
ASSERT_EQUALS("#if 0\n\n#else\nB\n#endif\nC\n", preprocessor.read(code,"",NULL));
std::istringstream code2("#if 1\n"
"A\n"
"#else\n"
"B\n"
"#endif\n"
"C\n");
TODO_ASSERT_EQUALS("#if 1\nA\n#else\n\n#endif\nC\n",
"#if 1\nA\n#else\nB\n#endif\nC\n", preprocessor.read(code2,"",NULL));
}
void if0_elif()
{
Settings settings;
Preprocessor preprocessor(&settings, this);
std::istringstream code("#if 0\n"
"A\n"
"#elif 1\n"
"B\n"
"#endif\n"
"C\n");
TODO_ASSERT_EQUALS("#if 0\n\n#elif 1\nB\n#endif\nC\n",
"#if 0\n\n\n\n#endif\nC\n", preprocessor.read(code,"",NULL));
}
void if0_include_1()