From dd3ea45c232d18cd06fed9a380e2fc3a87fe5b8a Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 21 Jan 2022 09:42:40 +0100 Subject: Remove flaky and duplicate animateClick tests The animateClick method is a QAbstractButton member, and neither QCommandLinkButton nor QPushButton override it. The method is tested in the QAbstractButton test, and 3a9b7d1f18648d7236664d3adfc65c009b01e668 made that test more robust. The previous, flaky version of the test was almost duplicated here. They add no additional code coverage, so remove them. Pick-to: 6.2 6.3 Change-Id: I1fa988c1eabd5054193acb1f5fa1c81d29b3878d Reviewed-by: Fabian Kosmale Reviewed-by: Axel Spoerl --- .../widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp | 15 --------------- .../auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp | 15 --------------- 2 files changed, 30 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp b/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp index 0d9e3a3198..11bef2dc0d 100644 --- a/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp +++ b/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp @@ -58,7 +58,6 @@ private slots: void setDown(); void popupCrash(); void isChecked(); - void animateClick(); void toggle(); void clicked(); void toggled(); @@ -363,20 +362,6 @@ void tst_QCommandLinkButton::setAccel() #endif // QT_CONFIG(shortcut) -void tst_QCommandLinkButton::animateClick() -{ - QVERIFY( !testWidget->isDown() ); - testWidget->animateClick(); - QVERIFY( testWidget->isDown() ); - QTest::qWait( 200 ); - QVERIFY( !testWidget->isDown() ); - - QVERIFY( click_count == 1 ); - QVERIFY( press_count == 1 ); - QVERIFY( release_count == 1 ); - QVERIFY( toggle_count == 0 ); -} - void tst_QCommandLinkButton::clicked() { QTest::mousePress( testWidget, Qt::LeftButton ); diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp index 8c0eb591aa..60b5bebdaf 100644 --- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp +++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp @@ -60,7 +60,6 @@ private slots: void setDown(); void popupCrash(); void isChecked(); - void animateClick(); void toggle(); void clicked(); void touchTap(); @@ -361,20 +360,6 @@ void tst_QPushButton::setAccel() #endif // QT_CONFIG(shortcut) -void tst_QPushButton::animateClick() -{ - QVERIFY( !testWidget->isDown() ); - testWidget->animateClick(); - QVERIFY( testWidget->isDown() ); - QTest::qWait( 200 ); - QVERIFY( !testWidget->isDown() ); - - QVERIFY( click_count == 1 ); - QVERIFY( press_count == 1 ); - QVERIFY( release_count == 1 ); - QVERIFY( toggle_count == 0 ); -} - void tst_QPushButton::clicked() { QTest::mousePress( testWidget, Qt::LeftButton ); -- cgit v1.2.3