From 5704cbc462ad0b316a6b55a0f1dadc3c50762ef7 Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Fri, 7 Sep 2012 14:59:15 +0200 Subject: 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 Reviewed-by: Sergio Ahumada --- .../kernel/qprinterinfo/tst_qprinterinfo.cpp | 29 ++++++---------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'tests/auto/printsupport/kernel/qprinterinfo') diff --git a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp index 3427a122ee..63ed70045a 100644 --- a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp +++ b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ - #include #include #include @@ -57,12 +56,11 @@ class tst_QPrinterInfo : public QObject { Q_OBJECT -public slots: - void initTestCase(); -#ifndef QT_NO_PRINTER private slots: +#ifndef Q_OS_WIN32 void testForDefaultPrinter(); void testForPrinters(); +#endif void testForPaperSizes(); void testConstructors(); void testAssignment(); @@ -75,17 +73,8 @@ private: #ifdef Q_OS_UNIX QString getOutputFromCommand(const QStringList& command); #endif // Q_OS_UNIX -#endif // QT_NO_PRINTER }; -void tst_QPrinterInfo::initTestCase() -{ -#ifdef QT_NO_PRINTER - QSKIP("This test requires printing support"); -#endif // QT_NO_PRINTER -} - -#ifndef QT_NO_PRINTER QString tst_QPrinterInfo::getDefaultPrinterFromSystem() { QString printer; @@ -200,11 +189,10 @@ QString tst_QPrinterInfo::getOutputFromCommand(const QStringList& command) } #endif +// Windows test support not yet implemented +#ifndef Q_OS_WIN32 void tst_QPrinterInfo::testForDefaultPrinter() { -#ifdef Q_OS_WIN32 - QSKIP("Windows test support not yet implemented"); -#endif // Q_OS_WIN32 QString testPrinter = getDefaultPrinterFromSystem(); QString defaultPrinter = QPrinterInfo::defaultPrinter().printerName(); QString availablePrinter; @@ -227,12 +215,12 @@ void tst_QPrinterInfo::testForDefaultPrinter() if (!availablePrinter.isEmpty()) QCOMPARE(availablePrinterDefaults, 1); } +#endif +// Windows test support not yet implemented +#ifndef Q_OS_WIN32 void tst_QPrinterInfo::testForPrinters() { -#ifdef Q_OS_WIN32 - QSKIP("Windows test support not yet implemented"); -#endif // Q_OS_WIN32 QStringList testPrinters = getPrintersFromSystem(); QList printers = QPrinterInfo::availablePrinters(); @@ -251,6 +239,7 @@ void tst_QPrinterInfo::testForPrinters() for (int i = 0; i < testPrinters.size(); ++i) QCOMPARE(qtPrinters.at(i), testPrinters.at(i)); } +#endif void tst_QPrinterInfo::testForPaperSizes() { @@ -324,7 +313,5 @@ void tst_QPrinterInfo::namedPrinter() } } -#endif // QT_NO_PRINTER - QTEST_MAIN(tst_QPrinterInfo) #include "tst_qprinterinfo.moc" -- cgit v1.2.3