summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-17 23:46:45 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-17 23:46:45 (GMT)
commit53d3083eecf88a20bc36ada43942c7a18677af62 (patch)
tree19116918f6aa138197831c2cb86e1adcce120dea /tests/auto
parentd61c74faef2ed787aacc53c03b8361fa57bccc8e (diff)
parent15efa03d234aa51b0c24c68c18a98dce0d66bdff (diff)
downloadQt-53d3083eecf88a20bc36ada43942c7a18677af62.zip
Qt-53d3083eecf88a20bc36ada43942c7a18677af62.tar.gz
Qt-53d3083eecf88a20bc36ada43942c7a18677af62.tar.bz2
Merge branch 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration into 4.7-integration
* 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration: (50 commits) Fix compilation after merge Fixed some network tests never being run. Remove test cases which cause stack overflow Avoid a crash in the OpenVG paint engine when clipping to an empty path Fix last character being overwritten in password field Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( 038b62085831eef4dee423361c65ecd55b7b9b1d ) QSslSocket: Improve error handling Compile when bootstrapping qmake Fix regression in tst_qrand::testqrand() syncqt: don't try to split %module's values syncqt: fix wrong paths in include/ActiveQt/headers.pri Fix a crash when recursing into QSharedPointer from QSharedPointer::clear() Fix a couple of memory leaks due to not releasing CFTypes on Mac Initalize the nativeDialogInUse variable The Q_WGL define was removed years ago. Compile QUUid::createUuid() should not generate identical sequences on UNIX typos fixed Use lower case for including system header files Added trace statements to Phonon MMF backend ...
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/network.pro2
-rw-r--r--tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp15
-rw-r--r--tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp13
-rw-r--r--tests/auto/qsharedpointer/tst_qsharedpointer.cpp56
-rw-r--r--tests/auto/qtexttable/tst_qtexttable.cpp14
-rw-r--r--tests/auto/qxmlquery/qxmlquery.pro7
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp25
7 files changed, 118 insertions, 14 deletions
diff --git a/tests/auto/network.pro b/tests/auto/network.pro
index e1898f1..31c754c 100644
--- a/tests/auto/network.pro
+++ b/tests/auto/network.pro
@@ -36,7 +36,7 @@ SUBDIRS=\
qsslkey \
qsslsocket \
-contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!contains(QT_CONFIG, private_tests): SUBDIRS -= \
qauthenticator \
qhttpnetworkconnection \
qhttpnetworkreply \
diff --git a/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp b/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
index 49f110e..49a76fa 100644
--- a/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
+++ b/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
@@ -161,6 +161,7 @@ private slots:
void draw();
void update();
void boundingRect();
+ void clippedBoundingRect();
void deviceRect();
void pixmap();
@@ -282,6 +283,20 @@ void tst_QGraphicsEffectSource::boundingRect()
QTRY_COMPARE(effect->source()->boundingRect(), itemBoundingRect);
}
+void tst_QGraphicsEffectSource::clippedBoundingRect()
+{
+ QRectF itemBoundingRect = item->boundingRect();
+ item->setFlag(QGraphicsItem::ItemClipsChildrenToShape);
+
+ QGraphicsRectItem *child = new QGraphicsRectItem(-1000, -1000, 2000, 2000);
+ child->setBrush(Qt::red);
+ child->setParentItem(item);
+
+ effect->storeDeviceDependentStuff = true;
+ effect->source()->update();
+ QTRY_COMPARE(effect->source()->boundingRect(Qt::LogicalCoordinates), itemBoundingRect);
+}
+
void tst_QGraphicsEffectSource::deviceRect()
{
effect->storeDeviceDependentStuff = true;
diff --git a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
index 6396e44..dba8a64 100644
--- a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
+++ b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
@@ -224,7 +224,18 @@ void tst_QGraphicsSceneIndex::connectedToSceneRectChanged()
{
class MyScene : public QGraphicsScene
- { public: using QGraphicsScene::receivers; };
+ {
+ public:
+#ifdef Q_CC_RVCT
+ //using keyword doesn't change visibility to public in RVCT2.2 compiler
+ inline int receivers(const char* signal) const
+ {
+ return QGraphicsScene::receivers(signal);
+ }
+#else
+ using QGraphicsScene::receivers;
+#endif
+ };
MyScene scene; // Uses QGraphicsSceneBspTreeIndex by default.
QCOMPARE(scene.receivers(SIGNAL(sceneRectChanged(const QRectF&))), 1);
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
index 4e23cb1..6b4904f 100644
--- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
@@ -95,6 +95,8 @@ private slots:
void creating();
void creatingQObject();
void mixTrackingPointerCode();
+ void reentrancyWhileDestructing();
+
void threadStressTest_data();
void threadStressTest();
void map();
@@ -1870,6 +1872,60 @@ void tst_QSharedPointer::invalidConstructs()
}
}
+namespace QTBUG11730 {
+ struct IB
+ {
+ virtual ~IB() {}
+ };
+
+ struct IA
+ {
+ virtual QSharedPointer<IB> getB() = 0;
+ };
+
+ struct B: public IB
+ {
+ IA *m_a;
+ B(IA *a_a) :m_a(a_a)
+ { }
+ ~B()
+ {
+ QSharedPointer<IB> b = m_a->getB();
+ }
+ };
+
+ struct A: public IA
+ {
+ QSharedPointer<IB> b;
+
+ virtual QSharedPointer<IB> getB()
+ {
+ return b;
+ }
+
+ A()
+ {
+ b = QSharedPointer<IB>(new B(this));
+ }
+
+ ~A()
+ {
+ b.clear();
+ }
+ };
+}
+
+void tst_QSharedPointer::reentrancyWhileDestructing()
+{
+ // this bug is about recursing back into QSharedPointer::clear()
+ // from inside it
+ // that is, the destructor of the object being deleted recurses
+ // into the same QSharedPointer object.
+ // First reported as QTBUG-11730
+ QTBUG11730::A obj;
+}
+
+
QTEST_MAIN(tst_QSharedPointer)
#include "tst_qsharedpointer.moc"
diff --git a/tests/auto/qtexttable/tst_qtexttable.cpp b/tests/auto/qtexttable/tst_qtexttable.cpp
index 9dcc369..a811b85 100644
--- a/tests/auto/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/qtexttable/tst_qtexttable.cpp
@@ -99,6 +99,7 @@ private slots:
void removeColumns3();
void removeColumns4();
void removeColumns5();
+ void removeColumnsInTableWithMergedRows();
void QTBUG11282_insertBeforeMergedEnding_data();
void QTBUG11282_insertBeforeMergedEnding();
@@ -949,6 +950,19 @@ void tst_QTextTable::removeColumns5()
QCOMPARE(table->cellAt(3, 2).firstPosition(), 11);
}
+void tst_QTextTable::removeColumnsInTableWithMergedRows()
+{
+ QTextTable *table = cursor.insertTable(3, 4);
+ table->mergeCells(0, 0, 1, 4);
+ QCOMPARE(table->rows(), 3);
+ QCOMPARE(table->columns(), 4);
+
+ table->removeColumns(0, table->columns() - 1);
+
+ QCOMPARE(table->rows(), 3);
+ QCOMPARE(table->columns(), 1);
+}
+
void tst_QTextTable::QTBUG11282_insertBeforeMergedEnding_data()
{
QTest::addColumn<int>("rows");
diff --git a/tests/auto/qxmlquery/qxmlquery.pro b/tests/auto/qxmlquery/qxmlquery.pro
index ae73488..044b7ce 100644
--- a/tests/auto/qxmlquery/qxmlquery.pro
+++ b/tests/auto/qxmlquery/qxmlquery.pro
@@ -23,7 +23,12 @@ wince*|symbian: {
addFiles.path = .
patternistFiles.sources = ../xmlpatterns/queries
- patternistFiles.path = ../xmlpatterns
+ symbian: {
+ #../xmlpatterns resolves to an illegal path for deployment
+ patternistFiles.path = xmlpatterns
+ } else {
+ patternistFiles.path = ../xmlpatterns
+ }
DEPLOYMENT += addFiles patternistFiles
}
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index 6fd9b93..2187aeb 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -67,6 +67,9 @@
#if defined(Q_OS_SYMBIAN)
#define SRCDIR ""
+#define XMLPATTERNSDIR "xmlpatterns"
+#else
+#define XMLPATTERNSDIR SRCDIR "../xmlpatterns"
#endif
/*!
@@ -264,7 +267,7 @@ void tst_QXmlQuery::checkBaseURI(const QUrl &baseURI, const QString &candidate)
QVERIFY(QDir(baseURI.toLocalFile()).relativeFilePath(QFileInfo(candidate).canonicalFilePath()).startsWith("../"));
}
-const char *const tst_QXmlQuery::queriesDirectory = SRCDIR "../xmlpatterns/queries/";
+const char *const tst_QXmlQuery::queriesDirectory = XMLPATTERNSDIR "/queries/";
QStringList tst_QXmlQuery::queries()
{
@@ -857,7 +860,7 @@ void tst_QXmlQuery::bindVariableXSLTSuccess() const
stylesheet.bindVariable(QLatin1String("paramSelectWithTypeIntBoundWithBindVariableRequired"),
QVariant(QLatin1String("param5")));
- stylesheet.setQuery(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/parameters.xsl"))));
+ stylesheet.setQuery(QUrl(inputFileAsURI(QLatin1String(XMLPATTERNSDIR "/stylesheets/parameters.xsl"))));
QVERIFY(stylesheet.isValid());
@@ -1798,11 +1801,11 @@ void tst_QXmlQuery::setFocusQUrl() const
{
QXmlQuery query(QXmlQuery::XSLT20);
- const TestURIResolver resolver(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+ const TestURIResolver resolver(QUrl(inputFileAsURI(QLatin1String(XMLPATTERNSDIR "/stylesheets/documentElement.xml"))));
query.setUriResolver(&resolver);
QVERIFY(query.setFocus(QUrl(QLatin1String("arbitraryURI"))));
- query.setQuery(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/copyWholeDocument.xsl"))));
+ query.setQuery(QUrl(inputFileAsURI(QLatin1String(XMLPATTERNSDIR "/stylesheets/copyWholeDocument.xsl"))));
QVERIFY(query.isValid());
QBuffer result;
@@ -2997,7 +3000,7 @@ void tst_QXmlQuery::setInitialTemplateNameQXmlName() const
QCOMPARE(query.initialTemplateName(), name);
- query.setQuery(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/namedTemplate.xsl"))));
+ query.setQuery(QUrl(inputFileAsURI(QLatin1String(XMLPATTERNSDIR "/stylesheets/namedTemplate.xsl"))));
QVERIFY(query.isValid());
QBuffer result;
@@ -3059,7 +3062,7 @@ void tst_QXmlQuery::setNetworkAccessManager() const
/* Ensure fn:doc() picks up the right QNetworkAccessManager. */
{
NetworkOverrider networkOverrider(QUrl(QLatin1String("tag:example.com:DOESNOTEXIST")),
- QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/queries/simpleDocument.xml"))));
+ QUrl(inputFileAsURI(QLatin1String(XMLPATTERNSDIR "/queries/simpleDocument.xml"))));
QXmlQuery query;
query.setNetworkAccessManager(&networkOverrider);
@@ -3075,7 +3078,7 @@ void tst_QXmlQuery::setNetworkAccessManager() const
/* Ensure setQuery() is using the right network manager. */
{
NetworkOverrider networkOverrider(QUrl(QLatin1String("tag:example.com:DOESNOTEXIST")),
- QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/queries/concat.xq"))));
+ QUrl(inputFileAsURI(QLatin1String(XMLPATTERNSDIR "/queries/concat.xq"))));
QXmlQuery query;
query.setNetworkAccessManager(&networkOverrider);
@@ -3133,9 +3136,9 @@ void tst_QXmlQuery::multipleDocsAndFocus() const
/* We use string concatenation, since variable bindings might disturb what
* we're testing. */
query.setQuery(QLatin1String("string(doc('") +
- inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/simpleDocument.xml")) +
+ inputFile(QLatin1String(XMLPATTERNSDIR "/queries/simpleDocument.xml")) +
QLatin1String("'))"));
- query.setFocus(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+ query.setFocus(QUrl(inputFileAsURI(QLatin1String(XMLPATTERNSDIR "/stylesheets/documentElement.xml"))));
query.setQuery(QLatin1String("string(.)"));
QStringList result;
@@ -3159,11 +3162,11 @@ void tst_QXmlQuery::multipleEvaluationsWithDifferentFocus() const
QXmlQuery query;
QStringList result;
- query.setFocus(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+ query.setFocus(QUrl(inputFileAsURI(QLatin1String(XMLPATTERNSDIR "/stylesheets/documentElement.xml"))));
query.setQuery(QLatin1String("string(.)"));
QVERIFY(query.evaluateTo(&result));
- query.setFocus(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+ query.setFocus(QUrl(inputFileAsURI(QLatin1String(XMLPATTERNSDIR "/stylesheets/documentElement.xml"))));
QVERIFY(query.evaluateTo(&result));
}