summaryrefslogtreecommitdiffstats
path: root/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp')
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp31
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);