summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextcodec
diff options
context:
space:
mode:
authorJyri Tahtela <jyri.tahtela@nokia.com>2011-05-19 13:56:55 (GMT)
committerJyri Tahtela <jyri.tahtela@nokia.com>2011-05-19 13:56:55 (GMT)
commit94051a438e64eaede021b4e926ef58f793a09a70 (patch)
tree9860dc49d8e6453df356f51da9126b583ac35206 /tests/auto/qtextcodec
parent06557b8d7c472c6298f7d8b310feda225864265f (diff)
parent35b5f15c3fe5c2f1f0d046d09b9d95dee3bb91b5 (diff)
downloadQt-94051a438e64eaede021b4e926ef58f793a09a70.zip
Qt-94051a438e64eaede021b4e926ef58f793a09a70.tar.gz
Qt-94051a438e64eaede021b4e926ef58f793a09a70.tar.bz2
Merge remote-tracking branch 'qt/4.8'
Diffstat (limited to 'tests/auto/qtextcodec')
-rw-r--r--tests/auto/qtextcodec/tst_qtextcodec.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/qtextcodec/tst_qtextcodec.cpp
index a0bfac6..049af79 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");