@@ -424,6 +424,8 @@ class TestCmdlineParser : public TestFixture {
424
424
TEST_CASE (maxTemplateRecursionMissingCount);
425
425
TEST_CASE (emitDuplicates);
426
426
TEST_CASE (debugClangOutput);
427
+ TEST_CASE (debugXmlMultiple);
428
+ TEST_CASE (debugNormalXmlMultiple);
427
429
428
430
TEST_CASE (ignorepaths1);
429
431
TEST_CASE (ignorepaths2);
@@ -2926,6 +2928,20 @@ class TestCmdlineParser : public TestFixture {
2926
2928
ASSERT_EQUALS (true , settings->debugClangOutput );
2927
2929
}
2928
2930
2931
+ void debugXmlMultiple () {
2932
+ REDIRECT;
2933
+ const char * const argv[] = {" cppcheck" , " --debug" , " --xml" , " 1.cpp" , " 2.cpp" };
2934
+ ASSERT_EQUALS_ENUM (CmdLineParser::Result::Fail, parser->parseFromArgs (5 , argv));
2935
+ ASSERT_EQUALS (" cppcheck: error: printing debug output in XML format does not support multiple input files.\n " , logger->str ());
2936
+ }
2937
+
2938
+ void debugNormalXmlMultiple () {
2939
+ REDIRECT;
2940
+ const char * const argv[] = {" cppcheck" , " --debug-normal" , " --xml" , " 1.cpp" , " 2.cpp" };
2941
+ ASSERT_EQUALS_ENUM (CmdLineParser::Result::Fail, parser->parseFromArgs (5 , argv));
2942
+ ASSERT_EQUALS (" cppcheck: error: printing debug output in XML format does not support multiple input files.\n " , logger->str ());
2943
+ }
2944
+
2929
2945
void ignorepaths1 () {
2930
2946
REDIRECT;
2931
2947
const char * const argv[] = {" cppcheck" , " -isrc" , " file.cpp" };
0 commit comments