From 0b2068eafd9d3789897c82f29a9153d5fd6e21a5 Mon Sep 17 00:00:00 2001 From: Teemu Katajisto Date: Tue, 21 Aug 2012 10:53:31 +0300 Subject: QtPrintSupport: allow slight deviations from pre-defined paper sizes in tests CUPS paper sizes may differ from Qt paper sizes slightly and thus fail the strict comparison in qprinter tests. This is needed for the followup patch which initializes the cupsplugin with CUPS/PPD defaults. Change-Id: Ie66f77ead0204de0fc7c7913005fa516d57d34eb Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Lars Knoll --- tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto/printsupport/kernel') diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index cd1ff6fe66..7f872a4ffb 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -491,8 +491,8 @@ void tst_QPrinter::testMulitpleSets() return; } - QCOMPARE(printer.widthMM(), widthMMAfter); - QCOMPARE(printer.heightMM(), heightMMAfter); + QVERIFY(qAbs(printer.widthMM() - widthMMAfter) <= 2); + QVERIFY(qAbs(printer.heightMM() - heightMMAfter) <= 2); computePageValue(printer, paperWidth, paperHeight); @@ -501,8 +501,8 @@ void tst_QPrinter::testMulitpleSets() // Set it again and see if it still works. printer.setPageSize(printerPageSize); - QCOMPARE(printer.widthMM(), widthMMAfter); - QCOMPARE(printer.heightMM(), heightMMAfter); + QVERIFY(qAbs(printer.widthMM() - widthMMAfter) <= 2); + QVERIFY(qAbs(printer.heightMM() - heightMMAfter) <= 2); printer.setOrientation(QPrinter::Landscape); computePageValue(printer, paperWidth, paperHeight); -- cgit v1.2.3