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; ++level;
else if (line == "#endif") else if (line == "#endif")
--level; --level;
else if (line == "#else") else if ((line == "#else") || (line.compare(0, 5, "#elif") == 0))
{ {
if (level == 1) if (level == 1)
in = true; in = true;

View File

@ -723,8 +723,7 @@ private:
"B\n" "B\n"
"#endif\n" "#endif\n"
"C\n"); "C\n");
TODO_ASSERT_EQUALS("#if 0\n\n#elif 1\nB\n#endif\nC\n", ASSERT_EQUALS("#if 0\n\n#elif 1\nB\n#endif\nC\n", preprocessor.read(code,"",NULL));
"#if 0\n\n\n\n#endif\nC\n", preprocessor.read(code,"",NULL));
} }
void if0_include_1() void if0_include_1()