diff options
Diffstat (limited to 'tests/auto/qpixmap')
-rw-r--r-- | tests/auto/qpixmap/qpixmap.pro | 8 | ||||
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 16 |
2 files changed, 20 insertions, 4 deletions
diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro index ff8258f..185ec1a 100644 --- a/tests/auto/qpixmap/qpixmap.pro +++ b/tests/auto/qpixmap/qpixmap.pro @@ -3,16 +3,16 @@ SOURCES += tst_qpixmap.cpp contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { - task31722_0.sources = convertFromImage/task31722_0/*.png + task31722_0.files = convertFromImage/task31722_0/*.png task31722_0.path = convertFromImage/task31722_0 - task31722_1.sources = convertFromImage/task31722_1/*.png + task31722_1.files = convertFromImage/task31722_1/*.png task31722_1.path = convertFromImage/task31722_1 - icons.sources = convertFromToHICON/* + icons.files = convertFromToHICON/* icons.path = convertFromToHICON - loadFromData.sources = loadFromData/* + loadFromData.files = loadFromData/* loadFromData.path = loadFromData DEPLOYMENT += task31722_0 task31722_1 icons loadFromData diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 419518a1..3ac54b9 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -95,6 +95,8 @@ public slots: void cleanup(); private slots: + void swap(); + void setAlphaChannel_data(); void setAlphaChannel(); @@ -246,6 +248,20 @@ void tst_QPixmap::cleanup() { } +void tst_QPixmap::swap() +{ + QPixmap p1( 16, 16 ), p2( 32, 32 ); + p1.fill( Qt::white ); + p2.fill( Qt::black ); + const qint64 p1k = p1.cacheKey(); + const qint64 p2k = p2.cacheKey(); + p1.swap(p2); + QCOMPARE(p1.cacheKey(), p2k); + QCOMPARE(p1.size(), QSize(32,32)); + QCOMPARE(p2.cacheKey(), p1k); + QCOMPARE(p2.size(), QSize(16,16)); +} + void tst_QPixmap::setAlphaChannel_data() { QTest::addColumn<int>("red"); |