Preprocessor: Fix #if0 #elif todo test case. Ticket: #2619

This commit is contained in:
Simon Martin 2011-07-24 08:54:24 +02:00 committed by Daniel Marjamäki
parent aa65eed02b
commit fc0f75fe6a
2 changed files with 2 additions and 3 deletions

View File

@ -660,7 +660,7 @@ std::string Preprocessor::removeIf0(const std::string &code)
++level;
else if (line == "#endif")
--level;
else if (line == "#else")
else if ((line == "#else") || (line.compare(0, 5, "#elif") == 0))
{
if (level == 1)
in = true;

View File

@ -723,8 +723,7 @@ private:
"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));
ASSERT_EQUALS("#if 0\n\n#elif 1\nB\n#endif\nC\n", preprocessor.read(code,"",NULL));
}
void if0_include_1()