summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-09-11 11:30:01 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-09-11 11:30:01 (GMT)
commit7dab66be83319cf7cd6cf48edc9ed19e154139bc (patch)
treeca6e83b6e85962947c9ea889c5159aff699767de /tests
parent7ea2c96fbd394fe930dc59b611b125ad269ec0ab (diff)
parent42beaa8e1e422a41efe1a398b55db044827f336c (diff)
downloadQt-7dab66be83319cf7cd6cf48edc9ed19e154139bc.zip
Qt-7dab66be83319cf7cd6cf48edc9ed19e154139bc.tar.gz
Qt-7dab66be83319cf7cd6cf48edc9ed19e154139bc.tar.bz2
Merge branch '4.6' of git@scm.dev.troll.no:qt/qt into 4.6
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qbytearray/tst_qbytearray.cpp16
-rw-r--r--tests/auto/qmenubar/tst_qmenubar.cpp7
-rw-r--r--tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp5
-rw-r--r--tests/auto/qtwidgets/tst_qtwidgets.cpp3
4 files changed, 28 insertions, 3 deletions
diff --git a/tests/auto/qbytearray/tst_qbytearray.cpp b/tests/auto/qbytearray/tst_qbytearray.cpp
index 44cfe4a..b0bf3df 100644
--- a/tests/auto/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/qbytearray/tst_qbytearray.cpp
@@ -236,6 +236,7 @@ void tst_QByteArray::qUncompress_data()
void tst_QByteArray::qUncompress()
{
QFETCH(QByteArray, in);
+ QFETCH(QByteArray, out);
#if defined Q_OS_HPUX && !defined __ia64 && defined Q_CC_GNU
QSKIP("Corrupt data causes this tests to lock up on HP-UX / PA-RISC with gcc", SkipAll);
@@ -245,9 +246,20 @@ void tst_QByteArray::qUncompress()
QSKIP("Corrupt data causes this test to lock up on QNX", SkipAll);
#endif
- QTEST(::qUncompress(in), "out");
+ QByteArray res;
+ QT_TRY {
+ res = ::qUncompress(in);
+ } QT_CATCH(const std::bad_alloc &) {
+ res = QByteArray();
+ }
+ QCOMPARE(res, out);
- QTEST(::qUncompress(in + "blah"), "out");
+ QT_TRY {
+ res = ::qUncompress(in + "blah");
+ } QT_CATCH(const std::bad_alloc &) {
+ res = QByteArray();
+ }
+ QCOMPARE(res, out);
}
#endif
diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp
index c74bbcb..07aa9f4 100644
--- a/tests/auto/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/qmenubar/tst_qmenubar.cpp
@@ -1545,22 +1545,27 @@ void tst_QMenuBar::task256322_highlight()
win.show();
QTest::qWait(200);
+ QTest::mousePress(win.menuBar(), Qt::LeftButton, 0, win.menuBar()->actionGeometry(file).center());
QTest::mouseMove(win.menuBar(), win.menuBar()->actionGeometry(file).center());
- QTest::mouseClick(win.menuBar(), Qt::LeftButton, 0, win.menuBar()->actionGeometry(file).center());
+ QTest::mouseRelease(win.menuBar(), Qt::LeftButton, 0, win.menuBar()->actionGeometry(file).center());
QTRY_VERIFY(menu.isVisible());
QVERIFY(!menu2.isVisible());
QCOMPARE(win.menuBar()->activeAction(), file);
+ QTest::mousePress(win.menuBar(), Qt::LeftButton, 0, win.menuBar()->actionGeometry(file2).center());
QTest::mouseMove(win.menuBar(), win.menuBar()->actionGeometry(file2).center());
QTRY_VERIFY(!menu.isVisible());
QVERIFY(menu2.isVisible());
QCOMPARE(win.menuBar()->activeAction(), file2);
+ QTest::mouseRelease(win.menuBar(), Qt::LeftButton, 0, win.menuBar()->actionGeometry(file2).center());
QPoint nothingCenter = win.menuBar()->actionGeometry(nothing).center();
+ QTest::mousePress(win.menuBar(), Qt::LeftButton, 0, nothingCenter);
QTest::mouseMove(win.menuBar(), nothingCenter);
QTRY_VERIFY(!menu2.isVisible());
QVERIFY(!menu.isVisible());
QCOMPARE(win.menuBar()->activeAction(), nothing);
+ QTest::mouseRelease(win.menuBar(), Qt::LeftButton, 0, nothingCenter);
}
void tst_QMenuBar::menubarSizeHint()
diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
index 60bc39e..bea399c 100644
--- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
+++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
@@ -473,6 +473,7 @@ void tst_QPropertyAnimation::startWhenAnotherIsRunning()
{
//normal case: the animation finishes and is deleted
QPointer<QVariantAnimation> anim = new QPropertyAnimation(&o, "ole");
+ anim->setEndValue(100);
QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
anim->start(QVariantAnimation::DeleteWhenStopped);
QTest::qWait(anim->duration() + 50);
@@ -482,10 +483,12 @@ void tst_QPropertyAnimation::startWhenAnotherIsRunning()
{
QPointer<QVariantAnimation> anim = new QPropertyAnimation(&o, "ole");
+ anim->setEndValue(100);
QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
anim->start(QVariantAnimation::DeleteWhenStopped);
QTest::qWait(anim->duration()/2);
QPointer<QVariantAnimation> anim2 = new QPropertyAnimation(&o, "ole");
+ anim2->setEndValue(100);
QCOMPARE(runningSpy.count(), 1);
QCOMPARE(anim->state(), QVariantAnimation::Running);
@@ -634,6 +637,7 @@ void tst_QPropertyAnimation::playForwardBackward()
QCOMPARE(o.property("ole").toInt(), 0);
QPropertyAnimation anim(&o, "ole");
+ anim.setStartValue(0);
anim.setEndValue(100);
anim.start();
QTest::qWait(anim.duration() + 50);
@@ -906,6 +910,7 @@ void tst_QPropertyAnimation::operationsInStates()
QObject o;
o.setProperty("ole", 42);
QPropertyAnimation anim(&o, "ole");
+ anim.setEndValue(100);
QSignalSpy spy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
anim.stop();
diff --git a/tests/auto/qtwidgets/tst_qtwidgets.cpp b/tests/auto/qtwidgets/tst_qtwidgets.cpp
index 12bc02f..a765bde 100644
--- a/tests/auto/qtwidgets/tst_qtwidgets.cpp
+++ b/tests/auto/qtwidgets/tst_qtwidgets.cpp
@@ -72,6 +72,8 @@ tst_QtWidgets::~tst_QtWidgets()
void tst_QtWidgets::snapshot()
{
+ QSKIP("Jesper will fix this test when he has time.", SkipAll);
+#if 0
StyleWidget widget(0, Qt::X11BypassWindowManagerHint);
widget.show();
@@ -100,6 +102,7 @@ void tst_QtWidgets::snapshot()
}
QVERIFY2(ftp.error() == QFtp::NoError, ftp.errorString().toLocal8Bit().constData());
QVERIFY(!ftp.hasPendingCommands());
+#endif
}