preprocessor: Added test if_cond1. It fails currently
This commit is contained in:
parent
18efbaf433
commit
7657ac27ce
|
@ -49,6 +49,8 @@ private:
|
||||||
TEST_CASE( if1 );
|
TEST_CASE( if1 );
|
||||||
|
|
||||||
TEST_CASE( include1 );
|
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)
|
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));
|
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 )
|
REGISTER_TEST( TestPreprocessor )
|
||||||
|
|
Loading…
Reference in New Issue