summaryrefslogtreecommitdiffstats
path: root/tests/auto/printsupport
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2012-09-10 15:05:28 +0200
committerQt by Nokia <qt-info@nokia.com>2012-09-12 10:14:10 +0200
commit97b4c5a5746a33a27076d72ceb3533fbd54b9642 (patch)
treee3ebcbace90b9acc2444d43da5277dd6fa5b6a64 /tests/auto/printsupport
parent975ebdc4ab77d1c0d8bc91e393eca7095a5d8742 (diff)
Stabilize qprinter test
The CreationDate entry in the two PDF files can potentially be different depending on when the test is run. We ignore the line for this entry when comparing the two results. Task-number: QTBUG-27171 Change-Id: I8978678295217edd537edb0d2c25260813aa3d93 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'tests/auto/printsupport')
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index ca7fd4f7af..6977bbe8b4 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -985,7 +985,16 @@ void tst_QPrinter::taskQTBUG4497_reusePrinterOnDifferentFiles()
QFile file2("out2.ps");
QVERIFY(file2.open(QIODevice::ReadOnly));
- QCOMPARE(file1.readAll(), file2.readAll());
+ while (!file1.atEnd() && !file2.atEnd()) {
+ QByteArray file1Line = file1.readLine();
+ QByteArray file2Line = file2.readLine();
+
+ if (!file1Line.startsWith("%%CreationDate"))
+ QCOMPARE(file1Line, file2Line);
+ }
+
+ QVERIFY(file1.atEnd());
+ QVERIFY(file2.atEnd());
}
void tst_QPrinter::testCurrentPage()