summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2010-07-19 12:06:18 (GMT)
committeraavit <qt-info@nokia.com>2010-07-19 12:06:18 (GMT)
commitcbbdb874e0340492b80c8abcd130d1f41a8cf2b3 (patch)
tree4965dc63dcbdbbd7c0bfd8c90665e8b4a57e3ef4 /tests/auto
parent30341a6f9e57caac3ec19e02ffd67164d43c0453 (diff)
parent8acf3098bf5d88871d866aa87fa38e6feb3a32d0 (diff)
downloadQt-cbbdb874e0340492b80c8abcd130d1f41a8cf2b3.zip
Qt-cbbdb874e0340492b80c8abcd130d1f41a8cf2b3.tar.gz
Qt-cbbdb874e0340492b80c8abcd130d1f41a8cf2b3.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml3
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp3
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp19
3 files changed, 24 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
index f5198c9..d030222 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
@@ -11,6 +11,9 @@ ListView {
width: 100
color: model.modelData.color
Text { objectName: "name"; text: name }
+ Text { objectName: "section"; text: parent.ListView.section }
}
}
+ section.property: "name"
+ section.criteria: ViewSection.FullString
}
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
index 43d4d06..e0f32ea 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
@@ -179,6 +179,9 @@ void tst_qdeclarativevisualdatamodel::objectListModel()
QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "name", 0);
QCOMPARE(name->text(), QString("Item 1"));
+ QDeclarativeText *section = findItem<QDeclarativeText>(contentItem, "section", 0);
+ QCOMPARE(section->text(), QString("Item 1"));
+
dataList[0]->setProperty("name", QLatin1String("Changed"));
QCOMPARE(name->text(), QString("Changed"));
}
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index fe2a719..e9ef070 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -315,7 +315,24 @@ void tst_QImageReader::jpegRgbCmyk()
QImage image1(prefix + QLatin1String("YCbCr_cmyk.jpg"));
QImage image2(prefix + QLatin1String("YCbCr_cmyk.png"));
- QCOMPARE(image1, image2);
+ // first, do some obvious tests
+ QCOMPARE(image1.height(), image2.height());
+ QCOMPARE(image1.width(), image2.width());
+ QCOMPARE(image1.format(), image2.format());
+ QCOMPARE(image1.format(), QImage::Format_RGB32);
+
+ // compare all the pixels with a slack of 3. This ignores rounding errors in libjpeg/libpng
+ for (int h = 0; h < image1.height(); ++h) {
+ const uchar *s1 = image1.constScanLine(h);
+ const uchar *s2 = image2.constScanLine(h);
+ for (int w = 0; w < image1.width() * 4; ++w) {
+ if (*s1 != *s2) {
+ QVERIFY2(qAbs(*s1 - *s2) <= 3, qPrintable(QString("images differ in line %1, col %2 (image1: %3, image2: %4)").arg(h).arg(w).arg(*s1, 0, 16).arg(*s2, 0, 16)));
+ }
+ s1++;
+ s2++;
+ }
+ }
}
void tst_QImageReader::setScaledSize_data()