diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-07-22 12:42:43 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-22 12:44:11 +0100 |
commit | dbc371c4bed118678d71dba51a0dac7f604e1874 (patch) | |
tree | 236780aeee3b23791cc76a9dc91ae926c6881a79 /vcl/qa/cppunit/mnemonic.cxx | |
parent | 86988a9eb3aebfa9c6c713ed69df0876d4e6e348 (diff) |
add test for CJK (~X) mnemonics
Change-Id: I1f69c23dcde6d963ad9c3bc1f2d9178fe15eb27c
Diffstat (limited to 'vcl/qa/cppunit/mnemonic.cxx')
-rw-r--r-- | vcl/qa/cppunit/mnemonic.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/vcl/qa/cppunit/mnemonic.cxx b/vcl/qa/cppunit/mnemonic.cxx index f377a2d1085a..fb8bc8c454ac 100644 --- a/vcl/qa/cppunit/mnemonic.cxx +++ b/vcl/qa/cppunit/mnemonic.cxx @@ -32,9 +32,24 @@ void VclMnemonicTest::testMnemonic() { MnemonicGenerator aGenerator; - const sal_Unicode TEST[] = { 0x00DF, 'a' }; - OUString sResult = aGenerator.CreateMnemonic(OUString(TEST, SAL_N_ELEMENTS(TEST))); - CPPUNIT_ASSERT_EQUAL(u'~', sResult[1]); + { + const sal_Unicode TEST[] = { 0x00DF, 'a' }; + OUString sResult = aGenerator.CreateMnemonic(OUString(TEST, SAL_N_ELEMENTS(TEST))); + CPPUNIT_ASSERT_EQUAL(u'~', sResult[1]); + } + + { + const sal_Unicode TEST[] = { 0x4E00, 'b' }; + OUString sResult = aGenerator.CreateMnemonic(OUString(TEST, SAL_N_ELEMENTS(TEST))); + CPPUNIT_ASSERT_EQUAL(u'~', sResult[1]); + } + + { + const sal_Unicode TEST[] = { 0x4E00 }; + OUString sResult = aGenerator.CreateMnemonic(OUString(TEST, SAL_N_ELEMENTS(TEST))); + CPPUNIT_ASSERT_EQUAL(OUString("(~C)"), sResult.copy(sResult.getLength() - 4)); + } + } CPPUNIT_TEST_SUITE_REGISTRATION(VclMnemonicTest); |