diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/auto.pro | 4 | ||||
-rw-r--r-- | tests/auto/qbytearray/tst_qbytearray.cpp | 13 | ||||
-rw-r--r-- | tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 25 | ||||
-rw-r--r-- | tests/auto/symbols/tst_symbols.cpp | 12 |
5 files changed, 55 insertions, 2 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 7ba6243..791d23c 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -11,7 +11,6 @@ TEMPLATE = subdirs maketestselftest \ moc \ uic \ - uic3 \ guiapplauncher \ #atwrapper \ # These tests need significant updating, #uiloader \ # they have hardcoded machine names etc. @@ -69,6 +68,9 @@ Q3SUBDIRS += \ q3uridrag \ q3widgetstack +!cross_compile:Q3SUBDIRS += \ + uic3 + SUBDIRS += \ # exceptionsafety_objects \ shouldn't enable it languagechange \ 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"); diff --git a/tests/auto/symbols/tst_symbols.cpp b/tests/auto/symbols/tst_symbols.cpp index 70abc43..28970eb 100644 --- a/tests/auto/symbols/tst_symbols.cpp +++ b/tests/auto/symbols/tst_symbols.cpp @@ -211,6 +211,10 @@ void tst_Symbols::prefix() << "winfnt_driver_class" << "pshinter_module_class" << "psnames_module_class" + // C symbols from Qt + << "qt_addObject" + << "qt_removeObject" + << "qt_startup_hook" ; QHash<QString,QStringList> excusedPrefixes; @@ -278,6 +282,10 @@ void tst_Symbols::prefix() << "cti" // ctiTrampoline and ctiVMThrowTrampoline from the JIT #ifdef QT_NAMESPACE << "QWeb" // Webkit is only 'namespace aware' + << "qWeb" + << "qt" + << "QGraphicsWebView" + << "operator" #endif ; @@ -330,6 +338,8 @@ void tst_Symbols::prefix() symbol = symbol.mid(symbol.indexOf(' ') + 1); } + if (symbol.mid(symbol.indexOf(' ')+1).startsWith("std::")) + continue; if (symbol.startsWith("_") || symbol.startsWith("std::")) continue; if (symbol.startsWith("vtable ") || symbol.startsWith("VTT for ") || @@ -341,6 +351,8 @@ void tst_Symbols::prefix() continue; if (symbol.startsWith(ns + "operator")) continue; + if (symbol.startsWith("operator new") || symbol.startsWith("operator delete")) + continue; if (symbol.startsWith("guard variable for ")) continue; if (symbol.contains("(" + ns + "QTextStream")) |