118 QCOMPARE(sendCalled, true); |
133 QCOMPARE(sendCalled, true); |
119 } |
134 } |
120 |
135 |
121 void TestParserRecognizer::testActivateWarrantyMode() |
136 void TestParserRecognizer::testActivateWarrantyMode() |
122 { |
137 { |
|
138 // Lifetimer is implemented by phone and should not be handled |
|
139 // by the recognizer. |
123 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageActivateWarrantyMode, 0); |
140 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageActivateWarrantyMode, 0); |
124 QCOMPARE(apiString, QString("com.nokia.services.telephony")); |
141 QCOMPARE(apiString, QString("")); |
125 QCOMPARE(methodString, QString("activateWarrantyMode()")); |
142 QCOMPARE(methodString, QString("")); |
126 QCOMPARE(sendCalled, true); |
143 QCOMPARE(sendCalled, false); |
127 } |
144 } |
128 |
145 |
129 void TestParserRecognizer::testShowBTDeviceAddress() |
146 void TestParserRecognizer::testShowBTDeviceAddress() |
130 { |
147 { |
131 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowBTDeviceAddress, 0); |
148 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowBTDeviceAddress, 0); |
150 QCOMPARE(sendCalled, true); |
167 QCOMPARE(sendCalled, true); |
151 } |
168 } |
152 |
169 |
153 void TestParserRecognizer::testShowIMEI() |
170 void TestParserRecognizer::testShowIMEI() |
154 { |
171 { |
|
172 // IMEI code showing is implemented by phone and should not be handled |
|
173 // by the recognizer. |
155 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowIMEI, 0); |
174 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowIMEI, 0); |
156 QCOMPARE(apiString, QString("com.nokia.services.telephony")); |
175 QCOMPARE(apiString, QString("")); |
157 QCOMPARE(methodString, QString("showIMEICode()")); |
176 QCOMPARE(methodString, QString("")); |
158 QCOMPARE(sendCalled, true); |
177 QCOMPARE(sendCalled, false); |
159 } |
178 } |
160 |
179 |
161 void TestParserRecognizer::testShowVersion() |
180 void TestParserRecognizer::testShowVersion() |
162 { |
181 { |
163 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0); |
182 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0); |
164 QCOMPARE(apiString, QString("com.nokia.services.telephony")); |
183 QCOMPARE(apiString, QString("com.nokia.services.devicemanager")); |
165 QCOMPARE(methodString, QString("showVersionNumber()")); |
184 QCOMPARE(methodString, QString("showVersionNumber()")); |
166 QCOMPARE(sendCalled, true); |
185 QCOMPARE(sendCalled, true); |
167 } |
186 } |
168 |
187 |
169 void TestParserRecognizer::testShowWLANMacAddress() |
188 void TestParserRecognizer::testShowWLANMacAddress() |
170 { |
189 { |
|
190 // WLAN address showing not supported currently (TB 10.1) |
171 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowWlanMacAddress, 0); |
191 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowWlanMacAddress, 0); |
172 QCOMPARE(apiString, QString("com.nokia.services.wlan")); |
192 QCOMPARE(apiString, QString("")); |
173 QCOMPARE(methodString, QString("showWLANMacAddress()")); |
193 QCOMPARE(methodString, QString("")); |
174 QCOMPARE(sendCalled, true); |
194 QCOMPARE(sendCalled, false); |
175 } |
195 } |
176 |
196 |
177 void TestParserRecognizer::testSSRequestFailed() |
197 void TestParserRecognizer::testSSRequestFailed() |
178 { |
198 { |
179 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageSSRequestFailed, 0); |
199 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageSSRequestFailed, 0); |
180 QCOMPARE(apiString, QString("com.nokia.services.telephony")); |
200 QCOMPARE(apiString, QString("com.nokia.services.telephony")); |
181 QCOMPARE(methodString, QString("supplementaryServiceRequestFailed()")); |
201 QCOMPARE(methodString, QString("supplementaryServiceRequestFailed()")); |
182 QCOMPARE(sendCalled, true); |
202 QCOMPARE(sendCalled, true); |
183 } |
203 } |
184 |
204 |
|
205 void TestParserRecognizer::testSendRequestFail() |
|
206 { |
|
207 gSendRequestResult = false; |
|
208 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0); |
|
209 QCOMPARE(apiString, QString("com.nokia.services.devicemanager")); |
|
210 QCOMPARE(methodString, QString("showVersionNumber()")); |
|
211 QCOMPARE(sendCalled, true); |
|
212 } |
|
213 |
|
214 void TestParserRecognizer::testSimultaneousRequests() |
|
215 { |
|
216 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0); |
|
217 QCOMPARE(apiString, QString("com.nokia.services.devicemanager")); |
|
218 QCOMPARE(methodString, QString("showVersionNumber()")); |
|
219 QCOMPARE(sendCalled, true); |
|
220 |
|
221 sendCalled = false; |
|
222 parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0); |
|
223 QCOMPARE(sendCalled, false); |
|
224 } |
|
225 |
185 QTEST_MAIN(TestParserRecognizer) |
226 QTEST_MAIN(TestParserRecognizer) |
186 #include "unit_tests.moc" |
227 #include "unit_tests.moc" |