diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-10-30 11:35:49 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-10-30 11:35:49 (GMT) |
commit | 30b0902cf05b0c1dc649e9c2e7ae0415e0c1d042 (patch) | |
tree | b8b8bc89c7e0f09abf7426f0696815554b2a1ab9 /tests | |
parent | 6fbd9589cbe77c4d3213ba43c7e88fc451c9664e (diff) | |
download | Qt-30b0902cf05b0c1dc649e9c2e7ae0415e0c1d042.zip Qt-30b0902cf05b0c1dc649e9c2e7ae0415e0c1d042.tar.gz Qt-30b0902cf05b0c1dc649e9c2e7ae0415e0c1d042.tar.bz2 |
Remove the unnecessary (and broken) tst_QMouseEvent::checkMouseMoveEvent() test
According to people responsible for the test, it is not
necessary. This partially reverts commit
b1f9882fa52745c922eb0109daa011908214dcf7.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qmouseevent/tst_qmouseevent.cpp | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/tests/auto/qmouseevent/tst_qmouseevent.cpp b/tests/auto/qmouseevent/tst_qmouseevent.cpp index d700181..b961851 100644 --- a/tests/auto/qmouseevent/tst_qmouseevent.cpp +++ b/tests/auto/qmouseevent/tst_qmouseevent.cpp @@ -62,7 +62,6 @@ public: } bool mousePressEventRecieved; bool mouseReleaseEventRecieved; - bool mouseMoveEventRecieved; #ifdef QT3_SUPPORT int mousePressStateBefore; int mousePressStateAfter; @@ -77,13 +76,6 @@ public: int mouseReleaseButton; int mouseReleaseButtons; int mouseReleaseModifiers; -#ifdef QT3_SUPPORT - int mouseMoveStateBefore; - int mouseMoveStateAfter; -#endif - int mouseMoveButton; - int mouseMoveButtons; - int mouseMoveModifiers; protected: void mousePressEvent(QMouseEvent *e) { @@ -111,19 +103,6 @@ protected: mouseReleaseEventRecieved = TRUE; e->accept(); } - void mouseMoveEvent(QMouseEvent *e) - { - QWidget::mouseMoveEvent(e); -#ifdef QT3_SUPPORT - mouseMoveStateBefore = e->state(); - mouseMoveStateAfter = e->stateAfter(); -#endif - mouseMoveButton = e->button(); - mouseMoveButtons = e->buttons(); - mouseMoveModifiers = e->modifiers(); - mouseMoveEventRecieved = TRUE; - e->accept(); - } }; class tst_QMouseEvent : public QObject @@ -145,8 +124,6 @@ private slots: void checkMousePressEvent(); void checkMouseReleaseEvent_data(); void checkMouseReleaseEvent(); - void checkMouseMoveEvent_data(); - void checkMouseMoveEvent(); void qt3supportConstructors(); @@ -180,14 +157,11 @@ void tst_QMouseEvent::init() { testMouseWidget->mousePressEventRecieved = FALSE; testMouseWidget->mouseReleaseEventRecieved = FALSE; - testMouseWidget->mouseMoveEventRecieved = FALSE; #ifdef QT3_SUPPORT testMouseWidget->mousePressStateBefore = 0; testMouseWidget->mousePressStateAfter = 0; testMouseWidget->mouseReleaseStateBefore = 0; testMouseWidget->mouseReleaseStateAfter = 0; - testMouseWidget->mouseMoveStateBefore = 0; - testMouseWidget->mouseMoveStateAfter = 0; #endif testMouseWidget->mousePressButton = 0; testMouseWidget->mousePressButtons = 0; @@ -195,9 +169,6 @@ void tst_QMouseEvent::init() testMouseWidget->mouseReleaseButton = 0; testMouseWidget->mouseReleaseButtons = 0; testMouseWidget->mouseReleaseModifiers = 0; - testMouseWidget->mouseMoveButton = 0; - testMouseWidget->mouseMoveButtons = 0; - testMouseWidget->mouseMoveModifiers = 0; } void tst_QMouseEvent::cleanup() @@ -294,52 +265,6 @@ void tst_QMouseEvent::checkMouseReleaseEvent() #endif } -void tst_QMouseEvent::checkMouseMoveEvent_data() -{ - QTest::addColumn<int>("buttonMoved"); - QTest::addColumn<int>("keyPressed"); - - QTest::newRow("leftButton-nokey") << int(Qt::LeftButton) << int(Qt::NoButton); - QTest::newRow("leftButton-shiftkey") << int(Qt::LeftButton) << int(Qt::ShiftModifier); - QTest::newRow("leftButton-controlkey") << int(Qt::LeftButton) << int(Qt::ControlModifier); - QTest::newRow("leftButton-altkey") << int(Qt::LeftButton) << int(Qt::AltModifier); - QTest::newRow("leftButton-metakey") << int(Qt::LeftButton) << int(Qt::MetaModifier); - QTest::newRow("rightButton-nokey") << int(Qt::RightButton) << int(Qt::NoButton); - QTest::newRow("rightButton-shiftkey") << int(Qt::RightButton) << int(Qt::ShiftModifier); - QTest::newRow("rightButton-controlkey") << int(Qt::RightButton) << int(Qt::ControlModifier); - QTest::newRow("rightButton-altkey") << int(Qt::RightButton) << int(Qt::AltModifier); - QTest::newRow("rightButton-metakey") << int(Qt::RightButton) << int(Qt::MetaModifier); - QTest::newRow("midButton-nokey") << int(Qt::MidButton) << int(Qt::NoButton); - QTest::newRow("midButton-shiftkey") << int(Qt::MidButton) << int(Qt::ShiftModifier); - QTest::newRow("midButton-controlkey") << int(Qt::MidButton) << int(Qt::ControlModifier); - QTest::newRow("midButton-altkey") << int(Qt::MidButton) << int(Qt::AltModifier); - QTest::newRow("midButton-metakey") << int(Qt::MidButton) << int(Qt::MetaModifier); -} - -void tst_QMouseEvent::checkMouseMoveEvent() -{ - QFETCH(int,buttonMoved); - QFETCH(int,keyPressed); - int button = (int)Qt::NoButton; - int buttons = buttonMoved; - int modifiers = keyPressed; - - QTest::mousePress(testMouseWidget, Qt::MouseButton(buttonMoved), Qt::KeyboardModifiers(keyPressed)); - QTest::mouseMove(testMouseWidget, QPoint(10,10)); - QVERIFY(testMouseWidget->mouseMoveEventRecieved); - QCOMPARE(testMouseWidget->mouseMoveButton, button); - QCOMPARE(testMouseWidget->mouseMoveButtons, buttons); - QCOMPARE(testMouseWidget->mouseMoveModifiers, modifiers); -#ifdef QT3_SUPPORT - int stateAfter = buttons|modifiers; - int stateBefore = stateAfter|button; - - QCOMPARE(testMouseWidget->mouseMoveStateBefore, stateBefore); - QCOMPARE(testMouseWidget->mouseMoveStateAfter, stateAfter); -#endif - QTest::mouseRelease(testMouseWidget, Qt::MouseButton(buttonMoved), Qt::KeyboardModifiers(keyPressed)); -} - void tst_QMouseEvent::qt3supportConstructors() { #if !defined(QT3_SUPPORT) |