110 // ----------------------------------------------------------------------------- |
110 // ----------------------------------------------------------------------------- |
111 // |
111 // |
112 void UT_CPcsKeyMap::UT_NewLL() |
112 void UT_CPcsKeyMap::UT_NewLL() |
113 { |
113 { |
114 #if defined(USE_ORBIT_KEYMAP) |
114 #if defined(USE_ORBIT_KEYMAP) |
115 const TInt KAmountOfKeys = 10; // Must have same value as in cpcskeymap.cpp |
115 // Must be same as in cpcskeymap.cpp |
|
116 const TInt KAmountOfKeys = 12; |
|
117 // Note that * and # keys do not have mappings in most languages |
|
118 const TInt KAmountOfNumberKeys = 10; |
116 |
119 |
117 // Each numeric key has been mapped |
120 // Each numeric key has been mapped |
118 EUNIT_ASSERT_EQUALS( KAmountOfKeys, iKeyMap->iKeyMapping.count() ); |
121 EUNIT_ASSERT_EQUALS( KAmountOfKeys, iKeyMap->iKeyMapping.count() ); |
119 for (TInt i = 0; i < KAmountOfKeys; ++i) |
122 for (TInt i = 0; i < KAmountOfNumberKeys; ++i) |
120 { |
123 { |
121 EUNIT_ASSERT( iKeyMap->iKeyMapping.at(i).length() > 0 ); |
124 EUNIT_ASSERT( iKeyMap->iKeyMapping.at(i).length() > 0 ); |
122 } |
125 } |
123 #endif |
126 #endif |
124 } |
127 } |
223 // Source string contains numbers |
226 // Source string contains numbers |
224 // ----------------------------------------------------------------------------- |
227 // ----------------------------------------------------------------------------- |
225 // |
228 // |
226 void UT_CPcsKeyMap::UT_GetNumericKeyStringWithSpecialCharactersL() |
229 void UT_CPcsKeyMap::UT_GetNumericKeyStringWithSpecialCharactersL() |
227 { |
230 { |
228 _LIT( KAlpha, " +g-[5]t" ); |
231 _LIT( KAlpha, " +g-*[#5]?t" ); |
229 #if defined(USE_ORBIT_KEYMAP) |
232 #if defined(USE_ORBIT_KEYMAP) |
230 // Orbit keymap code is used |
233 _LIT( KNumeric, " a41afb5f18" ); |
231 _LIT( KNumeric, " 141[5]8" ); |
|
232 #else |
234 #else |
233 // Hardcoded keymap is used |
235 _LIT( KNumeric, " a4-a[b5]?8" ); |
234 _LIT( KNumeric, " +4-[5]8" ); |
|
235 #endif |
236 #endif |
236 HBufC* numericBuf = iKeyMap->GetNumericKeyStringL( KAlpha, EFalse ); |
237 HBufC* numericBuf = iKeyMap->GetNumericKeyStringL( KAlpha, EFalse ); |
237 CleanupStack::PushL( numericBuf ); |
238 CleanupStack::PushL( numericBuf ); |
238 EUNIT_ASSERT_EQUALS( *numericBuf, KNumeric ); |
239 EUNIT_ASSERT_EQUALS( *numericBuf, KNumeric ); |
239 CleanupStack::PopAndDestroy(numericBuf); |
240 CleanupStack::PopAndDestroy(numericBuf); |