add TODO for #elif inside #if 0 processing, also for #if 1
This commit is contained in:
parent
2efb2efaca
commit
baf50c6db1
|
@ -95,6 +95,7 @@ private:
|
||||||
TEST_CASE(if0_exclude);
|
TEST_CASE(if0_exclude);
|
||||||
TEST_CASE(if0_whitespace);
|
TEST_CASE(if0_whitespace);
|
||||||
TEST_CASE(if0_else);
|
TEST_CASE(if0_else);
|
||||||
|
TEST_CASE(if0_elif);
|
||||||
|
|
||||||
// Don't handle include in a #if 0 block
|
// Don't handle include in a #if 0 block
|
||||||
TEST_CASE(if0_include_1);
|
TEST_CASE(if0_include_1);
|
||||||
|
@ -687,6 +688,30 @@ private:
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"C\n");
|
"C\n");
|
||||||
ASSERT_EQUALS("#if 0\n\n#else\nB\n#endif\nC\n", preprocessor.read(code,"",NULL));
|
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()
|
void if0_include_1()
|
||||||
|
|
Loading…
Reference in New Issue