From ff1aba7d92ae6661713eb068161c6235719028b9 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Mon, 11 Jun 2012 21:45:59 +0300 Subject: [PATCH] Make QTBF autotest support SMP code points in the test data I didn't do this earlier since the current test data doesn't contain any SMP code points, the Unicode 6.2 test data does - so, I can confirm this code really works. Change-Id: Ieae35e8480a89e22d846fd038e79592fefbbf2ee Reviewed-by: Lars Knoll --- .../corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp index eef2931..ad48ebf 100644 --- a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp +++ b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp @@ -154,8 +154,12 @@ static void generateDataFromFile(const QString &fname) bool ok = true; uint ucs4 = part.toInt(&ok, 16); QVERIFY(ok && ucs4 > 0); - QVERIFY(!QChar::requiresSurrogates(ucs4)); - testString.append(QChar(ucs4)); + if (QChar::requiresSurrogates(ucs4)) { + testString.append(QChar::highSurrogate(ucs4)); + testString.append(QChar::lowSurrogate(ucs4)); + } else { + testString.append(QChar(ucs4)); + } } QVERIFY(!testString.isEmpty()); QVERIFY(!expectedBreakPositions.isEmpty()); -- 2.7.4