summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeimage
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-11-30 15:06:38 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-11-30 15:06:38 (GMT)
commitbb1a6cd1e9d6d00e8d70f665ca223261e9eda06e (patch)
treeb65be7919d3eb5e0b6fd63c6127234a79bd9e262 /tests/auto/declarative/qdeclarativeimage
parente42d95d4e9d0dc547c604939f88de95180e74fa0 (diff)
parent840ffbd6187fe2573d8c00481120d4cf30aed351 (diff)
downloadQt-bb1a6cd1e9d6d00e8d70f665ca223261e9eda06e.zip
Qt-bb1a6cd1e9d6d00e8d70f665ca223261e9eda06e.tar.gz
Qt-bb1a6cd1e9d6d00e8d70f665ca223261e9eda06e.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Ensure header is considered when positioning content with snapping. Fix integer overflow in QDeclarativeItemPrivate::origin enumeration Correct ownership semantics for QObject derived types Correctly handle CppOwnership even when a QDeclarativeData doesn't exist Fix Browser.qml warnings Document which header to include for qmlRegister functions. Don't draw null pixmap in QDeclarativeImage paint function Fix id documentation Link to List Properties docs from QML Intro page
Diffstat (limited to 'tests/auto/declarative/qdeclarativeimage')
-rw-r--r--tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
index bf779ad..447210d 100644
--- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -87,6 +87,7 @@ private slots:
void noLoading();
void paintedWidthHeight();
void sourceSize_QTBUG_14303();
+ void nullPixmapPaint();
private:
template<typename T>
@@ -540,6 +541,35 @@ void tst_qdeclarativeimage::sourceSize_QTBUG_14303()
QTRY_COMPARE(sourceSizeSpy.count(), 2);
}
+static int numberOfWarnings = 0;
+static void checkWarnings(QtMsgType, const char *)
+{
+ numberOfWarnings++;
+}
+
+// QTBUG-15690
+void tst_qdeclarativeimage::nullPixmapPaint()
+{
+ QString componentStr = QString("import QtQuick 1.0\nImage { width: 10; height:10; fillMode: Image.PreserveAspectFit; source: \"")
+ + SERVER_ADDR + QString("/no-such-file.png\" }");
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *image = qobject_cast<QDeclarativeImage*>(component.create());
+
+ QTRY_VERIFY(image != 0);
+
+ QtMsgHandler previousMsgHandler = qInstallMsgHandler(checkWarnings);
+
+ QPixmap pm(100, 100);
+ QPainter p(&pm);
+
+ // used to print "QTransform::translate with NaN called"
+ image->paint(&p, 0, 0);
+ qInstallMsgHandler(previousMsgHandler);
+ QVERIFY(numberOfWarnings == 0);
+ delete image;
+}
+
/*
Find an item with the specified objectName. If index is supplied then the
item must also evaluate the {index} expression equal to index