diff --git a/application/argumentparser.cpp b/application/argumentparser.cpp index d135e7a..3e6e438 100644 --- a/application/argumentparser.cpp +++ b/application/argumentparser.cpp @@ -251,7 +251,7 @@ void ArgumentReader::read(ArgumentVector &args) ++index, ++argv, argDenotation = nullptr; break; case UnknownArgumentBehavior::Fail: - throw Failure("The specified argument \""s % *argv + "\" is unknown and will be ignored."s); + throw Failure(argsToString("The specified argument \"", *argv, "\" is unknown.")); } } } // if(!matchingArg) diff --git a/tests/argumentparsertests.cpp b/tests/argumentparsertests.cpp index 194a166..58ab88c 100644 --- a/tests/argumentparsertests.cpp +++ b/tests/argumentparsertests.cpp @@ -169,7 +169,7 @@ void ArgumentParserTests::testParsing() parser.parseArgs(6, argv3); CPPUNIT_FAIL("Exception expected."); } catch(const Failure &e) { - CPPUNIT_ASSERT(!strcmp(e.what(), "The specified argument \"album\" is unknown and will be ignored.")); + CPPUNIT_ASSERT_EQUAL("The specified argument \"album\" is unknown."s, string(e.what())); } // warning about unknown argument @@ -272,7 +272,7 @@ void ArgumentParserTests::testParsing() CPPUNIT_FAIL("Exception expected."); } catch(const Failure &e) { CPPUNIT_ASSERT(!qtConfigArgs.qtWidgetsGuiArg().isPresent()); - CPPUNIT_ASSERT(!strcmp(e.what(), "The specified argument \"-f\" is unknown and will be ignored.")); + CPPUNIT_ASSERT_EQUAL("The specified argument \"-f\" is unknown."s, string(e.what())); } // equation sign syntax