From: Eskil Abrahamsen Blomfeldt Date: Mon, 10 Sep 2012 13:05:28 +0000 (+0200) Subject: Stabilize qprinter test X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97b4c5a5746a33a27076d72ceb3533fbd54b9642;p=profile%2Fivi%2Fqtbase.git 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 Reviewed-by: Jiang Jiang --- diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index ca7fd4f..6977bbe 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()