summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-02-24 01:23:03 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-02-24 01:23:03 (GMT)
commit10ee284f7722c2479e85d469b179c9311b10238a (patch)
treef763d60087111ed6210812b3d028a07513807996 /tests
parent1ec06a42b2b18b850b5ede133d1c23a00e6dbe21 (diff)
parentf95e0d4dee769363a9c84b27f854055b0425e6ec (diff)
downloadQt-10ee284f7722c2479e85d469b179c9311b10238a.zip
Qt-10ee284f7722c2479e85d469b179c9311b10238a.tar.gz
Qt-10ee284f7722c2479e85d469b179c9311b10238a.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
Conflicts: src/declarative/qml/qml.h
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/auto.pro4
-rw-r--r--tests/auto/declarative/qmllanguage/data/component.5.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/script.10.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/script.9.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp2
-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
-rw-r--r--tests/auto/symbols/tst_symbols.cpp12
9 files changed, 59 insertions, 6 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/declarative/qmllanguage/data/component.5.errors.txt b/tests/auto/declarative/qmllanguage/data/component.5.errors.txt
index 5e88900..e3c2df7 100644
--- a/tests/auto/declarative/qmllanguage/data/component.5.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/component.5.errors.txt
@@ -1 +1 @@
-4:5:Invalid component specification
+4:5:Component elements may not contain properties other than id
diff --git a/tests/auto/declarative/qmllanguage/data/script.10.errors.txt b/tests/auto/declarative/qmllanguage/data/script.10.errors.txt
index 8299d23..13f47d1 100644
--- a/tests/auto/declarative/qmllanguage/data/script.10.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/script.10.errors.txt
@@ -1 +1 @@
-6:9:Invalid component specification
+6:9:Component elements may not contain script blocks
diff --git a/tests/auto/declarative/qmllanguage/data/script.9.errors.txt b/tests/auto/declarative/qmllanguage/data/script.9.errors.txt
index dc1eb53..41e8d46 100644
--- a/tests/auto/declarative/qmllanguage/data/script.9.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/script.9.errors.txt
@@ -1 +1 @@
-5:9:Invalid component specification
+5:9:Component elements may not contain script blocks
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
index 5f9cb1b..ecdd33a 100644
--- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
+++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
@@ -335,7 +335,7 @@ void tst_qmllanguage::errors()
QFETCH(bool, create);
if (file == "invalidID.6.qml")
- QSKIP("Test disabled until we strictly disallow ids from beginning with uppercase letters", SkipSingle);
+ QTest::ignoreMessage(QtWarningMsg, "id \"StartsWithUpperCase\" is invalid: ids cannot start with uppercase letters");
QmlComponent component(&engine, TEST_FILE(file));
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"))