summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@nokia.com>2010-03-18 13:52:49 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-03-18 13:52:49 (GMT)
commitb0eeea8a2ff13e1449dd98ef5c43c1c89e2e357b (patch)
treefd4f2e143c327b21054f380def0b7ed7dcd5b2e4 /tests/auto
parentb19899f81cb7ac3b35e5fad3af777e89f1627474 (diff)
downloadQt-b0eeea8a2ff13e1449dd98ef5c43c1c89e2e357b.zip
Qt-b0eeea8a2ff13e1449dd98ef5c43c1c89e2e357b.tar.gz
Qt-b0eeea8a2ff13e1449dd98ef5c43c1c89e2e357b.tar.bz2
Add a test case for commit 76d767080a6be7b025f36d6778dfaedbd31a9f07
Merge-request: 496 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qkeysequence/tst_qkeysequence.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp
index b1ef223..1faae6a 100644
--- a/tests/auto/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp
@@ -134,6 +134,8 @@ private slots:
void keyBindings();
void translated_data();
void translated();
+ void i18nKeys_data();
+ void i18nKeys();
void initTestCase();
@@ -570,5 +572,55 @@ void tst_QKeySequence::translated()
}
+void tst_QKeySequence::i18nKeys_data()
+{
+ QTest::addColumn<int>("keycode");
+ QTest::addColumn<QString>("keystring");
+
+ // Japanese keyboard support
+ QTest::newRow("Kanji") << (int)Qt::Key_Kanji << QString("Kanji");
+ QTest::newRow("Muhenkan") << (int)Qt::Key_Muhenkan << QString("Muhenkan");
+ QTest::newRow("Henkan") << (int)Qt::Key_Henkan << QString("Henkan");
+ QTest::newRow("Romaji") << (int)Qt::Key_Romaji << QString("Romaji");
+ QTest::newRow("Hiragana") << (int)Qt::Key_Hiragana << QString("Hiragana");
+ QTest::newRow("Katakana") << (int)Qt::Key_Katakana << QString("Katakana");
+ QTest::newRow("Hiragana Katakana") << (int)Qt::Key_Hiragana_Katakana << QString("Hiragana Katakana");
+ QTest::newRow("Zenkaku") << (int)Qt::Key_Zenkaku << QString("Zenkaku");
+ QTest::newRow("Hankaku") << (int)Qt::Key_Hankaku << QString("Hankaku");
+ QTest::newRow("Zenkaku Hankaku") << (int)Qt::Key_Zenkaku_Hankaku << QString("Zenkaku Hankaku");
+ QTest::newRow("Touroku") << (int)Qt::Key_Touroku << QString("Touroku");
+ QTest::newRow("Massyo") << (int)Qt::Key_Massyo << QString("Massyo");
+ QTest::newRow("Kana Lock") << (int)Qt::Key_Kana_Lock << QString("Kana Lock");
+ QTest::newRow("Kana Shift") << (int)Qt::Key_Kana_Shift << QString("Kana Shift");
+ QTest::newRow("Eisu Shift") << (int)Qt::Key_Eisu_Shift << QString("Eisu Shift");
+ QTest::newRow("Eisu_toggle") << (int)Qt::Key_Eisu_toggle << QString("Eisu toggle");
+ QTest::newRow("Code input") << (int)Qt::Key_Codeinput << QString("Code input");
+ QTest::newRow("Multiple Candidate") << (int)Qt::Key_MultipleCandidate << QString("Multiple Candidate");
+ QTest::newRow("Previous Candidate") << (int)Qt::Key_PreviousCandidate << QString("Previous Candidate");
+
+ // Korean keyboard support
+ QTest::newRow("Hangul") << (int)Qt::Key_Hangul << QString("Hangul");
+ QTest::newRow("Hangul Start") << (int)Qt::Key_Hangul_Start << QString("Hangul Start");
+ QTest::newRow("Hangul End") << (int)Qt::Key_Hangul_End << QString("Hangul End");
+ QTest::newRow("Hangul Hanja") << (int)Qt::Key_Hangul_Hanja << QString("Hangul Hanja");
+ QTest::newRow("Hangul Jamo") << (int)Qt::Key_Hangul_Jamo << QString("Hangul Jamo");
+ QTest::newRow("Hangul Romaja") << (int)Qt::Key_Hangul_Romaja << QString("Hangul Romaja");
+ QTest::newRow("Hangul Jeonja") << (int)Qt::Key_Hangul_Jeonja << QString("Hangul Jeonja");
+ QTest::newRow("Hangul Banja") << (int)Qt::Key_Hangul_Banja << QString("Hangul Banja");
+ QTest::newRow("Hangul PreHanja") << (int)Qt::Key_Hangul_PreHanja << QString("Hangul PreHanja");
+ QTest::newRow("Hangul PostHanja") << (int)Qt::Key_Hangul_PostHanja << QString("Hangul PostHanja");
+ QTest::newRow("Hangul Special") << (int)Qt::Key_Hangul_Special << QString("Hangul Special");
+}
+
+void tst_QKeySequence::i18nKeys()
+{
+ QFETCH(int, keycode);
+ QFETCH(QString, keystring);
+ QKeySequence seq(keycode);
+
+ QCOMPARE(seq, QKeySequence(keystring));
+ QCOMPARE(seq.toString(), keystring);
+}
+
QTEST_MAIN(tst_QKeySequence)
#include "tst_qkeysequence.moc"