Skip to content

Commit a0015cc

Browse files
committed
add defaultReportType test
1 parent d18736c commit a0015cc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/testcmdlineparser.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ class TestCmdlineParser : public TestFixture {
455455
TEST_CASE(reportTypeMisraCpp2008);
456456
TEST_CASE(reportTypeMisraCpp2023);
457457
TEST_CASE(invalidReportType);
458+
TEST_CASE(defaultReportType);
458459
}
459460

460461
void nooptions() {
@@ -3119,6 +3120,13 @@ class TestCmdlineParser : public TestFixture {
31193120
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Fail, parser->parseFromArgs(3, argv));
31203121
ASSERT_EQUALS("cppcheck: error: Unknown report type 'invalid'\n", logger->str());
31213122
}
3123+
3124+
void defaultReportType() {
3125+
REDIRECT;
3126+
const char *const argv[] = { "cppcheck", "file.cpp" };
3127+
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Success, parser->parseFromArgs(2, argv));
3128+
ASSERT_EQUALS_ENUM(checkers::ReportType::normal, settings->reportType);
3129+
}
31223130
};
31233131

31243132
REGISTER_TEST(TestCmdlineParser)

0 commit comments

Comments
 (0)