summaryrefslogtreecommitdiffstats
path: root/tests/auto/qbrush
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2010-03-31 09:13:38 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2010-03-31 09:13:38 (GMT)
commit27a110eb7238b8b8d72db968d813855a9c2afb08 (patch)
treea814332b2f45fd44b60b18570844acf984d3cdcc /tests/auto/qbrush
parent287a8d25b0e13602d02abc301e64060f46fff0e9 (diff)
downloadQt-27a110eb7238b8b8d72db968d813855a9c2afb08.zip
Qt-27a110eb7238b8b8d72db968d813855a9c2afb08.tar.gz
Qt-27a110eb7238b8b8d72db968d813855a9c2afb08.tar.bz2
Fix crash when using qDebug() on a QBrush with Qt::TexturePattern style.
Merge-request: 541 Reviewed-by: Benjamin Poulain <benjamin.poulain@nokia.com>
Diffstat (limited to 'tests/auto/qbrush')
-rw-r--r--tests/auto/qbrush/tst_qbrush.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/auto/qbrush/tst_qbrush.cpp b/tests/auto/qbrush/tst_qbrush.cpp
index bc2bc60..cff45c2 100644
--- a/tests/auto/qbrush/tst_qbrush.cpp
+++ b/tests/auto/qbrush/tst_qbrush.cpp
@@ -75,9 +75,10 @@ private slots:
void gradientStops();
void textures();
-
+
void nullBrush();
void isOpaque();
+ void debug();
};
Q_DECLARE_METATYPE(QBrush)
@@ -390,5 +391,15 @@ void tst_QBrush::isOpaque()
QVERIFY(!brush.isOpaque());
}
+void tst_QBrush::debug()
+{
+ QPixmap pixmap_source(10, 10);
+ fill(&pixmap_source);
+ QBrush pixmap_brush;
+ pixmap_brush.setTexture(pixmap_source);
+ QCOMPARE(pixmap_brush.style(), Qt::TexturePattern);
+ qDebug() << pixmap_brush; // don't crash
+}
+
QTEST_MAIN(tst_QBrush)
#include "tst_qbrush.moc"