21 #include <QString> |
21 #include <QString> |
22 #include <QTextCodec> |
22 #include <QTextCodec> |
23 |
23 |
24 // SYSTEM INCLUDES |
24 // SYSTEM INCLUDES |
25 #include <digia/eunit/eunitmacros.h> |
25 #include <digia/eunit/eunitmacros.h> |
26 #if defined(USE_ORBIT_KEYMAP) |
|
27 #include <hbinputkeymapfactory.h> |
26 #include <hbinputkeymapfactory.h> |
28 #endif |
|
29 |
27 |
30 |
28 |
31 // 10.1 wk12 SDK's Thai keymap does not map anything to *,# keys |
29 // 10.1 wk12 SDK's Thai keymap does not map anything to *,# keys |
32 // so must use either a hardcoded keymap, or replace the SDK's keymap |
30 // so must use either a hardcoded keymap, or replace the SDK's keymap |
33 // with a newer one by copying the keymap file 120.txt to |
31 // with a newer one by copying the keymap file 120.txt to |
132 // UT_CPcsKeyMap::SetupL |
130 // UT_CPcsKeyMap::SetupL |
133 // ----------------------------------------------------------------------------- |
131 // ----------------------------------------------------------------------------- |
134 // |
132 // |
135 void UT_CPcsKeyMap::SetupL() |
133 void UT_CPcsKeyMap::SetupL() |
136 { |
134 { |
137 #if defined(USE_ORBIT_KEYMAP) |
|
138 // Create singleton outside actual test cases so that it is not treated as |
135 // Create singleton outside actual test cases so that it is not treated as |
139 // resource leak, since it can't be deleted. |
136 // resource leak, since it can't be deleted. |
140 HbKeymapFactory::instance(); |
137 HbKeymapFactory::instance(); |
141 #endif |
|
142 } |
138 } |
143 |
139 |
144 // ----------------------------------------------------------------------------- |
140 // ----------------------------------------------------------------------------- |
145 // UT_CPcsKeyMap::Teardown |
141 // UT_CPcsKeyMap::Teardown |
146 // ----------------------------------------------------------------------------- |
142 // ----------------------------------------------------------------------------- |
156 // UT_CPcsKeyMap::UT_NewLL |
152 // UT_CPcsKeyMap::UT_NewLL |
157 // ----------------------------------------------------------------------------- |
153 // ----------------------------------------------------------------------------- |
158 // |
154 // |
159 void UT_CPcsKeyMap::UT_NewLL() |
155 void UT_CPcsKeyMap::UT_NewLL() |
160 { |
156 { |
161 #if defined(USE_ORBIT_KEYMAP) |
|
162 // Must be same as in c12keykeymap.cpp |
157 // Must be same as in c12keykeymap.cpp |
163 const TInt KAmountOfKeys = 12; |
158 const TInt KAmountOfKeys = 12; |
164 |
159 |
165 // Each numeric key has been mapped |
160 // Each numeric key has been mapped |
166 EUNIT_ASSERT_EQUALS( KAmountOfKeys, iKeyMap->iKeyMapping.count() ); |
161 EUNIT_ASSERT_EQUALS( KAmountOfKeys, iKeyMap->iKeyMapping.count() ); |
167 for (TInt i = 0; i < KAmountOfKeys; ++i) |
162 for (TInt i = 0; i < KAmountOfKeys; ++i) |
168 { |
163 { |
169 EUNIT_ASSERT( iKeyMap->iKeyMapping.at(i).length() > 0 ); |
164 EUNIT_ASSERT( iKeyMap->iKeyMapping.at(i).length() > 0 ); |
170 } |
165 } |
171 #endif |
|
172 } |
166 } |
173 |
167 |
174 // ----------------------------------------------------------------------------- |
168 // ----------------------------------------------------------------------------- |
175 // UT_CPcsKeyMap::UT_GetMappedStringL |
169 // UT_CPcsKeyMap::UT_GetMappedStringL |
176 // ----------------------------------------------------------------------------- |
170 // ----------------------------------------------------------------------------- |