equal
deleted
inserted
replaced
20 #include "cqwertykeymap.h" |
20 #include "cqwertykeymap.h" |
21 #include <QString> |
21 #include <QString> |
22 |
22 |
23 // SYSTEM INCLUDES |
23 // SYSTEM INCLUDES |
24 #include <digia/eunit/eunitmacros.h> |
24 #include <digia/eunit/eunitmacros.h> |
25 #if defined(USE_ORBIT_KEYMAP) |
|
26 #include <hbinputkeymapfactory.h> |
25 #include <hbinputkeymapfactory.h> |
27 #endif |
|
28 |
26 |
29 |
27 |
30 // ----------------------------------------------------------------------------- |
28 // ----------------------------------------------------------------------------- |
31 // UT_CQwertyKeyMap::NewL |
29 // UT_CQwertyKeyMap::NewL |
32 // ----------------------------------------------------------------------------- |
30 // ----------------------------------------------------------------------------- |
87 // UT_CQwertyKeyMap::SetupL |
85 // UT_CQwertyKeyMap::SetupL |
88 // ----------------------------------------------------------------------------- |
86 // ----------------------------------------------------------------------------- |
89 // |
87 // |
90 void UT_CQwertyKeyMap::SetupL() |
88 void UT_CQwertyKeyMap::SetupL() |
91 { |
89 { |
92 #if defined(USE_ORBIT_KEYMAP) |
|
93 // Create singleton outside actual test cases so that it is not treated as |
90 // Create singleton outside actual test cases so that it is not treated as |
94 // resource leak, since it can't be deleted. |
91 // resource leak, since it can't be deleted. |
95 HbKeymapFactory::instance(); |
92 HbKeymapFactory::instance(); |
96 #endif |
|
97 } |
93 } |
98 |
94 |
99 // ----------------------------------------------------------------------------- |
95 // ----------------------------------------------------------------------------- |
100 // UT_CQwertyKeyMap::Teardown |
96 // UT_CQwertyKeyMap::Teardown |
101 // ----------------------------------------------------------------------------- |
97 // ----------------------------------------------------------------------------- |
111 // UT_CQwertyKeyMap::UT_NewLL |
107 // UT_CQwertyKeyMap::UT_NewLL |
112 // ----------------------------------------------------------------------------- |
108 // ----------------------------------------------------------------------------- |
113 // |
109 // |
114 void UT_CQwertyKeyMap::UT_NewLL() |
110 void UT_CQwertyKeyMap::UT_NewLL() |
115 { |
111 { |
116 #if defined(USE_ORBIT_KEYMAP) |
|
117 // Check each key has been mapped |
112 // Check each key has been mapped |
118 EUNIT_ASSERT_EQUALS(CQwertyKeyMap::EAmountOfKeysInQwertyKeypad, |
113 EUNIT_ASSERT_EQUALS(CQwertyKeyMap::EAmountOfKeysInQwertyKeypad, |
119 iKeyMap->iKeyMapping.count()); |
114 iKeyMap->iKeyMapping.count()); |
120 |
115 |
121 const TInt KAmountOfKeysInUse = 32; |
116 const TInt KAmountOfKeysInUse = 32; |
123 // So far no language has the full 44 keys. |
118 // So far no language has the full 44 keys. |
124 for (TInt i = 0; i < KAmountOfKeysInUse; ++i) |
119 for (TInt i = 0; i < KAmountOfKeysInUse; ++i) |
125 { |
120 { |
126 EUNIT_ASSERT(iKeyMap->iKeyMapping.at(i).length() > 0); |
121 EUNIT_ASSERT(iKeyMap->iKeyMapping.at(i).length() > 0); |
127 } |
122 } |
128 #endif |
|
129 } |
123 } |
130 |
124 |
131 // ----------------------------------------------------------------------------- |
125 // ----------------------------------------------------------------------------- |
132 // UT_CQwertyKeyMap::UT_GetMappedStringL |
126 // UT_CQwertyKeyMap::UT_GetMappedStringL |
133 // ----------------------------------------------------------------------------- |
127 // ----------------------------------------------------------------------------- |