summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-10-07 12:34:25 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-10-07 12:34:25 (GMT)
commit5695b50d2f21e94e8c284148367d2656d1158722 (patch)
treed29f2194a812a27d78f143bde046ae577d6c61ff /tests
parent350f97874544396a99cf82b47eb9a6e50838a88a (diff)
parent75b41faff44a1488d88eca6e910d4b617cb42221 (diff)
downloadQt-5695b50d2f21e94e8c284148367d2656d1158722.zip
Qt-5695b50d2f21e94e8c284148367d2656d1158722.tar.gz
Qt-5695b50d2f21e94e8c284148367d2656d1158722.tar.bz2
Merge commit 'qt/4.6' into mmfphonon
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/networkselftest/tst_networkselftest.cpp86
-rw-r--r--tests/auto/qabstractitemview/tst_qabstractitemview.cpp3
-rw-r--r--tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp279
-rw-r--r--tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp7
-rw-r--r--tests/auto/qicoimageformat/qicoimageformat.pro9
-rw-r--r--tests/auto/qicon/qicon.pro9
-rw-r--r--tests/auto/qimage/qimage.pro9
-rw-r--r--tests/auto/qimagereader/qimagereader.pro10
-rw-r--r--tests/auto/qimagewriter/qimagewriter.pro9
-rw-r--r--tests/auto/qitemmodel/qitemmodel.pro10
-rw-r--r--tests/auto/qmovie/qmovie.pro10
-rw-r--r--tests/auto/qscriptcontext/tst_qscriptcontext.cpp1
-rw-r--r--tests/auto/qscriptengine/qscriptengine.pro7
-rw-r--r--tests/auto/qscriptstring/tst_qscriptstring.cpp17
-rw-r--r--tests/auto/qsql/qsql.pro10
-rw-r--r--tests/auto/qsqldatabase/qsqldatabase.pro10
-rw-r--r--tests/auto/qsqldriver/qsqldriver.pro10
-rw-r--r--tests/auto/qsqlerror/qsqlerror.pro10
-rw-r--r--tests/auto/qsqlfield/qsqlfield.pro10
-rw-r--r--tests/auto/qsqlquery/qsqlquery.pro10
-rw-r--r--tests/auto/qsqlquerymodel/qsqlquerymodel.pro10
-rw-r--r--tests/auto/qsqlrecord/qsqlrecord.pro11
-rw-r--r--tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro10
-rw-r--r--tests/auto/qsqltablemodel/qsqltablemodel.pro10
-rw-r--r--tests/auto/qsqlthread/qsqlthread.pro10
-rw-r--r--tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp27
-rw-r--r--tests/auto/qtextstream/test/test.pro8
-rw-r--r--tests/auto/qurl/tst_qurl.cpp11
28 files changed, 537 insertions, 86 deletions
diff --git a/tests/auto/networkselftest/tst_networkselftest.cpp b/tests/auto/networkselftest/tst_networkselftest.cpp
index 4e60101..d58402b 100644
--- a/tests/auto/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/networkselftest/tst_networkselftest.cpp
@@ -54,10 +54,13 @@
class tst_NetworkSelfTest: public QObject
{
Q_OBJECT
+ QHostAddress cachedIpAddress;
public:
tst_NetworkSelfTest();
virtual ~tst_NetworkSelfTest();
+ QHostAddress serverIpAddress();
+
private slots:
void hostTest();
void dnsResolution_data();
@@ -325,6 +328,16 @@ tst_NetworkSelfTest::~tst_NetworkSelfTest()
{
}
+QHostAddress tst_NetworkSelfTest::serverIpAddress()
+{
+ if (cachedIpAddress.protocol() == QAbstractSocket::UnknownNetworkLayerProtocol) {
+ // need resolving
+ QHostInfo resolved = QHostInfo::fromName(QtNetworkSettings::serverName());
+ cachedIpAddress = resolved.addresses().first();
+ }
+ return cachedIpAddress;
+}
+
void tst_NetworkSelfTest::hostTest()
{
// this is a localhost self-test
@@ -353,14 +366,22 @@ void tst_NetworkSelfTest::dnsResolution()
QHostInfo resolved = QHostInfo::fromName(hostName);
QVERIFY2(resolved.error() == QHostInfo::NoError,
QString("Failed to resolve hostname %1: %2").arg(hostName, resolved.errorString()).toLocal8Bit());
+ QVERIFY2(resolved.addresses().size() > 0, "Got 0 addresses for server IP");
+
+ cachedIpAddress = resolved.addresses().first();
}
void tst_NetworkSelfTest::serverReachability()
{
- // check that we get a proper error connecting to port 1
+ // check that we get a proper error connecting to port 12346
QTcpSocket socket;
- socket.connectToHost(QtNetworkSettings::serverName(), 1);
+ socket.connectToHost(QtNetworkSettings::serverName(), 12346);
+
+ QTime timer;
+ timer.start();
socket.waitForConnected(10000);
+ QVERIFY2(timer.elapsed() < 9900, "Connection to closed port timed out instead of refusing, something is wrong");
+
QVERIFY2(socket.state() == QAbstractSocket::UnconnectedState, "Socket connected unexpectedly!");
QVERIFY2(socket.error() == QAbstractSocket::ConnectionRefusedError,
QString("Could not reach server: %1").arg(socket.errorString()).toLocal8Bit());
@@ -516,7 +537,18 @@ void tst_NetworkSelfTest::httpsServer()
void tst_NetworkSelfTest::httpProxy()
{
netChat(3128, QList<Chat>()
- // proxy GET
+ // proxy GET by IP
+ << Chat::send("GET http://" + serverIpAddress().toString().toLatin1() + "/ HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Proxy-connection: close\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("200 ")
+ << Chat::DiscardUntilDisconnect
+
+ // proxy GET by hostname
+ << Chat::Reconnect
<< Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n"
"Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
"Proxy-connection: close\r\n"
@@ -526,7 +558,17 @@ void tst_NetworkSelfTest::httpProxy()
<< Chat::expect("200 ")
<< Chat::DiscardUntilDisconnect
- // proxy CONNECT
+ // proxy CONNECT by IP
+ << Chat::Reconnect
+ << Chat::send("CONNECT " + serverIpAddress().toString().toLatin1() + ":21 HTTP/1.0\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("200 ")
+ << Chat::discardUntil("\r\n\r\n")
+ << ftpChat()
+
+ // proxy CONNECT by hostname
<< Chat::Reconnect
<< Chat::send("CONNECT " + QtNetworkSettings::serverName().toLatin1() + ":21 HTTP/1.0\r\n"
"\r\n")
@@ -534,7 +576,8 @@ void tst_NetworkSelfTest::httpProxy()
<< Chat::discardUntil(" ")
<< Chat::expect("200 ")
<< Chat::discardUntil("\r\n\r\n")
- << ftpChat());
+ << ftpChat()
+ );
}
void tst_NetworkSelfTest::httpProxyBasicAuth()
@@ -591,11 +634,22 @@ static const char handshakeAuthPassword[] = "\5\1\2\1\12qsockstest\10password";
static const char handshakeOkPasswdAuth[] = "\5\2\1\0";
static const char handshakeAuthNotOk[] = "\5\377";
static const char connect1[] = "\5\1\0\1\177\0\0\1\0\25"; // Connect IPv4 127.0.0.1 port 21
+static const char connect1a[] = "\5\1\0\1"; // just "Connect to IPv4"
+static const char connect1b[] = "\0\25"; // just "port 21"
static const char connect2[] = "\5\1\0\3\11localhost\0\25"; // Connect hostname localhost 21
+static const char connect2a[] = "\5\1\0\3"; // just "Connect to hostname"
static const char connected[] = "\5\0\0";
+#define QBA(x) (QByteArray::fromRawData(x, -1 + sizeof(x)))
+
void tst_NetworkSelfTest::socks5Proxy()
{
+ union {
+ char buf[4];
+ quint32 data;
+ } ip4Address;
+ ip4Address.data = qToBigEndian(serverIpAddress().toIPv4Address());
+
netChat(1080, QList<Chat>()
// IP address connection
<< Chat::send(QByteArray(handshakeNoAuth, -1 + sizeof handshakeNoAuth))
@@ -606,7 +660,17 @@ void tst_NetworkSelfTest::socks5Proxy()
<< Chat::skipBytes(6) // the server's local address and port
<< ftpChat()
- // hostname connection
+ // connect by IP
+ << Chat::Reconnect
+ << Chat::send(QByteArray(handshakeNoAuth, -1 + sizeof handshakeNoAuth))
+ << Chat::expect(QByteArray(handshakeOkNoAuth, -1 + sizeof handshakeOkNoAuth))
+ << Chat::send(QBA(connect1a) + QByteArray::fromRawData(ip4Address.buf, 4) + QBA(connect1b))
+ << Chat::expect(QByteArray(connected, -1 + sizeof connected))
+ << Chat::expect("\1") // IPv4 address following
+ << Chat::skipBytes(6) // the server's local address and port
+ << ftpChat()
+
+ // connect to "localhost" by hostname
<< Chat::Reconnect
<< Chat::send(QByteArray(handshakeNoAuth, -1 + sizeof handshakeNoAuth))
<< Chat::expect(QByteArray(handshakeOkNoAuth, -1 + sizeof handshakeOkNoAuth))
@@ -615,6 +679,16 @@ void tst_NetworkSelfTest::socks5Proxy()
<< Chat::expect("\1") // IPv4 address following
<< Chat::skipBytes(6) // the server's local address and port
<< ftpChat()
+
+ // connect to server by its official name
+ << Chat::Reconnect
+ << Chat::send(QByteArray(handshakeNoAuth, -1 + sizeof handshakeNoAuth))
+ << Chat::expect(QByteArray(handshakeOkNoAuth, -1 + sizeof handshakeOkNoAuth))
+ << Chat::send(QBA(connect2a) + char(QtNetworkSettings::serverName().size()) + QtNetworkSettings::serverName().toLatin1() + QBA(connect1b))
+ << Chat::expect(QByteArray(connected, -1 + sizeof connected))
+ << Chat::expect("\1") // IPv4 address following
+ << Chat::skipBytes(6) // the server's local address and port
+ << ftpChat()
);
}
diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
index 4e385d5..d6911d2 100644
--- a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
@@ -1225,6 +1225,9 @@ void tst_QAbstractItemView::task250754_fontChange()
void tst_QAbstractItemView::task200665_itemEntered()
{
+#ifdef Q_OS_WINCE_WM
+ QSKIP("On Windows Mobile the mouse tracking is unavailable at the moment", SkipAll);
+#endif
//we test that view will emit entered
//when the scrollbar move but not the mouse itself
QStandardItemModel model(1000,1);
diff --git a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
index 9f13aca..286ea2d 100644
--- a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
+++ b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
@@ -69,6 +69,10 @@ private slots:
void delete_anchor();
void conflicts();
void sizePolicy();
+ void expandingSequence();
+ void expandingSequenceFairDistribution();
+ void expandingParallel();
+ void floatConflict();
};
class RectWidget : public QGraphicsWidget
@@ -155,7 +159,15 @@ void tst_QGraphicsAnchorLayout::simple()
QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout;
l->setContentsMargins(0, 0, 0, 0);
+
+ // Horizontal
+ l->addAnchor(l, Qt::AnchorLeft, w1, Qt::AnchorLeft);
l->addAnchor(w1, Qt::AnchorRight, w2, Qt::AnchorLeft);
+ l->addAnchor(w2, Qt::AnchorRight, l, Qt::AnchorRight);
+
+ // Vertical
+ l->addAnchors(l, w1, Qt::Vertical);
+ l->addAnchors(l, w2, Qt::Vertical);
QGraphicsWidget p;
p.setLayout(l);
@@ -586,6 +598,20 @@ void tst_QGraphicsAnchorLayout::snake()
QCOMPARE(b->geometry(), QRectF(90.0, 100.0, 10.0, 100.0));
QCOMPARE(c->geometry(), QRectF(90.0, 200.0, 100.0, 100.0));
QCOMPARE(p.size(), layoutMaximumSize);
+
+ QVERIFY(layoutHasConflict(l) == false);
+
+ // Test QSizePolicy::ExpandFlag, it shouldn't change the extreme
+ // points of the layout...
+ b->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ QSizeF newLayoutMinimumSize = l->effectiveSizeHint(Qt::MinimumSize);
+ QSizeF newLayoutMaximumSize = l->effectiveSizeHint(Qt::MaximumSize);
+ QSizeF newLayoutPreferredSize = l->effectiveSizeHint(Qt::PreferredSize);
+
+ QCOMPARE(layoutMinimumSize, newLayoutMinimumSize);
+ QCOMPARE(layoutMaximumSize, newLayoutMaximumSize);
+ QCOMPARE(layoutPreferredSize, newLayoutPreferredSize);
}
void tst_QGraphicsAnchorLayout::snakeOppositeDirections()
@@ -1135,12 +1161,19 @@ void tst_QGraphicsAnchorLayout::delete_anchor()
QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout;
l->setSpacing(0);
l->setContentsMargins(0, 0, 0, 0);
+
+ // Horizontal
l->addAnchor(l, Qt::AnchorLeft, w1, Qt::AnchorLeft);
l->addAnchor(w1, Qt::AnchorRight, w2, Qt::AnchorLeft);
l->addAnchor(w2, Qt::AnchorRight, l, Qt::AnchorRight);
l->addAnchor(w1, Qt::AnchorRight, w3, Qt::AnchorLeft);
l->addAnchor(w3, Qt::AnchorRight, l, Qt::AnchorRight);
+ // Vertical
+ l->addAnchors(l, w1, Qt::Vertical);
+ l->addAnchors(l, w2, Qt::Vertical);
+ l->addAnchors(l, w3, Qt::Vertical);
+
QGraphicsAnchor *anchor = l->anchor(w3, Qt::AnchorRight, l, Qt::AnchorRight);
anchor->setSpacing(10);
@@ -1254,7 +1287,7 @@ void tst_QGraphicsAnchorLayout::sizePolicy()
w1->adjustSize();
QCOMPARE(l->effectiveSizeHint(Qt::MinimumSize), QSizeF(0, 0));
- QCOMPARE(l->effectiveSizeHint(Qt::PreferredSize), QSizeF(0, 0));
+ QCOMPARE(l->effectiveSizeHint(Qt::PreferredSize), QSizeF(100, 100));
QCOMPARE(l->effectiveSizeHint(Qt::MaximumSize), QSizeF(100, 100));
delete p;
@@ -1308,5 +1341,249 @@ void tst_QGraphicsAnchorLayout::conflicts()
delete p;
}
+void tst_QGraphicsAnchorLayout::expandingSequence()
+{
+ QSizeF min(10, 10);
+ QSizeF pref(50, 10);
+ QSizeF max(100, 10);
+
+ QGraphicsWidget *a = createItem(min, pref, max, "a");
+ QGraphicsWidget *b = createItem(min, pref, max, "b");
+
+ b->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout;
+ l->setContentsMargins(0, 0, 0, 0);
+
+ // horizontal
+ setAnchor(l, l, Qt::AnchorLeft, a, Qt::AnchorLeft, 0);
+ setAnchor(l, a, Qt::AnchorRight, b, Qt::AnchorLeft, 0);
+ setAnchor(l, b, Qt::AnchorRight, l, Qt::AnchorRight, 0);
+
+ // vertical
+ l->addAnchors(l, a, Qt::Vertical);
+ l->addAnchors(l, b, Qt::Vertical);
+
+ QCOMPARE(l->count(), 2);
+
+ QGraphicsWidget p;
+ p.setLayout(l);
+
+ QSizeF layoutMinimumSize = l->effectiveSizeHint(Qt::MinimumSize);
+ QCOMPARE(layoutMinimumSize.width(), qreal(20));
+
+ QSizeF layoutExpandedSize(pref.width() + max.width(), layoutMinimumSize.height());
+ p.resize(layoutExpandedSize);
+
+ QCOMPARE(a->geometry().size(), pref);
+ QCOMPARE(b->geometry().size(), max);
+
+ QSizeF layoutMaximumSize = l->effectiveSizeHint(Qt::MaximumSize);
+ QCOMPARE(layoutMaximumSize.width(), qreal(200));
+}
+
+void tst_QGraphicsAnchorLayout::expandingSequenceFairDistribution()
+{
+ QSizeF min(10, 10);
+ QSizeF pref(50, 10);
+ QSizeF max(100, 10);
+
+ QGraphicsWidget *a = createItem(min, pref, max, "a");
+ QGraphicsWidget *b = createItem(min, pref, max, "b");
+ QGraphicsWidget *c = createItem(min, pref, max, "c");
+ QGraphicsWidget *d = createItem(min, pref, max, "d");
+
+ b->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+ d->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout;
+ l->setContentsMargins(0, 0, 0, 0);
+
+ // horizontal
+ setAnchor(l, l, Qt::AnchorLeft, a, Qt::AnchorLeft, 0);
+ setAnchor(l, a, Qt::AnchorRight, b, Qt::AnchorLeft, 0);
+ setAnchor(l, b, Qt::AnchorRight, c, Qt::AnchorLeft, 0);
+ setAnchor(l, c, Qt::AnchorRight, d, Qt::AnchorLeft, 0);
+ setAnchor(l, d, Qt::AnchorRight, l, Qt::AnchorRight, 0);
+
+ // vertical
+ l->addAnchors(l, a, Qt::Vertical);
+ l->addAnchors(l, b, Qt::Vertical);
+ l->addAnchors(l, c, Qt::Vertical);
+ l->addAnchors(l, d, Qt::Vertical);
+
+ QCOMPARE(l->count(), 4);
+
+ QGraphicsWidget p;
+ p.setLayout(l);
+
+ QSizeF layoutMinimumSize = l->effectiveSizeHint(Qt::MinimumSize);
+ QCOMPARE(layoutMinimumSize.width(), qreal(40));
+
+ QSizeF layoutPartialExpandedSize((2 * pref.width()) + (2 * (pref.width() + 10)),
+ layoutMinimumSize.height());
+ p.resize(layoutPartialExpandedSize);
+
+ QCOMPARE(a->geometry().size(), pref);
+ QCOMPARE(b->geometry().size(), pref + QSizeF(10, 0));
+ QCOMPARE(c->geometry().size(), pref);
+ QCOMPARE(d->geometry().size(), pref + QSizeF(10, 0));
+
+ QSizeF layoutExpandedSize((2 * pref.width()) + (2 * max.width()),
+ layoutMinimumSize.height());
+ p.resize(layoutExpandedSize);
+
+ QCOMPARE(a->geometry().size(), pref);
+ QCOMPARE(b->geometry().size(), max);
+ QCOMPARE(c->geometry().size(), pref);
+ QCOMPARE(d->geometry().size(), max);
+
+ QSizeF layoutMaximumSize = l->effectiveSizeHint(Qt::MaximumSize);
+ QCOMPARE(layoutMaximumSize.width(), qreal(400));
+
+ // Now we change D to have more "room for growth" from its preferred size
+ // to its maximum size. We expect a proportional fair distribution. Note that
+ // this seems to not conform with what QGraphicsLinearLayout does.
+ d->setMaximumSize(QSizeF(150, 10));
+
+ QSizeF newLayoutExpandedSize((2 * pref.width()) + (max.width() + 150),
+ layoutMinimumSize.height());
+ p.resize(newLayoutExpandedSize);
+
+ QCOMPARE(a->geometry().size(), pref);
+ QCOMPARE(b->geometry().size(), max);
+ QCOMPARE(c->geometry().size(), pref);
+ QCOMPARE(d->geometry().size(), QSizeF(150, 10));
+
+ QSizeF newLayoutPartialExpandedSize((4 * pref.width()) + 75,
+ layoutMinimumSize.height());
+ p.resize(newLayoutPartialExpandedSize);
+
+ QCOMPARE(a->geometry().size(), pref);
+ QCOMPARE(b->geometry().size(), pref + QSizeF(25, 0));
+ QCOMPARE(c->geometry().size(), pref);
+ QCOMPARE(d->geometry().size(), pref + QSizeF(50, 0));
+}
+
+void tst_QGraphicsAnchorLayout::expandingParallel()
+{
+ QSizeF min(10, 10);
+ QSizeF pref(50, 10);
+ QSizeF max(100, 10);
+ QSizeF max2(100, 50);
+
+ QGraphicsWidget *a = createItem(min, pref, max, "a");
+ QGraphicsWidget *b = createItem(min, pref, max, "b");
+ QGraphicsWidget *c = createItem(min, pref, max2, "c");
+
+ b->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout;
+ l->setContentsMargins(0, 0, 0, 0);
+
+ // horizontal
+ setAnchor(l, l, Qt::AnchorLeft, a, Qt::AnchorLeft, 0);
+ setAnchor(l, l, Qt::AnchorLeft, b, Qt::AnchorLeft, 0);
+
+ setAnchor(l, a, Qt::AnchorRight, c, Qt::AnchorLeft, 0);
+ setAnchor(l, b, Qt::AnchorRight, c, Qt::AnchorLeft, 0);
+
+ setAnchor(l, c, Qt::AnchorRight, l, Qt::AnchorRight, 0);
+
+ // vertical
+ l->addAnchors(l, c, Qt::Vertical);
+ setAnchor(l, l, Qt::AnchorTop, a, Qt::AnchorTop, 0);
+ setAnchor(l, a, Qt::AnchorBottom, c, Qt::AnchorVerticalCenter, 0);
+ setAnchor(l, b, Qt::AnchorTop, c, Qt::AnchorVerticalCenter, 0);
+ setAnchor(l, b, Qt::AnchorBottom, l, Qt::AnchorBottom, 0);
+
+ QCOMPARE(l->count(), 3);
+
+ QGraphicsWidget p;
+ p.setLayout(l);
+
+ QSizeF layoutMinimumSize = l->effectiveSizeHint(Qt::MinimumSize);
+ QCOMPARE(layoutMinimumSize.width(), qreal(20));
+
+ QSizeF layoutExpandedSize(pref.width() + max.width(), layoutMinimumSize.height());
+ p.resize(layoutExpandedSize);
+
+ QCOMPARE(a->geometry().size(), max);
+ QCOMPARE(b->geometry().size(), max);
+ QCOMPARE(c->geometry().size(), QSizeF(pref.width(), 20));
+
+ QSizeF layoutMaximumSize = l->effectiveSizeHint(Qt::MaximumSize);
+ QCOMPARE(layoutMaximumSize.width(), qreal(200));
+
+ //
+ // Change the parallel connection to a paralell connection of b with a center...
+ //
+ QGraphicsAnchor *anchor = l->anchor(b, Qt::AnchorRight, c, Qt::AnchorLeft);
+ delete anchor;
+ setAnchor(l, b, Qt::AnchorRight, a, Qt::AnchorHorizontalCenter, 0);
+ a->setMaximumSize(max + QSizeF(100, 0));
+
+ QSizeF newLayoutMinimumSize = l->effectiveSizeHint(Qt::MinimumSize);
+ QCOMPARE(newLayoutMinimumSize.width(), qreal(30));
+
+ QSizeF newLayoutExpandedSize = layoutExpandedSize + QSizeF(100, 0);
+ p.resize(newLayoutExpandedSize);
+
+ QCOMPARE(a->geometry().size(), max + QSizeF(100, 0));
+ QCOMPARE(b->geometry().size(), max);
+ QCOMPARE(c->geometry().size(), QSizeF(pref.width(), 20));
+
+ QSizeF newLayoutMaximumSize = l->effectiveSizeHint(Qt::MaximumSize);
+ QCOMPARE(newLayoutMaximumSize.width(), qreal(300));
+}
+
+void tst_QGraphicsAnchorLayout::floatConflict()
+{
+ QGraphicsWidget *a = createItem(QSizeF(80,10), QSizeF(90,10), QSizeF(100,10), "a");
+ QGraphicsWidget *b = createItem(QSizeF(80,10), QSizeF(90,10), QSizeF(100,10), "b");
+
+ QGraphicsAnchorLayout *l;
+ QGraphicsWidget *p = new QGraphicsWidget(0, Qt::Window);
+
+ l = new QGraphicsAnchorLayout;
+ l->setContentsMargins(0, 0, 0, 0);
+
+ p->setLayout(l);
+
+ // horizontal
+ // with this anchor we have two floating items
+ setAnchor(l, a, Qt::AnchorRight, b, Qt::AnchorLeft);
+
+ // Just checking if the layout is handling well the removal of floating items
+ delete l->anchor(a, Qt::AnchorRight, b, Qt::AnchorLeft);
+ QCOMPARE(l->count(), 0);
+ QCOMPARE(layoutHasConflict(l), false);
+
+ // setting back the same anchor
+ setAnchor(l, a, Qt::AnchorRight, b, Qt::AnchorLeft);
+
+ // We don't support floating items but they should be counted as if they are in the layout
+ QCOMPARE(l->count(), 2);
+ // Although, we have an invalid situation
+ QCOMPARE(layoutHasConflict(l), true);
+
+ // Semi-floats are supported
+ setAnchor(l, a, Qt::AnchorLeft, l, Qt::AnchorLeft);
+ QCOMPARE(l->count(), 2);
+
+ // Vertically the layout has floating items. Therefore, we have a conflict
+ QCOMPARE(layoutHasConflict(l), true);
+
+ // No more floating items
+ setAnchor(l, b, Qt::AnchorRight, l, Qt::AnchorRight);
+ setAnchor(l, a, Qt::AnchorTop, l, Qt::AnchorTop);
+ setAnchor(l, a, Qt::AnchorBottom, l, Qt::AnchorBottom);
+ setAnchor(l, b, Qt::AnchorTop, l, Qt::AnchorTop);
+ setAnchor(l, b, Qt::AnchorBottom, l, Qt::AnchorBottom);
+ QCOMPARE(layoutHasConflict(l), false);
+
+ delete p;
+}
+
QTEST_MAIN(tst_QGraphicsAnchorLayout)
#include "tst_qgraphicsanchorlayout.moc"
diff --git a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
index a521b78..148b2c8 100644
--- a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
+++ b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
@@ -530,16 +530,18 @@ void tst_QGraphicsAnchorLayout1::testIsValid()
TestWidget *widget1 = new TestWidget();
TestWidget *widget2 = new TestWidget();
+ // Vertically the layout has floating items. Therefore, we have a conflict
layout->setAnchor(layout, Qt::AnchorLeft, widget1, Qt::AnchorLeft, 0.1);
layout->setAnchor(layout, Qt::AnchorRight, widget1, Qt::AnchorRight, -0.1);
+ // Horizontally the layout has floating items. Therefore, we have a conflict
layout->setAnchor(layout, Qt::AnchorTop, widget2, Qt::AnchorTop, 0.1);
layout->setAnchor(layout, Qt::AnchorBottom, widget2, Qt::AnchorBottom, -0.1);
widget->setLayout(layout);
widget->setGeometry(QRectF(0,0,100,100));
- QCOMPARE(layout->isValid(), true);
+ QCOMPARE(layout->isValid(), false);
delete widget;
}
}
@@ -1413,9 +1415,6 @@ void tst_QGraphicsAnchorLayout1::testMixedSpacing_data()
QTest::newRow("One widget, unsolvable") << QSizeF(10, 10) << theData << theResult;
}
- // ### BUG. We are not handling "floating" elements properly. Ie. elements that
- // have no anchors in a given orientation.
- if (0)
// Two widgets, one has fixed size
{
BasicLayoutTestDataList theData;
diff --git a/tests/auto/qicoimageformat/qicoimageformat.pro b/tests/auto/qicoimageformat/qicoimageformat.pro
index c0aa4b5..b9c8622 100644
--- a/tests/auto/qicoimageformat/qicoimageformat.pro
+++ b/tests/auto/qicoimageformat/qicoimageformat.pro
@@ -15,9 +15,12 @@ wince*: {
} else:symbian* {
addFiles.sources = icons
addFiles.path = .
- addPlugins.sources = qico.dll
- addPlugins.path = imageformats
- DEPLOYMENT += addFiles addPlugins
+ DEPLOYMENT += addFiles
+ qt_not_deployed {
+ addPlugins.sources = qico.dll
+ addPlugins.path = imageformats
+ DEPLOYMENT += addPlugins
+ }
TARGET.UID3 = 0xE0340004
DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
} else {
diff --git a/tests/auto/qicon/qicon.pro b/tests/auto/qicon/qicon.pro
index 8ae252f..68b888d 100644
--- a/tests/auto/qicon/qicon.pro
+++ b/tests/auto/qicon/qicon.pro
@@ -18,9 +18,12 @@ wince* {
QT += xml svg
addFiles.sources = *.png tst_qicon.cpp *.svg *.svgz
addFiles.path = .
- plugins.sources = qsvgicon.dll
- plugins.path = iconengines
- DEPLOYMENT += addFiles plugins
+ DEPLOYMENT += addFiles
+ qt_not_deployed {
+ plugins.sources = qsvgicon.dll
+ plugins.path = iconengines
+ DEPLOYMENT += plugins
+ }
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/qimage/qimage.pro b/tests/auto/qimage/qimage.pro
index 69d6f0f..3e0bd69 100644
--- a/tests/auto/qimage/qimage.pro
+++ b/tests/auto/qimage/qimage.pro
@@ -10,9 +10,12 @@ wince*: {
TARGET.EPOCHEAPSIZE = 0x200000 0x800000
addImages.sources = images/*
addImages.path = images
- imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll qtiff.dll qico.dll
- imagePlugins.path = imageformats
- DEPLOYMENT += addImages imagePlugins
+ DEPLOYMENT += addImages
+ qt_not_deployed {
+ imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll qtiff.dll qico.dll
+ imagePlugins.path = imageformats
+ DEPLOYMENT += imagePlugins
+ }
} else {
contains(QT_CONFIG, qt3support): QT += qt3support
DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro
index 31a9b0f..5b061b0 100644
--- a/tests/auto/qimagereader/qimagereader.pro
+++ b/tests/auto/qimagereader/qimagereader.pro
@@ -30,8 +30,12 @@ symbian*: {
images.sources = images
images.path = .
- imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll
- imagePlugins.path = imageformats
+ DEPLOYMENT += images
- DEPLOYMENT += images imagePlugins
+ qt_not_deployed {
+ imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll
+ imagePlugins.path = imageformats
+
+ DEPLOYMENT += imagePlugins
+ }
}
diff --git a/tests/auto/qimagewriter/qimagewriter.pro b/tests/auto/qimagewriter/qimagewriter.pro
index 5a2c908..8da2942 100644
--- a/tests/auto/qimagewriter/qimagewriter.pro
+++ b/tests/auto/qimagewriter/qimagewriter.pro
@@ -13,9 +13,12 @@ wince*: {
} else:symbian* {
addFiles.sources = images\*.*
addFiles.path = images
- imagePlugins.sources = qjpeg.dll qtiff.dll
- imagePlugins.path = imageformats
- DEPLOYMENT += addFiles imagePlugins
+ DEPLOYMENT += addFiles
+ qt_not_deployed {
+ imagePlugins.sources = qjpeg.dll qtiff.dll
+ imagePlugins.path = imageformats
+ DEPLOYMENT += imagePlugins
+ }
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/qitemmodel/qitemmodel.pro b/tests/auto/qitemmodel/qitemmodel.pro
index eb62b24..2d0bdea 100644
--- a/tests/auto/qitemmodel/qitemmodel.pro
+++ b/tests/auto/qitemmodel/qitemmodel.pro
@@ -16,9 +16,11 @@ QT += sql
symbian {
TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
- DEPLOYMENT += sqlite
+ qt_not_deployed {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
}
}
diff --git a/tests/auto/qmovie/qmovie.pro b/tests/auto/qmovie/qmovie.pro
index 15f0c83..30e5901 100644
--- a/tests/auto/qmovie/qmovie.pro
+++ b/tests/auto/qmovie/qmovie.pro
@@ -18,7 +18,9 @@ symbian*: {
addFiles.path = animations
DEPLOYMENT += addFiles
- imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll
- imagePlugins.path = imageformats
- DEPLOYMENT += imagePlugins
-} \ No newline at end of file
+ qt_not_deployed {
+ imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll
+ imagePlugins.path = imageformats
+ DEPLOYMENT += imagePlugins
+ }
+}
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
index 89f8a5cf..a0af214 100644
--- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
+++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
@@ -1235,7 +1235,6 @@ void tst_QScriptContext::parentContextCallee_QT2270()
QScriptValue fun = engine.evaluate("(function() { return getParentContextCallee(); })");
QVERIFY(fun.isFunction());
QScriptValue callee = fun.call();
- QEXPECT_FAIL("", "QT-2270: Incorrect parentContext() returned for native call", Abort);
QVERIFY(callee.equals(fun));
}
diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro
index d4c0f4c..dd058a4 100644
--- a/tests/auto/qscriptengine/qscriptengine.pro
+++ b/tests/auto/qscriptengine/qscriptengine.pro
@@ -1,7 +1,12 @@
load(qttest_p4)
QT = core gui script
SOURCES += tst_qscriptengine.cpp
-!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+wince* {
+ DEFINES += SRCDIR=\\\"./\\\"
+} else:!symbian {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
wince*|symbian*: {
addFiles.sources = script
diff --git a/tests/auto/qscriptstring/tst_qscriptstring.cpp b/tests/auto/qscriptstring/tst_qscriptstring.cpp
index 0968b61..e1a4bc1 100644
--- a/tests/auto/qscriptstring/tst_qscriptstring.cpp
+++ b/tests/auto/qscriptstring/tst_qscriptstring.cpp
@@ -58,6 +58,7 @@ public:
private slots:
void test();
+ void hash();
};
tst_QScriptString::tst_QScriptString()
@@ -138,5 +139,21 @@ void tst_QScriptString::test()
}
}
+void tst_QScriptString::hash()
+{
+ QScriptEngine engine;
+ QHash<QScriptString, int> stringToInt;
+ QScriptString foo = engine.toStringHandle("foo");
+ QScriptString bar = engine.toStringHandle("bar");
+ QVERIFY(!stringToInt.contains(foo));
+ for (int i = 0; i < 1000000; ++i)
+ stringToInt.insert(foo, 123);
+ QCOMPARE(stringToInt.value(foo), 123);
+ QVERIFY(!stringToInt.contains(bar));
+ stringToInt.insert(bar, 456);
+ QCOMPARE(stringToInt.value(bar), 456);
+ QCOMPARE(stringToInt.value(foo), 123);
+}
+
QTEST_MAIN(tst_QScriptString)
#include "tst_qscriptstring.moc"
diff --git a/tests/auto/qsql/qsql.pro b/tests/auto/qsql/qsql.pro
index 167a38d..0ec581d 100644
--- a/tests/auto/qsql/qsql.pro
+++ b/tests/auto/qsql/qsql.pro
@@ -10,9 +10,11 @@ wince*: {
}
symbian {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
- DEPLOYMENT += sqlite
+ qt_not_deployed {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
}
}
diff --git a/tests/auto/qsqldatabase/qsqldatabase.pro b/tests/auto/qsqldatabase/qsqldatabase.pro
index 964c8c9..6381219 100644
--- a/tests/auto/qsqldatabase/qsqldatabase.pro
+++ b/tests/auto/qsqldatabase/qsqldatabase.pro
@@ -23,10 +23,12 @@ symbian {
TARGET.EPOCHEAPSIZE=5000 5000000
TARGET.EPOCSTACKSIZE=50000
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
- DEPLOYMENT += sqlite
+ qt_not_deployed {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
}
}
diff --git a/tests/auto/qsqldriver/qsqldriver.pro b/tests/auto/qsqldriver/qsqldriver.pro
index 7f289a6..d04ca83 100644
--- a/tests/auto/qsqldriver/qsqldriver.pro
+++ b/tests/auto/qsqldriver/qsqldriver.pro
@@ -17,9 +17,11 @@ wince*: {
}
symbian {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
- DEPLOYMENT += sqlite
+ qt_not_deployed {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
}
}
diff --git a/tests/auto/qsqlerror/qsqlerror.pro b/tests/auto/qsqlerror/qsqlerror.pro
index 2eb7934..456f585 100644
--- a/tests/auto/qsqlerror/qsqlerror.pro
+++ b/tests/auto/qsqlerror/qsqlerror.pro
@@ -8,9 +8,11 @@ QT = core sql
SOURCES += tst_qsqlerror.cpp
symbian {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
- DEPLOYMENT += sqlite
+ qt_not_deployed {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
}
}
diff --git a/tests/auto/qsqlfield/qsqlfield.pro b/tests/auto/qsqlfield/qsqlfield.pro
index 6e5b461..7339854 100644
--- a/tests/auto/qsqlfield/qsqlfield.pro
+++ b/tests/auto/qsqlfield/qsqlfield.pro
@@ -4,10 +4,12 @@ SOURCES += tst_qsqlfield.cpp
QT += sql
symbian {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
- DEPLOYMENT += sqlite
+ qt_not_deployed {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
}
}
diff --git a/tests/auto/qsqlquery/qsqlquery.pro b/tests/auto/qsqlquery/qsqlquery.pro
index 494ca4c..97646ed 100644
--- a/tests/auto/qsqlquery/qsqlquery.pro
+++ b/tests/auto/qsqlquery/qsqlquery.pro
@@ -15,9 +15,11 @@ wince*: {
}
symbian {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
- DEPLOYMENT += sqlite
+ qt_not_deployed {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
}
}
diff --git a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro
index cd8586c..cda8cab 100644
--- a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro
+++ b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro
@@ -7,10 +7,12 @@ wince*: {
DEPLOYMENT_PLUGIN += qsqlite
LIBS += -lws2
}else:symbian {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
- DEPLOYMENT += sqlite
+ qt_not_deployed {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
}
} else {
win32:LIBS += -lws2_32
diff --git a/tests/auto/qsqlrecord/qsqlrecord.pro b/tests/auto/qsqlrecord/qsqlrecord.pro
index 67e8ab9..7a72075 100644
--- a/tests/auto/qsqlrecord/qsqlrecord.pro
+++ b/tests/auto/qsqlrecord/qsqlrecord.pro
@@ -2,10 +2,13 @@ load(qttest_p4)
SOURCES += tst_qsqlrecord.cpp
symbian {
-contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
- DEPLOYMENT += sqlite
+ qt_not_deployed {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
+ }
}
TARGET.EPOCSTACKSIZE=50000
diff --git a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro
index 2fddd03..ee4f2f0 100644
--- a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro
+++ b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro
@@ -9,10 +9,12 @@ wince*: {
DEPLOYMENT += plugFiles
LIBS += -lws2
}else:symbian {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
- DEPLOYMENT += sqlite
+ qt_not_deployed {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
}
} else {
win32-g++ {
diff --git a/tests/auto/qsqltablemodel/qsqltablemodel.pro b/tests/auto/qsqltablemodel/qsqltablemodel.pro
index a046fb1..9a23237 100644
--- a/tests/auto/qsqltablemodel/qsqltablemodel.pro
+++ b/tests/auto/qsqltablemodel/qsqltablemodel.pro
@@ -9,10 +9,12 @@ wince*: {
DEPLOYMENT += plugFiles
LIBS += -lws2
}else:symbian {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
- DEPLOYMENT += sqlite
+ qt_not_deployed {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
}
}else {
win32:LIBS += -lws2_32
diff --git a/tests/auto/qsqlthread/qsqlthread.pro b/tests/auto/qsqlthread/qsqlthread.pro
index 2708f1a..5522232 100644
--- a/tests/auto/qsqlthread/qsqlthread.pro
+++ b/tests/auto/qsqlthread/qsqlthread.pro
@@ -10,10 +10,12 @@ wince*: {
DEPLOYMENT += plugFiles
LIBS += -lws2
}else:symbian {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.sources = sqlite3.dll
- DEPLOYMENT += sqlite
+ qt_not_deployed {
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ sqlite.path = /sys/bin
+ sqlite.sources = sqlite3.dll
+ DEPLOYMENT += sqlite
+ }
}
}else {
win32:LIBS += -lws2_32
diff --git a/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
index a5748ae..3b1e18f 100644
--- a/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
+++ b/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
@@ -66,6 +66,7 @@ struct TestIterator
};
#include <qiterator.h>
+#ifndef QT_NO_STL
namespace std {
template <>
struct iterator_traits<TestIterator>
@@ -79,6 +80,7 @@ int distance(TestIterator &a, TestIterator &b)
}
}
+#endif
#include <qtconcurrentiteratekernel.h>
@@ -112,7 +114,7 @@ class PrintFor : public IterateKernel<TestIterator, void>
{
public:
PrintFor(TestIterator begin, TestIterator end) : IterateKernel<TestIterator, void>(begin, end) {iterations = 0; }
- inline bool runIterations(TestIterator/*beginIterator*/, int begin, int end, void *)
+ bool runIterations(TestIterator/*beginIterator*/, int begin, int end, void *)
{
iterations.fetchAndAddRelaxed(end - begin);
#ifdef PRINT
@@ -120,6 +122,11 @@ public:
#endif
return false;
}
+ bool runIteration(TestIterator it, int index , void *result)
+ {
+ return runIterations(it, index, index + 1, result);
+ }
+
};
class SleepPrintFor : public IterateKernel<TestIterator, void>
@@ -135,6 +142,10 @@ public:
#endif
return false;
}
+ bool runIteration(TestIterator it, int index , void *result)
+ {
+ return runIterations(it, index, index + 1, result);
+ }
};
@@ -165,6 +176,10 @@ public:
counter.fetchAndAddRelaxed(end - begin);
return false;
}
+ bool runIteration(TestIterator it, int index , void *result)
+ {
+ return runIterations(it, index, index + 1, result);
+ }
};
void tst_iteratekernel::stresstest()
@@ -215,6 +230,10 @@ public:
return false;
}
+ bool runIteration(TestIterator it, int index , void *result)
+ {
+ return runIterations(it, index, index + 1, result);
+ }
bool shouldThrottleThread()
{
@@ -254,6 +273,9 @@ public:
void tst_iteratekernel::blockSize()
{
+#ifdef QT_NO_STL
+ QSKIP("Missing stl iterators prevent correct block size calculation", SkipAll);
+#endif
const int expectedMinimumBlockSize = 1024 / QThread::idealThreadCount();
BlockSizeRecorder(0, 10000).startBlocking();
if (peakBlockSize < expectedMinimumBlockSize)
@@ -276,6 +298,9 @@ public:
void tst_iteratekernel::multipleResults()
{
+#ifdef QT_NO_STL
+ QSKIP("Missing stl iterators prevent correct summation", SkipAll);
+#endif
QFuture<int> f = startThreadEngine(new MultipleResultsFor(0, 10)).startAsynchronously();
QCOMPARE(f.results().count() , 10);
QCOMPARE(f.resultAt(0), 0);
diff --git a/tests/auto/qtextstream/test/test.pro b/tests/auto/qtextstream/test/test.pro
index 9f117d5..c70c27b 100644
--- a/tests/auto/qtextstream/test/test.pro
+++ b/tests/auto/qtextstream/test/test.pro
@@ -30,9 +30,11 @@ wince*: {
}else:symbian {
load(data_caging_paths)
# Symbian can't define SRCDIR meaningfully here
- codecs_plugins.sources = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll
- codecs_plugins.path = $$QT_PLUGINS_BASE_DIR/codecs
- DEPLOYMENT += codecs_plugins
+ qt_not_deployed {
+ codecs_plugins.sources = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll
+ codecs_plugins.path = $$QT_PLUGINS_BASE_DIR/codecs
+ DEPLOYMENT += codecs_plugins
+ }
}else {
DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp
index 8856792..026c30e 100644
--- a/tests/auto/qurl/tst_qurl.cpp
+++ b/tests/auto/qurl/tst_qurl.cpp
@@ -2624,6 +2624,13 @@ void tst_QUrl::tolerantParser()
//QCOMPARE(tsdgeosQUrl.toEncoded(), tsdgeosExpected); // unusable output from qtestlib...
QCOMPARE(QString(tsdgeosQUrl.toEncoded()), QString(tsdgeosExpected));
}
+
+ {
+ QUrl url;
+ url.setUrl("http://strange<username>@hostname/", QUrl::TolerantMode);
+ QVERIFY(url.isValid());
+ QCOMPARE(QString(url.toEncoded()), QString("http://strange%3Cusername%3E@hostname/"));
+ }
}
void tst_QUrl::correctEncodedMistakes_data()
@@ -3594,9 +3601,9 @@ void tst_QUrl::setAuthority()
void tst_QUrl::errorString()
{
- QUrl u = QUrl::fromEncoded("http://strange<username>@ok_hostname/", QUrl::StrictMode);
+ QUrl u = QUrl::fromEncoded("http://strange<username>@bad_hostname/", QUrl::StrictMode);
QVERIFY(!u.isValid());
- QString errorString = "Invalid URL \"http://strange<username>@ok_hostname/\": "
+ QString errorString = "Invalid URL \"http://strange<username>@bad_hostname/\": "
"error at position 14: expected end of URL, but found '<'";
QCOMPARE(u.errorString(), errorString);