diff options
author | Teemu Katajisto <teemu.katajisto@digia.com> | 2012-08-21 10:53:31 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-09-26 10:08:59 +0200 |
commit | 0b2068eafd9d3789897c82f29a9153d5fd6e21a5 (patch) | |
tree | 1eb4d8444d5b4232bc6504147b72aa8bf9820887 /tests/auto/printsupport | |
parent | 906c0168c564ccbc6722dc9bafc482137317085c (diff) |
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 <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/printsupport')
-rw-r--r-- | tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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); |