summaryrefslogtreecommitdiffstats
path: root/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@nokia.com>2012-09-07 14:59:15 +0200
committerQt by Nokia <qt-info@nokia.com>2012-09-12 10:14:10 +0200
commit5704cbc462ad0b316a6b55a0f1dadc3c50762ef7 (patch)
treee60381eadd15677b5d972735bc73364d892e9856 /tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
parent97b4c5a5746a33a27076d72ceb3533fbd54b9642 (diff)
Test: remove QSKIP from printsupport tests
Exclude printsupport tests from the build when QT_NO_PRINTER is defined. Change-Id: Iedae91666a599f4b77250abc8aac14c256fde34e Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Diffstat (limited to 'tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp')
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp33
1 files changed, 9 insertions, 24 deletions
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index 6977bbe8b4..c8667822ae 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -81,20 +81,18 @@ class tst_QPrinter : public QObject
{
Q_OBJECT
-#ifdef QT_NO_PRINTER
-public slots:
- void initTestCase();
-#else
private slots:
void getSetCheck();
// Add your testfunctions and testdata create functions here
+#ifdef Q_OS_WIN
void testPageSize();
+ void testNonExistentPrinter();
+#endif
void testPageRectAndPaperRect();
void testPageRectAndPaperRect_data();
void testSetOptions();
void testMargins_data();
void testMargins();
- void testNonExistentPrinter();
void testPageSetupDialog();
void testMulitpleSets_data();
void testMulitpleSets();
@@ -115,17 +113,8 @@ private slots:
void taskQTBUG4497_reusePrinterOnDifferentFiles();
void testPdfTitle();
-#endif
};
-#ifdef QT_NO_PRINTER
-void tst_QPrinter::initTestCase()
-{
- QSKIP("This test requires printing support");
-}
-
-#else
-
// Testing get/set functions
void tst_QPrinter::getSetCheck()
{
@@ -233,11 +222,10 @@ void tst_QPrinter::testPageSetupDialog()
}
}
+#ifdef Q_OS_WIN
+// QPrinter::winPageSize(): Windows only.
void tst_QPrinter::testPageSize()
{
-#ifndef Q_OS_WIN
- QSKIP("QPrinter::winPageSize(): Windows only.");
-#else
QPrinter prn;
prn.setPageSize(QPrinter::Letter);
@@ -255,8 +243,8 @@ void tst_QPrinter::testPageSize()
prn.setWinPageSize(DMPAPER_A4);
MYCOMPARE(prn.winPageSize(), DMPAPER_A4);
MYCOMPARE(prn.pageSize(), QPrinter::A4);
-#endif // Q_OS_WIN
}
+#endif // Q_OS_WIN
void tst_QPrinter::testPageRectAndPaperRect_data()
{
@@ -397,11 +385,10 @@ void tst_QPrinter::testMargins()
QFile::remove("silly");
}
+#ifdef Q_OS_WIN
+// QPrinter::testNonExistentPrinter() is not relevant for this platform
void tst_QPrinter::testNonExistentPrinter()
{
-#ifndef Q_OS_WIN
- QSKIP("QPrinter::testNonExistentPrinter() is not relevant for this platform");
-#else
QPrinter printer;
QPainter painter;
@@ -429,8 +416,8 @@ void tst_QPrinter::testNonExistentPrinter()
QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmPhysicalDpiY), 0);
QVERIFY(!painter.begin(&printer));
-#endif
}
+#endif
void tst_QPrinter::testMulitpleSets_data()
{
@@ -1047,7 +1034,5 @@ void tst_QPrinter::testPdfTitle()
QVERIFY(file.readAll().contains(QByteArray(expected, 26)));
}
-#endif
-
QTEST_MAIN(tst_QPrinter)
#include "tst_qprinter.moc"