summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/other')
-rw-r--r--tests/auto/other/compiler/tst_compiler.cpp2
-rw-r--r--tests/auto/other/lancelot/paintcommands.h1
-rw-r--r--tests/auto/other/lancelot/scripts/degeneratebeziers.qps11
-rw-r--r--tests/auto/other/networkselftest/tst_networkselftest.cpp5
-rw-r--r--tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp17
-rw-r--r--tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h2
-rw-r--r--tests/auto/other/qobjectrace/tst_qobjectrace.cpp8
7 files changed, 26 insertions, 20 deletions
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp
index b2b45bb237..de15f4c62d 100644
--- a/tests/auto/other/compiler/tst_compiler.cpp
+++ b/tests/auto/other/compiler/tst_compiler.cpp
@@ -842,7 +842,7 @@ void tst_Compiler::cxx11_constexpr()
static constexpr QBasicAtomicInt atomic = Q_BASIC_ATOMIC_INITIALIZER(1);
static constexpr int i = constexprValue();
QCOMPARE(i, constexprValue());
- QCOMPARE(atomic.load(), 1);
+ QCOMPARE(atomic.loadRelaxed(), 1);
#endif
}
diff --git a/tests/auto/other/lancelot/paintcommands.h b/tests/auto/other/lancelot/paintcommands.h
index 2923502e68..79bdab634a 100644
--- a/tests/auto/other/lancelot/paintcommands.h
+++ b/tests/auto/other/lancelot/paintcommands.h
@@ -37,7 +37,6 @@
#include <qpixmap.h>
#include <qbrush.h>
#include <qhash.h>
-#include <qregexp.h>
QT_FORWARD_DECLARE_CLASS(QPainter)
#ifndef QT_NO_OPENGL
diff --git a/tests/auto/other/lancelot/scripts/degeneratebeziers.qps b/tests/auto/other/lancelot/scripts/degeneratebeziers.qps
index 6c069fd82f..948968b0cd 100644
--- a/tests/auto/other/lancelot/scripts/degeneratebeziers.qps
+++ b/tests/auto/other/lancelot/scripts/degeneratebeziers.qps
@@ -34,3 +34,14 @@ setPen blue 40 solidline roundcap
drawPath revbez
setPen red 0
drawPath revbez
+
+resetMatrix
+path_lineTo tightJoin 60 10
+path_cubicTo tightJoin 50 0 100 0 100 50
+
+translate 50 500
+
+setPen green 40 solidline roundcap roundjoin
+drawPath tightJoin
+setPen red 0
+drawPath tightJoin
diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp
index dc353d2090..1b125d8825 100644
--- a/tests/auto/other/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp
@@ -29,6 +29,7 @@
#include <QtTest/QtTest>
#include <QtNetwork/QtNetwork>
#include <QtCore/QDateTime>
+#include <QtCore/QElapsedTimer>
#include <QtCore/QTextStream>
#include <QtCore/QRandomGenerator>
#include <QtCore/QStandardPaths>
@@ -195,7 +196,7 @@ static bool doSocketFlush(QTcpSocket *socket, int timeout = 4000)
#ifndef QT_NO_SSL
QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket);
#endif
- QTime timer;
+ QElapsedTimer timer;
timer.start();
int t = timeout;
forever {
@@ -421,7 +422,7 @@ void tst_NetworkSelfTest::serverReachability()
QTcpSocket socket;
socket.connectToHost(QtNetworkSettings::serverName(), 12346);
- QTime timer;
+ QElapsedTimer timer;
timer.start();
socket.waitForConnected(10000);
QVERIFY2(timer.elapsed() < 9900, "Connection to closed port timed out instead of refusing, something is wrong");
diff --git a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp
index fc979bce2d..c8698242d5 100644
--- a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp
+++ b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp
@@ -80,13 +80,9 @@ qint64 DynamicTreeModel::findParentId(qint64 searchId) const
if (searchId <= 0)
return -1;
- QHashIterator<qint64, QList<QList<qint64> > > i(m_childItems);
- while (i.hasNext()) {
- i.next();
- QListIterator<QList<qint64> > j(i.value());
- while (j.hasNext()) {
- QList<qint64> l = j.next();
- if (l.contains(searchId))
+ for (auto i = m_childItems.cbegin(), end = m_childItems.cend(); i != end; ++i) {
+ for (const auto &list : i.value()) {
+ if (list.contains(searchId))
return i.key();
}
}
@@ -163,13 +159,12 @@ ModelChangeCommand::ModelChangeCommand(DynamicTreeModel *model, QObject *parent)
{
}
-QModelIndex ModelChangeCommand::findIndex(QList<int> rows)
+QModelIndex ModelChangeCommand::findIndex(const QList<int> &rows) const
{
const int col = 0;
QModelIndex parent = QModelIndex();
- QListIterator<int> i(rows);
- while (i.hasNext()) {
- parent = m_model->index(i.next(), col, parent);
+ for (int row : rows) {
+ parent = m_model->index(row, col, parent);
if (!parent.isValid())
qFatal("%s: parent must be valid", Q_FUNC_INFO);
}
diff --git a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h
index 709751dd27..0807ffbe94 100644
--- a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h
+++ b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h
@@ -97,7 +97,7 @@ public:
m_rowNumbers = rowNumbers;
}
- QModelIndex findIndex(QList<int> rows);
+ QModelIndex findIndex(const QList<int> &rows) const;
void setStartRow(int row)
{
diff --git a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
index 22782f6b09..e09d304ff3 100644
--- a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
+++ b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
@@ -85,7 +85,7 @@ class RaceThread : public QThread
{
Q_OBJECT
RaceObject *object;
- QTime stopWatch;
+ QElapsedTimer stopWatch;
public:
RaceThread()
@@ -414,7 +414,7 @@ void tst_QObjectRace::disconnectRace()
{
enum { ThreadCount = 20, TimeLimit = 3000 };
- QCOMPARE(countedStructObjectsCount.load(), 0u);
+ QCOMPARE(countedStructObjectsCount.loadRelaxed(), 0u);
{
QScopedPointer<DisconnectRaceSenderObject> sender(new DisconnectRaceSenderObject());
@@ -440,7 +440,7 @@ void tst_QObjectRace::disconnectRace()
QVERIFY(senderThread->wait());
}
- QCOMPARE(countedStructObjectsCount.load(), 0u);
+ QCOMPARE(countedStructObjectsCount.loadRelaxed(), 0u);
{
QScopedPointer<DisconnectRaceSenderObject> sender(new DisconnectRaceSenderObject());
@@ -466,7 +466,7 @@ void tst_QObjectRace::disconnectRace()
}
}
- QCOMPARE(countedStructObjectsCount.load(), 0u);
+ QCOMPARE(countedStructObjectsCount.loadRelaxed(), 0u);
}
QTEST_MAIN(tst_QObjectRace)