summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/text/qtextlayout
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-09-30 13:19:21 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-03 03:34:57 +0200
commit0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b (patch)
tree33c67e6b261357b5bd4a180e13bb48d26da5ca16 /tests/auto/gui/text/qtextlayout
parent3c54bd67dacc2a5d11246213377e804be364a387 (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/auto/gui/text/qtextlayout')
-rw-r--r--tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp47
1 files changed, 27 insertions, 20 deletions
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()
{