summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextcodec
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-03-30 08:39:21 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-03-30 08:40:40 (GMT)
commitbc4fe607fe65dca24460d4f612c5815b4767e988 (patch)
treeb9c4dcb66ffc141f866c2367a475abc537db6729 /tests/auto/qtextcodec
parent6cc6ca434f0ff63273c3fd3da80803f39c888e91 (diff)
downloadQt-bc4fe607fe65dca24460d4f612c5815b4767e988.zip
Qt-bc4fe607fe65dca24460d4f612c5815b4767e988.tar.gz
Qt-bc4fe607fe65dca24460d4f612c5815b4767e988.tar.bz2
One more test for chinese codecs
Relates to QT-2627
Diffstat (limited to 'tests/auto/qtextcodec')
-rw-r--r--tests/auto/qtextcodec/tst_qtextcodec.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/qtextcodec/tst_qtextcodec.cpp
index 1c64ade..4e7123f 100644
--- a/tests/auto/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/qtextcodec/tst_qtextcodec.cpp
@@ -2178,6 +2178,45 @@ void tst_QTextCodec::moreToFromUnicode_data() {
koi8_u_ba.append(x);
}
QTest::newRow("KOI8-U") << QByteArray("KOI8-U") << koi8_u_ba;
+
+
+ QByteArray big5_ba;
+ for (unsigned char u=0xa1; u<=0xf9; u++) {
+ if (u==0xc8) {
+ continue;
+ }
+ for (unsigned char v=0x40; v<=0x7e; v++) {
+ big5_ba.append(u);
+ big5_ba.append(v);
+ }
+ unsigned char v_up;
+ switch (u) {
+ case 0xa3: v_up=0xbf; break;
+ case 0xc7: v_up=0xfc; break;
+ case 0xf9: v_up=0xd5; break;
+ default: v_up=0xfe;
+ }
+
+ for (unsigned char v=0xa1; v<=v_up; v++) {
+ if (u==0xa2 && (v==0xcc || v==0xce)) {
+ continue;
+ }
+ big5_ba.append(u);
+ big5_ba.append(v);
+ }
+ }
+
+ QTest::newRow("BIG5") << QByteArray("BIG5") << big5_ba;
+
+ QByteArray gb2312_ba;
+ for (unsigned char u=0xa1; u<=0xf7; u++) {
+ for (unsigned char v=0xa1; v<=0xfe; v++) {
+ gb2312_ba.append(u);
+ gb2312_ba.append(v);
+ }
+ }
+
+ QTest::newRow("GB2312") << QByteArray("GB2312") << gb2312_ba;
}
void tst_QTextCodec::moreToFromUnicode()