From 4870282117b43242d9c2cd6fbde8175b2a907b08 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 9 Nov 2017 15:49:26 -0800 Subject: QSemaphore: fix regression when the timeout < 0 The issue was introduced by eaee1209f0ead5be786e81db8aee604ccfea85b0, so it affected only 5.9.2. [ChangeLog][QtCore][QSemaphore] Fixed a regression that would make tryAcquire() not to wait forever if the timeout was a negative value. Note: new code is advised to only use -1 to indicate "forever", as some other functions taking timeout periods do not accept other values. Task-number: QTBUG-64413 Change-Id: I57a1bd6e0c194530b732fffd14f58fce60d5dfc9 Reviewed-by: Lars Knoll --- .../corelib/thread/qsemaphore/tst_qsemaphore.cpp | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp index 2970b2e118..ce093f769c 100644 --- a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp +++ b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp @@ -41,6 +41,8 @@ private slots: void tryAcquireWithTimeout_data(); void tryAcquireWithTimeout(); void tryAcquireWithTimeoutStarvation(); + void tryAcquireWithTimeoutForever_data(); + void tryAcquireWithTimeoutForever(); void producerConsumer(); }; @@ -155,21 +157,25 @@ void tst_QSemaphore::tryAcquire() semaphore.release(); QCOMPARE(semaphore.available(), 1); QVERIFY(!semaphore.tryAcquire(2)); + QVERIFY(!semaphore.tryAcquire(2, 0)); QCOMPARE(semaphore.available(), 1); semaphore.release(); QCOMPARE(semaphore.available(), 2); QVERIFY(!semaphore.tryAcquire(3)); + QVERIFY(!semaphore.tryAcquire(3, 0)); QCOMPARE(semaphore.available(), 2); semaphore.release(10); QCOMPARE(semaphore.available(), 12); QVERIFY(!semaphore.tryAcquire(100)); + QVERIFY(!semaphore.tryAcquire(100, 0)); QCOMPARE(semaphore.available(), 12); semaphore.release(10); QCOMPARE(semaphore.available(), 22); QVERIFY(!semaphore.tryAcquire(100)); + QVERIFY(!semaphore.tryAcquire(100, 0)); QCOMPARE(semaphore.available(), 22); QVERIFY(semaphore.tryAcquire()); @@ -178,23 +184,38 @@ void tst_QSemaphore::tryAcquire() QVERIFY(semaphore.tryAcquire()); QCOMPARE(semaphore.available(), 20); + semaphore.release(2); + QVERIFY(semaphore.tryAcquire(1, 0)); + QCOMPARE(semaphore.available(), 21); + + QVERIFY(semaphore.tryAcquire(1, 0)); + QCOMPARE(semaphore.available(), 20); + QVERIFY(semaphore.tryAcquire(10)); QCOMPARE(semaphore.available(), 10); + semaphore.release(10); + QVERIFY(semaphore.tryAcquire(10, 0)); + QCOMPARE(semaphore.available(), 10); + QVERIFY(semaphore.tryAcquire(10)); QCOMPARE(semaphore.available(), 0); // should not be able to acquire more QVERIFY(!semaphore.tryAcquire()); + QVERIFY(!semaphore.tryAcquire(1, 0)); QCOMPARE(semaphore.available(), 0); QVERIFY(!semaphore.tryAcquire()); + QVERIFY(!semaphore.tryAcquire(1, 0)); QCOMPARE(semaphore.available(), 0); QVERIFY(!semaphore.tryAcquire(10)); + QVERIFY(!semaphore.tryAcquire(10, 0)); QCOMPARE(semaphore.available(), 0); QVERIFY(!semaphore.tryAcquire(10)); + QVERIFY(!semaphore.tryAcquire(10, 0)); QCOMPARE(semaphore.available(), 0); } @@ -344,6 +365,48 @@ void tst_QSemaphore::tryAcquireWithTimeoutStarvation() QVERIFY(consumer.wait()); } +void tst_QSemaphore::tryAcquireWithTimeoutForever_data() +{ + QTest::addColumn("timeout"); + QTest::newRow("-1") << -1; + + // tryAcquire is documented to take any negative value as "forever" + QTest::newRow("INT_MIN") << INT_MIN; +} + +void tst_QSemaphore::tryAcquireWithTimeoutForever() +{ + enum { WaitTime = 1000 }; + struct Thread : public QThread { + QSemaphore sem; + + void run() override + { + QTest::qWait(WaitTime); + sem.release(2); + } + }; + + QFETCH(int, timeout); + Thread t; + + // sanity check it works if we can immediately acquire + t.sem.release(11); + QVERIFY(t.sem.tryAcquire(1, timeout)); + QVERIFY(t.sem.tryAcquire(10, timeout)); + + // verify that we do wait for at least WaitTime if we can't acquire immediately + QElapsedTimer timer; + timer.start(); + t.start(); + QVERIFY(t.sem.tryAcquire(1, timeout)); + QVERIFY(timer.elapsed() >= WaitTime); + + QVERIFY(t.wait()); + + QCOMPARE(t.sem.available(), 1); +} + const char alphabet[] = "ACGTH"; const int AlphabetSize = sizeof(alphabet) - 1; -- cgit v1.2.3 From ce08318a46164172eaa72f4436cddf7f69ce9e1c Mon Sep 17 00:00:00 2001 From: Svenn-Arne Dragly Date: Wed, 20 Sep 2017 09:28:27 +0200 Subject: Add QThreadPool autotest to detect stale threads after tryTake This test makes sure that we do not introduce a regression where the threads exited the inner loop over the queue before the queue was empty. This was triggered by calling tryTake at least maxThreadCount times, which left the same number of null pointers in the queue and caused the inner loop to exit too soon for all the threads. Change-Id: I3a9d800149b88d09510ddc424667670b60f06a33 Reviewed-by: Lars Knoll --- .../corelib/thread/qthreadpool/tst_qthreadpool.cpp | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp index 66853a88d8..0eaf8a4b77 100644 --- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp +++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp @@ -94,6 +94,7 @@ private slots: void destroyingWaitsForTasksToFinish(); void stressTest(); void takeAllAndIncreaseMaxThreadCount(); + void waitForDoneAfterTake(); private: QMutex m_functionTestMutex; @@ -1263,5 +1264,72 @@ void tst_QThreadPool::takeAllAndIncreaseMaxThreadCount() { delete task3; } +void tst_QThreadPool::waitForDoneAfterTake() +{ + class Task : public QRunnable + { + public: + Task(QSemaphore *mainBarrier, QSemaphore *threadBarrier) + : m_mainBarrier(mainBarrier) + , m_threadBarrier(threadBarrier) + {} + + void run() + { + m_mainBarrier->release(); + m_threadBarrier->acquire(); + } + + private: + QSemaphore *m_mainBarrier = nullptr; + QSemaphore *m_threadBarrier = nullptr; + }; + + int threadCount = 4; + + // Blocks the main thread from releasing the threadBarrier before all run() functions have started + QSemaphore mainBarrier; + // Blocks the tasks from completing their run function + QSemaphore threadBarrier; + + QThreadPool manager; + manager.setMaxThreadCount(threadCount); + + // Fill all the threads with runnables that wait for the threadBarrier + for (int i = 0; i < threadCount; i++) { + auto *task = new Task(&mainBarrier, &threadBarrier); + manager.start(task); + } + + QVERIFY(manager.activeThreadCount() == manager.maxThreadCount()); + + // Add runnables that are immediately removed from the pool queue. + // This sets the queue elements to nullptr in QThreadPool and we want to test that + // the threads keep going through the queue after encountering a nullptr. + for (int i = 0; i < threadCount; i++) { + QRunnable *runnable = createTask(emptyFunct); + manager.start(runnable); + QVERIFY(manager.tryTake(runnable)); + } + + // Add another runnable that will not be removed + manager.start(createTask(emptyFunct)); + + // Wait for the first runnables to start + mainBarrier.acquire(threadCount); + + QVERIFY(mainBarrier.available() == 0); + QVERIFY(threadBarrier.available() == 0); + + // Release runnables that are waiting and expect all runnables to complete + threadBarrier.release(threadCount); + + // Using qFatal instead of QVERIFY to force exit if threads are still running after timeout. + // Otherwise, QCoreApplication will still wait for the stale threads and never exit the test. + if (!manager.waitForDone(5 * 60 * 1000)) + qFatal("waitForDone returned false. Aborting to stop background threads."); + +} + QTEST_MAIN(tst_QThreadPool); #include "tst_qthreadpool.moc" -- cgit v1.2.3 From ba2f3a156ebc9ce3e6b6e59e231a5c2847163671 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 12 Nov 2017 13:33:25 +0100 Subject: QTreeView: recalculate row heights in hide/showColumn() When calling QTreeView::hideColumn() the row heights are not recalculated. This can lead to rows which are unnecessarily high due to hidden columns may contain large (e.g. multiline) content. The same applies to showColumn() - there the row might be to small. Hiding columns directly via QTreeView::header()->hideSection() is not covered by this patch since QHeaderView has no way to inform about newly shown/hidden sections. Task-number: QTBUG-8376 Change-Id: I20b1198e56e403ab8cf649af76e5e2280821dd68 Reviewed-by: Richard Moe Gustavsen --- .../widgets/itemviews/qtreeview/tst_qtreeview.cpp | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp index 6ee0e50cce..3260d7c968 100644 --- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp @@ -193,6 +193,7 @@ private slots: void taskQTBUG_37813_crash(); void taskQTBUG_45697_crash(); void taskQTBUG_7232_AllowUserToControlSingleStep(); + void taskQTBUG_8376(); void testInitialFocus(); }; @@ -4399,5 +4400,51 @@ void tst_QTreeView::taskQTBUG_7232_AllowUserToControlSingleStep() QCOMPARE(hStep1, t.horizontalScrollBar()->singleStep()); } +static void fillModeltaskQTBUG_8376(QAbstractItemModel &model) +{ + model.insertRow(0); + model.insertColumn(0); + model.insertColumn(1); + QModelIndex index = model.index(0, 0); + model.setData(index, "Level0"); + { + model.insertRow(0, index); + model.insertRow(1, index); + model.insertColumn(0, index); + model.insertColumn(1, index); + + QModelIndex idx; + idx = model.index(0, 0, index); + model.setData(idx, "Level1"); + + idx = model.index(0, 1, index); + model.setData(idx, "very\nvery\nhigh\ncell"); + } +} + +void tst_QTreeView::taskQTBUG_8376() +{ + QTreeView tv; + QStandardItemModel model; + fillModeltaskQTBUG_8376(model); + tv.setModel(&model); + tv.expandAll(); // init layout + + QModelIndex idxLvl0 = model.index(0, 0); + QModelIndex idxLvl1 = model.index(0, 1, idxLvl0); + const int rowHeightLvl0 = tv.rowHeight(idxLvl0); + const int rowHeightLvl1Visible = tv.rowHeight(idxLvl1); + QVERIFY(rowHeightLvl0 < rowHeightLvl1Visible); + + tv.hideColumn(1); + const int rowHeightLvl1Hidden = tv.rowHeight(idxLvl1); + QCOMPARE(rowHeightLvl0, rowHeightLvl1Hidden); + + tv.showColumn(1); + const int rowHeightLvl1Visible2 = tv.rowHeight(idxLvl1); + QCOMPARE(rowHeightLvl1Visible, rowHeightLvl1Visible2); +} + + QTEST_MAIN(tst_QTreeView) #include "tst_qtreeview.moc" -- cgit v1.2.3 From 0f3c9782e6e2459f3fea361962492f52fa9c4fd9 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 20 Nov 2017 16:50:12 +0100 Subject: tst_QNetworkReply::ioHttpRedirectErrors - fix a flaky test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This test became a real pain recently. A close look at the test shows several problems (strangely enough, the failure can never be reproduced on real machines, only on VM - Ubuntu and RHEL 6.6). There are several asserts that are firing from time to time here and there. They show that the logic in test is broken/incorrect. QNAM can open several connections to a host, our test then incorrectly resets its 'client' data-member and bad things can later happen after 'bytesWrittenSlot' executed (and deleted a socket). For example, I can reproduce this scenario in every second run: 1. incoming connection -> client = socket(descriptor), connect to client's readyRead (s1) 2. incoming connection -> client = socket(descriptor), connect to client's readyRead (s2) QNAM sends a request on s1. We reply on s2 (which is already wrong) and call client->deleteLater(), which resets client to nullptr. If QNAM sends something else on s1, we hit assert(!client.isNull()). To avoid this, whenever 'sender' in any slot is different from the 'client', we use the actual 'sender' to reply. Another problem is this weird and rather cryptic waitForFinish which is not needed in this particular test since we wait for reply error, not 'finished'. As it happened before - it's not clear if these two problems were the cause of guaranteed fails on CI - an integration failed ~10 times in a row in the same test (not happening anymore though). Task-number: QTBUG-64569 Change-Id: Id9aa091290350c61fadf1c3c001e7c2e1b5ac8f4 Reviewed-by: Edward Welbourne Reviewed-by: Mårten Nordheim --- .../access/qnetworkreply/tst_qnetworkreply.cpp | 38 +++++++++++++++------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 3a752c0748..9fa54597f1 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -622,7 +622,7 @@ protected: Q_ASSERT(!client.isNull()); // we need to emulate the bytesWrittenSlot call if the data is empty. if (dataToTransmit.size() == 0) { - QMetaObject::invokeMethod(this, "bytesWrittenSlot", Qt::QueuedConnection); + emit client->bytesWritten(0); } else { client->write(dataToTransmit); // FIXME: For SSL connections, if we don't flush the socket, the @@ -659,22 +659,26 @@ private slots: #ifndef QT_NO_SSL void slotSslErrors(const QList& errors) { - Q_ASSERT(!client.isNull()); - qDebug() << "slotSslErrors" << client->errorString() << errors; + QTcpSocket *currentClient = qobject_cast(sender()); + Q_ASSERT(currentClient); + qDebug() << "slotSslErrors" << currentClient->errorString() << errors; } #endif void slotError(QAbstractSocket::SocketError err) { - if (client.isNull()) - qDebug() << "slotError" << err; - else - qDebug() << "slotError" << err << client->errorString(); + QTcpSocket *currentClient = qobject_cast(sender()); + Q_ASSERT(currentClient); + qDebug() << "slotError" << err << currentClient->errorString(); } public slots: void readyReadSlot() { - Q_ASSERT(!client.isNull()); + QTcpSocket *currentClient = qobject_cast(sender()); + Q_ASSERT(currentClient); + if (currentClient != client) + client = currentClient; + receivedData += client->readAll(); const int doubleEndlPos = receivedData.indexOf("\r\n\r\n"); @@ -8290,11 +8294,23 @@ void tst_QNetworkReply::ioHttpRedirectErrors() QNetworkReplyPtr reply(manager.get(request)); if (localhost.scheme() == "https") reply.data()->ignoreSslErrors(); - QSignalSpy spy(reply.data(), SIGNAL(error(QNetworkReply::NetworkError))); - QCOMPARE(waitForFinish(reply), int(Failure)); + QEventLoop eventLoop; + QTimer watchDog; + watchDog.setSingleShot(true); - QCOMPARE(spy.count(), 1); + reply->connect(reply.data(), QOverload().of(&QNetworkReply::error), + [&eventLoop](QNetworkReply::NetworkError){ + eventLoop.exit(Failure); + }); + + watchDog.connect(&watchDog, &QTimer::timeout, [&eventLoop](){ + eventLoop.exit(Timeout); + }); + + watchDog.start(5000); + + QCOMPARE(eventLoop.exec(), int(Failure)); QCOMPARE(reply->error(), error); } -- cgit v1.2.3 From 53f48fceeec7af4439ee45111e327dd4e7a226e8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 1 Nov 2017 12:11:33 +0100 Subject: Start from the first visible item when doing a search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the first item in a treeview might be hidden, start from the first visible item in the view when starting or wrapping round during a keyboard search. Task-number: QTBUG-63869 Change-Id: I202bea567c6d4484c3ffaf8a5f9af8ea2e13708d Reviewed-by: Thorbjørn Lund Martsum --- .../widgets/itemviews/qtreeview/tst_qtreeview.cpp | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp index 3260d7c968..dfcaa9b5b9 100644 --- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp @@ -1067,6 +1067,103 @@ void tst_QTreeView::keyboardSearch() // The item that starts with B is selected. view.keyboardSearch(QLatin1String("B")); QVERIFY(view.selectionModel()->isSelected(model.index(1, 0))); + + // Test that it wraps round + model.appendRow(new QStandardItem("Andy")); + QTest::qWait(QApplication::keyboardInputInterval() * 2); + view.keyboardSearch(QLatin1String("A")); + QVERIFY(view.selectionModel()->isSelected(model.index(3, 0))); + QTest::qWait(QApplication::keyboardInputInterval() * 2); + view.keyboardSearch(QLatin1String("A")); + QVERIFY(view.selectionModel()->isSelected(model.index(0, 0))); + QTest::qWait(QApplication::keyboardInputInterval() * 2); + view.keyboardSearch(QLatin1String("A")); + QVERIFY(view.selectionModel()->isSelected(model.index(3, 0))); + + // Test that it handles the case where the first item is hidden correctly + model.insertRow(0, new QStandardItem("Hidden item")); + view.setRowHidden(0, QModelIndex(), true); + + QTest::qWait(QApplication::keyboardInputInterval() * 2); + view.keyboardSearch(QLatin1String("A")); + QVERIFY(view.selectionModel()->isSelected(model.index(1, 0))); + QTest::qWait(QApplication::keyboardInputInterval() * 2); + view.keyboardSearch(QLatin1String("A")); + QVERIFY(view.selectionModel()->isSelected(model.index(4, 0))); + QTest::qWait(QApplication::keyboardInputInterval() * 2); + view.keyboardSearch(QLatin1String("A")); + QVERIFY(view.selectionModel()->isSelected(model.index(1, 0))); + + QTest::qWait(QApplication::keyboardInputInterval() * 2); + model.clear(); + view.setCurrentIndex(QModelIndex()); + QList items = { new QStandardItem("Andreas"), new QStandardItem("Alicia") }; + model.appendRow(items); + items = { new QStandardItem("Baldrian"), new QStandardItem("Belinda") }; + model.appendRow(items); + items = { new QStandardItem("Cecilie"), new QStandardItem("Claire") }; + model.appendRow(items); + QVERIFY(!view.selectionModel()->hasSelection()); + QVERIFY(!view.selectionModel()->isSelected(model.index(0, 0))); + + // We want to search on the 2nd column so we have to force it to have + // an index in that column as a starting point + view.setCurrentIndex(QModelIndex(model.index(0, 1))); + // Second item in first row is selected + view.keyboardSearch(QLatin1String("A")); + QTRY_VERIFY(view.selectionModel()->isSelected(model.index(0, 1))); + QVERIFY(view.currentIndex() == model.index(0, 1)); + + // Second item in first row is still selected + view.keyboardSearch(QLatin1String("l")); + QVERIFY(view.selectionModel()->isSelected(model.index(0, 1))); + QCOMPARE(view.currentIndex(), model.index(0, 1)); + + // No "AnB" item - keep the same selection. + view.keyboardSearch(QLatin1String("B")); + QVERIFY(view.selectionModel()->isSelected(model.index(0, 1))); + QCOMPARE(view.currentIndex(), model.index(0, 1)); + + // Wait a bit. + QTest::qWait(QApplication::keyboardInputInterval() * 2); + + // The item that starts with B is selected. + view.keyboardSearch(QLatin1String("B")); + QVERIFY(view.selectionModel()->isSelected(model.index(1, 1))); + QCOMPARE(view.currentIndex(), model.index(1, 1)); + + // Test that it wraps round + items = { new QStandardItem("Andy"), new QStandardItem("Adele") }; + model.appendRow(items); + QTest::qWait(QApplication::keyboardInputInterval() * 2); + view.keyboardSearch(QLatin1String("A")); + QVERIFY(view.selectionModel()->isSelected(model.index(3, 1))); + QCOMPARE(view.currentIndex(), model.index(3, 1)); + QTest::qWait(QApplication::keyboardInputInterval() * 2); + view.keyboardSearch(QLatin1String("A")); + QVERIFY(view.selectionModel()->isSelected(model.index(0, 1))); + QCOMPARE(view.currentIndex(), model.index(0, 1)); + QTest::qWait(QApplication::keyboardInputInterval() * 2); + view.keyboardSearch(QLatin1String("A")); + QVERIFY(view.selectionModel()->isSelected(model.index(3, 1))); + QCOMPARE(view.currentIndex(), model.index(3, 1)); + + // Test that it handles the case where the first item is hidden correctly + model.insertRow(0, new QStandardItem("Hidden item")); + view.setRowHidden(0, QModelIndex(), true); + + QTest::qWait(QApplication::keyboardInputInterval() * 2); + view.keyboardSearch(QLatin1String("A")); + QVERIFY(view.selectionModel()->isSelected(model.index(1, 1))); + QCOMPARE(view.currentIndex(), model.index(1, 1)); + QTest::qWait(QApplication::keyboardInputInterval() * 2); + view.keyboardSearch(QLatin1String("A")); + QVERIFY(view.selectionModel()->isSelected(model.index(4, 1))); + QCOMPARE(view.currentIndex(), model.index(4, 1)); + QTest::qWait(QApplication::keyboardInputInterval() * 2); + view.keyboardSearch(QLatin1String("A")); + QVERIFY(view.selectionModel()->isSelected(model.index(1, 1))); + QCOMPARE(view.currentIndex(), model.index(1, 1)); } void tst_QTreeView::keyboardSearchMultiColumn() -- cgit v1.2.3 From c3a5c482efcac794033721e4e32b01b012704096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 17 Nov 2017 14:44:36 +0100 Subject: Fix tst_QSslSocket::waitForConnectedEncryptedReadyRead ... and unblacklist it. It was blacklisted some years ago because it was failing too often. It was failing because the ssl socket had already received and decrypted all the data it was going to get, meaning the waitForReadyRead call was just going to block forever. Change-Id: Ia540735177d4e1be8696f2d752f1d7813faecfe5 Reviewed-by: Timur Pocheptsov Reviewed-by: Edward Welbourne --- tests/auto/network/ssl/qsslsocket/BLACKLIST | 2 -- tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/network/ssl/qsslsocket/BLACKLIST b/tests/auto/network/ssl/qsslsocket/BLACKLIST index 52c023b78f..a9ecc69f50 100644 --- a/tests/auto/network/ssl/qsslsocket/BLACKLIST +++ b/tests/auto/network/ssl/qsslsocket/BLACKLIST @@ -1,6 +1,4 @@ windows -[waitForConnectedEncryptedReadyRead:WithSocks5ProxyAuth] -* [protocolServerSide:ssl3-any] rhel-7.2 [protocolServerSide:tls1.0-any] diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index c74d3b5375..f97627cb42 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -1587,7 +1587,12 @@ void tst_QSslSocket::waitForConnectedEncryptedReadyRead() QFETCH_GLOBAL(bool, setProxy); if (setProxy && !socket->waitForEncrypted(10000)) QSKIP("Skipping flaky test - See QTBUG-29941"); - QVERIFY(socket->waitForReadyRead(10000)); + + // We only do this if we have no bytes available to read already because readyRead will + // not be emitted again. + if (socket->bytesAvailable() == 0) + QVERIFY(socket->waitForReadyRead(10000)); + QVERIFY(!socket->peerCertificate().isNull()); QVERIFY(!socket->peerCertificateChain().isEmpty()); } -- cgit v1.2.3 From b71b7461b0b95bbf02c215019381b19e4070e07c Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Fri, 29 Sep 2017 22:17:10 +0200 Subject: CMake: Set SKIP_AUTOMOC/AUTOUIC where needed Make sure we don't run into warnings for CMake 3.10 Task-number: QTBUG-63442 Change-Id: Ida004705646f0c32fb4bf6006036d80b1f279fd7 Reviewed-by: David Faure Reviewed-by: Sebastian Holtermann Reviewed-by: Rolf Eike Beer --- tests/auto/cmake/CMakeLists.txt | 12 ++++-- tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt | 30 ++++++++++++++ tests/auto/cmake/test_QTBUG-63422/mywidget.cpp | 43 ++++++++++++++++++++ tests/auto/cmake/test_QTBUG-63422/mywidget.h | 52 ++++++++++++++++++++++++ tests/auto/cmake/test_QTBUG-63422/mywidget.ui | 34 ++++++++++++++++ tests/auto/cmake/test_QTBUG-63422/res.qrc | 4 ++ 6 files changed, 172 insertions(+), 3 deletions(-) create mode 100644 tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt create mode 100644 tests/auto/cmake/test_QTBUG-63422/mywidget.cpp create mode 100644 tests/auto/cmake/test_QTBUG-63422/mywidget.h create mode 100644 tests/auto/cmake/test_QTBUG-63422/mywidget.ui create mode 100644 tests/auto/cmake/test_QTBUG-63422/res.qrc (limited to 'tests/auto') diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 0e6da23c09..40c86132e9 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -157,7 +157,13 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.11 AND NOT NO_WIDGETS) expect_pass(test_interface) endif() -if (NOT CMAKE_VERSION VERSION_LESS 2.8.12) - expect_pass(test_interface_link_libraries) - expect_pass(test_moc_macro_target) +expect_pass(test_interface_link_libraries) +expect_pass(test_moc_macro_target) + +if (NOT CMAKE_VERSION VERSION_LESS 3.8) + # With earlier CMake versions, this test would simply run moc multiple times and lead to: + # /usr/bin/ld: error: CMakeFiles/mywidget.dir/mywidget_automoc.cpp.o: multiple definition of 'MyWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)' + # /usr/bin/ld: CMakeFiles/mywidget.dir/moc_mywidget.cpp.o: previous definition here + # Reason: SKIP_* properties were added in CMake 3.8 only + expect_pass(test_QTBUG-63422) endif() diff --git a/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt b/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt new file mode 100644 index 0000000000..a0b82caee4 --- /dev/null +++ b/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 2.8) +project(test_dependent_modules) + +find_package(Qt5Widgets REQUIRED) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +# make sure CMP0071 warnings cause a test failure +set(CMAKE_SUPPRESS_DEVELOPER_ERRORS FALSE CACHE INTERNAL "" FORCE) + +qt5_wrap_cpp(moc_files mywidget.h) +qt5_wrap_ui(ui_files mywidget.ui) +qt5_add_resources(qrc_files res.qrc) + +add_executable(mywidget + # source files + mywidget.cpp + mywidget.h + mywidget.ui + res.qrc + + # generated files + ${moc_files} + ${ui_files} + ${qrc_files} +) +target_link_libraries(mywidget ${Qt5Widgets_LIBRARIES}) diff --git a/tests/auto/cmake/test_QTBUG-63422/mywidget.cpp b/tests/auto/cmake/test_QTBUG-63422/mywidget.cpp new file mode 100644 index 0000000000..7bc42537d5 --- /dev/null +++ b/tests/auto/cmake/test_QTBUG-63422/mywidget.cpp @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Kevin Funk +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "mywidget.h" +#include "ui_mywidget.h" + +MyWidget::MyWidget(QWidget *parent) + : QWidget(parent) +{ + emit someSignal(); +} + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + MyWidget myWidget; + return 0; +} diff --git a/tests/auto/cmake/test_QTBUG-63422/mywidget.h b/tests/auto/cmake/test_QTBUG-63422/mywidget.h new file mode 100644 index 0000000000..d0c79c0538 --- /dev/null +++ b/tests/auto/cmake/test_QTBUG-63422/mywidget.h @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Kevin Funk +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef MYWIDGET_H +#define MYWIDGET_H + +#include + +namespace Ui +{ +class MyWidget; +} + +class MyWidget : public QWidget +{ + Q_OBJECT +public: + MyWidget(QWidget *parent = nullptr); + +signals: + void someSignal(); + +private: + Ui::MyWidget *ui = nullptr; +}; + +#endif diff --git a/tests/auto/cmake/test_QTBUG-63422/mywidget.ui b/tests/auto/cmake/test_QTBUG-63422/mywidget.ui new file mode 100644 index 0000000000..ac42ac4dc2 --- /dev/null +++ b/tests/auto/cmake/test_QTBUG-63422/mywidget.ui @@ -0,0 +1,34 @@ + + + Form + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + PushButton + + + + + + + + + + + + + + diff --git a/tests/auto/cmake/test_QTBUG-63422/res.qrc b/tests/auto/cmake/test_QTBUG-63422/res.qrc new file mode 100644 index 0000000000..4ca9cd5837 --- /dev/null +++ b/tests/auto/cmake/test_QTBUG-63422/res.qrc @@ -0,0 +1,4 @@ + + + + -- cgit v1.2.3 From a6d7f38791bd4627314be2c93d0989116413830e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 18 Dec 2016 14:35:11 +0000 Subject: QHeaderView: Simplify and fix layoutChange handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A layoutChange indicates that anything can have moved to anywhere else, including as a result purely of new items being added. It can also indicate that items are removed. The old code here incorrectly assumed that the section count remained constant over this operation by setting the size of the oldSectionHidden QBitArray - whose size is the size before the layoutChange operation - and then calling setBit with model rows numbered after the layoutChange operation. As the two are not necessarily the same dimensions, this can result in asserts from the setBit call. Simplify the handling of layoutChanged entirely by clearing section information, and using the QPersistentIndexes which indicate hidden state to restore that state after re-population. Task-number: QTBUG-53221 Change-Id: I3cda13e86b51b3029b37b647a48748fb604db252 Reviewed-by: Thorbjørn Lund Martsum --- .../itemviews/qheaderview/tst_qheaderview.cpp | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp index fa543ae2c3..90019a1798 100644 --- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp @@ -210,6 +210,7 @@ private slots: void QTBUG12268_hiddenMovedSectionSorting(); void QTBUG14242_hideSectionAutoSize(); void QTBUG50171_visualRegionForSwappedItems(); + void QTBUG53221_assertShiftHiddenRow(); void ensureNoIndexAtLength(); void offsetConsistent(); @@ -2384,6 +2385,54 @@ void tst_QHeaderView::QTBUG50171_visualRegionForSwappedItems() headerView.testVisualRegionForSelection(); } +class QTBUG53221_Model : public QAbstractItemModel +{ +public: + void insertRowAtBeginning() + { + Q_EMIT layoutAboutToBeChanged(); + m_displayNames.insert(0, QStringLiteral("Item %1").arg(m_displayNames.count())); + // Rows are always inserted at the beginning, so move all others. + foreach (const QModelIndex &persIndex, persistentIndexList()) + { + // The vertical header view will have a persistent index stored here on the second call to insertRowAtBeginning. + changePersistentIndex(persIndex, index(persIndex.row() + 1, persIndex.column(), persIndex.parent())); + } + Q_EMIT layoutChanged(); + } + + QVariant data(const QModelIndex &index, int role) const override + { + return (role == Qt::DisplayRole) ? m_displayNames.at(index.row()) : QVariant(); + } + + QModelIndex index(int row, int column, const QModelIndex &) const override { return createIndex(row, column); } + QModelIndex parent(const QModelIndex &) const override { return QModelIndex(); } + int rowCount(const QModelIndex &) const override { return m_displayNames.count(); } + int columnCount(const QModelIndex &) const override { return 1; } + +private: + QStringList m_displayNames; +}; + +void tst_QHeaderView::QTBUG53221_assertShiftHiddenRow() +{ + QTableView tableView; + QTBUG53221_Model modelTableView; + tableView.setModel(&modelTableView); + + modelTableView.insertRowAtBeginning(); + tableView.setRowHidden(0, true); + QCOMPARE(tableView.verticalHeader()->isSectionHidden(0), true); + modelTableView.insertRowAtBeginning(); + QCOMPARE(tableView.verticalHeader()->isSectionHidden(0), false); + QCOMPARE(tableView.verticalHeader()->isSectionHidden(1), true); + modelTableView.insertRowAtBeginning(); + QCOMPARE(tableView.verticalHeader()->isSectionHidden(0), false); + QCOMPARE(tableView.verticalHeader()->isSectionHidden(1), false); + QCOMPARE(tableView.verticalHeader()->isSectionHidden(2), true); +} + void protected_QHeaderView::testVisualRegionForSelection() { QRegion r = visualRegionForSelection(QItemSelection(model()->index(1, 0), model()->index(1, 2))); -- cgit v1.2.3 From 5a235da270a4ea65b7ef1edf31a761c41dbfcc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 22 Nov 2017 14:16:42 +0100 Subject: tst_QTcpSocket: fix disconnectWhileLookingUp ... and unblacklist it on Windows. From what I can tell there is no particular reason why this test fails other than that it is a little too slow sometimes (these things happen). So, to fix the test I bumped the timeout, but to avoid the test running for longer on every test-run it now also ends when the socket enters the "Unconnected" state. Previously it failed 171/500 times, and after this patch it failed 0/1000 times. Change-Id: I4266bff6b91aaaf502ee66265d01c3a177706402 Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira Reviewed-by: Jesus Fernandez --- tests/auto/network/socket/qtcpsocket/BLACKLIST | 2 -- tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | 9 ++++++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/network/socket/qtcpsocket/BLACKLIST b/tests/auto/network/socket/qtcpsocket/BLACKLIST index 5fc2589323..96e59e5678 100644 --- a/tests/auto/network/socket/qtcpsocket/BLACKLIST +++ b/tests/auto/network/socket/qtcpsocket/BLACKLIST @@ -6,8 +6,6 @@ windows windows [invalidProxy:socks5-on-http] windows -[disconnectWhileLookingUp] -windows [timeoutConnect:ip] windows ] diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index 7340817ade..f64a88cc05 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -1447,8 +1447,15 @@ void tst_QTcpSocket::disconnectWhileLookingUp() } // let anything queued happen + QEventLoop loop; - QTimer::singleShot(50, &loop, SLOT(quit())); + // If 'doClose' is false then we called '::waitForDisconnected' earlier, meaning + // we are already 'Unconnected'. So we don't need to wait for any potentially slow host lookups. + QTimer::singleShot(doClose ? 4000 : 50, &loop, SLOT(quit())); + connect(socket, &QTcpSocket::stateChanged, [&loop](QAbstractSocket::SocketState state) { + if (state == QAbstractSocket::UnconnectedState) + loop.exit(); // we don't need to wait for the timer to expire; we're done. + }); loop.exec(); // recheck -- cgit v1.2.3 From 3587a25238b5c0a53285f96383ed0af1c05b3153 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sat, 18 Nov 2017 18:21:13 +0100 Subject: QFlags: support enum classes in setFlag() Unary ~ is not defined for enum classes, so we need a cast. Change-Id: I79d495ebcc24ab960da8dae3be08eb307a9de448 Reviewed-by: Thiago Macieira --- tests/auto/corelib/global/qflags/tst_qflags.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/corelib/global/qflags/tst_qflags.cpp b/tests/auto/corelib/global/qflags/tst_qflags.cpp index 7dd1a1be01..2f1b56629a 100644 --- a/tests/auto/corelib/global/qflags/tst_qflags.cpp +++ b/tests/auto/corelib/global/qflags/tst_qflags.cpp @@ -290,6 +290,18 @@ void tst_QFlags::testSetFlags() btn.setFlag(Qt::LeftButton, false); QVERIFY(!btn.testFlag(Qt::LeftButton)); QVERIFY(!btn.testFlag(Qt::MidButton)); + + MyStrictFlags flags; + flags.setFlag(MyStrictEnum::StrictOne); + flags.setFlag(MyStrictEnum::StrictTwo, true); + QVERIFY(flags.testFlag(MyStrictEnum::StrictOne)); + QVERIFY(flags.testFlag(MyStrictEnum::StrictTwo)); + QVERIFY(!flags.testFlag(MyStrictEnum::StrictFour)); + + flags.setFlag(MyStrictEnum::StrictTwo, false); + QVERIFY(flags.testFlag(MyStrictEnum::StrictOne)); + QVERIFY(!flags.testFlag(MyStrictEnum::StrictTwo)); + QVERIFY(!flags.testFlag(MyStrictEnum::StrictFour)); } // (statically) check QTypeInfo for QFlags instantiations: -- cgit v1.2.3 From fa2a653b3b934783065bb3ea264788e9f8bbdc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 14 Apr 2017 15:13:28 +0200 Subject: Initialize QLoggingRegistry rules on first use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows categorized logging before QCoreApplication has been created, which otherwise would silently fail to output anything because the category would never be enabled, despite QT_LOGGING_RULES being set. Change-Id: I1861e5366ea980dff2ffa753b137276c77278eee Reviewed-by: Kai Koehne Reviewed-by: Morten Johan Sørvig --- .../io/qloggingregistry/tst_qloggingregistry.cpp | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp index 1643eed3d2..15c63d4acd 100644 --- a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp +++ b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp @@ -197,10 +197,22 @@ private slots: // Check whether QT_LOGGING_CONF is picked up from environment // - qputenv("QT_LOGGING_CONF", QFINDTESTDATA("qtlogging.ini").toLocal8Bit()); + Q_ASSERT(!qApp); // Rules should not require an app to resolve - QLoggingRegistry registry; - registry.init(); + qputenv("QT_LOGGING_RULES", "qt.foo.bar=true"); + QLoggingCategory qtEnabledByLoggingRule("qt.foo.bar"); + QCOMPARE(qtEnabledByLoggingRule.isDebugEnabled(), true); + QLoggingCategory qtDisabledByDefault("qt.foo.baz"); + QCOMPARE(qtDisabledByDefault.isDebugEnabled(), false); + + QLoggingRegistry ®istry = *QLoggingRegistry::instance(); + QCOMPARE(registry.ruleSets[QLoggingRegistry::ApiRules].size(), 0); + QCOMPARE(registry.ruleSets[QLoggingRegistry::ConfigRules].size(), 0); + QCOMPARE(registry.ruleSets[QLoggingRegistry::EnvironmentRules].size(), 1); + + qunsetenv("QT_LOGGING_RULES"); + qputenv("QT_LOGGING_CONF", QFINDTESTDATA("qtlogging.ini").toLocal8Bit()); + registry.initalizeRules(); QCOMPARE(registry.ruleSets[QLoggingRegistry::ApiRules].size(), 0); QCOMPARE(registry.ruleSets[QLoggingRegistry::ConfigRules].size(), 0); @@ -208,7 +220,7 @@ private slots: // check that QT_LOGGING_RULES take precedence qputenv("QT_LOGGING_RULES", "Digia.*=true"); - registry.init(); + registry.initalizeRules(); QCOMPARE(registry.ruleSets[QLoggingRegistry::EnvironmentRules].size(), 2); QCOMPARE(registry.ruleSets[QLoggingRegistry::EnvironmentRules].at(1).enabled, true); } @@ -234,7 +246,7 @@ private slots: file.close(); QLoggingRegistry registry; - registry.init(); + registry.initalizeRules(); QCOMPARE(registry.ruleSets[QLoggingRegistry::ConfigRules].size(), 1); // remove file again @@ -300,6 +312,6 @@ private slots: } }; -QTEST_MAIN(tst_QLoggingRegistry) +QTEST_APPLESS_MAIN(tst_QLoggingRegistry) #include "tst_qloggingregistry.moc" -- cgit v1.2.3 From 5f66f871816d083da9795d71f746413d6f6118f7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 26 Nov 2017 23:01:57 -0800 Subject: Stop depending on test.macieira.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have had test.qt-project.org for close to 3 years now. Change-Id: I71488efd29b645f7b228fffd14fadf4627288243 Reviewed-by: Jędrzej Nowacki --- .../auto/network/kernel/qdnslookup_appless/tst_qdnslookup_appless.cpp | 4 ++-- tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/network/kernel/qdnslookup_appless/tst_qdnslookup_appless.cpp b/tests/auto/network/kernel/qdnslookup_appless/tst_qdnslookup_appless.cpp index 7874221da9..e302fe8c74 100644 --- a/tests/auto/network/kernel/qdnslookup_appless/tst_qdnslookup_appless.cpp +++ b/tests/auto/network/kernel/qdnslookup_appless/tst_qdnslookup_appless.cpp @@ -43,7 +43,7 @@ private slots: void tst_QDnsLookup_Appless::noApplication() { QTest::ignoreMessage(QtWarningMsg, "QDnsLookup requires a QCoreApplication"); - QDnsLookup dns(QDnsLookup::A, "a-single.test.macieira.org"); + QDnsLookup dns(QDnsLookup::A, "a-single.test.qt-project.org"); dns.lookup(); } @@ -53,7 +53,7 @@ void tst_QDnsLookup_Appless::recreateApplication() char **argv = 0; for (int i = 0; i < 10; ++i) { QCoreApplication app(argc, argv); - QDnsLookup dns(QDnsLookup::A, "a-single.test.macieira.org"); + QDnsLookup dns(QDnsLookup::A, "a-single.test.qt-project.org"); dns.lookup(); if (!dns.isFinished()) { QObject::connect(&dns, SIGNAL(finished()), diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp index 2671c253cb..14bffaf7ca 100644 --- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp @@ -76,7 +76,7 @@ #include "../../../network-settings.h" -#define TEST_DOMAIN ".test.macieira.org" +#define TEST_DOMAIN ".test.qt-project.org" class tst_QHostInfo : public QObject -- cgit v1.2.3