diff options
author | John Layt <jlayt@kde.org> | 2014-02-19 15:07:10 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-26 12:58:00 +0100 |
commit | aab29d546c006bf9be3fccd484e88ecc840bc0e3 (patch) | |
tree | c57a006df8a8f896deb3a620fd0f25dd8041475d /tests | |
parent | f05e48381b309447297a290f699a3389ac41af41 (diff) |
QPrinter - Add more tests
Add more missing tests.
Change-Id: I801c5c67731075ccb3e62377c0eccc420e708365
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index 9571cb4110..b138f34967 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -1259,6 +1259,8 @@ void tst_QPrinter::fullPage() QCOMPARE(pdf.fullPage(), false); pdf.setFullPage(true); QCOMPARE(pdf.fullPage(), true); + pdf.setFullPage(false); + QCOMPARE(pdf.fullPage(), false); QPrinter native; if (native.outputFormat() == QPrinter::NativeFormat) { @@ -1275,6 +1277,17 @@ void tst_QPrinter::fullPage() QCOMPARE(native.fullPage(), expected); native.setOutputFormat(QPrinter::NativeFormat); QCOMPARE(native.fullPage(), expected); + + // Test set/get + expected = false; + native.setFullPage(expected); + QCOMPARE(native.fullPage(), expected); + + // Test value preservation + native.setOutputFormat(QPrinter::PdfFormat); + QCOMPARE(native.fullPage(), expected); + native.setOutputFormat(QPrinter::NativeFormat); + QCOMPARE(native.fullPage(), expected); } else { QSKIP("No printers installed, cannot test NativeFormat, please install printers to test"); } @@ -1310,6 +1323,17 @@ void tst_QPrinter::orientation() QCOMPARE(native.orientation(), expected); native.setOutputFormat(QPrinter::NativeFormat); QCOMPARE(native.orientation(), expected); + + // Test set/get + expected = QPrinter::Portrait; + native.setOrientation(expected); + QCOMPARE(native.orientation(), expected); + + // Test value preservation + native.setOutputFormat(QPrinter::PdfFormat); + QCOMPARE(native.orientation(), expected); + native.setOutputFormat(QPrinter::NativeFormat); + QCOMPARE(native.orientation(), expected); } else { QSKIP("No printers installed, cannot test NativeFormat, please install printers to test"); } @@ -1710,13 +1734,8 @@ void tst_QPrinter::resolution() // Test set/get int expected = 333; #ifdef Q_OS_MAC + // Set resolution does nothing on OSX, see QTBUG-7000 expected = native.resolution(); - foreach (int supported, native.supportedResolutions()) { - if (supported != expected) { - expected = supported; - break; - } - } #endif // Q_OS_MAC native.setResolution(expected); QCOMPARE(native.resolution(), expected); |