diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-09-30 13:19:21 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-03 03:34:57 +0200 |
commit | 0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b (patch) | |
tree | 33c67e6b261357b5bd4a180e13bb48d26da5ca16 /tests | |
parent | 3c54bd67dacc2a5d11246213377e804be364a387 (diff) |
Avoid using QSKIP in lieu of compile-time checks
QSKIP is intended to be used to skip test functions that are found at
run-time to be inapplicable or unsafe. If a test function can be
determined to be inapplicable at compile-time, the entire test function
should be omitted instead of replacing the body of the test function
with a QSKIP, which only serves to slow down test runs and to inflate
test run-rates with empty, inapplicable tests.
Task-number: QTQAINFRA-278
Change-Id: I31e069f5476f8adf9851e94b33c6afac4394b88e
Reviewed-on: http://codereview.qt-project.org/5824
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests')
9 files changed, 139 insertions, 166 deletions
diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp index 34bc581396..88506e66a6 100644 --- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp +++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp @@ -55,8 +55,9 @@ class tst_QClipboard : public QObject { Q_OBJECT private slots: - +#if !defined(Q_WS_X11) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA) && !defined(QT_NO_PROCESS) void copy_exit_paste(); +#endif void capabiliyFunctions(); void modes(); void testSignals(); @@ -186,17 +187,13 @@ void tst_QClipboard::testSignals() QCOMPARE(dataChangedSpy.count(), 1); } -/* - Test that pasted text remain on the clipboard - after a Qt application exits. -*/ +// 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_WS_X11) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA) && !defined(QT_NO_PROCESS) void tst_QClipboard::copy_exit_paste() { -#ifndef QT_NO_PROCESS -#if defined Q_WS_X11 || defined Q_WS_QWS || defined (Q_WS_QPA) - QSKIP("This test does not make sense on X11 and embedded, copied data disappears from the clipboard when the application exits ", SkipAll); - // ### It's still possible to test copy/paste - just keep the apps running -#endif if (!nativeClipboardWorking()) QSKIP("Native clipboard not working in this setup", SkipAll); const QStringList stringArgument = QStringList() << "Test string."; @@ -206,8 +203,8 @@ void tst_QClipboard::copy_exit_paste() QTest::qWait(100); #endif QCOMPARE(QProcess::execute("paster/paster", stringArgument), 0); -#endif } +#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 4c9fc149e5..e7a484365a 100644 --- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp @@ -121,8 +121,10 @@ 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(); @@ -133,8 +135,10 @@ 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(); @@ -383,8 +387,8 @@ 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"); @@ -406,9 +410,6 @@ void tst_QKeySequence::mnemonic_data() void tst_QKeySequence::mnemonic() { -#ifdef Q_WS_MAC - QSKIP("mnemonics are not used on Mac OS X", SkipAll); -#endif QFETCH(QString, string); QFETCH(QString, key); QFETCH(bool, warning); @@ -425,8 +426,7 @@ void tst_QKeySequence::mnemonic() QCOMPARE(seq, res); } - - +#endif void tst_QKeySequence::toString_data() { @@ -534,6 +534,8 @@ 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); @@ -565,11 +567,6 @@ void tst_QKeySequence::translated() { QFETCH(QString, transKey); QFETCH(QString, compKey); -#ifdef Q_WS_MAC - QSKIP("No need to translate modifiers on Mac OS X", SkipAll); -#elif defined(Q_OS_WINCE) - QSKIP("No need to translate modifiers on WinCE", SkipAll); -#endif qApp->installTranslator(ourTranslator); qApp->installTranslator(qtTranslator); @@ -580,7 +577,7 @@ void tst_QKeySequence::translated() qApp->removeTranslator(ourTranslator); qApp->removeTranslator(qtTranslator); } - +#endif void tst_QKeySequence::i18nKeys_data() { diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index c2606a6c6a..a56894f189 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -98,8 +98,10 @@ private slots: void getSetCheck(); void qt_format_text_clip(); void qt_format_text_boundingRect(); +#ifndef Q_WS_MAC void drawPixmap_comp_data(); void drawPixmap_comp(); +#endif void saveAndRestore_data(); void saveAndRestore(); @@ -185,8 +187,10 @@ private slots: void fillRect_stretchToDeviceMode(); void monoImages(); +#ifndef Q_WS_QWS void linearGradientSymmetry_data(); void linearGradientSymmetry(); +#endif void gradientInterpolation(); void fpe_pixmapTransform(); @@ -219,7 +223,9 @@ private slots: void drawRect_task215378(); void drawRect_task247505(); +#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA) void drawText_subPixelPositionsInRaster_qtbug5053(); +#endif void drawImage_data(); void drawImage(); @@ -686,6 +692,8 @@ 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) { @@ -732,10 +740,6 @@ 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", SkipAll); -#endif - QFETCH(uint, dest); QFETCH(uint, source); @@ -783,6 +787,7 @@ void tst_QPainter::drawPixmap_comp() QVERIFY(!different); } +#endif void tst_QPainter::saveAndRestore_data() { @@ -3897,6 +3902,8 @@ 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"); @@ -3928,9 +3935,6 @@ void tst_QPainter::linearGradientSymmetry_data() void tst_QPainter::linearGradientSymmetry() { -#ifdef Q_WS_QWS - QSKIP("QWS has limited resolution in the gradient color table", SkipAll); -#else QFETCH(QGradientStops, stops); QImage a(64, 8, QImage::Format_ARGB32_Premultiplied); @@ -3952,8 +3956,8 @@ void tst_QPainter::linearGradientSymmetry() b = b.mirrored(true); QCOMPARE(a, b); -#endif } +#endif void tst_QPainter::gradientInterpolation() { @@ -4524,11 +4528,10 @@ void tst_QPainter::clipBoundingRect() } +// Only Mac/Cocoa supports sub pixel positions in raster engine currently +#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA) void tst_QPainter::drawText_subPixelPositionsInRaster_qtbug5053() { -#if !defined(Q_WS_MAC) || !defined(QT_MAC_USE_COCOA) - QSKIP("Only Mac/Cocoa supports sub pixel positions in raster engine currently", SkipAll); -#endif QFontMetricsF fm(qApp->font()); QImage baseLine(fm.width(QChar::fromLatin1('e')), fm.height(), QImage::Format_RGB32); @@ -4556,6 +4559,7 @@ 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 a6b6895981..a3d5f10120 100644 --- a/tests/auto/gui/painting/qprinter/tst_qprinter.cpp +++ b/tests/auto/gui/painting/qprinter/tst_qprinter.cpp @@ -82,13 +82,17 @@ 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(); +#if !defined(Q_WS_X11) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA) && !defined(Q_OS_MAC) void testNonExistentPrinter(); +#endif void testPageSetupDialog(); void testMulitpleSets_data(); void testMulitpleSets(); @@ -100,15 +104,15 @@ private slots: void valuePreservation(); void errorReporting(); void testCustomPageSizes(); +#if !defined(QT_NO_COMPLETER) && !defined(QT_NO_FILEDIALOG) void printDialogCompleter(); +#endif void testCopyCount(); void testCurrentPage(); void taskQTBUG4497_reusePrinterOnDifferentFiles(); void testPdfTitle(); - -private: }; // Testing get/set functions @@ -259,9 +263,10 @@ void tst_QPrinter::testPageSetupDialog() } } +// QPrinter::winPageSize() does not exist for non-Windows platforms. +#ifdef Q_WS_WIN void tst_QPrinter::testPageSize() { -#if defined (Q_WS_WIN) QPrinter prn; prn.setPageSize(QPrinter::Letter); @@ -279,10 +284,8 @@ void tst_QPrinter::testPageSize() prn.setWinPageSize(DMPAPER_A4); MYCOMPARE(prn.winPageSize(), DMPAPER_A4); MYCOMPARE(prn.pageSize(), QPrinter::A4); -#else - QSKIP("QPrinter::winPageSize() does not exist for nonwindows platforms", SkipAll); -#endif } +#endif void tst_QPrinter::testPageRectAndPaperRect_data() { @@ -421,11 +424,10 @@ void tst_QPrinter::testMargins() delete painter; } +// QPrinter::testNonExistentPrinter() is not relevant for some platforms. +#if !defined(Q_WS_X11) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA) && !defined(Q_OS_MAC) void tst_QPrinter::testNonExistentPrinter() { -#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_QPA) || defined(Q_OS_MAC) - QSKIP("QPrinter::testNonExistentPrinter() is not relevant for this platform", SkipAll); -#else QPrinter printer; QPainter painter; @@ -453,9 +455,8 @@ void tst_QPrinter::testNonExistentPrinter() QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmPhysicalDpiY), 0); QVERIFY(!painter.begin(&printer)); -#endif } - +#endif void tst_QPrinter::testMulitpleSets_data() { @@ -930,11 +931,9 @@ void tst_QPrinter::testCustomPageSizes() QCOMPARE(paperSize, customSize); } +#if !defined(QT_NO_COMPLETER) && !defined(QT_NO_FILEDIALOG) void tst_QPrinter::printDialogCompleter() { -#if defined(QT_NO_COMPLETER) || defined(QT_NO_FILEDIALOG) - QSKIP("QT_NO_COMPLETER || QT_NO_FILEDIALOG: Auto-complete turned off in QPrinterDialog.", QTest::SkipAll); -#else QPrintDialog dialog; dialog.printer()->setOutputFileName("file.pdf"); dialog.setEnabledOptions(QAbstractPrintDialog::PrintToFile); @@ -945,8 +944,8 @@ void tst_QPrinter::printDialogCompleter() QTest::keyClick(&dialog, Qt::Key_Tab); QTest::keyClick(&dialog, 'P'); // The test passes if it doesn't crash. -#endif } +#endif void tst_QPrinter::testCopyCount() { diff --git a/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp index 7e5da4a6f8..f4579cfd79 100644 --- a/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp +++ b/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp @@ -56,12 +56,6 @@ Q_DECLARE_METATYPE(QRect) - -#if defined(Q_OS_WIN32) -# define ACCEPTABLE_WINDOWS -#endif - - //TESTED_CLASS= //TESTED_FILES= @@ -80,8 +74,10 @@ public slots: //void init(); //void cleanup(); private slots: +#if defined(Q_OS_UNIX) || defined(Q_OS_WIN32) void testForDefaultPrinter(); void testForPrinters(); +#endif void testForPaperSizes(); void testConstructors(); void testAssignment(); @@ -208,13 +204,13 @@ QString tst_QPrinterInfo::getOutputFromCommand(const QStringList& command) } #else return QString(); -#endif // Q_OS_UNIX +#endif } +#if defined(Q_OS_UNIX) || defined(Q_OS_WIN32) void tst_QPrinterInfo::testForDefaultPrinter() { -#if defined(Q_OS_UNIX) || defined(ACCEPTABLE_WINDOWS) -# ifdef ACCEPTABLE_WINDOWS +# ifdef Q_OS_WIN32 if (QHostInfo::localHostName() == "fantomet" || QHostInfo::localHostName() == "bobo") { QWARN("Test is hardcoded to \"fantomet\" and \"bobo\" on Windows and may fail"); } else { @@ -245,15 +241,13 @@ 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", SkipAll); -#endif // defined(Q_OS_UNIX) || defined(ACCEPTABLE_WINDOWS) } +#endif +#if defined(Q_OS_UNIX) || defined(Q_OS_WIN32) void tst_QPrinterInfo::testForPrinters() { -#if defined(Q_OS_UNIX) || defined(ACCEPTABLE_WINDOWS) -# ifdef ACCEPTABLE_WINDOWS +# ifdef Q_OS_WIN32 if (QHostInfo::localHostName() == "fantomet" || QHostInfo::localHostName() == "bobo") { QWARN("Test is hardcoded to \"fantomet\" and \"bobo\" on Windows and may fail"); } else { @@ -296,10 +290,8 @@ 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", SkipAll); -#endif // defined(Q_OS_UNIX) || defined(ACCEPTABLE_WINDOWS) } +#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 a564e71e19..48d0e438f3 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -72,12 +72,18 @@ private slots: void resolve(); void resetFont(); void isCopyOf(); +#ifdef Q_WS_X11 void setFontRaw(); +#endif void italicOblique(); void insertAndRemoveSubstitutions(); void serializeSpacing(); +#if !defined(Q_WS_QWS) && !defined(Q_WS_QPA) void lastResortFont(); +#endif +#if defined(Q_WS_MAC) void styleName(); +#endif }; // Testing get/set functions @@ -512,11 +518,9 @@ 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", SkipAll); -#else QFont f; f.setRawName("-*-fixed-bold-r-normal--0-0-*-*-*-0-iso8859-1"); // qDebug("font family: %s", f.family().utf8()); @@ -534,8 +538,8 @@ void tst_QFont::setFontRaw() QSKIP("Fixed font not available.", SkipSingle); } QCOMPARE(QFontInfo(f).family().left(5).toLower(), QString("fixed")); -#endif } +#endif void tst_QFont::insertAndRemoveSubstitutions() { @@ -602,28 +606,26 @@ void tst_QFont::serializeSpacing() QCOMPARE(font3.wordSpacing(), 50.); } +// QFont::lastResortFont() may abort with qFatal() on QWS/QPA +// if absolutely no font is found. Just as ducumented for QFont::lastResortFont(). +// This happens on our CI machines which run QWS autotests. +#if !defined(Q_WS_QWS) && !defined(Q_WS_QPA) void tst_QFont::lastResortFont() { -#if defined(Q_WS_QWS) || defined(Q_WS_QPA) - QSKIP("QFont::lastResortFont() may abort with qFatal() on QWS/QPA", SkipAll); - // ...if absolutely no font is found. Just as ducumented for QFont::lastResortFont(). - // This happens on our CI machines which run QWS autotests. -#endif QFont font; QVERIFY(!font.lastResortFont().isEmpty()); } +#endif +#if defined(Q_WS_MAC) void tst_QFont::styleName() { -#if !defined(Q_WS_MAC) - QSKIP("Only tested on Mac", SkipAll); -#else QFont font("Helvetica Neue"); font.setStyleName("UltraLight"); QCOMPARE(QFontInfo(font).styleName(), QString("UltraLight")); -#endif } +#endif QTEST_MAIN(tst_QFont) #include "tst_qfont.moc" diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp index 052b4d4bd0..fe37c77dd5 100644 --- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp @@ -63,8 +63,10 @@ private slots: void styles_data(); void styles(); +#ifndef Q_WS_QWS void fixedPitch_data(); void fixedPitch(); +#endif #ifdef Q_WS_MAC void trickyFonts_data(); @@ -125,6 +127,8 @@ void tst_QFontDatabase::styles() } } +// fixedPitch not implemented for Qtopia Core. +#ifndef Q_WS_QWS void tst_QFontDatabase::fixedPitch_data() { QTest::addColumn<QString>("font"); @@ -148,9 +152,6 @@ void tst_QFontDatabase::fixedPitch_data() void tst_QFontDatabase::fixedPitch() { -#ifdef Q_WS_QWS - QSKIP("fixedPitch not implemented for Qtopia Core", SkipAll); -#endif QFETCH(QString, font); QFETCH(bool, fixedPitch); @@ -164,6 +165,7 @@ 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 2414ab3e37..8b6b51b2da 100644 --- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp @@ -74,13 +74,19 @@ 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(); @@ -88,10 +94,14 @@ 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(); @@ -199,10 +209,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]; @@ -279,10 +288,8 @@ void tst_QTextLayout::lineBreaking() QCOMPARE(b->breaks[i], (uchar)0xff); ++b; } -#else - QSKIP("This test can not be run on non-X11 platforms", SkipAll); -#endif } +#endif void tst_QTextLayout::simpleBoundingRect() { @@ -301,11 +308,10 @@ 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", SkipAll); -#endif /* stricter check. break text into three lines */ QString firstWord("hello"); @@ -357,6 +363,7 @@ void tst_QTextLayout::threeLineBoundingRect() QCOMPARE(layout.boundingRect(), QRectF(0, 0, longestLine, y + 1)); } +#endif void tst_QTextLayout::boundingRectWithLongLineAndNoWrap() { @@ -420,11 +427,10 @@ 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", SkipAll); -#endif QString text = "ABCD"; QTextLayout layout(text, testFont); @@ -461,12 +467,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", SkipAll); -#endif QString text = "AB CD"; QTextLayout layout(text, testFont); @@ -487,6 +493,7 @@ void tst_QTextLayout::noWrap() layout.endLayout(); } +#endif void tst_QTextLayout::cursorToXForInlineObjects() { @@ -606,11 +613,10 @@ 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", SkipAll); -#endif QString text = "FirstLine SecondLine"; text.replace('\n', QChar::LineSeparator); @@ -631,6 +637,7 @@ void tst_QTextLayout::xToCursorAtEndOfLine() line = layout.lineAt(1); QCOMPARE(line.xToCursor(100000), 20); } +#endif void tst_QTextLayout::boundingRectTopLeft() { @@ -668,11 +675,10 @@ 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", SkipAll); -#endif QString txt("Hello there\tworld"); QTextLayout layout(txt, testFont); layout.beginLayout(); @@ -689,6 +695,7 @@ 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 cbed675cb7..7f30009e56 100644 --- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp @@ -90,6 +90,7 @@ public slots: void init(); void cleanup(); private slots: +#ifdef Q_WS_X11 void devanagari(); void bengali(); void gurmukhi(); @@ -105,10 +106,15 @@ 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; @@ -198,9 +204,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", SkipAll); } @@ -309,14 +315,12 @@ void tst_QTextScriptEngine::devanagari() QSKIP("couldn't find mangal", SkipAll); } } -#else - QSKIP("X11 specific test", SkipAll); -#endif } +#endif +#ifdef Q_WS_X11 void tst_QTextScriptEngine::bengali() { -#if defined(Q_WS_X11) if (!haveTestFonts) { QSKIP("Test fonts are not available", SkipAll); } @@ -564,14 +568,12 @@ void tst_QTextScriptEngine::bengali() QSKIP("couldn't find Likhan", SkipAll); } } -#else - QSKIP("X11 specific test", SkipAll); -#endif } +#endif +#ifdef Q_WS_X11 void tst_QTextScriptEngine::gurmukhi() { -#if defined(Q_WS_X11) if (!haveTestFonts) { QSKIP("Test fonts are not available", SkipAll); } @@ -595,12 +597,12 @@ void tst_QTextScriptEngine::gurmukhi() QSKIP("couldn't find Lohit Punjabi", SkipAll); } } -#endif } +#endif +#ifdef Q_WS_X11 void tst_QTextScriptEngine::oriya() { -#if defined(Q_WS_X11) if (!haveTestFonts) { QSKIP("Test fonts are not available", SkipAll); } @@ -636,15 +638,12 @@ void tst_QTextScriptEngine::oriya() QSKIP("couldn't find utkal", SkipAll); } } -#else - QSKIP("X11 specific test", SkipAll); -#endif } +#endif - +#ifdef Q_WS_X11 void tst_QTextScriptEngine::tamil() { -#if defined(Q_WS_X11) if (!haveTestFonts) { QSKIP("Test fonts are not available", SkipAll); } @@ -717,15 +716,12 @@ void tst_QTextScriptEngine::tamil() QSKIP("couldn't find AkrutiTml1", SkipAll); } } -#else - QSKIP("X11 specific test", SkipAll); -#endif } +#endif - +#ifdef Q_WS_X11 void tst_QTextScriptEngine::telugu() { -#if defined(Q_WS_X11) if (!haveTestFonts) { QSKIP("Test fonts are not available", SkipAll); } @@ -769,15 +765,12 @@ void tst_QTextScriptEngine::telugu() QSKIP("couldn't find Pothana2000", SkipAll); } } -#else - QSKIP("X11 specific test", SkipAll); -#endif } +#endif - +#ifdef Q_WS_X11 void tst_QTextScriptEngine::kannada() { -#if defined(Q_WS_X11) { if (QFontDatabase().families(QFontDatabase::Kannada).contains("Sampige")) { QFont f("Sampige"); @@ -847,16 +840,12 @@ void tst_QTextScriptEngine::kannada() QSKIP("couldn't find Tunga", SkipAll); } } -#else - QSKIP("X11 specific test", SkipAll); -#endif } +#endif - - +#ifdef Q_WS_X11 void tst_QTextScriptEngine::malayalam() { -#if defined(Q_WS_X11) if (!haveTestFonts) { QSKIP("Test fonts are not available", SkipAll); } @@ -940,15 +929,12 @@ void tst_QTextScriptEngine::malayalam() QSKIP("couldn't find Rachana", SkipAll); } } - -#else - QSKIP("X11 specific test", SkipAll); -#endif } +#endif +#ifdef Q_WS_X11 void tst_QTextScriptEngine::sinhala() { -#if defined(Q_WS_X11) if (!haveTestFonts) { QSKIP("Test fonts are not available", SkipAll); } @@ -982,15 +968,12 @@ void tst_QTextScriptEngine::sinhala() QSKIP("couldn't find Malithi Web", SkipAll); } } -#else - QSKIP("X11 specific test", SkipAll); -#endif } +#endif - +#ifdef Q_WS_X11 void tst_QTextScriptEngine::khmer() { -#if defined(Q_WS_X11) if (!haveTestFonts) { QSKIP("Test fonts are not available", SkipAll); } @@ -1030,14 +1013,12 @@ void tst_QTextScriptEngine::khmer() QSKIP("couldn't find Khmer OS", SkipAll); } } -#else - QSKIP("X11 specific test", SkipAll); -#endif } +#endif +#ifdef Q_WS_X11 void tst_QTextScriptEngine::linearB() { -#if defined(Q_WS_X11) if (!haveTestFonts) { QSKIP("Test fonts are not available", SkipAll); } @@ -1061,10 +1042,8 @@ void tst_QTextScriptEngine::linearB() QSKIP("couldn't find Penuturesu", SkipAll); } } -#else - QSKIP("X11 specific test", SkipAll); -#endif } +#endif #if defined(Q_WS_X11) static bool decomposedShaping( const QFont &f, const QChar &ch) @@ -1113,10 +1092,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", SkipAll); } @@ -1175,14 +1153,12 @@ void tst_QTextScriptEngine::greek() QSKIP("couldn't find SBL_grk", SkipAll); } } -#else - QSKIP("X11 specific test", SkipAll); -#endif } +#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)); @@ -1196,11 +1172,10 @@ 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", SkipAll); -#endif } +#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) && defined(QT_MAC_USE_COCOA) @@ -1238,11 +1213,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", SkipAll); #endif } +#endif +#ifndef Q_WS_MAC void tst_QTextScriptEngine::mirroredChars_data() { QTest::addColumn<int>("hintingPreference"); @@ -1255,9 +1230,6 @@ void tst_QTextScriptEngine::mirroredChars_data() void tst_QTextScriptEngine::mirroredChars() { -#if defined(Q_WS_MAC) - QSKIP("Not supported on Mac", SkipAll); -#endif QFETCH(int, hintingPreference); QFont font; @@ -1299,6 +1271,7 @@ void tst_QTextScriptEngine::mirroredChars() QCOMPARE(glyphLayout.glyphs[1], leftParenthesis); } } +#endif QTEST_MAIN(tst_QTextScriptEngine) #include "tst_qtextscriptengine.moc" |