Skip to content

Commit

Permalink
update stdunknown2 test to use ASSERT... instead of TODO_ASSERT...
Browse files Browse the repository at this point in the history
  • Loading branch information
ludviggunne committed Aug 26, 2024
1 parent ad0f103 commit 3202520
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion cli/cmdlineparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
// --std
else if (std::strncmp(argv[i], "--std=", 6) == 0) {
const std::string std = argv[i] + 6;
// TODO: print error when standard is unknown
if (std::strncmp(std.c_str(), "c++", 3) == 0) {
const Standards::cppstd_t cppstd = Standards::getCPP(std);
if (cppstd == Standards::CPPInvalid) {
Expand Down
4 changes: 2 additions & 2 deletions test/testcmdlineparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1369,8 +1369,8 @@ class TestCmdlineParser : public TestFixture {
void stdunknown2() {
REDIRECT;
const char *const argv[] = {"cppcheck", "--std=cplusplus11", "file.cpp"};
TODO_ASSERT_EQUALS(static_cast<int>(CmdLineParser::Result::Fail), static_cast<int>(CmdLineParser::Result::Success), static_cast<int>(parser->parseFromArgs(3, argv)));
TODO_ASSERT_EQUALS("cppcheck: error: unknown --std value 'cplusplus11'\n", "", logger->str());
ASSERT_EQUALS(static_cast<int>(CmdLineParser::Result::Fail), static_cast<int>(parser->parseFromArgs(3, argv)));
ASSERT_EQUALS("cppcheck: error: unknown --std value 'cplusplus11'\n", logger->str());
}

void platformWin64() {
Expand Down

0 comments on commit 3202520

Please sign in to comment.