summaryrefslogtreecommitdiffstats
path: root/tests/auto/lancelot
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond.kjernasen@nokia.com>2010-09-07 13:55:27 (GMT)
committerTrond Kjernåsen <trond.kjernasen@nokia.com>2010-09-07 13:59:47 (GMT)
commita59566262ebd226a901172fc06c7bcb9023d5a33 (patch)
tree5bef597d469780f6fde314307bcd4ebcc89d11c5 /tests/auto/lancelot
parent5e3d55cc6fc3216e0079bb9d0c835338c9ac2ef8 (diff)
downloadQt-a59566262ebd226a901172fc06c7bcb9023d5a33.zip
Qt-a59566262ebd226a901172fc06c7bcb9023d5a33.tar.gz
Qt-a59566262ebd226a901172fc06c7bcb9023d5a33.tar.bz2
Make it possible to have several checksums associated with one ImageItem.
Also changed the meta file from being a text file to a binary file. Nothing uses the extra checksums yet, but that should be added soon.
Diffstat (limited to 'tests/auto/lancelot')
-rw-r--r--tests/auto/lancelot/tst_lancelot.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/lancelot/tst_lancelot.cpp b/tests/auto/lancelot/tst_lancelot.cpp
index 0f57c1e..0226cc6 100644
--- a/tests/auto/lancelot/tst_lancelot.cpp
+++ b/tests/auto/lancelot/tst_lancelot.cpp
@@ -234,11 +234,11 @@ void tst_Lancelot::runTestSuite()
QSKIP("Baseline not found; new baseline created.", SkipSingle);
}
- if (rendered.imageChecksum != baseline.imageChecksum) {
- QByteArray serverMsg;
- if (!proto.submitMismatch(rendered, &serverMsg))
- serverMsg = "Failed to submit mismatching image to server.";
- QFAIL("Rendered image differs from baseline.\n" + serverMsg);
+ if (!baseline.imageChecksums.contains(rendered.imageChecksums.at(0))) {
+ QByteArray serverMsg;
+ if (!proto.submitMismatch(rendered, &serverMsg))
+ serverMsg = "Failed to submit mismatching image to server.";
+ QFAIL("Rendered image differs from baseline.\n" + serverMsg);
}
}
@@ -250,17 +250,17 @@ ImageItem tst_Lancelot::render(const ImageItem &item)
QStringList script = loadScriptFile(filePath);
if (script.isEmpty()) {
res.image = QImage();
- res.imageChecksum = 0;
+ res.imageChecksums.append(0);
} else if (item.engine == ImageItem::Raster) {
QImage img(800, 800, item.renderFormat);
paint(&img, script, QFileInfo(filePath).absoluteFilePath()); // eh yuck (filePath stuff)
res.image = img;
- res.imageChecksum = ImageItem::computeChecksum(img);
+ res.imageChecksums.append(ImageItem::computeChecksum(img));
} else if (item.engine == ImageItem::OpenGL) {
QGLWidget glWidget;
if (!glWidget.isValid()) {
res.image = QImage();
- res.imageChecksum = 0;
+ res.imageChecksums.append(0);
return res;
}
glWidget.resize(800, 800);
@@ -270,7 +270,7 @@ ImageItem tst_Lancelot::render(const ImageItem &item)
#endif
paint(&glWidget, script, QFileInfo(filePath).absoluteFilePath()); // eh yuck (filePath stuff)
res.image = glWidget.grabFrameBuffer().convertToFormat(item.renderFormat);
- res.imageChecksum = ImageItem::computeChecksum(res.image);
+ res.imageChecksums.append(ImageItem::computeChecksum(res.image));
}
return res;