diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-16 07:16:17 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-16 07:16:17 (GMT) |
commit | c9a89b253176547901e11d27c042983a65f43b1f (patch) | |
tree | e3d39e3033d462b51edd39d889a61b7dca9b81d4 /tests | |
parent | bb8142436bacf5a4fa31880b58a8b3b6bc7b4d5b (diff) | |
parent | 2bfd1b35482a45370c49fec15d056322f35c3176 (diff) | |
download | Qt-c9a89b253176547901e11d27c042983a65f43b1f.zip Qt-c9a89b253176547901e11d27c042983a65f43b1f.tar.gz Qt-c9a89b253176547901e11d27c042983a65f43b1f.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (62 commits)
Use native locale aware string comparison on Symbian.
Temporary fix for regression in QSslCertificate::fromPath()
doc: Added more DITA output to the XML generator
Fix symbian building of TARGET with a slash
Fix a minor typo in QAbstractItemModel's documentation.
QXmlSchema: allow usage of xsd:all
QSslSocket: fix build for MinGW and VS 2005
Fix symbian-abld build failure with bearer plugins
remove certificate bundle
make QSslSocket::systemCaCertificates() use system certs
Adjusted RegExp in QSslCertificate::fromPath()
Fix QSystemTrayIcon::supportsMessages() on Windows
Use NIM_SETVERSION to get the latest behavior
Cleanup obsolete stuff
doc: Added DITA XML generator
Fixed a broken merge.
Changed the way we detect touch screen on Windows.
Fixed error deploying qsymbianbearer.qtplugin on Symbian.
Revert "Attempt to fix build failure on Symbian."
Attempt to fix build failure on Symbian.
...
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gestures/tst_gestures.cpp | 66 | ||||
-rw-r--r-- | tests/auto/qapplication/tst_qapplication.cpp | 19 | ||||
-rw-r--r-- | tests/auto/qlocale/test/test.pro | 2 | ||||
-rw-r--r-- | tests/auto/qprocess/testProcessEOF/testProcessEOF.pro | 2 | ||||
-rw-r--r-- | tests/auto/qsqldriver/qsqldriver.pro | 2 | ||||
-rw-r--r-- | tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro | 2 | ||||
-rw-r--r-- | tests/auto/qsslcertificate/tst_qsslcertificate.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qtcpserver/crashingServer/crashingServer.pro | 2 | ||||
-rw-r--r-- | tests/auto/qtextformat/tst_qtextformat.cpp | 5 | ||||
-rw-r--r-- | tests/auto/qtextlayout/tst_qtextlayout.cpp | 9 | ||||
-rw-r--r-- | tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp | 9 | ||||
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 6 | ||||
-rw-r--r-- | tests/auto/xmlpatternsxqts/tst_suitetest.cpp | 4 |
13 files changed, 97 insertions, 34 deletions
diff --git a/tests/auto/gestures/tst_gestures.cpp b/tests/auto/gestures/tst_gestures.cpp index 7c1170c..a968520 100644 --- a/tests/auto/gestures/tst_gestures.cpp +++ b/tests/auto/gestures/tst_gestures.cpp @@ -334,6 +334,7 @@ private slots: void gestureOverChild(); void multipleWidgetOnlyGestureInTree(); void conflictingGestures(); + void conflictingGesturesInGraphicsView(); void finishedWithoutStarted(); void unknownGesture(); void graphicsItemGesture(); @@ -2235,5 +2236,70 @@ void tst_Gestures::testReuseCanceledGestures() QCOMPARE(target->canceled(), 1); } +void tst_Gestures::conflictingGesturesInGraphicsView() +{ + QGraphicsScene scene; + GraphicsView view(&scene); + view.setWindowFlags(Qt::X11BypassWindowManagerHint); + + GestureItem *item1 = new GestureItem("item1"); + item1->grabGesture(CustomGesture::GestureType); + item1->size = QRectF(0, 0, 100, 100); + item1->setZValue(2); + scene.addItem(item1); + + GestureItem *item2 = new GestureItem("item2"); + item2->grabGesture(CustomGesture::GestureType); + item2->size = QRectF(0, 0, 100, 100); + item2->setZValue(5); + scene.addItem(item2); + + view.show(); + QTest::qWaitForWindowShown(&view); + view.ensureVisible(scene.sceneRect()); + + static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1; + + CustomEvent event; + + // nobody accepts override + item1->acceptGestureOverride = false; + item2->acceptGestureOverride = false; + event.hotSpot = mapToGlobal(item2->boundingRect().center(), item2, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item2, &scene); + QCOMPARE(item2->gestureOverrideEventsReceived, 1); + QCOMPARE(item2->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item1->gestureOverrideEventsReceived, 1); + QCOMPARE(item1->gestureEventsReceived, 0); + + item1->reset(); item2->reset(); + + // the original target accepts override + item1->acceptGestureOverride = false; + item2->acceptGestureOverride = true; + event.hotSpot = mapToGlobal(item2->boundingRect().center(), item2, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item2, &scene); + QCOMPARE(item2->gestureOverrideEventsReceived, 1); + QCOMPARE(item2->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1->gestureEventsReceived, 0); + + item1->reset(); item2->reset(); + + // the item behind accepts override + item1->acceptGestureOverride = true; + item2->acceptGestureOverride = false; + event.hotSpot = mapToGlobal(item2->boundingRect().center(), item2, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item2, &scene); + + QCOMPARE(item2->gestureOverrideEventsReceived, 1); + QCOMPARE(item2->gestureEventsReceived, 0); + QCOMPARE(item1->gestureOverrideEventsReceived, 1); + QCOMPARE(item1->gestureEventsReceived, TotalGestureEventsCount); +} + QTEST_MAIN(tst_Gestures) #include "tst_gestures.moc" diff --git a/tests/auto/qapplication/tst_qapplication.cpp b/tests/auto/qapplication/tst_qapplication.cpp index 43fbba1..1a38070 100644 --- a/tests/auto/qapplication/tst_qapplication.cpp +++ b/tests/auto/qapplication/tst_qapplication.cpp @@ -189,15 +189,22 @@ void tst_QApplication::getSetCheck() { int argc = 0; QApplication obj1(argc, 0, QApplication::GuiServer); - // QInputContext * QApplication::inputContext() - // void QApplication::setInputContext(QInputContext *) MyInputContext *var1 = new MyInputContext; + + // QApplication takes ownership, so check for reparenting: obj1.setInputContext(var1); - QCOMPARE((QInputContext *)var1, obj1.inputContext()); + QCOMPARE(var1->parent(), static_cast<QObject *>(&obj1)); + + // Test for self-assignment: + obj1.setInputContext(obj1.inputContext()); + QVERIFY(obj1.inputContext()); + QCOMPARE(static_cast<QInputContext *>(var1), obj1.inputContext()); + + // Resetting the input context to 0 is not allowed: QTest::ignoreMessage(QtWarningMsg, "QApplication::setInputContext: called with 0 input context"); - obj1.setInputContext((QInputContext *)0); - QCOMPARE((QInputContext *)var1, obj1.inputContext()); - // delete var1; // No delete, since QApplication takes ownership + obj1.setInputContext(0); + + QCOMPARE(static_cast<QInputContext *>(var1), obj1.inputContext()); } class CloseEventTestWindow : public QWidget diff --git a/tests/auto/qlocale/test/test.pro b/tests/auto/qlocale/test/test.pro index d57f2d1..e33d0fe 100644 --- a/tests/auto/qlocale/test/test.pro +++ b/tests/auto/qlocale/test/test.pro @@ -36,4 +36,4 @@ symbian:contains(S60_VERSION,3.2) { "PAGED" \ "$${LITERAL_HASH}endif" MMP_RULES += custom_paged_rule -}
\ No newline at end of file +} diff --git a/tests/auto/qprocess/testProcessEOF/testProcessEOF.pro b/tests/auto/qprocess/testProcessEOF/testProcessEOF.pro index f406759..756bd23 100644 --- a/tests/auto/qprocess/testProcessEOF/testProcessEOF.pro +++ b/tests/auto/qprocess/testProcessEOF/testProcessEOF.pro @@ -2,7 +2,7 @@ SOURCES = main.cpp CONFIG -= qt app_bundle CONFIG += console -!win32-g++:win32:!equals(TEMPLATE_PREFIX, "vc"):QMAKE_CXXFLAGS += /GS- +win32:!win32-g++*:!equals(TEMPLATE_PREFIX, "vc"):QMAKE_CXXFLAGS += /GS- DESTDIR = ./ diff --git a/tests/auto/qsqldriver/qsqldriver.pro b/tests/auto/qsqldriver/qsqldriver.pro index d04ca83..2e9ed67 100644 --- a/tests/auto/qsqldriver/qsqldriver.pro +++ b/tests/auto/qsqldriver/qsqldriver.pro @@ -9,7 +9,7 @@ wince*: { DEPLOYMENT += plugFiles LIBS += -lws2 } else { - win32-g++ { + win32-g++* { LIBS += -lws2_32 } else:win32 { LIBS += ws2_32.lib diff --git a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro index ee4f2f0..c6681d5 100644 --- a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro +++ b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro @@ -17,7 +17,7 @@ wince*: { } } } else { - win32-g++ { + win32-g++* { LIBS += -lws2_32 } else:win32 { LIBS += ws2_32.lib diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp index 505b867..d0509bb 100644 --- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp @@ -542,6 +542,9 @@ void tst_QSslCertificate::fromPath_data() QTest::newRow("\"d.*/c.*.pem\" regexp der") << QString("d.*/c.*.pem") << int(QRegExp::RegExp) << false << 0; QTest::newRow("\"d.*/c.*.pem\" wildcard pem") << QString("d.*/c.*.pem") << int(QRegExp::Wildcard) << true << 0; QTest::newRow("\"d.*/c.*.pem\" wildcard der") << QString("d.*/c.*.pem") << int(QRegExp::Wildcard) << false << 0; +#ifdef Q_OS_LINUX + QTest::newRow("absolute path wildcard pem") << QString(QDir::currentPath() + "/certificates/*.pem") << int(QRegExp::Wildcard) << true << 4; +#endif QTest::newRow("trailing-whitespace") << QString("more-certificates/trailing-whitespace.pem") << int(QRegExp::FixedString) << true << 1; QTest::newRow("no-ending-newline") << QString("more-certificates/no-ending-newline.pem") << int(QRegExp::FixedString) << true << 1; diff --git a/tests/auto/qtcpserver/crashingServer/crashingServer.pro b/tests/auto/qtcpserver/crashingServer/crashingServer.pro index 70e42b4..0bea655 100644 --- a/tests/auto/qtcpserver/crashingServer/crashingServer.pro +++ b/tests/auto/qtcpserver/crashingServer/crashingServer.pro @@ -5,4 +5,4 @@ DESTDIR = ./ # This means the auto test works on some machines for MinGW. No dialog stalls # the application. -win32-g++:CONFIG += console +win32-g++*:CONFIG += console diff --git a/tests/auto/qtextformat/tst_qtextformat.cpp b/tests/auto/qtextformat/tst_qtextformat.cpp index ee1f4b5..9b71481 100644 --- a/tests/auto/qtextformat/tst_qtextformat.cpp +++ b/tests/auto/qtextformat/tst_qtextformat.cpp @@ -308,10 +308,7 @@ void tst_QTextFormat::getSetTabs() format.setTabPositions(tabs); Comparator c2(tabs, format.tabPositions()); - QTextOption::Tab tab2; - tab2.position = 3456; - tab2.type = QTextOption::RightTab; - tab2.delimiter = QChar('x'); + QTextOption::Tab tab2(3456, QTextOption::RightTab, QChar('x')); tabs.append(tab2); format.setTabPositions(tabs); Comparator c3(tabs, format.tabPositions()); diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index 1a5f493..a631f3d 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -980,9 +980,7 @@ void tst_QTextLayout::testCenteredTab() // test if centering the tab works. We expect the center of 'Bar.' to be at the tab point. QTextOption option = layout.textOption(); QList<QTextOption::Tab> tabs; - QTextOption::Tab tab; - tab.type = QTextOption::CenterTab; - tab.position = 150; + QTextOption::Tab tab(150, QTextOption::CenterTab); tabs.append(tab); option.setTabs(tabs); layout.setTextOption(option); @@ -1002,10 +1000,7 @@ void tst_QTextLayout::testDelimiterTab() // try the different delimiter characters to see if the alignment works there. QTextOption option = layout.textOption(); QList<QTextOption::Tab> tabs; - QTextOption::Tab tab; - tab.type = QTextOption::DelimiterTab; - tab.delimiter = QChar('.'); - tab.position = 100; + QTextOption::Tab tab(100, QTextOption::DelimiterTab, QChar('.')); tabs.append(tab); option.setTabs(tabs); layout.setTextOption(option); diff --git a/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp b/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp index 64c42bb..a463d86 100644 --- a/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp +++ b/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp @@ -198,14 +198,9 @@ void tst_QTextOdfWriter::testWriteStyle2() { QTextBlockFormat bf; // = cursor.blockFormat(); QList<QTextOption::Tab> tabs; - QTextOption::Tab tab1; - tab1.position = 40; - tab1.type = QTextOption::RightTab; + QTextOption::Tab tab1(40, QTextOption::RightTab); tabs << tab1; - QTextOption::Tab tab2; - tab2.position = 80; - tab2.type = QTextOption::DelimiterTab; - tab2.delimiter = 'o'; + QTextOption::Tab tab2(80, QTextOption::DelimiterTab, 'o'); tabs << tab2; bf.setTabPositions(tabs); diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index d76bbfa..045216a 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -610,10 +610,14 @@ void tst_QWidget::getSetCheck() obj1.setAttribute(Qt::WA_InputMethodEnabled); obj1.setInputContext(var13); QCOMPARE(static_cast<QInputContext *>(var13), obj1.inputContext()); + // QWidget takes ownership, so check parent + QCOMPARE(var13->parent(), static_cast<QObject *>(&obj1)); + // Check self assignment + obj1.setInputContext(obj1.inputContext()); + QCOMPARE(static_cast<QInputContext *>(var13), obj1.inputContext()); obj1.setInputContext((QInputContext *)0); QCOMPARE(qApp->inputContext(), obj1.inputContext()); QVERIFY(qApp->inputContext() != var13); - //delete var13; // No delete, since QWidget takes ownership // bool QWidget::autoFillBackground() // void QWidget::setAutoFillBackground(bool) diff --git a/tests/auto/xmlpatternsxqts/tst_suitetest.cpp b/tests/auto/xmlpatternsxqts/tst_suitetest.cpp index ec63858..6e10e3f 100644 --- a/tests/auto/xmlpatternsxqts/tst_suitetest.cpp +++ b/tests/auto/xmlpatternsxqts/tst_suitetest.cpp @@ -141,8 +141,6 @@ void tst_SuiteTest::checkTestSuiteResult() const /* Passed to ResultThreader so it knows what kind of file it is handling. */ ResultThreader::Type type = ResultThreader::Baseline; - QProcess::execute(QLatin1String("p4 edit ") + m_existingBaseline); - for(QFileInfoList::const_iterator it(list.constBegin()); it != end; ++it) { QFileInfo i(*it); @@ -167,8 +165,6 @@ void tst_SuiteTest::checkTestSuiteResult() const const int exitCode = eventLoop.exec(); - QProcess::execute(QLatin1String("p4 revert -a ") + m_existingBaseline); - QCOMPARE(exitCode, 0); } |