summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2010-02-24 19:13:47 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-03-05 15:58:09 (GMT)
commit76eb4f454073a30ef62d8bb85862589a13415605 (patch)
tree49f7f54d461e0a0dae791539a809f5b982784ea4
parent5cea1e11166998fc5862a782af4aa502f2b7be6a (diff)
downloadQt-76eb4f454073a30ef62d8bb85862589a13415605.zip
Qt-76eb4f454073a30ef62d8bb85862589a13415605.tar.gz
Qt-76eb4f454073a30ef62d8bb85862589a13415605.tar.bz2
improve error reporting a bit more
Merge-request: 480 Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
-rw-r--r--util/unicode/main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp
index 84b50e1..368cd83 100644
--- a/util/unicode/main.cpp
+++ b/util/unicode/main.cpp
@@ -706,6 +706,7 @@ static void readUnicodeData()
bool ok;
int codepoint = properties[UD_Value].toInt(&ok, 16);
Q_ASSERT(ok);
+ Q_ASSERT(codepoint <= LAST_CODEPOINT);
int lastCodepoint = codepoint;
QByteArray name = properties[UD_Name];
@@ -714,12 +715,16 @@ static void readUnicodeData()
nextLine.resize(1024);
f.readLine(nextLine.data(), 1024);
QList<QByteArray> properties = nextLine.split(';');
+ Q_ASSERT(properties[UD_Name].startsWith('<') && properties[UD_Name].contains("Last"));
lastCodepoint = properties[UD_Value].toInt(&ok, 16);
Q_ASSERT(ok);
+ Q_ASSERT(lastCodepoint <= LAST_CODEPOINT);
}
UnicodeData data(codepoint);
data.p.category = categoryMap.value(properties[UD_Category], QChar::NoCategory);
+ if (data.p.category == QChar::NoCategory)
+ qFatal("unassigned char category: %s", properties[UD_Category].constData());
data.p.combiningClass = properties[UD_CombiningClass].toInt();
if (!combiningClassUsage.contains(data.p.combiningClass))
@@ -781,7 +786,9 @@ static void readUnicodeData()
highestComposedCharacter = qMax(highestComposedCharacter, codepoint);
QList<QByteArray> d = decomposition.split(' ');
if (d[0].contains('<')) {
- data.decompositionType = decompositionMap.value(d[0], QChar::Canonical);
+ data.decompositionType = decompositionMap.value(d[0], QChar::NoDecomposition);
+ if (data.decompositionType == QChar::NoDecomposition)
+ qFatal("unassigned decomposition type: %s", d[0].constData());
d.takeFirst();
} else {
data.decompositionType = QChar::Canonical;