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>
This commit is contained in:
parent
975ebdc4ab
commit
97b4c5a574
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user