diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-03 09:04:15 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-03 09:04:15 (GMT) |
commit | ad46fadbe343e1b6caf94823237064551ab53c52 (patch) | |
tree | 10c93cae97aa682c68f7a7295728cb9200e68e4f /tests/auto | |
parent | 0d9ff247db8ca64e0dcfd0ea05c3a615abab845b (diff) | |
parent | 0c73b18d0750bee9da4b88de595aa6093b5be820 (diff) | |
download | Qt-ad46fadbe343e1b6caf94823237064551ab53c52.zip Qt-ad46fadbe343e1b6caf94823237064551ab53c52.tar.gz Qt-ad46fadbe343e1b6caf94823237064551ab53c52.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Implementation for QVGPixmapData to/fromSymbianCFbsBitmap
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 8bcd5e8..d7c6ad3 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -145,9 +145,11 @@ private slots: void fromWinHICON(); #endif -#if defined(Q_WS_S60) +#if defined(Q_OS_SYMBIAN) void fromSymbianCFbsBitmap_data(); void fromSymbianCFbsBitmap(); + void toSymbianCFbsBitmap_data(); + void toSymbianCFbsBitmap(); #endif void onlyNullPixmapsOutsideGuiThread(); @@ -1110,7 +1112,7 @@ void tst_QPixmap::fromWinHICON() #endif // Q_WS_WIN -#if defined(Q_WS_S60) +#if defined(Q_OS_SYMBIAN) Q_DECLARE_METATYPE(TDisplayMode) void tst_QPixmap::fromSymbianCFbsBitmap_data() @@ -1206,6 +1208,45 @@ void tst_QPixmap::fromSymbianCFbsBitmap() CleanupStack::PopAndDestroy(3); } + +void tst_QPixmap::toSymbianCFbsBitmap_data() +{ + QTest::addColumn<int>("red"); + QTest::addColumn<int>("green"); + QTest::addColumn<int>("blue"); + + QTest::newRow("red") << 255 << 0 << 0; + QTest::newRow("green") << 0 << 255 << 0; + QTest::newRow("blue") << 0 << 0 << 255; +} + +void tst_QPixmap::toSymbianCFbsBitmap() +{ + QFETCH(int, red); + QFETCH(int, green); + QFETCH(int, blue); + + QPixmap pm(100, 100); + pm.fill(QColor(red, green, blue)); + + CFbsBitmap *bitmap = pm.toSymbianCFbsBitmap(); + + QVERIFY(bitmap != 0); + + // Verify size + QCOMPARE(100, (int) bitmap->SizeInPixels().iWidth); + QCOMPARE(100, (int) bitmap->SizeInPixels().iHeight); + + // Verify pixel color + TRgb pixel; + bitmap->GetPixel(pixel, TPoint(0,0)); + QCOMPARE((int)pixel.Red(), red); + QCOMPARE((int)pixel.Green(), green); + QCOMPARE((int)pixel.Blue(), blue); + + // Clean up + delete bitmap; +} #endif void tst_QPixmap::onlyNullPixmapsOutsideGuiThread() |