diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-18 14:22:24 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-18 14:22:24 (GMT) |
commit | f50a2555301e7e1d5e4bde32c380a3576e998407 (patch) | |
tree | 53dbef90951408f27c2757ce710dde800fe51c63 /tests/auto/qtextcodec | |
parent | 2c07b5d2cba8d8e499bd0861eefef12d4e00d99a (diff) | |
parent | 8e321cd869da7ff1cf0168da41aa0246b44867cc (diff) | |
download | Qt-f50a2555301e7e1d5e4bde32c380a3576e998407.zip Qt-f50a2555301e7e1d5e4bde32c380a3576e998407.tar.gz Qt-f50a2555301e7e1d5e4bde32c380a3576e998407.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-air-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-air-staging:
Fix inconsistency between Qt and ICU in Shift-JIS codec with regards to ASCII range
Fix crashes with regular expressions QtScript on ARM traditional architectures
Diffstat (limited to 'tests/auto/qtextcodec')
-rw-r--r-- | tests/auto/qtextcodec/tst_qtextcodec.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/qtextcodec/tst_qtextcodec.cpp index d122b0b..34d34fa 100644 --- a/tests/auto/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/qtextcodec/tst_qtextcodec.cpp @@ -106,6 +106,8 @@ private slots: void moreToFromUnicode_data(); void moreToFromUnicode(); + + void shiftJis(); }; void tst_QTextCodec::toUnicode_data() @@ -2236,6 +2238,19 @@ void tst_QTextCodec::moreToFromUnicode() QCOMPARE(testData, cStr); } +void tst_QTextCodec::shiftJis() +{ + QByteArray backslashTilde("\\~"); + QTextCodec* codec = QTextCodec::codecForName("shift_jis"); + QString string = codec->toUnicode(backslashTilde); + QCOMPARE(string.length(), 2); + QCOMPARE(string.at(0), QChar(QLatin1Char('\\'))); + QCOMPARE(string.at(1), QChar(QLatin1Char('~'))); + + QByteArray encoded = codec->fromUnicode(string); + QCOMPARE(encoded, backslashTilde); +} + struct DontCrashAtExit { ~DontCrashAtExit() { QTextCodec *c = QTextCodec::codecForName("utf8"); |