summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-11-15 09:44:40 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-11-15 09:44:40 (GMT)
commit8fc0d1c36cae1b0d659e119032af006b8f8eca52 (patch)
tree02245930ef4c1ced7d951be7a085b2c0b165d3dd
parentaa1a47af767eefea3e2ff248d1e7493031896fe8 (diff)
downloadQt-8fc0d1c36cae1b0d659e119032af006b8f8eca52.zip
Qt-8fc0d1c36cae1b0d659e119032af006b8f8eca52.tar.gz
Qt-8fc0d1c36cae1b0d659e119032af006b8f8eca52.tar.bz2
Take snapshots starting from the first frame
Partly because it's invaluble for the times people forget to record a test as a snapshot, partly because it provides more data on the initial state of the test case. Task-number: QTBUG-14792
-rw-r--r--tools/qml/qdeclarativetester.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp
index eaf3403..499822a 100644
--- a/tools/qml/qdeclarativetester.cpp
+++ b/tools/qml/qdeclarativetester.cpp
@@ -286,7 +286,7 @@ void QDeclarativeTester::updateCurrentTime(int msec)
fe.msec = msec;
if (msec == 0 || !(options & QDeclarativeViewer::TestImages)) {
// Skip first frame, skip if not doing images
- } else if (0 == (m_savedFrameEvents.count() % 60) || snapshot) {
+ } else if (0 == (m_savedFrameEvents.count()-1 % 60) || snapshot) {
fe.image = img;
} else {
QCryptographicHash hash(QCryptographicHash::Md5);
@@ -356,6 +356,11 @@ void QDeclarativeTester::updateCurrentTime(int msec)
if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record) && !frame->image().isEmpty()) {
QImage goodImage(frame->image().toLocalFile());
+ if (frame->msec() == 16 && goodImage.size() != img.size()){
+ //Also an image mismatch, but this warning is more informative. Only checked at start though.
+ qWarning() << "QDeclarativeTester(" << m_script << "): Size mismatch. This test must be run at " << goodImage.size();
+ imagefailure();
+ }
if (goodImage != img) {
QString reject(frame->image().toLocalFile() + ".reject.png");
qWarning() << "QDeclarativeTester: Image mismatch. Reject saved to:"