diff options
Diffstat (limited to 'tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp')
-rw-r--r-- | tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp index e039347801..f9734df10d 100644 --- a/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp +++ b/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp @@ -66,10 +66,8 @@ public slots: void initTestCase(); #else private slots: -#if defined(Q_OS_UNIX) || defined(Q_OS_WIN32) void testForDefaultPrinter(); void testForPrinters(); -#endif void testForPaperSizes(); void testConstructors(); void testAssignment(); @@ -208,9 +206,9 @@ QString tst_QPrinterInfo::getOutputFromCommand(const QStringList& command) #endif } -#if defined(Q_OS_UNIX) || defined(Q_OS_WIN32) void tst_QPrinterInfo::testForDefaultPrinter() { +#if defined(Q_OS_UNIX) || defined(Q_OS_WIN32) # ifdef Q_OS_WIN32 if (QHostInfo::localHostName() == "fantomet" || QHostInfo::localHostName() == "bobo") { QWARN("Test is hardcoded to \"fantomet\" and \"bobo\" on Windows and may fail"); @@ -242,12 +240,14 @@ void tst_QPrinterInfo::testForDefaultPrinter() } if (!found && defSysPrinter != "") QFAIL("No default printer reported by Qt, although there is one"); -} +#else + QSKIP("Test doesn't work on non-Unix"); #endif +} -#if defined(Q_OS_UNIX) || defined(Q_OS_WIN32) void tst_QPrinterInfo::testForPrinters() { +#if defined(Q_OS_UNIX) || defined(Q_OS_WIN32) # ifdef Q_OS_WIN32 if (QHostInfo::localHostName() == "fantomet" || QHostInfo::localHostName() == "bobo") { QWARN("Test is hardcoded to \"fantomet\" and \"bobo\" on Windows and may fail"); @@ -291,8 +291,10 @@ void tst_QPrinterInfo::testForPrinters() QFAIL(qPrintable(QString("Printer '%1' reported by system, but not reported by Qt").arg(sysPrinters.at(i)))); } } -} +#else + QSKIP("Test doesn't work on non-Unix"); #endif +} void tst_QPrinterInfo::testForPaperSizes() { |