preprocessor: updated the tests. They are now failing.

This commit is contained in:
Daniel Marjamäki 2008-10-28 19:08:05 +00:00
parent ed646d15be
commit c9fa509591
1 changed files with 23 additions and 3 deletions

View File

@ -43,6 +43,8 @@ private:
TEST_CASE( comments1 );
TEST_CASE( if0 );
TEST_CASE( include1 );
}
bool cmpmaps(const std::map<std::string, std::string> &m1, const std::map<std::string, std::string> &m2)
@ -103,7 +105,7 @@ private:
// Expected result..
std::map<std::string, std::string> expected;
expected[""] = "\n\"............\"\n\n\n\n";
expected[""] = "\n\" # ifdef WIN32\"\n\n\n\n";
expected["WIN32"] = "\n\n\nqwerty\n\n";
// Preprocess => actual result..
@ -160,6 +162,24 @@ private:
}
void include1()
{
const char filedata[] = " # include \"abcd.h\" // abcd\n";
// Expected result..
std::map<std::string, std::string> expected;
expected[""] = "#include \"abcd.h\"\n";
// 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 )