summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
index f37e192ad3..d111c53551 100644
--- a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
+++ b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
@@ -69,6 +69,7 @@ private slots:
void testUnknownOptionErrorHandling();
void testDoubleDash_data();
void testDoubleDash();
+ void testDefaultValue();
void testProcessNotCalled();
void testEmptyArgsList();
void testMissingOptionValue();
@@ -322,6 +323,17 @@ void tst_QCommandLineParser::testDoubleDash()
QCOMPARE(parser.unknownOptionNames(), QStringList());
}
+void tst_QCommandLineParser::testDefaultValue()
+{
+ QCommandLineOption opt(QStringLiteral("name"), QStringLiteral("desc"),
+ QStringLiteral("valueName"), QStringLiteral("default"));
+ QCOMPARE(opt.defaultValues(), QStringList(QStringLiteral("default")));
+ opt.setDefaultValue(QStringLiteral(""));
+ QCOMPARE(opt.defaultValues(), QStringList());
+ opt.setDefaultValue(QStringLiteral("default"));
+ QCOMPARE(opt.defaultValues(), QStringList(QStringLiteral("default")));
+}
+
void tst_QCommandLineParser::testProcessNotCalled()
{
QCoreApplication app(empty_argc, empty_argv);