summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-23 13:04:15 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-23 13:04:15 (GMT)
commit0d02bf894a1f3f494a4787ddfaf0e3bcd02affa2 (patch)
tree619aae505826654f3d89492efa53f758214fea6f /tests
parent3db40b0be40c946f547f238ed3f0af813892115e (diff)
parentde4332a4728e739b37e9c7b04c021e150e096270 (diff)
downloadQt-0d02bf894a1f3f494a4787ddfaf0e3bcd02affa2.zip
Qt-0d02bf894a1f3f494a4787ddfaf0e3bcd02affa2.tar.gz
Qt-0d02bf894a1f3f494a4787ddfaf0e3bcd02affa2.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (33 commits) Use QTRY_COMPARE to give the animation a chance to finish Cocoa: Sheets loose their opacity on 2nd show Added function overload for QByteArray &QByteArray::replace() Second attempt at work-around for MSVC2008 compiler crash QNativeSocketEngine: Fix some error handling related to waitFor*() qdoc: List new QML elements in \sincelist for What's New page. Cocoa: fix namespace build Cocoa: Fix build with namespace Cocoa: namespace build fix doc: Fixed some qdoc errors. Don't include private headers from public headers. Fix compilation on HP-UXi: m_volume is a #define WinCE doesn't have sys/types.h Fix compilation: qmlviewer cannot use symbols exported with Q_AUTOTEST_EXPORT in production builds Fix compilation on recent Linux systems: getpid(2) is in unistd.h. Cocoa: calling QEventLoop::exec from mouse up causes problem Fix compilation on GNU/Hurd (SA_SIGINFO isn't defined) Doc: Collected the Declarative UI tutorials together and renamed them. Doc: Simplified Commercial Editions for Qt 4.7. Work around MSVC2008 compiler crash ...
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qbytearray/tst_qbytearray.cpp13
-rw-r--r--tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp3
-rw-r--r--tests/auto/qtcpsocket/tst_qtcpsocket.cpp25
3 files changed, 40 insertions, 1 deletions
diff --git a/tests/auto/qbytearray/tst_qbytearray.cpp b/tests/auto/qbytearray/tst_qbytearray.cpp
index 5c72c7a..07fdbc3 100644
--- a/tests/auto/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/qbytearray/tst_qbytearray.cpp
@@ -111,6 +111,7 @@ private slots:
void remove();
void replace_data();
void replace();
+ void replaceWithSpecifiedLength();
void indexOf_data();
void indexOf();
void lastIndexOf_data();
@@ -840,6 +841,18 @@ void tst_QByteArray::replace()
QCOMPARE(str2.replace(pos, len, after.data()), expected);
}
+void tst_QByteArray::replaceWithSpecifiedLength()
+{
+ const char after[] = "zxc\0vbnmqwert";
+ int lenAfter = 6;
+ QByteArray ba("abcdefghjk");
+ ba.replace(0,2,after,lenAfter);
+
+ const char _expected[] = "zxc\0vbcdefghjk";
+ QByteArray expected(_expected,sizeof(_expected)-1);
+ QCOMPARE(ba,expected);
+}
+
void tst_QByteArray::indexOf_data()
{
QTest::addColumn<QByteArray>("haystack");
diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
index d020d8f..66cfeb7 100644
--- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
+++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
@@ -44,6 +44,7 @@
#include <QtCore/qpropertyanimation.h>
#include <QtCore/qvariantanimation.h>
#include <QtGui/qwidget.h>
+#include "../../shared/util.h"
//TESTED_CLASS=QPropertyAnimation
//TESTED_FILES=
@@ -1095,7 +1096,7 @@ void tst_QPropertyAnimation::valueChanged()
QTest::qWait(anim.duration() + 100);
- QCOMPARE(anim.state(), QAbstractAnimation::Stopped);
+ QTRY_COMPARE(anim.state(), QAbstractAnimation::Stopped);
QCOMPARE(anim.currentTime(), anim.duration());
//let's check that the values go forward
diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
index e638e287..12686bb 100644
--- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
@@ -191,6 +191,7 @@ private slots:
void increaseReadBufferSize();
void taskQtBug5799ConnectionErrorWaitForConnected();
void taskQtBug5799ConnectionErrorEventLoop();
+ void taskQtBug7054TimeoutErrorResetting();
void invalidProxy_data();
void invalidProxy();
@@ -2236,6 +2237,30 @@ void tst_QTcpSocket::taskQtBug5799ConnectionErrorEventLoop()
QString("Could not reach server: %1").arg(socket.errorString()).toLocal8Bit());
}
+void tst_QTcpSocket::taskQtBug7054TimeoutErrorResetting()
+{
+ QTcpSocket *socket = newSocket();
+
+ socket->connectToHost(QtNetworkSettings::serverName(), 443);
+ QVERIFY(socket->waitForConnected(5*1000));
+ QVERIFY(socket->error() == QAbstractSocket::UnknownSocketError);
+
+ // We connected to the HTTPS port. Wait two seconds to receive data. We will receive
+ // nothing because we would need to start the SSL handshake
+ QVERIFY(!socket->waitForReadyRead(2*1000));
+ QVERIFY(socket->error() == QAbstractSocket::SocketTimeoutError);
+
+ // Now write some crap to make the server disconnect us. 4 lines are enough.
+ socket->write("a\r\nb\r\nc\r\nd\r\n");
+ socket->waitForBytesWritten(2*1000);
+
+ // we try to waitForReadyRead another time, but this time instead of a timeout we
+ // should get a better error since the server disconnected us
+ QVERIFY(!socket->waitForReadyRead(2*1000));
+ // It must NOT be the SocketTimeoutError that had been set before
+ QVERIFY(socket->error() == QAbstractSocket::RemoteHostClosedError);
+}
+
void tst_QTcpSocket::invalidProxy_data()
{
QTest::addColumn<int>("type");