diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-03-08 16:11:33 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-03-08 16:11:33 +0100 |
commit | 72e5124b8517662ca2cd25deb5806bc04d20c022 (patch) | |
tree | 5950af37125647a6f14369eab667c7d611d1ac69 /tests/auto | |
parent | a19c22ebf8775f73b840f52b7e03869166ca0dab (diff) | |
parent | a12f6ba302e54c1570c54aa4c722f2dafbf794af (diff) |
Merge remote-tracking branch 'origin/release' into stable
Conflicts:
tests/auto/opengl/qgl/tst_qgl.cpp
Change-Id: I3c601351c984c1f4b00478d3c47ac9eeb021e892
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/gui/image/qpixmap/tst_qpixmap.cpp | 10 | ||||
-rw-r--r-- | tests/auto/gui/painting/qpainter/tst_qpainter.cpp | 38 | ||||
-rw-r--r-- | tests/auto/opengl/qgl/tst_qgl.cpp | 15 | ||||
-rw-r--r-- | tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp | 4 |
4 files changed, 63 insertions, 4 deletions
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index f5298a1690..61f53a5073 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -167,6 +167,8 @@ private slots: void scaled_QTBUG19157(); void detachOnLoad_QTBUG29639(); + + void copyOnNonAlignedBoundary(); }; static bool lenientCompare(const QPixmap &actual, const QPixmap &expected) @@ -1503,5 +1505,13 @@ void tst_QPixmap::detachOnLoad_QTBUG29639() QVERIFY(a.toImage() != b.toImage()); } +void tst_QPixmap::copyOnNonAlignedBoundary() +{ + QImage img(8, 2, QImage::Format_RGB16); + + QPixmap pm1 = QPixmap::fromImage(img, Qt::NoFormatConversion); + QPixmap pm2 = pm1.copy(QRect(5, 0, 3, 2)); // When copying second line: 2 bytes too many are read which might cause an access violation. +} + QTEST_MAIN(tst_QPixmap) #include "tst_qpixmap.moc" diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index cf520c06a9..774ade5fb0 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -280,6 +280,7 @@ private slots: void drawTextWithComplexBrush(); void QTBUG26013_squareCapStroke(); void QTBUG25153_drawLine(); + void dashing_systemClip(); private: void fillData(); @@ -4461,6 +4462,43 @@ void tst_QPainter::QTBUG25153_drawLine() } } +static void dashing_systemClip_paint(QPainter *p) +{ + p->setPen(QPen(Qt::black, 1, Qt::DashLine, Qt::RoundCap, Qt::MiterJoin)); + p->drawLine(8, 8, 42, 8); + p->drawLine(42, 8, 42, 42); + p->drawLine(42, 42, 8, 42); + p->drawLine(8, 42, 8, 8); +} + +void tst_QPainter::dashing_systemClip() +{ + QImage image(50, 50, QImage::Format_RGB32); + image.fill(Qt::white); + + QPainter p(&image); + dashing_systemClip_paint(&p); + p.end(); + + QImage old = image.copy(); + + image.paintEngine()->setSystemClip(QRect(10, 0, image.width() - 10, image.height())); + + p.begin(&image); + dashing_systemClip_paint(&p); + + // doing same paint operation again with different system clip should not change the image + QCOMPARE(old, image); + + old = image; + + p.setClipRect(QRect(20, 20, 30, 30)); + dashing_systemClip_paint(&p); + + // ditto for regular clips + QCOMPARE(old, image); +} + QTEST_MAIN(tst_QPainter) #include "tst_qpainter.moc" diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp index 3bae5d5103..00973cf533 100644 --- a/tests/auto/opengl/qgl/tst_qgl.cpp +++ b/tests/auto/opengl/qgl/tst_qgl.cpp @@ -832,10 +832,19 @@ static void fuzzyCompareImages(const QImage &testImage, const QImage &referenceI class UnclippedWidget : public QWidget { public: + bool painted; + + UnclippedWidget() + : painted(false) + { + } + void paintEvent(QPaintEvent *) { QPainter p(this); p.fillRect(rect().adjusted(-1000, -1000, 1000, 1000), Qt::black); + + painted = true; } }; @@ -866,10 +875,8 @@ void tst_QGL::graphicsViewClipping() scene.setSceneRect(view.viewport()->rect()); QVERIFY(QTest::qWaitForWindowExposed(&view)); - #ifdef Q_OS_MAC - // The black rectangle jumps from the center to the upper left for some reason. - QTest::qWait(100); - #endif + + QTRY_VERIFY(widget->painted); QImage image = viewport->grabFrameBuffer(); QImage expected = image; diff --git a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp index f16fe49712..2d3e3c1702 100644 --- a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp +++ b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp @@ -103,6 +103,10 @@ void tst_QToolTip::task183679() QFETCH(Qt::Key, key); QFETCH(bool, visible); +#ifdef Q_OS_MAC + QSKIP("This test fails in the CI system, QTBUG-30040"); +#endif + Widget_task183679 widget; widget.show(); QApplication::setActiveWindow(&widget); |