summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTrond Kjernaasen <trond@trolltech.com>2009-03-02 12:17:40 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-03-23 11:45:25 (GMT)
commitdc789e34bd2ff519024af077bebdf09c85e138e0 (patch)
treeb61b46b890a6877900368c21b5b95e4336c64996 /tests
parentebaeb25bebdd29651f15b6e53119597633ea854f (diff)
downloadQt-dc789e34bd2ff519024af077bebdf09c85e138e0.zip
Qt-dc789e34bd2ff519024af077bebdf09c85e138e0.tar.gz
Qt-dc789e34bd2ff519024af077bebdf09c85e138e0.tar.bz2
Fixes: Crash in QPixmap under X11.
Task: 246446 RevBy: Olivier AutoTest: tst_qpixmap::test_246446() Details: The new QX11PixmapData object wasn't referenced (e.g. the ref count would be 0) after calling setMask() on a 32 bit QPixmap when Xrender was used.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 2b337da..ba117d8 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -103,6 +103,7 @@ private slots:
void grabWidget();
void grabWindow();
void isNull();
+ void task_246446();
#ifdef Q_WS_QWS
void convertFromImageNoDetach();
@@ -1015,5 +1016,20 @@ void tst_QPixmap::fromData()
QCOMPARE(img.pixel(0, 1), QRgb(0xff000000));
}
+void tst_QPixmap::task_246446()
+{
+ // This crashed without the bugfix in 246446
+ QPixmap pm(10, 10);
+ pm.fill(Qt::transparent); // force 32-bit depth
+ QBitmap bm;
+ pm.setMask(bm);
+ {
+ QPixmap pm2(pm);
+ }
+ QVERIFY(pm.width() == 10);
+ QVERIFY(pm.mask().isNull());
+}
+
+
QTEST_MAIN(tst_QPixmap)
#include "tst_qpixmap.moc"