Add couple of tests for xml-version cmd line option.

This commit is contained in:
Kimmo Varis 2011-02-02 13:33:57 +02:00
parent fe57d50328
commit 1118b132b9
1 changed files with 20 additions and 0 deletions

View File

@ -84,6 +84,8 @@ private:
TEST_CASE(xmlver2);
TEST_CASE(xmlver2both);
TEST_CASE(xmlver2both2);
TEST_CASE(xmlverunknown);
TEST_CASE(xmlverinvalid);
TEST_CASE(errorlist1);
TEST_CASE(errorlistverbose1)
TEST_CASE(errorlistverbose2)
@ -618,6 +620,24 @@ private:
ASSERT_EQUALS(2, settings._xml_version);
}
void xmlverunknown()
{
REDIRECT;
const char *argv[] = {"cppcheck", "--xml", "--xml-version=3", "file.cpp"};
Settings settings;
CmdLineParser parser(&settings);
ASSERT(!parser.ParseFromArgs(4, argv));
}
void xmlverinvalid()
{
REDIRECT;
const char *argv[] = {"cppcheck", "--xml", "--xml-version=a", "file.cpp"};
Settings settings;
CmdLineParser parser(&settings);
ASSERT(!parser.ParseFromArgs(4, argv));
}
void errorlist1()
{
REDIRECT;