diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2013-06-16 08:28:11 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-11 10:26:33 (GMT) |
commit | 6326b4e622942c701af90e992d7a58f59be41fa2 (patch) | |
tree | 227ba46168ab6b820a1e276fb3527d01c825c919 /tests/auto | |
parent | c504d5b8047483e87fd1cfad2c2824353310c5da (diff) | |
download | Qt-6326b4e622942c701af90e992d7a58f59be41fa2.zip Qt-6326b4e622942c701af90e992d7a58f59be41fa2.tar.gz Qt-6326b4e622942c701af90e992d7a58f59be41fa2.tar.bz2 |
QString::normalize(): Fix assertion in some corner case
Don't assume `from` is 0 and the string always starts with a starter code point.
This has been fixed for 5.0 as part of Unicode Data & Algorithms update
(qtbase:46b78113b22428e6f8540193fcf0e00591dbd724).
Task-number: QTBUG-30931
Change-Id: I2030aaf831ebe619b980e55e98d5f5a366dbe3ed
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qchar/tst_qchar.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qchar/tst_qchar.cpp b/tests/auto/qchar/tst_qchar.cpp index 89fa34f..a4ad8e9 100644 --- a/tests/auto/qchar/tst_qchar.cpp +++ b/tests/auto/qchar/tst_qchar.cpp @@ -694,6 +694,20 @@ void tst_QChar::normalization_manual() QVERIFY(composed.normalized(QString::NormalizationForm_KD) == decomposed); QVERIFY(composed.normalized(QString::NormalizationForm_KC) == decomposed); } + { + QString composed; + composed += QChar(0x0061); + composed += QChar(0x00f2); + QString decomposed; + decomposed += QChar(0x0061); + decomposed += QChar(0x006f); + decomposed += QChar(0x0300); + + QVERIFY(decomposed.normalized(QString::NormalizationForm_D) == decomposed); + QVERIFY(decomposed.normalized(QString::NormalizationForm_C) == composed); + QVERIFY(decomposed.normalized(QString::NormalizationForm_KD) == decomposed); + QVERIFY(decomposed.normalized(QString::NormalizationForm_KC) == composed); + } } void tst_QChar::normalizationCorrections() |