From 730672220f9485d912976ba6f2986fa7ea39dabc 2012-06-15 12:28:22 From: Jani Honkonen Date: 2012-06-15 12:28:22 Subject: [PATCH] autotests: try to fix bar hover failures in bamboo --- diff --git a/tests/auto/qbarseries/tst_qbarseries.cpp b/tests/auto/qbarseries/tst_qbarseries.cpp index 2a3137b..2a99b01 100644 --- a/tests/auto/qbarseries/tst_qbarseries.cpp +++ b/tests/auto/qbarseries/tst_qbarseries.cpp @@ -23,6 +23,7 @@ #include #include #include +#include "tst_definitions.h" QTCOMMERCIALCHART_USE_NAMESPACE @@ -437,14 +438,13 @@ void tst_QBarSeries::mousehovered() //======================================================================= // move mouse to left border QTest::mouseMove(view.viewport(), QPoint(0, 142)); - - QVERIFY(seriesSpy.count() == 0); + QCoreApplication::processEvents(QEventLoop::AllEvents, 10000); + TRY_COMPARE(seriesSpy.count(), 0); //======================================================================= // move mouse on top of set1 QTest::mouseMove(view.viewport(), QPoint(102,142)); - - QVERIFY(seriesSpy.count() == 1); + TRY_COMPARE(seriesSpy.count(), 1); QList seriesSpyArg = seriesSpy.takeFirst(); QCOMPARE(qvariant_cast(seriesSpyArg.at(0)), set1); @@ -454,8 +454,7 @@ void tst_QBarSeries::mousehovered() //======================================================================= // move mouse from top of set1 to top of set2 QTest::mouseMove(view.viewport(), QPoint(127,142)); - - QVERIFY(seriesSpy.count() == 2); + TRY_COMPARE(seriesSpy.count(), 2); // should leave set1 seriesSpyArg = seriesSpy.takeFirst(); @@ -472,7 +471,7 @@ void tst_QBarSeries::mousehovered() //======================================================================= // move mouse from top of set2 to background QTest::mouseMove(view.viewport(), QPoint(127,0)); - QVERIFY(seriesSpy.count() == 1); + TRY_COMPARE(seriesSpy.count(), 1); // should leave set2 seriesSpyArg = seriesSpy.takeFirst(); diff --git a/tests/auto/qgroupedbarseries/tst_qgroupedbarseries.cpp b/tests/auto/qgroupedbarseries/tst_qgroupedbarseries.cpp index 73f0cb4..3558e5f 100644 --- a/tests/auto/qgroupedbarseries/tst_qgroupedbarseries.cpp +++ b/tests/auto/qgroupedbarseries/tst_qgroupedbarseries.cpp @@ -25,6 +25,7 @@ #include #include #include +#include "tst_definitions.h" QTCOMMERCIALCHART_USE_NAMESPACE @@ -224,17 +225,14 @@ void tst_QGroupedBarSeries::mousehovered() // move mouse to left border qDebug() << "move mouse to left border"; QTest::mouseMove(view.viewport(), QPoint(0, 143)); - QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); - - QVERIFY(seriesSpy.count() == 0); + QCoreApplication::processEvents(QEventLoop::AllEvents, 10000); + TRY_COMPARE(seriesSpy.count(), 0); //======================================================================= // move mouse on top of set1 qDebug() << "move mouse on top of set1"; QTest::mouseMove(view.viewport(), QPoint(95,143)); - QCoreApplication::processEvents(QEventLoop::AllEvents, 10000); - - QVERIFY(seriesSpy.count() == 1); + TRY_COMPARE(seriesSpy.count(), 1); QList seriesSpyArg = seriesSpy.takeFirst(); QCOMPARE(qvariant_cast(seriesSpyArg.at(0)), set1); @@ -245,9 +243,7 @@ void tst_QGroupedBarSeries::mousehovered() // move mouse from top of set1 to top of set2 qDebug() << "move mouse from top of set1 to top of set2"; QTest::mouseMove(view.viewport(), QPoint(118,143)); - QCoreApplication::processEvents(QEventLoop::AllEvents, 10000); - - QVERIFY(seriesSpy.count() == 2); + TRY_COMPARE(seriesSpy.count(), 2); // should leave set1 seriesSpyArg = seriesSpy.takeFirst(); @@ -266,9 +262,7 @@ void tst_QGroupedBarSeries::mousehovered() qDebug() << "move mouse from top of set2 to background"; QTest::mouseMove(view.viewport(), QPoint(118,0)); - QCoreApplication::processEvents(QEventLoop::AllEvents, 10000); - - QVERIFY(seriesSpy.count() == 1); + TRY_COMPARE(seriesSpy.count(), 1); // should leave set2 seriesSpyArg = seriesSpy.takeFirst(); diff --git a/tests/auto/qpercentbarseries/tst_qpercentbarseries.cpp b/tests/auto/qpercentbarseries/tst_qpercentbarseries.cpp index b0165d8..b764107 100644 --- a/tests/auto/qpercentbarseries/tst_qpercentbarseries.cpp +++ b/tests/auto/qpercentbarseries/tst_qpercentbarseries.cpp @@ -23,6 +23,7 @@ #include #include #include +#include "tst_definitions.h" QTCOMMERCIALCHART_USE_NAMESPACE @@ -221,14 +222,13 @@ void tst_QPercentBarSeries::mousehovered() //======================================================================= // move mouse to left border QTest::mouseMove(view.viewport(), QPoint(0, 190)); - - QVERIFY(seriesSpy.count() == 0); + QCoreApplication::processEvents(QEventLoop::AllEvents, 10000); + TRY_COMPARE(seriesSpy.count(), 0); //======================================================================= // move mouse on top of set1 QTest::mouseMove(view.viewport(), QPoint(106,190)); - - QVERIFY(seriesSpy.count() == 1); + TRY_COMPARE(seriesSpy.count(), 1); QList seriesSpyArg = seriesSpy.takeFirst(); QCOMPARE(qvariant_cast(seriesSpyArg.at(0)), set1); @@ -238,8 +238,7 @@ void tst_QPercentBarSeries::mousehovered() //======================================================================= // move mouse from top of set1 to top of set2 QTest::mouseMove(view.viewport(), QPoint(106,95)); - - QVERIFY(seriesSpy.count() == 2); + TRY_COMPARE(seriesSpy.count(), 2); // should leave set1 seriesSpyArg = seriesSpy.takeFirst(); @@ -256,8 +255,7 @@ void tst_QPercentBarSeries::mousehovered() //======================================================================= // move mouse from top of set2 to background QTest::mouseMove(view.viewport(), QPoint(106,0)); - - QVERIFY(seriesSpy.count() == 1); + TRY_COMPARE(seriesSpy.count(), 1); // should leave set2 seriesSpyArg = seriesSpy.takeFirst(); diff --git a/tests/auto/qstackedbarseries/tst_qstackedbarseries.cpp b/tests/auto/qstackedbarseries/tst_qstackedbarseries.cpp index 2192fb6..91a63ba 100644 --- a/tests/auto/qstackedbarseries/tst_qstackedbarseries.cpp +++ b/tests/auto/qstackedbarseries/tst_qstackedbarseries.cpp @@ -23,6 +23,7 @@ #include #include #include +#include "tst_definitions.h" QTCOMMERCIALCHART_USE_NAMESPACE @@ -221,14 +222,13 @@ void tst_QStackedBarSeries::mousehovered() //======================================================================= // move mouse to left border QTest::mouseMove(view.viewport(), QPoint(0, 190)); - - QVERIFY(seriesSpy.count() == 0); + QCoreApplication::processEvents(QEventLoop::AllEvents, 10000); + TRY_COMPARE(seriesSpy.count(), 0); //======================================================================= // move mouse on top of set1 QTest::mouseMove(view.viewport(), QPoint(106,190)); - - QVERIFY(seriesSpy.count() == 1); + TRY_COMPARE(seriesSpy.count(), 1); QList seriesSpyArg = seriesSpy.takeFirst(); QCOMPARE(qvariant_cast(seriesSpyArg.at(0)), set1); @@ -238,8 +238,7 @@ void tst_QStackedBarSeries::mousehovered() //======================================================================= // move mouse from top of set1 to top of set2 QTest::mouseMove(view.viewport(), QPoint(106,95)); - - QVERIFY(seriesSpy.count() == 2); + TRY_COMPARE(seriesSpy.count(), 2); // should leave set1 seriesSpyArg = seriesSpy.takeFirst(); @@ -256,8 +255,7 @@ void tst_QStackedBarSeries::mousehovered() //======================================================================= // move mouse from top of set2 to background QTest::mouseMove(view.viewport(), QPoint(106,0)); - - QVERIFY(seriesSpy.count() == 1); + TRY_COMPARE(seriesSpy.count(), 1); // should leave set2 seriesSpyArg = seriesSpy.takeFirst();