diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2013-06-16 11:28:11 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-11 12:26:33 +0200 |
commit | 6326b4e622942c701af90e992d7a58f59be41fa2 (patch) | |
tree | 227ba46168ab6b820a1e276fb3527d01c825c919 /tests/auto | |
parent | c504d5b8047483e87fd1cfad2c2824353310c5da (diff) | |
download | qt4-tools-6326b4e622942c701af90e992d7a58f59be41fa2.tar.gz |
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 89fa34f22c..a4ad8e9fc1 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() |