summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-03-25 05:55:45 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-03-25 05:55:45 (GMT)
commitf5c194ca63bb8992f2b74c232408de8ed467950e (patch)
treedbf0a2d92f4ee7fa1014b0a435081e871259027c /tests
parent660f881f04a0880c83a0b43b4f4d0e89da082d92 (diff)
parentf49490a13b664eb00207b2d3d6354071ae81f161 (diff)
downloadQt-f5c194ca63bb8992f2b74c232408de8ed467950e.zip
Qt-f5c194ca63bb8992f2b74c232408de8ed467950e.tar.gz
Qt-f5c194ca63bb8992f2b74c232408de8ed467950e.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Make sure num_glyphs pass to HarfBuzz is large enough
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qtextlayout/tst_qtextlayout.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp
index 2d15566..85e6616 100644
--- a/tests/auto/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp
@@ -125,6 +125,7 @@ private slots:
void textWidthVsWIdth();
void textWidthWithStackedTextEngine();
void textWidthWithLineSeparator();
+ void textWithSurrogates_qtbug15679();
private:
QFont testFont;
@@ -1416,5 +1417,24 @@ void tst_QTextLayout::textWidthWithLineSeparator()
QCOMPARE(line1.naturalTextWidth(), line2.naturalTextWidth());
}
+void tst_QTextLayout::textWithSurrogates_qtbug15679()
+{
+ QString str = QString::fromUtf8("🀀a🀀");
+ QTextLayout layout(str);
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ layout.endLayout();
+
+ qreal x[6];
+ for (int i = 0; i < 6; i++)
+ x[i] = line.cursorToX(i);
+
+ // If the first and third character are using the same
+ // font, they must have the same advance (since they
+ // are surrogate pairs, we need to add two for each
+ // character)
+ QCOMPARE(x[2] - x[0], x[5] - x[3]);
+}
+
QTEST_MAIN(tst_QTextLayout)
#include "tst_qtextlayout.moc"