preprocessor: Added test if_cond1. It fails currently

This commit is contained in:
Daniel Marjamäki 2008-10-30 04:23:35 +00:00
parent 18efbaf433
commit 7657ac27ce
1 changed files with 26 additions and 0 deletions

View File

@ -49,6 +49,8 @@ private:
TEST_CASE( if1 );
TEST_CASE( include1 );
TEST_CASE( if_cond1 );
}
bool cmpmaps(const std::map<std::string, std::string> &m1, const std::map<std::string, std::string> &m2)
@ -278,6 +280,30 @@ private:
ASSERT_EQUALS( true, cmpmaps(actual, expected));
}
void if_cond1()
{
const char filedata[] = "#if LIBVER>100\n"
" A\n"
"#else\n"
" B\n"
"#endif\n";
// TODO: What should the result be?
std::map<std::string, std::string> expected;
expected[""] = filedata;
// Preprocess => actual result..
std::istringstream istr(filedata);
std::map<std::string, std::string> actual;
preprocess( istr, actual );
// Compare results..
ASSERT_EQUALS( true, cmpmaps(actual, expected));
}
};
REGISTER_TEST( TestPreprocessor )