diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-06-30 14:34:08 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-06-30 14:44:58 +0200 |
commit | 56a5b47dad6f6250ec45cb6136c77371cee645c5 (patch) | |
tree | 73e85a7a8b70b17e7c5704ac91ac342a4d7cf341 /tests | |
parent | df0c37d80b2e3e7ef72b3fa0b8071bd0507b1cac (diff) |
tst_qwinjumplist: Check file names case insensitive.
Change-Id: I9149420ef62cb981f55ab79df9da44144eaed9dd
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qwinjumplist/tst_qwinjumplist.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/auto/qwinjumplist/tst_qwinjumplist.cpp b/tests/auto/qwinjumplist/tst_qwinjumplist.cpp index 58dcfa1..471051b 100644 --- a/tests/auto/qwinjumplist/tst_qwinjumplist.cpp +++ b/tests/auto/qwinjumplist/tst_qwinjumplist.cpp @@ -59,6 +59,13 @@ private slots: void testItems(); }; +static inline QByteArray msgFileNameMismatch(const QString &f1, const QString &f2) +{ + const QString result = QLatin1Char('"') + f1 + QStringLiteral("\" != \"") + + f2 + QLatin1Char('"'); + return result.toLocal8Bit(); +} + void tst_QWinJumpList::testRecent() { QScopedPointer<QWinJumpList> jumplist(new QWinJumpList); @@ -95,7 +102,10 @@ void tst_QWinJumpList::testRecent() QWinJumpListItem* item = recent2->items().value(0); QVERIFY(item); - QCOMPARE(item->filePath(), QCoreApplication::applicationFilePath()); + const QString itemPath = item->filePath(); + const QString applicationFilePath = QCoreApplication::applicationFilePath(); + QVERIFY2(!itemPath.compare(applicationFilePath, Qt::CaseInsensitive), + msgFileNameMismatch(itemPath, applicationFilePath)); QEXPECT_FAIL("", "QWinJumpListItem::title not supported for recent items", Continue); QCOMPARE(item->title(), QStringLiteral("tst_QWinJumpList")); @@ -139,7 +149,10 @@ void tst_QWinJumpList::testFrequent() QWinJumpListItem* item = frequent2->items().value(0); QVERIFY(item); - QCOMPARE(item->filePath(), QCoreApplication::applicationFilePath()); + const QString itemPath = item->filePath(); + const QString applicationFilePath = QCoreApplication::applicationFilePath(); + QVERIFY2(!itemPath.compare(applicationFilePath, Qt::CaseInsensitive), + msgFileNameMismatch(itemPath, applicationFilePath)); QEXPECT_FAIL("", "QWinJumpListItem::title not supported for frequent items", Continue); QCOMPARE(item->title(), QStringLiteral("tst_QWinJumpList")); |