summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-06-20 13:15:52 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2010-06-20 13:15:52 +0200
commitf5bab2bc74ed03fd1db99cba3830b6b21795a627 (patch)
treeb10c428a9b482354c5366e920a2a3359b676f82c /tests
parent489cface92f40f4e82866b5fabf57d29e9632811 (diff)
parenta27f18db247a0456ca15ad58f8dcc6b3441d55d0 (diff)
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into qt-4.7-from-4.6
src/3rdparty/* is left untouched and not merged from 4.6. The corresponding changes in Harfbuzz and WebKit are already in the 4.6 staging areas. Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebKit/qt/ChangeLog src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc tests/auto/qtextlayout/tst_qtextlayout.cpp tests/auto/qwidgetaction/tst_qwidgetaction.cpp
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/linguist/lconvert/tst_lconvert.cpp2
-rw-r--r--tests/auto/linguist/lupdate/tst_lupdate.cpp2
-rw-r--r--tests/auto/qtextlayout/tst_qtextlayout.cpp19
-rw-r--r--tests/auto/qtimeline/tst_qtimeline.cpp12
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp27
-rw-r--r--tests/auto/qwidgetaction/tst_qwidgetaction.cpp6
6 files changed, 32 insertions, 36 deletions
diff --git a/tests/auto/linguist/lconvert/tst_lconvert.cpp b/tests/auto/linguist/lconvert/tst_lconvert.cpp
index 054da4a801..998f5884ce 100644
--- a/tests/auto/linguist/lconvert/tst_lconvert.cpp
+++ b/tests/auto/linguist/lconvert/tst_lconvert.cpp
@@ -153,7 +153,7 @@ void tst_lconvert::verifyReadFail(const QString &fn)
{
QProcess cvt;
cvt.start(binDir + "/lconvert", QStringList() << (dataDir + fn));
- QVERIFY(cvt.waitForFinished(1000));
+ QVERIFY(cvt.waitForFinished(10000));
QVERIFY(cvt.exitStatus() == QProcess::NormalExit);
QVERIFY2(cvt.exitCode() == 2, "Accepted invalid input");
}
diff --git a/tests/auto/linguist/lupdate/tst_lupdate.cpp b/tests/auto/linguist/lupdate/tst_lupdate.cpp
index c179462d27..5ba6c52694 100644
--- a/tests/auto/linguist/lupdate/tst_lupdate.cpp
+++ b/tests/auto/linguist/lupdate/tst_lupdate.cpp
@@ -288,7 +288,7 @@ void tst_lupdate::good()
proc.setWorkingDirectory(workDir);
proc.setProcessChannelMode(QProcess::MergedChannels);
proc.start(m_cmdLupdate + ' ' + lupdatecmd, QIODevice::ReadWrite | QIODevice::Text);
- QVERIFY2(proc.waitForFinished(5000), qPrintable(lupdatecmd));
+ QVERIFY2(proc.waitForFinished(30000), qPrintable(lupdatecmd));
QByteArray output = proc.readAll();
QVERIFY2(proc.exitStatus() == QProcess::NormalExit,
"\"lupdate " + lupdatecmd.toLatin1() + "\" crashed\n" + output);
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp
index a631f3d282..f798fafe35 100644
--- a/tests/auto/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp
@@ -112,6 +112,7 @@ private slots:
void columnWrapWithTabs();
void boundingRectForUnsetLineWidth();
void boundingRectForSetLineWidth();
+ void glyphLessItems();
// QTextLine stuff
void setNumColumnsWrapAtWordBoundaryOrAnywhere();
@@ -1339,6 +1340,24 @@ void tst_QTextLayout::lineWidthFromBOM()
// Don't spin into an infinite loop
}
+void tst_QTextLayout::glyphLessItems()
+{
+ {
+ QTextLayout layout;
+ layout.setText("\t\t");
+ layout.beginLayout();
+ layout.createLine();
+ layout.endLayout();
+ }
+
+ {
+ QTextLayout layout;
+ layout.setText(QString::fromLatin1("AA") + QChar(QChar::LineSeparator));
+ layout.beginLayout();
+ layout.createLine();
+ layout.endLayout();
+ }
+}
QTEST_MAIN(tst_QTextLayout)
#include "tst_qtextlayout.moc"
diff --git a/tests/auto/qtimeline/tst_qtimeline.cpp b/tests/auto/qtimeline/tst_qtimeline.cpp
index b15d2a4301..47d0550d01 100644
--- a/tests/auto/qtimeline/tst_qtimeline.cpp
+++ b/tests/auto/qtimeline/tst_qtimeline.cpp
@@ -247,11 +247,7 @@ void tst_QTimeLine::frameRate()
void tst_QTimeLine::value()
{
-#ifdef Q_OS_WINCE //On WinCE timer resolution is bad - use longer times
QTimeLine timeLine(2000);
-#else
- QTimeLine timeLine(200);
-#endif
QVERIFY(timeLine.currentValue() == 0.0);
// Default speed
@@ -270,19 +266,11 @@ void tst_QTimeLine::value()
timeLine.setCurrentTime(100);
timeLine.start();
// Let it update on its own
-#ifdef Q_OS_WINCE
QTest::qWait(500);
-#else
- QTest::qWait(50);
-#endif
QCOMPARE(timeLine.state(), QTimeLine::Running);
qreal value = timeLine.currentValue();
timeLine.setDirection(QTimeLine::Backward);
-#ifdef Q_OS_WINCE
QTest::qWait(1000);
-#else
- QTest::qWait(100);
-#endif
QVERIFY(timeLine.currentValue() < value);
timeLine.stop();
}
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 045216a69a..2d559c8d62 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -151,16 +151,6 @@ bool macHasAccessToWindowsServer()
#undef Bool
#endif
-// Will try to wait for the condition while allowing event processing
-// for a maximum of 2 seconds.
-#define WAIT_FOR_CONDITION(expr, expected) \
- do { \
- const int step = 100; \
- for (int i = 0; i < 2000 && expr != expected; i+=step) { \
- QTest::qWait(step); \
- } \
- } while(0)
-
//TESTED_CLASS=
//TESTED_FILES=
@@ -1665,13 +1655,11 @@ void tst_QWidget::focusChainOnHide()
child->setFocus();
qApp->processEvents();
- WAIT_FOR_CONDITION(child->hasFocus(), true);
- QCOMPARE(child->hasFocus(), true);
+ QTRY_COMPARE(child->hasFocus(), true);
child->hide();
qApp->processEvents();
- WAIT_FOR_CONDITION(parent->hasFocus(), true);
- QCOMPARE(parent->hasFocus(), true);
+ QTRY_COMPARE(parent->hasFocus(), true);
QCOMPARE(parent, qApp->focusWidget());
delete parent;
@@ -9241,7 +9229,8 @@ void tst_QWidget::syntheticEnterLeave()
QCOMPARE(grandChild->numLeaveEvents, 0);
QCOMPARE(child1->numLeaveEvents, 0);
- QCOMPARE(window.numEnterEvents, 1);
+ // This event arrives asynchronously
+ QTRY_COMPARE(window.numEnterEvents, 1);
QCOMPARE(child2->numEnterEvents, 1);
QCOMPARE(grandChild->numEnterEvents, 1);
QCOMPARE(child1->numEnterEvents, 0);
@@ -9332,7 +9321,7 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
child.show();
// Make sure the child gets enter event and no mouse move event.
- QCOMPARE(child.numEnterEvents, 1);
+ QTRY_COMPARE(child.numEnterEvents, 1);
QCOMPARE(child.numMouseMoveEvents, 0);
child.hide();
@@ -9343,7 +9332,7 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
// Make sure the child gets enter event and mouse move event.
// Note that we verify event->button() and event->buttons()
// in SELChild::mouseMoveEvent().
- QCOMPARE(child.numEnterEvents, 1);
+ QTRY_COMPARE(child.numEnterEvents, 1);
QCOMPARE(child.numMouseMoveEvents, 1);
// Sending synthetic enter/leave trough the parent's mousePressEvent handler.
@@ -9354,7 +9343,7 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
QTest::mouseClick(&parent, Qt::LeftButton);
// Make sure the child gets enter event and one mouse move event.
- QCOMPARE(child.numEnterEvents, 1);
+ QTRY_COMPARE(child.numEnterEvents, 1);
QCOMPARE(child.numMouseMoveEvents, 1);
child.hide();
@@ -9363,7 +9352,7 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
QTest::mouseClick(&parent, Qt::LeftButton);
// Make sure the child gets enter event and no mouse move event.
- QCOMPARE(child.numEnterEvents, 1);
+ QTRY_COMPARE(child.numEnterEvents, 1);
QCOMPARE(child.numMouseMoveEvents, 0);
}
#endif
diff --git a/tests/auto/qwidgetaction/tst_qwidgetaction.cpp b/tests/auto/qwidgetaction/tst_qwidgetaction.cpp
index 53dc4b53b5..efe483806e 100644
--- a/tests/auto/qwidgetaction/tst_qwidgetaction.cpp
+++ b/tests/auto/qwidgetaction/tst_qwidgetaction.cpp
@@ -187,12 +187,12 @@ void tst_QWidgetAction::visibilityUpdate()
action->setDefaultWidget(combo);
tb.addAction(action);
- qApp->processEvents(); //the call to show is delayed by the toolbar layout
- QVERIFY(combo->isVisible());
+ //the call to show is delayed by the toolbar layout
+ QTRY_VERIFY(combo->isVisible());
QVERIFY(action->isVisible());
action->setVisible(false);
- qApp->processEvents(); //the call to hide is delayed by the toolbar layout
+ //the call to hide is delayed by the toolbar layout
QTRY_VERIFY(!combo->isVisible());
delete action;