From 628d367a9d618568167d43195c1118b7d7979da0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 15 Nov 2016 10:44:37 +0100 Subject: Stabilize tst_QFileDialog2::task143519_deleteAndRenameActionBehavior() The test relied on the file created being automatically selected, which sometimes does not happen when executing the entire test. Explicitly select the file and check the selection. Use the temporary directory for testing. Change-Id: Ia58641c1ac32ba21effa8a5ace9623eb5d48a1c2 Reviewed-by: Maurice Kalinowski --- tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp index b457558879..656d4d46de 100644 --- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp @@ -372,8 +372,7 @@ void tst_QFileDialog2::task143519_deleteAndRenameActionBehavior() // test based on task233037_selectingDirectory struct TestContext { - TestContext() - : current(QDir::current()) {} + explicit TestContext(const QString &path) : current(path) {} ~TestContext() { file.remove(); current.rmdir(test.dirName()); @@ -381,7 +380,9 @@ void tst_QFileDialog2::task143519_deleteAndRenameActionBehavior() QDir current; QDir test; QFile file; - } ctx; + }; + + TestContext ctx(tempDir.path()); // setup testbed QVERIFY(ctx.current.mkdir("task143519_deleteAndRenameActionBehavior_test")); // ensure at least one item @@ -395,6 +396,7 @@ void tst_QFileDialog2::task143519_deleteAndRenameActionBehavior() QNonNativeFileDialog fd; fd.setViewMode(QFileDialog::List); fd.setDirectory(ctx.test.absolutePath()); + fd.selectFile(ctx.file.fileName()); fd.show(); QTest::qWaitForWindowActive(&fd); @@ -409,7 +411,7 @@ void tst_QFileDialog2::task143519_deleteAndRenameActionBehavior() // defaults QVERIFY(openContextMenu(fd)); - QCOMPARE(fd.selectedFiles().size(), 1); + QCOMPARE(fd.selectedFiles(), QStringList(ctx.file.fileName())); QCOMPARE(rm->isEnabled(), !fd.isReadOnly()); QCOMPARE(mv->isEnabled(), !fd.isReadOnly()); -- cgit v1.2.3 From bebbaa43fd21baf0b2235199e84898f18d6cc861 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 30 Sep 2016 15:51:30 +0200 Subject: Fix warnings in tst_q{table,list}widget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC warned: tst_qtablewidget.cpp:30: tst_qtablewidget.cpp: In member function ‘void tst_QTableWidget::mimeData()’: qtestcase.h:66:52: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (!QTest::qVerify(static_cast(statement), #statement, "", __FILE__, __LINE__))\ ^ tst_qtablewidget.cpp:1523:5: note: in expansion of macro ‘QVERIFY’ QVERIFY(data = table.mimeData(tableWidgetItemList)); ^~~~~~~ Fix by adding the extra parentheses, as usual. Change-Id: I2826d7a865b4113b468d5a958ede06e03aa0e278 Reviewed-by: Edward Welbourne Reviewed-by: Marc Mutz --- tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp | 8 ++++---- tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp index ecf72613da..f526c041f5 100644 --- a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp +++ b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp @@ -1688,16 +1688,16 @@ void tst_QListWidget::mimeData() QMimeData *data; - QVERIFY(data = list.mimeData(tableWidgetItemList)); + QVERIFY((data = list.mimeData(tableWidgetItemList))); delete data; - QVERIFY(data = list.model()->mimeData(modelIndexList)); + QVERIFY((data = list.model()->mimeData(modelIndexList))); delete data; - QVERIFY(data = list.model()->mimeData(modelIndexList)); + QVERIFY((data = list.model()->mimeData(modelIndexList))); delete data; - QVERIFY(data = list.mimeData(tableWidgetItemList)); + QVERIFY((data = list.mimeData(tableWidgetItemList))); delete data; // check the saved data is actually the same diff --git a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp index ea31fd19dd..ff3cb72832 100644 --- a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp +++ b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp @@ -1537,16 +1537,16 @@ void tst_QTableWidget::mimeData() QMimeData *data; - QVERIFY(data = table.mimeData(tableWidgetItemList)); + QVERIFY((data = table.mimeData(tableWidgetItemList))); delete data; - QVERIFY(data = table.model()->mimeData(modelIndexList)); + QVERIFY((data = table.model()->mimeData(modelIndexList))); delete data; - QVERIFY(data = table.model()->mimeData(modelIndexList)); + QVERIFY((data = table.model()->mimeData(modelIndexList))); delete data; - QVERIFY(data = table.mimeData(tableWidgetItemList)); + QVERIFY((data = table.mimeData(tableWidgetItemList))); delete data; // check the saved data is actually the same -- cgit v1.2.3 From bd591064be388216f91d48522b3bdbc1be93bb92 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 21 Oct 2016 17:14:31 +0200 Subject: Use QPersistentModelIndex for storing a model index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QModelIndex is not safe to be used to store an index as it is designed to be discarded right after use as the index information can change. Therefore a QPersistentModelIndex should be used instead to store the index. Subsequently the m_index does not need to be updated whenever the model changes anymore as this is already done for us. Task-number: QTBUG-49907 Change-Id: Icc93e410de2821c503ea15a7a1dd9ae32634914e Reviewed-by: Jan Arve Sæther --- tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 62c2c0a916..3d78749024 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -2903,7 +2903,10 @@ void tst_QAccessibility::listTest() QAccessibleInterface *cellMunich3 = table2->cellAt(2,0); QCOMPARE(cell4, cellMunich3); QCOMPARE(axidMunich, QAccessible::uniqueId(cellMunich3)); - + delete listView->takeItem(2); + // list: Oslo, Helsinki + // verify that it doesn't return an invalid item from the cache + QVERIFY(table2->cellAt(2,0) == 0); delete listView; } -- cgit v1.2.3 From ac384524c8fa6b19153811e2eaf6dac6b911f930 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 14 Oct 2016 14:51:16 +0200 Subject: Speculative fix for tst_QThread::wait2() flakiness This test fails on Windows occasionally with values just short of 800, the lowest observed being 791. It is probably rounding somehow to 10ms segments, so allow it to be up to 10 ms too fast. Change-Id: Ie28e9f61588b68a9060a006f78eedc3a26d05155 Reviewed-by: Friedemann Kleint Reviewed-by: Thiago Macieira Reviewed-by: Simon Hausmann --- tests/auto/corelib/thread/qthread/tst_qthread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp index 3230472d5b..d7294c3ee6 100644 --- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp +++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp @@ -1082,8 +1082,8 @@ void tst_QThread::wait2() thread.start(); timer.start(); QVERIFY(!thread.wait(Waiting_Thread::WaitTime)); - qint64 elapsed = timer.elapsed(); // On Windows, we sometimes get (WaitTime - 1). - QVERIFY2(elapsed >= Waiting_Thread::WaitTime - 1, qPrintable(QString::fromLatin1("elapsed: %1").arg(elapsed))); + qint64 elapsed = timer.elapsed(); // On Windows, we sometimes get (WaitTime - 9). + QVERIFY2(elapsed >= Waiting_Thread::WaitTime - 10, qPrintable(QString::fromLatin1("elapsed: %1").arg(elapsed))); timer.start(); thread.cond1.wakeOne(); -- cgit v1.2.3 From a56dd0b82855dd91d95159de4b568203a026b66c Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 18 Jan 2016 17:07:56 +0100 Subject: tst_QDateTimeEdit: Use base method, not direct member access A test was directly accessing the .text member of QDateTimeParser (which presently has nothing private). Use the virtual .displayText() method of this base instead, to let the base have some hope of data-hiding (maybe, some day). Change-Id: I8b6e39fba130de56f117bffb2aec346197969c5b Reviewed-by: Timur Pocheptsov --- tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp index 08a28f3ea0..ee54b16990 100644 --- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp @@ -3749,7 +3749,7 @@ void tst_QDateTimeEdit::dateEditCorrectSectionSize() QTest::keyClick(&edit, keyPair.first, keyPair.second); QDateTimeEditPrivate* edit_d_ptr(static_cast(qt_widget_private(&edit))); - QCOMPARE(edit_d_ptr->text, expectedDisplayString); + QCOMPARE(edit_d_ptr->QDateTimeParser::displayText(), expectedDisplayString); } #endif -- cgit v1.2.3 From ad788c1014ea7a84f4ad9c52f50b957074cb3e38 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 18 Nov 2016 12:39:36 +0100 Subject: tst_qstandardpaths: Disable WOW64 redirection on Windows The logo (microsoft.windows.softwarelogo.showdesktop.exe) is otherwise not found. Change-Id: Ic52329462612a027e2928922a1f9a541dcbc67a3 Reviewed-by: Jesus Fernandez Reviewed-by: Oliver Wolff --- .../auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index e1c277717d..92e66e20c2 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp +++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -38,6 +38,9 @@ #include #include #include +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && !defined(Q_OS_WINCE) +# include +#endif #ifdef Q_OS_UNIX #include @@ -131,6 +134,16 @@ static const char * const enumNames[MaxStandardLocation + 1 - int(QStandardPaths void tst_qstandardpaths::initTestCase() { +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && !defined(Q_OS_WINCE) + // Disable WOW64 redirection, see testFindExecutable() + if (QSysInfo::buildCpuArchitecture() != QSysInfo::currentCpuArchitecture()) { + void *oldMode; + const bool disabledDisableWow64FsRedirection = Wow64DisableWow64FsRedirection(&oldMode) == TRUE; + if (!disabledDisableWow64FsRedirection) + qErrnoWarning("Wow64DisableWow64FsRedirection() failed"); + QVERIFY(disabledDisableWow64FsRedirection); + } +#endif // Q_OS_WIN && !Q_OS_WINRT && !Q_OS_WINCE QVERIFY2(m_localConfigTempDir.isValid(), qPrintable(m_localConfigTempDir.errorString())); QVERIFY2(m_globalConfigTempDir.isValid(), qPrintable(m_globalConfigTempDir.errorString())); QVERIFY2(m_localAppTempDir.isValid(), qPrintable(m_localAppTempDir.errorString())); @@ -380,6 +393,7 @@ void tst_qstandardpaths::testFindExecutable_data() if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS8) { // The logo executable on Windows 8 is perfectly suited for testing that the // suffix mechanism is not thrown off by dots in the name. + // Note: Requires disabling WOW64 redirection, see initTestCase() const QString logo = QLatin1String("microsoft.windows.softwarelogo.showdesktop"); const QString logoPath = cmdFi.absolutePath() + QLatin1Char('/') + logo + QLatin1String(".exe"); QTest::newRow("win8-logo") -- cgit v1.2.3 From 4bf5a3c885c26150317e83555c0c3213bd7b417e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 28 Sep 2016 00:12:36 +0200 Subject: tst_QFormLayout: Fix UB (invalid enum value) in several functions The code coerced a -123 into a QFormLayout::ItemFlags, which, however, being an enum with enumeration values 0..2, only has valid numerical values 0..3. Fix by using 3 as the value to represent the invalid enum value, and store this in a constant so as not to distribute this magic number all around the test class. Change-Id: Ie5e93a69ef5a3acdde43030b022e0cce8aec484d Reviewed-by: Thiago Macieira Reviewed-by: Marc Mutz --- .../widgets/kernel/qformlayout/tst_qformlayout.cpp | 42 ++++++++++++---------- 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp index 5703d7e114..5b87c0114d 100644 --- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp +++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp @@ -48,6 +48,10 @@ #include +// ItemRole has enumerators for numerical values 0..2, thus the only +// valid numerical values for storing into an ItemRole variable are 0..3: +Q_CONSTEXPR QFormLayout::ItemRole invalidRole = QFormLayout::ItemRole(3); + static inline void setFrameless(QWidget *w) { Qt::WindowFlags flags = w->windowFlags(); @@ -528,7 +532,7 @@ void tst_QFormLayout::insertRow_QWidget_QWidget() { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout->getWidgetPosition(lbl1, &row, &role); QCOMPARE(row, 0); QCOMPARE(int(role), int(QFormLayout::LabelRole)); @@ -536,7 +540,7 @@ void tst_QFormLayout::insertRow_QWidget_QWidget() { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout->getWidgetPosition(fld1, &row, &role); QCOMPARE(row, 0); QCOMPARE(int(role), int(QFormLayout::FieldRole)); @@ -597,7 +601,7 @@ void tst_QFormLayout::insertRow_QWidget_QLayout() { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout->getWidgetPosition(lbl1, &row, &role); QCOMPARE(row, 0); QCOMPARE(int(role), int(QFormLayout::LabelRole)); @@ -605,7 +609,7 @@ void tst_QFormLayout::insertRow_QWidget_QLayout() { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout->getLayoutPosition(fld1, &row, &role); QCOMPARE(row, 0); QCOMPARE(int(role), int(QFormLayout::FieldRole)); @@ -722,7 +726,7 @@ void tst_QFormLayout::setWidget() { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout.getWidgetPosition(&w1, &row, &role); QCOMPARE(row, 5); QCOMPARE(int(role), int(QFormLayout::LabelRole)); @@ -730,7 +734,7 @@ void tst_QFormLayout::setWidget() { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout.getWidgetPosition(&w2, &row, &role); QCOMPARE(row, 3); QCOMPARE(int(role), int(QFormLayout::FieldRole)); @@ -738,7 +742,7 @@ void tst_QFormLayout::setWidget() { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout.getWidgetPosition(&w3, &row, &role); QCOMPARE(row, 3); QCOMPARE(int(role), int(QFormLayout::LabelRole)); @@ -746,18 +750,20 @@ void tst_QFormLayout::setWidget() { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout.getWidgetPosition(&w4, &row, &role); + // not found QCOMPARE(row, -1); - QCOMPARE(int(role), -123); + QCOMPARE(int(role), int(invalidRole)); } { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout.getWidgetPosition(0, &row, &role); + // not found QCOMPARE(row, -1); - QCOMPARE(int(role), -123); + QCOMPARE(int(role), int(invalidRole)); } } @@ -790,7 +796,7 @@ void tst_QFormLayout::setLayout() { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout.getLayoutPosition(&l1, &row, &role); QCOMPARE(row, 5); QCOMPARE(int(role), int(QFormLayout::LabelRole)); @@ -798,7 +804,7 @@ void tst_QFormLayout::setLayout() { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout.getLayoutPosition(&l2, &row, &role); QCOMPARE(row, 3); QCOMPARE(int(role), int(QFormLayout::FieldRole)); @@ -806,7 +812,7 @@ void tst_QFormLayout::setLayout() { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout.getLayoutPosition(&l3, &row, &role); QCOMPARE(row, 3); QCOMPARE(int(role), int(QFormLayout::LabelRole)); @@ -814,18 +820,18 @@ void tst_QFormLayout::setLayout() { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout.getLayoutPosition(&l4, &row, &role); QCOMPARE(row, -1); - QCOMPARE(int(role), -123); + QCOMPARE(int(role), int(invalidRole)); } { int row = -1; - QFormLayout::ItemRole role = QFormLayout::ItemRole(-123); + QFormLayout::ItemRole role = invalidRole; layout.getLayoutPosition(0, &row, &role); QCOMPARE(row, -1); - QCOMPARE(int(role), -123); + QCOMPARE(int(role), int(invalidRole)); } } -- cgit v1.2.3 From 3cd457bdad6eee4a703ef9773b80165a272fbdc7 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 21 Nov 2016 11:38:43 +0100 Subject: Handle RemovePath correctly when calling matches() Change-Id: Ied324a537df127e676fad26b42e658a9d5aeec9b Reviewed-by: David Faure --- tests/auto/corelib/io/qurl/tst_qurl.cpp | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 8f99047df3..670b72acc8 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -182,6 +182,8 @@ private slots: void streaming(); void detach(); void testThreading(); + void matches_data(); + void matches(); private: void testThreadingHelper(); @@ -4023,6 +4025,54 @@ void tst_QUrl::testThreading() delete s_urlStorage; } +void tst_QUrl::matches_data() +{ + QTest::addColumn("urlStrOne"); + QTest::addColumn("urlStrTwo"); + QTest::addColumn("options"); + QTest::addColumn("matches"); + + QTest::newRow("matchingString-none") << "http://www.website.com/directory/?#ref" + << "http://www.website.com/directory/?#ref" + << uint(QUrl::None) << true; + QTest::newRow("nonMatchingString-none") << "http://www.website.com/directory/?#ref" + << "http://www.nomatch.com/directory/?#ref" + << uint(QUrl::None) << false; + QTest::newRow("matchingHost-removePath") << "http://www.website.com/directory" + << "http://www.website.com/differentdir" + << uint(QUrl::RemovePath) << true; + QTest::newRow("nonMatchingHost-removePath") << "http://www.website.com/directory" + << "http://www.different.com/differentdir" + << uint(QUrl::RemovePath) << false; + QTest::newRow("matchingHost-removePathAuthority") << "http://user:pass@www.website.com/directory" + << "http://www.website.com/differentdir" + << uint(QUrl::RemovePath | QUrl::RemoveAuthority) + << true; + QTest::newRow("nonMatchingHost-removePathAuthority") << "http://user:pass@www.website.com/directory" + << "http://user:pass@www.different.com/differentdir" + << uint(QUrl::RemovePath | QUrl::RemoveAuthority) + << true; + QTest::newRow("matchingHostAuthority-removePathAuthority") + << "http://user:pass@www.website.com/directory" << "http://www.website.com/differentdir" + << uint(QUrl::RemovePath | QUrl::RemoveAuthority) << true; + QTest::newRow("nonMatchingAuthority-removePathAuthority") + << "http://user:pass@www.website.com/directory" + << "http://otheruser:otherpass@www.website.com/directory" + << uint(QUrl::RemovePath | QUrl::RemoveAuthority) << true; +} + +void tst_QUrl::matches() +{ + QFETCH(QString, urlStrOne); + QFETCH(QString, urlStrTwo); + QFETCH(uint, options); + QFETCH(bool, matches); + + QUrl urlOne(urlStrOne); + QUrl urlTwo(urlStrTwo); + QCOMPARE(urlOne.matches(urlTwo, QUrl::FormattingOptions(options)), matches); +} + QTEST_MAIN(tst_QUrl) #include "tst_qurl.moc" -- cgit v1.2.3