summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/macgui/tst_gui.cpp7
-rw-r--r--tests/auto/qfuture/tst_qfuture.cpp2
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp4
-rw-r--r--tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp2
-rw-r--r--tests/auto/qimage/tst_qimage.cpp6
-rw-r--r--tests/auto/qitemmodel/tst_qitemmodel.cpp2
-rw-r--r--tests/auto/qitemview/tst_qitemview.cpp2
-rw-r--r--tests/auto/qmake/testcompiler.cpp6
-rw-r--r--tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp3
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp6
-rw-r--r--tests/auto/qprinter/tst_qprinter.cpp5
-rw-r--r--tests/auto/qsharedpointer/tst_qsharedpointer.cpp137
-rw-r--r--tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp4
-rw-r--r--tests/auto/qsplitter/tst_qsplitter.cpp5
-rw-r--r--tests/auto/qtessellator/testtessellator.cpp2
-rw-r--r--tests/auto/qtessellator/tst_tessellator.cpp8
-rw-r--r--tests/auto/qtessellator/utils.cpp2
-rw-r--r--tests/auto/qthreadonce/tst_qthreadonce.cpp2
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp1
19 files changed, 161 insertions, 45 deletions
diff --git a/tests/auto/macgui/tst_gui.cpp b/tests/auto/macgui/tst_gui.cpp
index b302f8b..641e596 100644
--- a/tests/auto/macgui/tst_gui.cpp
+++ b/tests/auto/macgui/tst_gui.cpp
@@ -69,8 +69,7 @@ private slots:
QPixmap grabWindowContents(QWidget * widget)
{
- const int titleBarHeight = widget->frameGeometry().height() - widget->height();
- return QPixmap::grabWindow(widget->winId(), 0, titleBarHeight, -1, widget->height());
+ return QPixmap::grabWindow(widget->winId());
}
/*
@@ -79,10 +78,6 @@ QPixmap grabWindowContents(QWidget * widget)
*/
void tst_gui::scrollbarPainting()
{
-#if defined (Q_WS_MAC) && defined (__i386__)
- QSKIP("This test fails on scruffy when run by the autotest system (but not when you run it manually).", SkipAll);
-#endif
-
ColorWidget colorWidget;
colorWidget.resize(400, 400);
diff --git a/tests/auto/qfuture/tst_qfuture.cpp b/tests/auto/qfuture/tst_qfuture.cpp
index 43fd614..383ecba 100644
--- a/tests/auto/qfuture/tst_qfuture.cpp
+++ b/tests/auto/qfuture/tst_qfuture.cpp
@@ -45,7 +45,7 @@
#include <QtTest/QtTest>
#include <qfuture.h>
-#include <versioncheck.h>
+#include "versioncheck.h"
#include <qfuturewatcher.h>
#include <qtconcurrentresultstore.h>
#include <qtconcurrentexception.h>
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index da99c30..0c5ebf6 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -47,6 +47,7 @@
#include <QtGui>
#include <math.h>
+#include "../../shared/util.h"
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
#include <windows.h>
@@ -3537,8 +3538,7 @@ void tst_QGraphicsScene::changedSignal()
scene.addItem(rect);
QCOMPARE(cl.changes.size(), 0);
- qApp->processEvents();
- QCOMPARE(cl.changes.size(), 1);
+ QTRY_COMPARE(cl.changes.size(), 1);
QCOMPARE(cl.changes.at(0).size(), 1);
QCOMPARE(cl.changes.at(0).first(), QRectF(0, 0, 10, 10));
diff --git a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp
index 4c92119..7eaf7c7 100644
--- a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp
+++ b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp
@@ -529,7 +529,7 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest()
// Read greeting
QVERIFY(!tcpSocketNonBlocking_data.isEmpty());
QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(),
- "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n");
+ "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
tcpSocketNonBlocking_data.clear();
tcpSocketNonBlocking_totalWritten = 0;
diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp
index ee4ece2..88bbb50 100644
--- a/tests/auto/qimage/tst_qimage.cpp
+++ b/tests/auto/qimage/tst_qimage.cpp
@@ -1454,9 +1454,9 @@ void tst_QImage::smoothScale3()
QRgb cb = b.pixel(x, y);
// tolerate a little bit of rounding errors
- QVERIFY(compare(qRed(ca), qRed(cb), 2));
- QVERIFY(compare(qGreen(ca), qGreen(cb), 2));
- QVERIFY(compare(qBlue(ca), qBlue(cb), 2));
+ QVERIFY(compare(qRed(ca), qRed(cb), 3));
+ QVERIFY(compare(qGreen(ca), qGreen(cb), 3));
+ QVERIFY(compare(qBlue(ca), qBlue(cb), 3));
}
}
}
diff --git a/tests/auto/qitemmodel/tst_qitemmodel.cpp b/tests/auto/qitemmodel/tst_qitemmodel.cpp
index ea1972e..d29a3e3 100644
--- a/tests/auto/qitemmodel/tst_qitemmodel.cpp
+++ b/tests/auto/qitemmodel/tst_qitemmodel.cpp
@@ -54,7 +54,7 @@
#include <QtTest/QtTest>
#include <QtCore>
#include <qdebug.h>
-#include <modelstotest.cpp>
+#include "modelstotest.cpp"
#include <QMetaType>
Q_DECLARE_METATYPE(QModelIndex)
diff --git a/tests/auto/qitemview/tst_qitemview.cpp b/tests/auto/qitemview/tst_qitemview.cpp
index 748bd50..3317c1d 100644
--- a/tests/auto/qitemview/tst_qitemview.cpp
+++ b/tests/auto/qitemview/tst_qitemview.cpp
@@ -42,7 +42,7 @@
#include <QtTest/QtTest>
#include <QtCore/QtCore>
-#include <viewstotest.cpp>
+#include "viewstotest.cpp"
#include <stdlib.h>
#if defined(Q_OS_WIN)
diff --git a/tests/auto/qmake/testcompiler.cpp b/tests/auto/qmake/testcompiler.cpp
index 122a2b8..7255d93 100644
--- a/tests/auto/qmake/testcompiler.cpp
+++ b/tests/auto/qmake/testcompiler.cpp
@@ -56,10 +56,8 @@ static QString targetName( BuildType buildMode, const QString& target, const QSt
targetName.append(".exe");
break;
case Dll: // dll
- if (version != "") {
- QStringList ver = QStringList::split(".", version);
- targetName.append(ver.first());
- }
+ if (!version.empty())
+ targetName.append(version.section(".", 0, 0));
targetName.append(".dll");
break;
case Lib: // lib
diff --git a/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
index fc15437..2383767 100644
--- a/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
+++ b/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
@@ -389,7 +389,8 @@ void tst_QNetworkDiskCache::expire()
qint64 max = cache.maximumCacheSize();
QCOMPARE(max, limit);
for (int i = 0; i < 10; ++i) {
- QTest::qWait(2000);
+ if (i % 3 == 0)
+ QTest::qWait(2000);
QNetworkCacheMetaData m;
m.setUrl(QUrl("http://www.foo.com/" + QString::number(i)));
QIODevice *d = cache.prepare(m);
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 23a6025..b76a4e6 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -3136,7 +3136,8 @@ void tst_QNetworkReply::downloadProgress()
QVERIFY(spy.isValid());
QCoreApplication::instance()->processEvents();
- server.waitForNewConnection(0); // ignore result, since processEvents may have got it
+ if (!server.hasPendingConnections())
+ server.waitForNewConnection(1000);
QVERIFY(server.hasPendingConnections());
QCOMPARE(spy.count(), 0);
@@ -3191,7 +3192,8 @@ void tst_QNetworkReply::uploadProgress()
QVERIFY(finished.isValid());
QCoreApplication::instance()->processEvents();
- server.waitForNewConnection(0); // ignore result, since processEvents may have got it
+ if (!server.hasPendingConnections())
+ server.waitForNewConnection(1000);
QVERIFY(server.hasPendingConnections());
QTcpSocket *receiver = server.nextPendingConnection();
diff --git a/tests/auto/qprinter/tst_qprinter.cpp b/tests/auto/qprinter/tst_qprinter.cpp
index cde4ae5..221e3b0 100644
--- a/tests/auto/qprinter/tst_qprinter.cpp
+++ b/tests/auto/qprinter/tst_qprinter.cpp
@@ -953,8 +953,9 @@ void tst_QPrinter::printDialogCompleter()
QTest::qWait(100);
- QTest::keyClick(0, Qt::Key_Tab);
- QTest::keyClick(0, 'P');
+ QTest::keyClick(&dialog, Qt::Key_Tab);
+ QTest::keyClick(&dialog, 'P');
+ // The test passes if it doesn't crash.
#endif
}
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
index 64439fb..a52bb3e 100644
--- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
@@ -57,8 +57,11 @@ private slots:
void downCast();
void upCast();
void differentPointers();
+ void virtualBaseDifferentPointers();
#ifndef QTEST_NO_RTTI
void dynamicCast();
+ void dynamicCastDifferentPointers();
+ void dynamicCastVirtualBase();
void dynamicCastFailure();
#endif
void customDeleter();
@@ -321,6 +324,10 @@ class DiffPtrDerivedData: public Stuffing, public Data
{
};
+class VirtualDerived: virtual public Data
+{
+};
+
void tst_QSharedPointer::downCast()
{
{
@@ -439,7 +446,7 @@ void tst_QSharedPointer::differentPointers()
DiffPtrDerivedData *aData = new DiffPtrDerivedData;
Data *aBase = aData;
Q_ASSERT(aData == aBase);
- Q_ASSERT(quintptr(&aData) != quintptr(&aBase));
+ Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase));
QSharedPointer<Data> baseptr = QSharedPointer<Data>(aData);
QSharedPointer<DiffPtrDerivedData> ptr = qSharedPointerCast<DiffPtrDerivedData>(baseptr);
@@ -453,7 +460,7 @@ void tst_QSharedPointer::differentPointers()
DiffPtrDerivedData *aData = new DiffPtrDerivedData;
Data *aBase = aData;
Q_ASSERT(aData == aBase);
- Q_ASSERT(quintptr(&aData) != quintptr(&aBase));
+ Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase));
QSharedPointer<DiffPtrDerivedData> ptr = QSharedPointer<DiffPtrDerivedData>(aData);
QSharedPointer<Data> baseptr = ptr;
@@ -464,23 +471,53 @@ void tst_QSharedPointer::differentPointers()
QVERIFY(baseptr == aData);
QVERIFY(baseptr == aBase);
}
+}
+
+void tst_QSharedPointer::virtualBaseDifferentPointers()
+{
+ {
+ VirtualDerived *aData = new VirtualDerived;
+ Data *aBase = aData;
+ Q_ASSERT(aData == aBase);
+ Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase));
+
+ QSharedPointer<VirtualDerived> ptr = QSharedPointer<VirtualDerived>(aData);
+ QSharedPointer<Data> baseptr = qSharedPointerCast<Data>(ptr);
+ QVERIFY(ptr == baseptr);
+ QVERIFY(ptr.data() == baseptr.data());
+ QVERIFY(ptr == aBase);
+ QVERIFY(ptr == aData);
+ QVERIFY(baseptr == aData);
+ QVERIFY(baseptr == aBase);
+ }
+
+ {
+ VirtualDerived *aData = new VirtualDerived;
+ Data *aBase = aData;
+ Q_ASSERT(aData == aBase);
+ Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase));
- // there is no possibility for different pointers in
- // internal reference counting right now
- //
- // to do that, it's necessary to first implement the ability to
- // call (virtual) functions, so that the two differing bases have
- // the same reference counter
+ QSharedPointer<VirtualDerived> ptr = QSharedPointer<VirtualDerived>(aData);
+ QSharedPointer<Data> baseptr = ptr;
+ QVERIFY(ptr == baseptr);
+ QVERIFY(ptr.data() == baseptr.data());
+ QVERIFY(ptr == aBase);
+ QVERIFY(ptr == aData);
+ QVERIFY(baseptr == aData);
+ QVERIFY(baseptr == aBase);
+ }
}
#ifndef QTEST_NO_RTTI
void tst_QSharedPointer::dynamicCast()
{
- QSharedPointer<Data> baseptr = QSharedPointer<Data>(new DerivedData);
+ DerivedData *aData = new DerivedData;
+ QSharedPointer<Data> baseptr = QSharedPointer<Data>(aData);
{
QSharedPointer<DerivedData> derivedptr = qSharedPointerDynamicCast<DerivedData>(baseptr);
QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
QCOMPARE(int(baseptr.d->weakref), 1);
@@ -490,6 +527,7 @@ void tst_QSharedPointer::dynamicCast()
QWeakPointer<Data> weakptr = baseptr;
QSharedPointer<DerivedData> derivedptr = qSharedPointerDynamicCast<DerivedData>(weakptr);
QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
QCOMPARE(int(baseptr.d->weakref), 1);
@@ -498,6 +536,87 @@ void tst_QSharedPointer::dynamicCast()
{
QSharedPointer<DerivedData> derivedptr = baseptr.dynamicCast<DerivedData>();
QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
+ QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
+ }
+ QCOMPARE(int(baseptr.d->weakref), 1);
+ QCOMPARE(int(baseptr.d->strongref), 1);
+}
+
+void tst_QSharedPointer::dynamicCastDifferentPointers()
+{
+ // DiffPtrDerivedData derives from both Data and Stuffing
+ DiffPtrDerivedData *aData = new DiffPtrDerivedData;
+ QSharedPointer<Data> baseptr = QSharedPointer<Data>(aData);
+
+ {
+ QSharedPointer<DiffPtrDerivedData> derivedptr = qSharedPointerDynamicCast<DiffPtrDerivedData>(baseptr);
+ QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
+ QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
+ }
+ QCOMPARE(int(baseptr.d->weakref), 1);
+ QCOMPARE(int(baseptr.d->strongref), 1);
+
+ {
+ QWeakPointer<Data> weakptr = baseptr;
+ QSharedPointer<DiffPtrDerivedData> derivedptr = qSharedPointerDynamicCast<DiffPtrDerivedData>(weakptr);
+ QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
+ QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
+ }
+ QCOMPARE(int(baseptr.d->weakref), 1);
+ QCOMPARE(int(baseptr.d->strongref), 1);
+
+ {
+ QSharedPointer<DiffPtrDerivedData> derivedptr = baseptr.dynamicCast<DiffPtrDerivedData>();
+ QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
+ QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
+ }
+ QCOMPARE(int(baseptr.d->weakref), 1);
+ QCOMPARE(int(baseptr.d->strongref), 1);
+
+ {
+ Stuffing *nakedptr = dynamic_cast<Stuffing *>(baseptr.data());
+ QVERIFY(nakedptr);
+
+ QSharedPointer<Stuffing> otherbaseptr = qSharedPointerDynamicCast<Stuffing>(baseptr);
+ QVERIFY(!otherbaseptr.isNull());
+ QVERIFY(otherbaseptr == nakedptr);
+ QCOMPARE(otherbaseptr.data(), nakedptr);
+ QCOMPARE(static_cast<DiffPtrDerivedData*>(otherbaseptr.data()), aData);
+ }
+}
+
+void tst_QSharedPointer::dynamicCastVirtualBase()
+{
+ VirtualDerived *aData = new VirtualDerived;
+ QSharedPointer<Data> baseptr = QSharedPointer<Data>(aData);
+
+ {
+ QSharedPointer<VirtualDerived> derivedptr = qSharedPointerDynamicCast<VirtualDerived>(baseptr);
+ QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
+ QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
+ }
+ QCOMPARE(int(baseptr.d->weakref), 1);
+ QCOMPARE(int(baseptr.d->strongref), 1);
+
+ {
+ QWeakPointer<Data> weakptr = baseptr;
+ QSharedPointer<VirtualDerived> derivedptr = qSharedPointerDynamicCast<VirtualDerived>(weakptr);
+ QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
+ QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
+ }
+ QCOMPARE(int(baseptr.d->weakref), 1);
+ QCOMPARE(int(baseptr.d->strongref), 1);
+
+ {
+ QSharedPointer<VirtualDerived> derivedptr = baseptr.dynamicCast<VirtualDerived>();
+ QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
QCOMPARE(int(baseptr.d->weakref), 1);
diff --git a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp
index 470f897..f501e78 100644
--- a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp
+++ b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp
@@ -593,7 +593,7 @@ void tst_QSocks5SocketEngine::tcpSocketBlockingTest()
// Read greeting
QVERIFY(socket.waitForReadyRead(5000));
QString s = socket.readLine();
- QCOMPARE(s.toLatin1().constData(), "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n");
+ QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
// Write NOOP
QCOMPARE((int) socket.write("1 NOOP\r\n", 8), 8);
@@ -668,7 +668,7 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest()
// Read greeting
QVERIFY(!tcpSocketNonBlocking_data.isEmpty());
QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(),
- "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n");
+ "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
tcpSocketNonBlocking_data.clear();
tcpSocketNonBlocking_totalWritten = 0;
diff --git a/tests/auto/qsplitter/tst_qsplitter.cpp b/tests/auto/qsplitter/tst_qsplitter.cpp
index 33404e4..5fa0286 100644
--- a/tests/auto/qsplitter/tst_qsplitter.cpp
+++ b/tests/auto/qsplitter/tst_qsplitter.cpp
@@ -55,6 +55,7 @@
#include <qtreeview.h>
#include <qlabel.h>
#include <qdebug.h> // for file error messages
+#include "../../shared/util.h"
//TESTED_CLASS=
//TESTED_FILES=
@@ -1341,9 +1342,7 @@ void tst_QSplitter::task187373_addAbstractScrollAreas()
if (addOutsideConstructor)
splitter->addWidget(w);
- qApp->processEvents();
-
- QVERIFY(w->isVisible());
+ QTRY_VERIFY(w->isVisible());
QVERIFY(!w->isHidden());
QVERIFY(w->viewport()->isVisible());
QVERIFY(!w->viewport()->isHidden());
diff --git a/tests/auto/qtessellator/testtessellator.cpp b/tests/auto/qtessellator/testtessellator.cpp
index bd2795c..423c1e8 100644
--- a/tests/auto/qtessellator/testtessellator.cpp
+++ b/tests/auto/qtessellator/testtessellator.cpp
@@ -38,7 +38,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <testtessellator.h>
+#include "testtessellator.h"
#include <private/qtessellator_p.h>
#include "math.h"
diff --git a/tests/auto/qtessellator/tst_tessellator.cpp b/tests/auto/qtessellator/tst_tessellator.cpp
index 8958ac3..8899285 100644
--- a/tests/auto/qtessellator/tst_tessellator.cpp
+++ b/tests/auto/qtessellator/tst_tessellator.cpp
@@ -218,8 +218,8 @@ void tst_QTessellator::testArc()
const int stop = 1000;
#endif
for (int i = 0; i < stop; ++i) {
- mat.rotate(.01);
- mat.scale(.99, .99);
+ mat.rotate(qreal(.01));
+ mat.scale(qreal(.99), qreal(.99));
QPolygonF poly = arc.at(0);
QPolygonF vec = poly * mat;
QVERIFY(test_arc(vec, true));
@@ -361,11 +361,11 @@ void tst_QTessellator::testRects()
QVector<QPointF> v(5);
for (int i = 0; i < 5; ++i)
v[i] = vec[5 * rect + i];
- if (!test(v.data(), v.size(), false, test_tessellate_polygon_rect, 0.05)) {
+ if (!test(v.data(), v.size(), false, test_tessellate_polygon_rect, qreal(0.05))) {
simplifyTestFailure(v, false);
++failures;
}
- if (!test(v.data(), v.size(), true, test_tessellate_polygon_rect, 0.05)) {
+ if (!test(v.data(), v.size(), true, test_tessellate_polygon_rect, qreal(0.05))) {
simplifyTestFailure(v, true);
++failures;
}
diff --git a/tests/auto/qtessellator/utils.cpp b/tests/auto/qtessellator/utils.cpp
index 8a9dc1e..d408193 100644
--- a/tests/auto/qtessellator/utils.cpp
+++ b/tests/auto/qtessellator/utils.cpp
@@ -43,7 +43,7 @@
#include <assert.h>
#include <qglobal.h>
-#include <qnum.h>
+#include "qnum.h"
#define FloatToXFixed(i) (int)((i) * 65536)
#define IntToXFixed(i) ((i) << 16)
diff --git a/tests/auto/qthreadonce/tst_qthreadonce.cpp b/tests/auto/qthreadonce/tst_qthreadonce.cpp
index 7e67dc3..f20788a 100644
--- a/tests/auto/qthreadonce/tst_qthreadonce.cpp
+++ b/tests/auto/qthreadonce/tst_qthreadonce.cpp
@@ -46,7 +46,7 @@
#include <qmutex.h>
#include <qthread.h>
#include <qwaitcondition.h>
-#include <qthreadonce.h>
+#include "qthreadonce.h"
//TESTED_CLASS=
//TESTED_FILES=corelib/thread/qthreadonce.h corelib/thread/qthreadonce.cpp
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index efdaaec..23ead01 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -8412,6 +8412,7 @@ void tst_QWidget::translucentWidget()
ColorRedWidget label;
label.setFixedSize(16,16);
label.setAttribute(Qt::WA_TranslucentBackground);
+ label.move(qApp->desktop()->availableGeometry().topLeft());
label.show();
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&label);