diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-08-14 13:13:56 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-08-14 13:13:56 (GMT) |
commit | 8ea7bc92650e8e4c74e5ec2bbf05ef2b33107ee8 (patch) | |
tree | 9b2b9f071a498100fd31f0b818a5f1b71c364b98 /tests/auto/qpixmap | |
parent | 53f08a35f50f41fe0151b0f1f8334332120b8826 (diff) | |
download | Qt-8ea7bc92650e8e4c74e5ec2bbf05ef2b33107ee8.zip Qt-8ea7bc92650e8e4c74e5ec2bbf05ef2b33107ee8.tar.gz Qt-8ea7bc92650e8e4c74e5ec2bbf05ef2b33107ee8.tar.bz2 |
Fix incorrect logic in QPixmap::fromSymbianCFbsBitmap.
In some alternate universes it might make sense to use a pointer before
checking if it is valid, but since this isn't one we shoudn't do
it. Also extend the autotest a little to make sure we catch this case.
Diffstat (limited to 'tests/auto/qpixmap')
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 7321fe9..35d4cf3 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -1011,6 +1011,14 @@ void tst_QPixmap::fromSymbianCFbsBitmap() bitmapContext->Clear(); __UHEAP_MARK; + { // Test the null case + CFbsBitmap *bitmap = 0; + QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(bitmap); + QVERIFY(pixmap.isNull()); + } + __UHEAP_MARKEND; + + __UHEAP_MARK; { // Test the normal case QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(nativeBitmap); // QCOMPARE(pixmap.depth(), expectedDepth); // Depth is not preserved now |