summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpixmap
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-02-04 12:37:18 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-02-04 12:37:18 (GMT)
commit8f83747d12efc612b730a7dd911f916127387c0c (patch)
treed61b4c877cd14247ae0de260034cb99494434c5d /tests/auto/qpixmap
parent53038b678ccba374da5ce9ad216044f075a3ffd8 (diff)
parent8e98033a67263f6a2d9155f228dc28e2faee4f5e (diff)
downloadQt-8f83747d12efc612b730a7dd911f916127387c0c.zip
Qt-8f83747d12efc612b730a7dd911f916127387c0c.tar.gz
Qt-8f83747d12efc612b730a7dd911f916127387c0c.tar.bz2
Merge remote branch 'origin/4.6' into qt-master-from-4.6
Conflicts: examples/assistant/simpletextviewer/findfiledialog.cpp qmake/generators/symbian/symmake.cpp tools/assistant/lib/qhelpgenerator.cpp tools/assistant/lib/qhelpsearchquerywidget.cpp translations/translations.pri
Diffstat (limited to 'tests/auto/qpixmap')
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp45
1 files changed, 43 insertions, 2 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index d6bf900..49b1e52 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -146,9 +146,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();
@@ -1129,7 +1131,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()
@@ -1225,6 +1227,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()