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/text/qtextlayout | |
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/text/qtextlayout')
-rw-r--r-- | tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp | 46 |
1 files changed, 19 insertions, 27 deletions
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() { |