summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2012-08-22 13:51:45 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-23 11:20:37 +0200
commite177a35dfe62dfebdd1381f30dc5f5b83b1d6b74 (patch)
tree8954355c48244376a9d846db88e3bf20122fc2ed /tests
parente9bc07c4f24e8580a688c41b91a63e12851bb5ce (diff)
ICU: Fix crash in codecForMib(2107)
availableMibs() unconditionally adds 2107 to the list of mibs. The patch ensures that codecForMib() also knows about this special TSCII codec. (Note that the autotest only really checks this code path if only this test case is run. The other tests already fill the internal codec cache otherwise). Change-Id: Id987d7cecd5f5700cca75e9b85b37011f8e5c622 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
index 2eac72db29..c32c6f9573 100644
--- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
@@ -73,6 +73,7 @@ private slots:
void decode0D() const;
void aliasForUTF16() const;
void mibForTSCII() const;
+ void codecForTSCII() const;
void utf8Codec_data();
void utf8Codec();
@@ -513,6 +514,13 @@ void tst_QTextCodec::mibForTSCII() const
QCOMPARE(codec->mibEnum(), 2107);
}
+void tst_QTextCodec::codecForTSCII() const
+{
+ QTextCodec *codec = QTextCodec::codecForMib(2107);
+ QVERIFY(codec);
+ QCOMPARE(codec->mibEnum(), 2107);
+}
+
static QString fromInvalidUtf8Sequence(const QByteArray &ba)
{
return QString().fill(QChar::ReplacementCharacter, ba.size());