summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/modeltest/modeltest.cpp4
-rw-r--r--tests/auto/qanimationgroup/tst_qanimationgroup.cpp26
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp2
-rw-r--r--tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro1
-rw-r--r--tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro1
-rw-r--r--tests/auto/qmenubar/tst_qmenubar.cpp36
-rw-r--r--tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp22
-rw-r--r--tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp16
-rw-r--r--tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp57
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp34
-rw-r--r--tests/auto/qtabbar/tst_qtabbar.cpp2
-rw-r--r--tests/auto/windowsmobile/test/tst_windowsmobile.cpp2
12 files changed, 124 insertions, 79 deletions
diff --git a/tests/auto/modeltest/modeltest.cpp b/tests/auto/modeltest/modeltest.cpp
index 68b723f..c4cc820 100644
--- a/tests/auto/modeltest/modeltest.cpp
+++ b/tests/auto/modeltest/modeltest.cpp
@@ -475,7 +475,7 @@ void ModelTest::data()
void ModelTest::rowsAboutToBeInserted ( const QModelIndex &parent, int start, int end )
{
// Q_UNUSED(end);
- qDebug() << "rowsAboutToBeInserted" << "start=" << start << "end=" << end << "parent=" << model->data ( parent ).value<QString>()
+ qDebug() << "rowsAboutToBeInserted" << "start=" << start << "end=" << end << "parent=" << model->data ( parent ).toString()
<< "current count of parent=" << model->rowCount ( parent ); // << "display of last=" << model->data( model->index(start-1, 0, parent) );
// qDebug() << model->index(start-1, 0, parent) << model->data( model->index(start-1, 0, parent) );
Changing c;
@@ -496,7 +496,7 @@ void ModelTest::rowsInserted ( const QModelIndex & parent, int start, int end )
Changing c = insert.pop();
Q_ASSERT ( c.parent == parent );
qDebug() << "rowsInserted" << "start=" << start << "end=" << end << "oldsize=" << c.oldSize
- << "parent=" << model->data ( parent ).value<QString>() << "current rowcount of parent=" << model->rowCount ( parent );
+ << "parent=" << model->data ( parent ).toString() << "current rowcount of parent=" << model->rowCount ( parent );
for (int ii=start; ii <= end; ii++)
{
diff --git a/tests/auto/qanimationgroup/tst_qanimationgroup.cpp b/tests/auto/qanimationgroup/tst_qanimationgroup.cpp
index 0457f8f..0e98797 100644
--- a/tests/auto/qanimationgroup/tst_qanimationgroup.cpp
+++ b/tests/auto/qanimationgroup/tst_qanimationgroup.cpp
@@ -206,9 +206,9 @@ void tst_QAnimationGroup::setCurrentTime()
// sequence operating on same object/property
QSequentialAnimationGroup *sequence = new QSequentialAnimationGroup();
- QVariantAnimation *a1_s_o1 = new QPropertyAnimation(&s_o1, "value");
- QVariantAnimation *a2_s_o1 = new QPropertyAnimation(&s_o1, "value");
- QVariantAnimation *a3_s_o1 = new QPropertyAnimation(&s_o1, "value");
+ QAbstractAnimation *a1_s_o1 = new QPropertyAnimation(&s_o1, "value");
+ QAbstractAnimation *a2_s_o1 = new QPropertyAnimation(&s_o1, "value");
+ QAbstractAnimation *a3_s_o1 = new QPropertyAnimation(&s_o1, "value");
a2_s_o1->setLoopCount(3);
sequence->addAnimation(a1_s_o1);
sequence->addAnimation(a2_s_o1);
@@ -216,25 +216,25 @@ void tst_QAnimationGroup::setCurrentTime()
// sequence operating on different object/properties
QAnimationGroup *sequence2 = new QSequentialAnimationGroup();
- QVariantAnimation *a1_s_o2 = new QPropertyAnimation(&s_o2, "value");
- QVariantAnimation *a1_s_o3 = new QPropertyAnimation(&s_o3, "value");
+ QAbstractAnimation *a1_s_o2 = new QPropertyAnimation(&s_o2, "value");
+ QAbstractAnimation *a1_s_o3 = new QPropertyAnimation(&s_o3, "value");
sequence2->addAnimation(a1_s_o2);
sequence2->addAnimation(a1_s_o3);
// parallel operating on different object/properties
QAnimationGroup *parallel = new QParallelAnimationGroup();
- QVariantAnimation *a1_p_o1 = new QPropertyAnimation(&p_o1, "value");
- QVariantAnimation *a1_p_o2 = new QPropertyAnimation(&p_o2, "value");
- QVariantAnimation *a1_p_o3 = new QPropertyAnimation(&p_o3, "value");
+ QAbstractAnimation *a1_p_o1 = new QPropertyAnimation(&p_o1, "value");
+ QAbstractAnimation *a1_p_o2 = new QPropertyAnimation(&p_o2, "value");
+ QAbstractAnimation *a1_p_o3 = new QPropertyAnimation(&p_o3, "value");
a1_p_o2->setLoopCount(3);
parallel->addAnimation(a1_p_o1);
parallel->addAnimation(a1_p_o2);
parallel->addAnimation(a1_p_o3);
- UncontrolledAnimation *notTimeDriven = new UncontrolledAnimation(&t_o1, "value");
+ QAbstractAnimation *notTimeDriven = new UncontrolledAnimation(&t_o1, "value");
QCOMPARE(notTimeDriven->totalDuration(), -1);
- QVariantAnimation *loopsForever = new QPropertyAnimation(&t_o2, "value");
+ QAbstractAnimation *loopsForever = new QPropertyAnimation(&t_o2, "value");
loopsForever->setLoopCount(-1);
QCOMPARE(loopsForever->totalDuration(), -1);
@@ -318,7 +318,7 @@ void tst_QAnimationGroup::setParentAutoAdd()
{
QParallelAnimationGroup group;
QVariantAnimation *animation = new QPropertyAnimation(&group);
- QCOMPARE(animation->group(), &group);
+ QCOMPARE(animation->group(), static_cast<QAnimationGroup*>(&group));
}
void tst_QAnimationGroup::beginNestedGroup()
@@ -347,8 +347,8 @@ void tst_QAnimationGroup::beginNestedGroup()
void tst_QAnimationGroup::addChildTwice()
{
- QPropertyAnimation *subGroup;
- QPropertyAnimation *subGroup2;
+ QAbstractAnimation *subGroup;
+ QAbstractAnimation *subGroup2;
QAnimationGroup *parent = new QSequentialAnimationGroup();
subGroup = new QPropertyAnimation();
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index e8a6d10..981efeb 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -3952,7 +3952,7 @@ void tst_QGraphicsItem::itemChange()
QCOMPARE(tester.changes.size(), changeCount);
QCOMPARE(tester.changes.at(tester.changes.size() - 2), QGraphicsItem::ItemFlagsChange);
QCOMPARE(tester.changes.at(tester.changes.size() - 1), QGraphicsItem::ItemFlagsHaveChanged);
- QVariant expectedFlags = qVariantFromValue<quint32>(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemSendsGeometryChanges);
+ QVariant expectedFlags = qVariantFromValue<quint32>(QGraphicsItem::GraphicsItemFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemSendsGeometryChanges));
QCOMPARE(tester.values.at(tester.values.size() - 2), expectedFlags);
QCOMPARE(tester.values.at(tester.values.size() - 1), qVariantFromValue<quint32>(QGraphicsItem::ItemIsSelectable));
}
diff --git a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro
index bc750c5..3283873 100644
--- a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro
+++ b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro
@@ -1,4 +1,5 @@
load(qttest_p4)
SOURCES += tst_qhttpnetworkconnection.cpp
+INCLUDEPATH += $$(QTDIR)/src/3rdparty/zlib
QT = core network
diff --git a/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro b/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro
index 9593c55..0755055 100644
--- a/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro
+++ b/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro
@@ -1,4 +1,5 @@
load(qttest_p4)
SOURCES += tst_qhttpnetworkreply.cpp
+INCLUDEPATH += $$(QTDIR)/src/3rdparty/zlib
QT = core network
diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp
index 5404d46..8a38782 100644
--- a/tests/auto/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/qmenubar/tst_qmenubar.cpp
@@ -149,6 +149,7 @@ private slots:
void check_shortcutPress();
void check_menuPosition();
void task223138_triggered();
+ void task256322_highlight();
#if defined(QT3_SUPPORT)
void indexBasedInsertion_data();
@@ -1520,6 +1521,41 @@ void tst_QMenuBar::task223138_triggered()
QCOMPARE(submenuSpy.count(), 1);
}
+void tst_QMenuBar::task256322_highlight()
+{
+ QMainWindow win;
+ QMenu menu;
+ QAction *file = win.menuBar()->addMenu(&menu);
+ file->setText("file");
+ QMenu menu2;
+ QAction *file2 = win.menuBar()->addMenu(&menu2);
+ file2->setText("file2");
+ QAction *nothing = win.menuBar()->addAction("nothing");
+
+ win.show();
+
+ QTest::mouseClick(win.menuBar(), Qt::LeftButton, 0, win.menuBar()->actionGeometry(file).center());
+ QVERIFY(menu.isVisible());
+ QVERIFY(!menu2.isVisible());
+ QCOMPARE(win.menuBar()->activeAction(), file);
+
+ QTest::mouseMove(win.menuBar(), win.menuBar()->actionGeometry(file2).center());
+ QVERIFY(!menu.isVisible());
+ QVERIFY(menu2.isVisible());
+ QCOMPARE(win.menuBar()->activeAction(), file2);
+
+ QTest::mouseMove(win.menuBar(), win.menuBar()->actionGeometry(nothing).center());
+ QVERIFY(!menu.isVisible());
+ QVERIFY(!menu2.isVisible());
+ QCOMPARE(win.menuBar()->activeAction(), nothing);
+
+ QTest::mouseMove(&win, win.menuBar()->geometry().bottomLeft() + QPoint(1,1));
+
+ QVERIFY(!menu.isVisible());
+ QVERIFY(!menu2.isVisible());
+ QVERIFY(!win.menuBar()->activeAction());
+}
+
#if defined(QT3_SUPPORT)
void tst_QMenuBar::indexBasedInsertion_data()
diff --git a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
index 9f66fe0..d7d6b88 100644
--- a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
+++ b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
@@ -253,16 +253,16 @@ void tst_QParallelAnimationGroup::setCurrentTime()
void tst_QParallelAnimationGroup::clearGroup()
{
QParallelAnimationGroup group;
+ static const int animationCount = 10;
- for (int i = 0; i < 10; ++i) {
+ for (int i = 0; i < animationCount; ++i) {
new QParallelAnimationGroup(&group);
}
- QCOMPARE(group.animationCount(), 10);
+ QCOMPARE(group.animationCount(), animationCount);
- int count = group.animationCount();
- QPointer<QAbstractAnimation> *children = new QPointer<QAbstractAnimation>[count];
- for (int i = 0; i < count; ++i) {
+ QPointer<QAbstractAnimation> children[animationCount];
+ for (int i = 0; i < animationCount; ++i) {
QVERIFY(group.animationAt(i) != 0);
children[i] = group.animationAt(i);
}
@@ -270,10 +270,8 @@ void tst_QParallelAnimationGroup::clearGroup()
group.clearAnimations();
QCOMPARE(group.animationCount(), 0);
QCOMPARE(group.currentTime(), 0);
- for (int i = 0; i < count; ++i)
- QCOMPARE(children[i], QPointer<QAbstractAnimation>());
-
- delete[] children;
+ for (int i = 0; i < animationCount; ++i)
+ QVERIFY(children[i].isNull());
}
void tst_QParallelAnimationGroup::propagateGroupUpdateToChildren()
@@ -807,15 +805,15 @@ void tst_QParallelAnimationGroup::autoAdd()
QParallelAnimationGroup group;
QCOMPARE(group.duration(), 0);
TestAnimation2 *test = new TestAnimation2(250, &group); // 0, duration = 250;
- QCOMPARE(test->group(), &group);
+ QCOMPARE(test->group(), static_cast<QAnimationGroup*>(&group));
QCOMPARE(test->duration(), 250);
QCOMPARE(group.duration(), 250);
test = new TestAnimation2(750, &group); // 1
- QCOMPARE(test->group(), &group);
+ QCOMPARE(test->group(), static_cast<QAnimationGroup*>(&group));
QCOMPARE(group.duration(), 750);
test = new TestAnimation2(500, &group); // 2
- QCOMPARE(test->group(), &group);
+ QCOMPARE(test->group(), static_cast<QAnimationGroup*>(&group));
QCOMPARE(group.duration(), 750);
delete group.animationAt(1); // remove the one with duration = 750
diff --git a/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp b/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp
index 5d9f56f..cbdaf1e 100644
--- a/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp
+++ b/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp
@@ -111,9 +111,11 @@ void tst_QScriptEngineDebugger::attachAndDetach()
{
{
QScriptEngineDebugger debugger;
+ QCOMPARE(debugger.state(), QScriptEngineDebugger::SuspendedState);
debugger.attachTo(0);
QScriptEngine engine;
debugger.attachTo(&engine);
+ QCOMPARE(debugger.state(), QScriptEngineDebugger::SuspendedState);
}
{
QScriptEngineDebugger debugger;
@@ -129,11 +131,9 @@ void tst_QScriptEngineDebugger::attachAndDetach()
QVERIFY(!engine.globalObject().property("print").strictlyEquals(oldPrint));
debugger.detach();
- QEXPECT_FAIL("", "Task 256184", Continue);
- QVERIFY(!engine.globalObject().property("print").isValid());
- QEXPECT_FAIL("", "Task 256184", Continue);
+ QVERIFY(engine.globalObject().property("print").strictlyEquals(oldPrint));
QVERIFY(!engine.globalObject().property("__FILE__").isValid());
-// QVERIFY(!engine.globalObject().property("__LINE__").isValid());
+ QVERIFY(!engine.globalObject().property("__LINE__").isValid());
}
{
QScriptEngineDebugger debugger;
@@ -161,6 +161,14 @@ void tst_QScriptEngineDebugger::attachAndDetach()
debugger2.attachTo(&engine);
}
#endif
+ {
+ QScriptEngine *engine = new QScriptEngine;
+ QScriptEngineDebugger debugger;
+ debugger.attachTo(engine);
+ delete engine;
+ QScriptEngine engine2;
+ debugger.attachTo(&engine2);
+ }
}
void tst_QScriptEngineDebugger::action()
diff --git a/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp b/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
index 522a900..97ff04b 100644
--- a/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
+++ b/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
@@ -321,15 +321,15 @@ void tst_QSequentialAnimationGroup::setCurrentTimeWithUncontrolledAnimation()
// sequence operating on different object/properties
QAnimationGroup *sequence = new QSequentialAnimationGroup();
- QVariantAnimation *a1_s_o1 = new QPropertyAnimation(&s_o1, "value");
- QVariantAnimation *a1_s_o2 = new QPropertyAnimation(&s_o2, "value");
+ QAbstractAnimation *a1_s_o1 = new QPropertyAnimation(&s_o1, "value");
+ QAbstractAnimation *a1_s_o2 = new QPropertyAnimation(&s_o2, "value");
sequence->addAnimation(a1_s_o1);
sequence->addAnimation(a1_s_o2);
- UncontrolledAnimation *notTimeDriven = new UncontrolledAnimation(&t_o1, "value");
+ QAbstractAnimation *notTimeDriven = new UncontrolledAnimation(&t_o1, "value");
QCOMPARE(notTimeDriven->totalDuration(), -1);
- QVariantAnimation *loopsForever = new QPropertyAnimation(&t_o2, "value");
+ QAbstractAnimation *loopsForever = new QPropertyAnimation(&t_o2, "value");
loopsForever->setLoopCount(-1);
QCOMPARE(loopsForever->totalDuration(), -1);
@@ -818,7 +818,7 @@ void tst_QSequentialAnimationGroup::restart()
QCOMPARE(seqCurrentAnimChangedSpy.count(), 6);
for(int i=0; i<seqCurrentAnimChangedSpy.count(); i++)
- QCOMPARE(anims[i%3], qVariantValue<QAbstractAnimation*>(seqCurrentAnimChangedSpy.at(i).at(0)));
+ QCOMPARE(static_cast<QAbstractAnimation*>(anims[i%3]), qVariantValue<QAbstractAnimation*>(seqCurrentAnimChangedSpy.at(i).at(0)));
group.start();
@@ -836,9 +836,9 @@ void tst_QSequentialAnimationGroup::looping()
// sequence operating on same object/property
QSequentialAnimationGroup *sequence = new QSequentialAnimationGroup();
- QVariantAnimation *a1_s_o1 = new QPropertyAnimation(&s_o1, "value");
- QVariantAnimation *a2_s_o1 = new QPropertyAnimation(&s_o1, "value");
- QVariantAnimation *a3_s_o1 = new QPropertyAnimation(&s_o1, "value");
+ QAbstractAnimation *a1_s_o1 = new QPropertyAnimation(&s_o1, "value");
+ QAbstractAnimation *a2_s_o1 = new QPropertyAnimation(&s_o1, "value");
+ QAbstractAnimation *a3_s_o1 = new QPropertyAnimation(&s_o1, "value");
QSignalSpy a1Spy(a1_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy a2Spy(a2_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
@@ -951,18 +951,19 @@ void tst_QSequentialAnimationGroup::startDelay()
void tst_QSequentialAnimationGroup::clearGroup()
{
QSequentialAnimationGroup group;
+
+ static const int animationCount = 20;
- for (int i = 0; i < 10; ++i) {
+ for (int i = 0; i < animationCount/2; ++i) {
QSequentialAnimationGroup *subGroup = new QSequentialAnimationGroup(&group);
group.addPause(100);
subGroup->addPause(10);
}
- QCOMPARE(group.animationCount(), 20);
+ QCOMPARE(group.animationCount(), animationCount);
- int count = group.animationCount();
- QPointer<QAbstractAnimation> *children = new QPointer<QAbstractAnimation>[count];
- for (int i = 0; i < count; ++i) {
+ QPointer<QAbstractAnimation> children[animationCount];
+ for (int i = 0; i < animationCount; ++i) {
QVERIFY(group.animationAt(i) != 0);
children[i] = group.animationAt(i);
}
@@ -970,10 +971,8 @@ void tst_QSequentialAnimationGroup::clearGroup()
group.clearAnimations();
QCOMPARE(group.animationCount(), 0);
QCOMPARE(group.currentTime(), 0);
- for (int i = 0; i < count; ++i)
- QCOMPARE(children[i], QPointer<QAbstractAnimation>());
-
- delete[] children;
+ for (int i = 0; i < animationCount; ++i)
+ QVERIFY(children[i].isNull());
}
void tst_QSequentialAnimationGroup::groupWithZeroDurationAnimations()
@@ -995,7 +994,7 @@ void tst_QSequentialAnimationGroup::groupWithZeroDurationAnimations()
//this should just run fine and change nothing
group.setCurrentTime(0);
- QCOMPARE(group.currentAnimation(), a1);
+ QCOMPARE(group.currentAnimation(), static_cast<QAbstractAnimation*>(a1));
QVariantAnimation *a2 = new QPropertyAnimation(&o2, "myOtherProperty");
a2->setDuration(500);
@@ -1457,7 +1456,7 @@ void tst_QSequentialAnimationGroup::finishWithUncontrolledAnimation()
group.setCurrentTime(300);
QCOMPARE(group.state(), QAnimationGroup::Stopped);
QCOMPARE(notTimeDriven.currentTime(), actualDuration);
- QCOMPARE(group.currentAnimation(), &anim);
+ QCOMPARE(group.currentAnimation(), static_cast<QAbstractAnimation*>(&anim));
//3rd case:
//now let's add a perfectly defined animation at the end
@@ -1474,7 +1473,7 @@ void tst_QSequentialAnimationGroup::finishWithUncontrolledAnimation()
QCOMPARE(notTimeDriven.state(), QAnimationGroup::Stopped);
QCOMPARE(group.state(), QAnimationGroup::Running);
QCOMPARE(anim.state(), QAnimationGroup::Running);
- QCOMPARE(group.currentAnimation(), &anim);
+ QCOMPARE(group.currentAnimation(), static_cast<QAbstractAnimation*>(&anim));
QCOMPARE(animStateChangedSpy.count(), 1);
QTest::qWait(300); //wait for the end of anim
@@ -1494,21 +1493,21 @@ void tst_QSequentialAnimationGroup::addRemoveAnimation()
QCOMPARE(group.duration(), 0);
QCOMPARE(group.currentTime(), 0);
- QVariantAnimation *anim1 = new QPropertyAnimation;
+ QAbstractAnimation *anim1 = new QPropertyAnimation;
group.addAnimation(anim1);
QCOMPARE(group.duration(), 250);
QCOMPARE(group.currentTime(), 0);
QCOMPARE(group.currentAnimation(), anim1);
//let's append an animation
- QVariantAnimation *anim2 = new QPropertyAnimation;
+ QAbstractAnimation *anim2 = new QPropertyAnimation;
group.addAnimation(anim2);
QCOMPARE(group.duration(), 500);
QCOMPARE(group.currentTime(), 0);
QCOMPARE(group.currentAnimation(), anim1);
//let's prepend an animation
- QVariantAnimation *anim0 = new QPropertyAnimation;
+ QAbstractAnimation *anim0 = new QPropertyAnimation;
group.insertAnimationAt(0, anim0);
QCOMPARE(group.duration(), 750);
QCOMPARE(group.currentTime(), 0);
@@ -1545,7 +1544,7 @@ void tst_QSequentialAnimationGroup::currentAnimation()
QPropertyAnimation anim;
anim.setDuration(0);
group.addAnimation(&anim);
- QCOMPARE(group.currentAnimation(), &anim);
+ QCOMPARE(group.currentAnimation(), static_cast<QAbstractAnimation*>(&anim));
}
void tst_QSequentialAnimationGroup::currentAnimationWithZeroDuration()
@@ -1572,21 +1571,21 @@ void tst_QSequentialAnimationGroup::currentAnimationWithZeroDuration()
group.addAnimation(&zero3);
group.addAnimation(&zero4);
- QCOMPARE(group.currentAnimation(), &zero1);
+ QCOMPARE(group.currentAnimation(), static_cast<QAbstractAnimation*>(&zero1));
group.setCurrentTime(0);
- QCOMPARE(group.currentAnimation(), &anim);
+ QCOMPARE(group.currentAnimation(), static_cast<QAbstractAnimation*>(&anim));
group.setCurrentTime(group.duration());
- QCOMPARE(group.currentAnimation(), &zero4);
+ QCOMPARE(group.currentAnimation(), static_cast<QAbstractAnimation*>(&zero4));
group.setDirection(QAbstractAnimation::Backward);
group.setCurrentTime(0);
- QCOMPARE(group.currentAnimation(), &zero1);
+ QCOMPARE(group.currentAnimation(), static_cast<QAbstractAnimation*>(&zero1));
group.setCurrentTime(group.duration());
- QCOMPARE(group.currentAnimation(), &anim);
+ QCOMPARE(group.currentAnimation(), static_cast<QAbstractAnimation*>(&anim));
}
void tst_QSequentialAnimationGroup::insertAnimation()
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index cd0c71d..b39f0a1 100644
--- a/tests/auto/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp
@@ -413,7 +413,7 @@ void tst_QStateMachine::customGlobalErrorState()
machine.start();
QCoreApplication::processEvents();
- QCOMPARE(machine.errorState(), customErrorState);
+ QCOMPARE(machine.errorState(), static_cast<QAbstractState*>(customErrorState));
QCOMPARE(machine.configuration().count(), 1);
QVERIFY(machine.configuration().contains(initialState));
@@ -778,7 +778,7 @@ void tst_QStateMachine::customErrorStateIsNull()
QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: Missing initial state in compound state ''");
QCoreApplication::processEvents();
- QCOMPARE(machine.errorState(), reinterpret_cast<void *>(0));
+ QCOMPARE(machine.errorState(), reinterpret_cast<QAbstractState *>(0));
QCOMPARE(machine.configuration().count(), 1);
QVERIFY(machine.configuration().contains(oldErrorState));
}
@@ -1103,29 +1103,29 @@ void tst_QStateMachine::stateEntryAndExit()
TestTransition *t = new TestTransition(s2);
QCOMPARE(t->machine(), (QStateMachine*)0);
QCOMPARE(t->sourceState(), (QState*)0);
- QCOMPARE(t->targetState(), s2);
+ QCOMPARE(t->targetState(), (QAbstractState*)s2);
QCOMPARE(t->targetStates().size(), 1);
- QCOMPARE(t->targetStates().at(0), s2);
+ QCOMPARE(t->targetStates().at(0), (QAbstractState*)s2);
t->setTargetState(0);
- QCOMPARE(t->targetState(), (QState*)0);
+ QCOMPARE(t->targetState(), (QAbstractState*)0);
QVERIFY(t->targetStates().isEmpty());
t->setTargetState(s2);
- QCOMPARE(t->targetState(), s2);
+ QCOMPARE(t->targetState(), (QAbstractState*)s2);
QTest::ignoreMessage(QtWarningMsg, "QAbstractTransition::setTargetStates: target state(s) cannot be null");
t->setTargetStates(QList<QAbstractState*>() << 0);
- QCOMPARE(t->targetState(), s2);
+ QCOMPARE(t->targetState(), (QAbstractState*)s2);
t->setTargetStates(QList<QAbstractState*>() << s2);
- QCOMPARE(t->targetState(), s2);
+ QCOMPARE(t->targetState(), (QAbstractState*)s2);
QCOMPARE(t->targetStates().size(), 1);
- QCOMPARE(t->targetStates().at(0), s2);
+ QCOMPARE(t->targetStates().at(0), (QAbstractState*)s2);
QCOMPARE(s1->addTransition(t), (QAbstractTransition*)t);
- QCOMPARE(t->sourceState(), s1);
+ QCOMPARE(t->sourceState(), (QState*)s1);
QCOMPARE(t->machine(), &machine);
{
QAbstractTransition *trans = s2->addTransition(s3);
QVERIFY(trans != 0);
- QCOMPARE(trans->sourceState(), (QAbstractState*)s2);
+ QCOMPARE(trans->sourceState(), (QState*)s2);
QCOMPARE(trans->targetState(), (QAbstractState*)s3);
{
char warning[256];
@@ -1134,10 +1134,10 @@ void tst_QStateMachine::stateEntryAndExit()
s1->removeTransition(trans);
}
s2->removeTransition(trans);
- QCOMPARE(trans->sourceState(), (QAbstractState*)0);
+ QCOMPARE(trans->sourceState(), (QState*)0);
QCOMPARE(trans->targetState(), (QAbstractState*)s3);
QCOMPARE(s2->addTransition(trans), trans);
- QCOMPARE(trans->sourceState(), (QAbstractState*)s2);
+ QCOMPARE(trans->sourceState(), (QState*)s2);
}
QSignalSpy startedSpy(&machine, SIGNAL(started()));
@@ -1724,18 +1724,18 @@ void tst_QStateMachine::signalTransitions()
QStateMachine machine;
QState *s0 = new QState(machine.rootState());
QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: sender cannot be null");
- QCOMPARE(s0->addTransition(0, SIGNAL(noSuchSignal()), 0), (QObject*)0);
+ QCOMPARE(s0->addTransition(0, SIGNAL(noSuchSignal()), 0), (QSignalTransition*)0);
SignalEmitter emitter;
QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: signal cannot be null");
- QCOMPARE(s0->addTransition(&emitter, 0, 0), (QObject*)0);
+ QCOMPARE(s0->addTransition(&emitter, 0, 0), (QSignalTransition*)0);
QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: cannot add transition to null state");
- QCOMPARE(s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), 0), (QObject*)0);
+ QCOMPARE(s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), 0), (QSignalTransition*)0);
QFinalState *s1 = new QFinalState(machine.rootState());
QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: no such signal SignalEmitter::noSuchSignal()");
- QCOMPARE(s0->addTransition(&emitter, SIGNAL(noSuchSignal()), s1), (QObject*)0);
+ QCOMPARE(s0->addTransition(&emitter, SIGNAL(noSuchSignal()), s1), (QSignalTransition*)0);
QSignalTransition *trans = s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), s1);
QVERIFY(trans != 0);
diff --git a/tests/auto/qtabbar/tst_qtabbar.cpp b/tests/auto/qtabbar/tst_qtabbar.cpp
index 29f42df..f908d3f 100644
--- a/tests/auto/qtabbar/tst_qtabbar.cpp
+++ b/tests/auto/qtabbar/tst_qtabbar.cpp
@@ -370,7 +370,7 @@ void tst_QTabBar::tabButton()
tabbar.setTabButton(0, position, button);
- QCOMPARE(tabbar.tabButton(0, position), static_cast<const QWidget *>(button));
+ QCOMPARE(tabbar.tabButton(0, position), static_cast<QWidget *>(button));
QTRY_VERIFY(!button->isHidden());
QVERIFY(tabbar.tabButton(0, otherSide) == 0);
QCOMPARE(button->parent(), static_cast<QObject *>(&tabbar));
diff --git a/tests/auto/windowsmobile/test/tst_windowsmobile.cpp b/tests/auto/windowsmobile/test/tst_windowsmobile.cpp
index 843974d..8c7c021 100644
--- a/tests/auto/windowsmobile/test/tst_windowsmobile.cpp
+++ b/tests/auto/windowsmobile/test/tst_windowsmobile.cpp
@@ -44,8 +44,10 @@
#include <QtCore/QDebug>
#include <QtCore/QObject>
#include <QtGui>
+#ifdef Q_OS_WINCE_WM
#include <windows.h>
#include <ddhelper.h>
+#endif