diff options
Diffstat (limited to 'tests/auto/gui/painting')
-rw-r--r-- | tests/auto/gui/painting/qcolor/tst_qcolor.cpp | 8 | ||||
-rw-r--r-- | tests/auto/gui/painting/qpainter/tst_qpainter.cpp | 27 | ||||
-rw-r--r-- | tests/auto/gui/painting/qprinter/tst_qprinter.cpp | 17 | ||||
-rw-r--r-- | tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp | 14 |
4 files changed, 32 insertions, 34 deletions
diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp index 7db941bb20..1090b5ddcf 100644 --- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp +++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp @@ -111,7 +111,7 @@ private slots: void achromaticHslHue(); -#if defined(Q_WS_X11) && !defined(Q_OS_IRIX) +#ifdef Q_WS_X11 void setallowX11ColorNames(); #endif }; @@ -1335,10 +1335,12 @@ void tst_QColor::achromaticHslHue() QCOMPARE(hsl.hslHue(), -1); } -// This test fails on IRIX due to the gamma settings in the SGI X server. -#if defined(Q_WS_X11) && !defined(Q_OS_IRIX) +#ifdef Q_WS_X11 void tst_QColor::setallowX11ColorNames() { +#if defined(Q_OS_IRIX) + QSKIP("This fails due to the gamma settings in the SGI X server"); +#endif RGBData x11RgbTbl[] = { // a few standard X11 color names { "DodgerBlue1", qRgb(30, 144, 255) }, diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index d41e0e4650..529bb3ee20 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -94,10 +94,8 @@ public slots: void cleanup(); private slots: void getSetCheck(); -#ifndef Q_WS_MAC void drawPixmap_comp_data(); void drawPixmap_comp(); -#endif void saveAndRestore_data(); void saveAndRestore(); @@ -183,10 +181,8 @@ private slots: void fillRect_stretchToDeviceMode(); void monoImages(); -#ifndef Q_WS_QWS void linearGradientSymmetry_data(); void linearGradientSymmetry(); -#endif void gradientInterpolation(); void fpe_pixmapTransform(); @@ -219,9 +215,7 @@ private slots: void drawRect_task215378(); void drawRect_task247505(); -#if defined(Q_OS_MAC) void drawText_subPixelPositionsInRaster_qtbug5053(); -#endif void drawImage_data(); void drawImage(); @@ -416,8 +410,6 @@ static const char* const maskResult_data[] = { "...ddddddddddddd"}; -// Mac has other ideas about alpha composition -#ifndef Q_WS_MAC void tst_QPainter::drawPixmap_comp_data() { if (qApp->desktop()->depth() < 24) @@ -462,6 +454,9 @@ QRgb qt_compose_alpha(QRgb source, QRgb dest) */ void tst_QPainter::drawPixmap_comp() { +#ifdef Q_WS_MAC + QSKIP("Mac has other ideas about alpha composition"); +#endif QFETCH(uint, dest); QFETCH(uint, source); @@ -509,7 +504,6 @@ void tst_QPainter::drawPixmap_comp() QVERIFY(!different); } -#endif void tst_QPainter::saveAndRestore_data() { @@ -3522,8 +3516,6 @@ static QLinearGradient inverseGradient(QLinearGradient g) return g2; } -// QWS has limited resolution in the gradient color table -#ifndef Q_WS_QWS void tst_QPainter::linearGradientSymmetry_data() { QTest::addColumn<QGradientStops>("stops"); @@ -3555,6 +3547,9 @@ void tst_QPainter::linearGradientSymmetry_data() void tst_QPainter::linearGradientSymmetry() { +#ifdef Q_WS_QWS + QSKIP("QWS has limited resolution in the gradient color table"); +#else QFETCH(QGradientStops, stops); QImage a(64, 8, QImage::Format_ARGB32_Premultiplied); @@ -3576,8 +3571,8 @@ void tst_QPainter::linearGradientSymmetry() b = b.mirrored(true); QCOMPARE(a, b); -} #endif +} void tst_QPainter::gradientInterpolation() { @@ -4148,11 +4143,12 @@ void tst_QPainter::clipBoundingRect() } -//Only Mac/Cocoa supports sub pixel positions in raster engine currently -#ifdef Q_OS_MAC void tst_QPainter::drawText_subPixelPositionsInRaster_qtbug5053() { - QFontMetricsF fm(qApp->font()); +#if !defined(Q_OS_MAC) + QSKIP("Only Mac supports sub pixel positions in raster engine currently"); +#endif + QFontMetricsF fm(qApp->font()); QImage baseLine(fm.width(QChar::fromLatin1('e')), fm.height(), QImage::Format_RGB32); baseLine.fill(Qt::white); @@ -4179,7 +4175,6 @@ void tst_QPainter::drawText_subPixelPositionsInRaster_qtbug5053() QVERIFY(foundDifferentRasterization); } -#endif void tst_QPainter::drawPointScaled() { diff --git a/tests/auto/gui/painting/qprinter/tst_qprinter.cpp b/tests/auto/gui/painting/qprinter/tst_qprinter.cpp index 0fac12d227..cbfa8a2d35 100644 --- a/tests/auto/gui/painting/qprinter/tst_qprinter.cpp +++ b/tests/auto/gui/painting/qprinter/tst_qprinter.cpp @@ -74,17 +74,13 @@ public slots: private slots: void getSetCheck(); // Add your testfunctions and testdata create functions here -#ifdef Q_WS_WIN void testPageSize(); -#endif void testPageRectAndPaperRect(); void testPageRectAndPaperRect_data(); void testSetOptions(); void testMargins_data(); void testMargins(); -#ifdef Q_OS_WIN void testNonExistentPrinter(); -#endif // Q_OS_WIN void testPageSetupDialog(); void testMulitpleSets_data(); void testMulitpleSets(); @@ -224,10 +220,11 @@ void tst_QPrinter::testPageSetupDialog() } } -// QPrinter::winPageSize() does not exist for non-Windows platforms. -#ifdef Q_WS_WIN void tst_QPrinter::testPageSize() { +#ifndef Q_OS_WIN + QSKIP("QPrinter::winPageSize() does not exist for non-Windows platforms"); +#else QPrinter prn; prn.setPageSize(QPrinter::Letter); @@ -245,8 +242,8 @@ void tst_QPrinter::testPageSize() prn.setWinPageSize(DMPAPER_A4); MYCOMPARE(prn.winPageSize(), DMPAPER_A4); MYCOMPARE(prn.pageSize(), QPrinter::A4); -} #endif +} void tst_QPrinter::testPageRectAndPaperRect_data() { @@ -385,9 +382,11 @@ void tst_QPrinter::testMargins() delete painter; } -#ifdef Q_OS_WIN void tst_QPrinter::testNonExistentPrinter() { +#ifndef Q_OS_WIN + QSKIP("QPrinter::testNonExistentPrinter() is not relevant for this platform"); +#else QPrinter printer; QPainter painter; @@ -415,8 +414,8 @@ void tst_QPrinter::testNonExistentPrinter() QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmPhysicalDpiY), 0); QVERIFY(!painter.begin(&printer)); +#endif } -#endif // Q_OS_WIN void tst_QPrinter::testMulitpleSets_data() { 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() { |