diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-11-15 11:36:18 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-18 01:51:57 +0100 |
commit | a8fd0c3654f8352773638633778cd8003680cbc7 (patch) | |
tree | 4815cca9daf879b96a92a3de95621b56ac5ba868 /tests/auto/gui | |
parent | d90d57bb8b995c7a66e7f9b7b2515447fbe11de0 (diff) |
Don't depend on moc to disable test functions.
The moc tool is not aware of all defines (particularly those that are
compiler builtins) and does not correctly evaluate others that depend
on compiler builtins, such as Q_OS_FOO.
This commit reverts parts of the following commits, but is not a
complete fix as there were many instances of this problem in the tests
prior to those commits:
924d810dbdcd5b5b0fa860922b2487ea9062d002
8aaff6751038b88d17e23be6fcee945771297c5b
338d3f11973412047c2c9cd41cbd0c961d738ef3
a55034062ba2bf73a9f1ed3d9cf31745b38149e3
253497b7446c7d723aa3bdd7152e25d6852f2604
7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6
9d2ff58f3642828e494e7e9b2df7dbb8e2cd408f
0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b
Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/gui')
10 files changed, 139 insertions, 133 deletions
diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp index 4f6c7defda..9458a97c6f 100644 --- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp +++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp @@ -55,9 +55,7 @@ class tst_QClipboard : public QObject { Q_OBJECT private slots: -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC)) && !defined(QT_NO_PROCESS) void copy_exit_paste(); -#endif void capabiliyFunctions(); void modes(); void testSignals(); @@ -188,12 +186,13 @@ void tst_QClipboard::testSignals() } // Test that pasted text remains on the clipboard after a Qt application exits. -// This test does not make sense on X11 and embedded, as copied data disappears -// from the clipboard when the application exits. It's still possible to test -// copy/paste - just keep the apps running. -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC)) && !defined(QT_NO_PROCESS) void tst_QClipboard::copy_exit_paste() { +#ifndef QT_NO_PROCESS +#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) + QSKIP("This test does not make sense on X11 and embedded, copied data disappears from the clipboard when the application exits "); + // ### It's still possible to test copy/paste - just keep the apps running +#endif if (!nativeClipboardWorking()) QSKIP("Native clipboard not working in this setup"); const QStringList stringArgument = QStringList() << "Test string."; @@ -203,8 +202,8 @@ void tst_QClipboard::copy_exit_paste() QTest::qWait(100); #endif QCOMPARE(QProcess::execute("paster/paster", stringArgument), 0); -} #endif +} void tst_QClipboard::setMimeData() { diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp index 0a2a20a29b..44380d2cd1 100644 --- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp @@ -121,10 +121,8 @@ private slots: void symetricConstructors(); void checkMultipleNames(); void checkMultipleCodes(); -#ifndef Q_WS_MAC void mnemonic_data(); void mnemonic(); -#endif void toString_data(); void toString(); void streamOperators_data(); @@ -135,10 +133,8 @@ private slots: void standardKeys_data(); void standardKeys(); void keyBindings(); -#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) void translated_data(); void translated(); -#endif void i18nKeys_data(); void i18nKeys(); @@ -384,8 +380,6 @@ void tst_QKeySequence::keyBindings() QVERIFY(bindings == expected); } -// mnemonics are not used on Mac OS X. -#ifndef Q_WS_MAC void tst_QKeySequence::mnemonic_data() { QTest::addColumn<QString>("string"); @@ -407,6 +401,9 @@ void tst_QKeySequence::mnemonic_data() void tst_QKeySequence::mnemonic() { +#ifdef Q_WS_MAC + QSKIP("mnemonics are not used on Mac OS X"); +#endif QFETCH(QString, string); QFETCH(QString, key); QFETCH(bool, warning); @@ -423,7 +420,6 @@ void tst_QKeySequence::mnemonic() QCOMPARE(seq, res); } -#endif void tst_QKeySequence::toString_data() { @@ -531,8 +527,6 @@ void tst_QKeySequence::fromString() QCOMPARE(ks4, ks1); } -// No need to translate modifiers on Mac OS X or WinCE. -#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) void tst_QKeySequence::translated_data() { qApp->installTranslator(ourTranslator); @@ -564,6 +558,11 @@ void tst_QKeySequence::translated() { QFETCH(QString, transKey); QFETCH(QString, compKey); +#ifdef Q_WS_MAC + QSKIP("No need to translate modifiers on Mac OS X"); +#elif defined(Q_OS_WINCE) + QSKIP("No need to translate modifiers on WinCE"); +#endif qApp->installTranslator(ourTranslator); qApp->installTranslator(qtTranslator); @@ -574,7 +573,7 @@ void tst_QKeySequence::translated() qApp->removeTranslator(ourTranslator); qApp->removeTranslator(qtTranslator); } -#endif + void tst_QKeySequence::i18nKeys_data() { 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() { diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index a949c91362..0c932e38a5 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -67,23 +67,17 @@ public slots: void cleanup(); private slots: void getSetCheck(); -#ifndef Q_WS_WIN void exactMatch(); -#endif void compare(); void resolve(); void resetFont(); void isCopyOf(); -#ifdef Q_WS_X11 void setFontRaw(); -#endif void italicOblique(); void insertAndRemoveSubstitutions(); void serializeSpacing(); void lastResortFont(); -#if defined(Q_WS_MAC) void styleName(); -#endif #ifdef QT_BUILD_INTERNAL void defaultFamily_data(); void defaultFamily(); @@ -148,8 +142,6 @@ void tst_QFont::cleanup() // This will be executed immediately after each test is run. } -// Exact matching on windows misses a lot because of the sample chars. -#ifndef Q_WS_WIN void tst_QFont::exactMatch() { QFont font; @@ -158,6 +150,10 @@ void tst_QFont::exactMatch() font = QFont( "BogusFont", 33 ); QVERIFY( !font.exactMatch() ); +#ifdef Q_WS_WIN + QSKIP("Exact matching on windows misses a lot because of the sample chars"); +#endif + #ifdef Q_WS_X11 QVERIFY(QFont("sans").exactMatch()); QVERIFY(QFont("sans-serif").exactMatch()); @@ -305,7 +301,6 @@ void tst_QFont::exactMatch() } } } -#endif void tst_QFont::italicOblique() { @@ -519,9 +514,11 @@ void tst_QFont::isCopyOf() QVERIFY(!font3.isCopyOf(font)); } -#ifdef Q_WS_X11 void tst_QFont::setFontRaw() { +#ifndef Q_WS_X11 + QSKIP("Only tested on X11"); +#else QFont f; f.setRawName("-*-fixed-bold-r-normal--0-0-*-*-*-0-iso8859-1"); // qDebug("font family: %s", f.family().utf8()); @@ -538,8 +535,8 @@ void tst_QFont::setFontRaw() if (!found) QSKIP("Fixed font not available."); QCOMPARE(QFontInfo(f).family().left(5).toLower(), QString("fixed")); -} #endif +} void tst_QFont::insertAndRemoveSubstitutions() { @@ -617,15 +614,17 @@ void tst_QFont::lastResortFont() QVERIFY(!font.lastResortFont().isEmpty()); } -#if defined(Q_WS_MAC) void tst_QFont::styleName() { +#if !defined(Q_WS_MAC) + QSKIP("Only tested on Mac"); +#else QFont font("Helvetica Neue"); font.setStyleName("UltraLight"); QCOMPARE(QFontInfo(font).styleName(), QString("UltraLight")); -} #endif +} #ifdef QT_BUILD_INTERNAL Q_DECLARE_METATYPE(QFont::StyleHint) diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp index c3b942f331..6886a687df 100644 --- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp @@ -63,10 +63,8 @@ private slots: void styles_data(); void styles(); -#ifndef Q_WS_QWS void fixedPitch_data(); void fixedPitch(); -#endif #ifdef Q_WS_MAC void trickyFonts_data(); @@ -127,8 +125,6 @@ void tst_QFontDatabase::styles() } } -// fixedPitch not implemented for Qtopia Core. -#ifndef Q_WS_QWS void tst_QFontDatabase::fixedPitch_data() { QTest::addColumn<QString>("font"); @@ -152,6 +148,9 @@ void tst_QFontDatabase::fixedPitch_data() void tst_QFontDatabase::fixedPitch() { +#ifdef Q_WS_QWS + QSKIP("fixedPitch not implemented for Qtopia Core"); +#endif QFETCH(QString, font); QFETCH(bool, fixedPitch); @@ -165,7 +164,6 @@ void tst_QFontDatabase::fixedPitch() QFontInfo fi(qfont); QCOMPARE(fi.fixedPitch(), fixedPitch); } -#endif #ifdef Q_WS_MAC void tst_QFontDatabase::trickyFonts_data() diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp index 0e1b3aaa1f..f1c2f6e4de 100644 --- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp @@ -74,19 +74,13 @@ public slots: void cleanup(); private slots: void getSetCheck(); -#ifdef Q_WS_X11 void lineBreaking(); -#endif void simpleBoundingRect(); -#ifndef Q_WS_MAC void threeLineBoundingRect(); -#endif void boundingRectWithLongLineAndNoWrap(); void forcedBreaks(); -#ifndef Q_WS_MAC void breakAny(); void noWrap(); -#endif void cursorToXForInlineObjects(); void cursorToXForSetColumns(); void defaultWordSeparators_data(); @@ -94,14 +88,10 @@ private slots: void cursorMovementFromInvalidPositions(); void cursorMovementInsideSpaces(); void charWordStopOnLineSeparator(); -#ifndef Q_WS_MAC void xToCursorAtEndOfLine(); -#endif void boundingRectTopLeft(); void charStopForSurrogatePairs(); -#ifndef Q_WS_MAC void tabStops(); -#endif void integerOverflow(); void testDefaultTabs(); void testTabs(); @@ -210,9 +200,9 @@ void tst_QTextLayout::cleanup() testFont = QFont(); } -#ifdef Q_WS_X11 void tst_QTextLayout::lineBreaking() { +#if defined(Q_WS_X11) struct Breaks { const char *utf8; uchar breaks[32]; @@ -289,8 +279,10 @@ void tst_QTextLayout::lineBreaking() QCOMPARE(b->breaks[i], (uchar)0xff); ++b; } -} +#else + QSKIP("This test can not be run on non-X11 platforms"); #endif +} void tst_QTextLayout::simpleBoundingRect() { @@ -309,10 +301,11 @@ void tst_QTextLayout::simpleBoundingRect() QCOMPARE(layout.boundingRect(), QRectF(0, 0, width, QFontMetrics(testFont).height())); } -// QTestFontEngine on the mac does not support logclusters at the moment. -#ifndef Q_WS_MAC void tst_QTextLayout::threeLineBoundingRect() { +#if defined(Q_WS_MAC) + QSKIP("QTestFontEngine on the mac does not support logclusters at the moment"); +#endif /* stricter check. break text into three lines */ QString firstWord("hello"); @@ -364,7 +357,6 @@ void tst_QTextLayout::threeLineBoundingRect() QCOMPARE(layout.boundingRect(), QRectF(0, 0, longestLine, y + 1)); } -#endif void tst_QTextLayout::boundingRectWithLongLineAndNoWrap() { @@ -428,10 +420,11 @@ void tst_QTextLayout::forcedBreaks() QCOMPARE(line.xToCursor(0), line.textStart()); } -// QTestFontEngine on the mac does not support logclusters at the moment. -#ifndef Q_WS_MAC void tst_QTextLayout::breakAny() { +#if defined(Q_WS_MAC) + QSKIP("QTestFontEngine on the mac does not support logclusters at the moment"); +#endif QString text = "ABCD"; QTextLayout layout(text, testFont); @@ -468,12 +461,12 @@ void tst_QTextLayout::breakAny() layout.endLayout(); } -#endif -// QTestFontEngine on the mac does not support logclusters at the moment. -#ifndef Q_WS_MAC void tst_QTextLayout::noWrap() { +#if defined(Q_WS_MAC) + QSKIP("QTestFontEngine on the mac does not support logclusters at the moment"); +#endif QString text = "AB CD"; QTextLayout layout(text, testFont); @@ -494,7 +487,6 @@ void tst_QTextLayout::noWrap() layout.endLayout(); } -#endif void tst_QTextLayout::cursorToXForInlineObjects() { @@ -614,10 +606,11 @@ void tst_QTextLayout::charWordStopOnLineSeparator() QVERIFY(attrs[1].charStop); } -// QTestFontEngine on the mac does not support logclusters at the moment. -#ifndef Q_WS_MAC void tst_QTextLayout::xToCursorAtEndOfLine() { +#if defined(Q_WS_MAC) + QSKIP("QTestFontEngine on the mac does not support logclusters at the moment"); +#endif QString text = "FirstLine SecondLine"; text.replace('\n', QChar::LineSeparator); @@ -638,7 +631,6 @@ void tst_QTextLayout::xToCursorAtEndOfLine() line = layout.lineAt(1); QCOMPARE(line.xToCursor(100000), 20); } -#endif void tst_QTextLayout::boundingRectTopLeft() { @@ -676,10 +668,11 @@ void tst_QTextLayout::charStopForSurrogatePairs() QVERIFY(attrs[3].charStop); } -// QTestFontEngine on the mac does not support logclusters at the moment. -#ifndef Q_WS_MAC void tst_QTextLayout::tabStops() { +#if defined(Q_WS_MAC) + QSKIP("QTestFontEngine on the mac does not support logclusters at the moment"); +#endif QString txt("Hello there\tworld"); QTextLayout layout(txt, testFont); layout.beginLayout(); @@ -696,7 +689,6 @@ void tst_QTextLayout::tabStops() layout.endLayout(); } -#endif void tst_QTextLayout::integerOverflow() { diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp index 0149a0a0a0..55ad866874 100644 --- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp @@ -90,7 +90,6 @@ public slots: void init(); void cleanup(); private slots: -#ifdef Q_WS_X11 void devanagari(); void bengali(); void gurmukhi(); @@ -106,15 +105,10 @@ private slots: void khmer(); void linearB(); void controlInSyllable_qtbug14204(); -#endif -#if (defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)) || defined(Q_WS_X11) void combiningMarks_qtbug15675(); -#endif -#ifndef Q_WS_MAC void mirroredChars_data(); void mirroredChars(); -#endif private: bool haveTestFonts; @@ -204,9 +198,9 @@ static bool shaping( const QFont &f, const ShapeTable *s) } #endif -#ifdef Q_WS_X11 void tst_QTextScriptEngine::devanagari() { +#if defined(Q_WS_X11) if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -312,12 +306,14 @@ void tst_QTextScriptEngine::devanagari() } else QSKIP("couldn't find mangal"); } -} +#else + QSKIP("X11 specific test"); #endif +} -#ifdef Q_WS_X11 void tst_QTextScriptEngine::bengali() { +#if defined(Q_WS_X11) if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -561,12 +557,14 @@ void tst_QTextScriptEngine::bengali() } else QSKIP("couldn't find Likhan"); } -} +#else + QSKIP("X11 specific test"); #endif +} -#ifdef Q_WS_X11 void tst_QTextScriptEngine::gurmukhi() { +#if defined(Q_WS_X11) if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -588,12 +586,14 @@ void tst_QTextScriptEngine::gurmukhi() } else QSKIP("couldn't find Lohit Punjabi"); } -} +#else + QSKIP("X11 specific test"); #endif +} -#ifdef Q_WS_X11 void tst_QTextScriptEngine::oriya() { +#if defined(Q_WS_X11) if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -626,13 +626,15 @@ void tst_QTextScriptEngine::oriya() } } else QSKIP("couldn't find utkal"); - } -} + } +#else + QSKIP("X11 specific test"); #endif +} -#ifdef Q_WS_X11 void tst_QTextScriptEngine::tamil() { +#if defined(Q_WS_X11) if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -703,12 +705,14 @@ void tst_QTextScriptEngine::tamil() } else QSKIP("couldn't find AkrutiTml1"); } -} +#else + QSKIP("X11 specific test"); #endif +} -#ifdef Q_WS_X11 void tst_QTextScriptEngine::telugu() { +#if defined(Q_WS_X11) if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -750,12 +754,14 @@ void tst_QTextScriptEngine::telugu() } else QSKIP("couldn't find Pothana2000"); } -} +#else + QSKIP("X11 specific test"); #endif +} -#ifdef Q_WS_X11 void tst_QTextScriptEngine::kannada() { +#if defined(Q_WS_X11) { if (QFontDatabase().families(QFontDatabase::Kannada).contains("Sampige")) { QFont f("Sampige"); @@ -823,12 +829,14 @@ void tst_QTextScriptEngine::kannada() } else QSKIP("couldn't find Tunga"); } -} +#else + QSKIP("X11 specific test"); #endif +} -#ifdef Q_WS_X11 void tst_QTextScriptEngine::malayalam() { +#if defined(Q_WS_X11) if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -909,12 +917,14 @@ void tst_QTextScriptEngine::malayalam() } else QSKIP("couldn't find Rachana"); } -} +#else + QSKIP("X11 specific test"); #endif +} -#ifdef Q_WS_X11 void tst_QTextScriptEngine::sinhala() { +#if defined(Q_WS_X11) if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -946,12 +956,14 @@ void tst_QTextScriptEngine::sinhala() } else QSKIP("couldn't find Malithi Web"); } -} +#else + QSKIP("X11 specific test"); #endif +} -#ifdef Q_WS_X11 void tst_QTextScriptEngine::khmer() { +#if defined(Q_WS_X11) if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -989,12 +1001,14 @@ void tst_QTextScriptEngine::khmer() } else QSKIP("couldn't find Khmer OS"); } -} +#else + QSKIP("X11 specific test"); #endif +} -#ifdef Q_WS_X11 void tst_QTextScriptEngine::linearB() { +#if defined(Q_WS_X11) if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -1016,8 +1030,10 @@ void tst_QTextScriptEngine::linearB() } else QSKIP("couldn't find Penuturesu"); } -} +#else + QSKIP("X11 specific test"); #endif +} #if defined(Q_WS_X11) static bool decomposedShaping( const QFont &f, const QChar &ch) @@ -1066,9 +1082,9 @@ static bool decomposedShaping( const QFont &f, const QChar &ch) } #endif -#ifdef Q_WS_X11 void tst_QTextScriptEngine::greek() { +#if defined(Q_WS_X11) if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -1124,12 +1140,14 @@ void tst_QTextScriptEngine::greek() } else QSKIP("couldn't find SBL_grk"); } -} +#else + QSKIP("X11 specific test"); #endif +} -#if defined(Q_WS_X11) void tst_QTextScriptEngine::controlInSyllable_qtbug14204() { +#if defined(Q_WS_X11) QString s; s.append(QChar(0x0915)); s.append(QChar(0x094d)); @@ -1143,10 +1161,11 @@ void tst_QTextScriptEngine::controlInSyllable_qtbug14204() QVERIFY(e->layoutData->items[0].num_glyphs == 2); QVERIFY(e->layoutData->glyphLayout.advances_x[1] != 0); -} +#else + QSKIP("X11 specific test"); #endif +} -#if (defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)) || defined(Q_WS_X11) void tst_QTextScriptEngine::combiningMarks_qtbug15675() { #if defined(Q_WS_MAC) @@ -1182,11 +1201,11 @@ void tst_QTextScriptEngine::combiningMarks_qtbug15675() QVERIFY(e->layoutData->items[0].num_glyphs == 3); QVERIFY(e->layoutData->glyphLayout.advances_x[1] == 0); +#else + QSKIP("X11/Mac specific test"); #endif } -#endif -#ifndef Q_WS_MAC void tst_QTextScriptEngine::mirroredChars_data() { QTest::addColumn<int>("hintingPreference"); @@ -1199,6 +1218,9 @@ void tst_QTextScriptEngine::mirroredChars_data() void tst_QTextScriptEngine::mirroredChars() { +#if defined(Q_WS_MAC) + QSKIP("Not supported on Mac"); +#endif QFETCH(int, hintingPreference); QFont font; @@ -1240,7 +1262,6 @@ void tst_QTextScriptEngine::mirroredChars() QCOMPARE(glyphLayout.glyphs[1], leftParenthesis); } } -#endif QTEST_MAIN(tst_QTextScriptEngine) #include "tst_qtextscriptengine.moc" |