|
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "Te_EtelSatTestStepBase.h" |
|
17 #include "TE_EtelSatpcmds1a.h" |
|
18 |
|
19 CTestSatPCmds1a::CTestSatPCmds1a() |
|
20 /** Each test step initialises it's own name |
|
21 */ |
|
22 { |
|
23 // store the name of this test case |
|
24 // this is the name that is used by the script file |
|
25 SetTestStepName(_L("TestSatPCmds1a")); |
|
26 } |
|
27 |
|
28 enum TVerdict CTestSatPCmds1a::doTestStepL() |
|
29 { |
|
30 INFO_PRINTF1(_L("*************************************")); |
|
31 INFO_PRINTF1(_L("RSat Proactive Commands Functionality")); |
|
32 INFO_PRINTF1(_L("*************************************")); |
|
33 |
|
34 TInt ret=phone.Open(iTelServer,DSATTSY_PHONE_NAME); |
|
35 TEST(ret==KErrNone); |
|
36 |
|
37 ret=sat.Open(phone); |
|
38 TEST(ret==KErrNone); |
|
39 |
|
40 // local variables used throughout the sat tests |
|
41 iTestCount=1; |
|
42 |
|
43 // Display Text with RSat::TDisplayTextV2 |
|
44 RSat::TDisplayTextV2* displayText = new (ELeave) RSat::TDisplayTextV2; |
|
45 CleanupStack::PushL(displayText); |
|
46 |
|
47 RSat::TDisplayTextV2Pckg* displayTextPckg = new (ELeave) RSat::TDisplayTextV2Pckg(*displayText); |
|
48 CleanupStack::PushL(displayTextPckg); |
|
49 |
|
50 sat.NotifyDisplayTextPCmd(reqStatus,*displayTextPckg); |
|
51 User::WaitForRequest(reqStatus); |
|
52 TEST(reqStatus.Int()==KErrNone); |
|
53 |
|
54 TEST(displayText->PCmdNumber()==DSATTSY_DISPLAY_TEXT_NUMBER); |
|
55 TEST(displayText->iPriority==DSATTSY_TEXT_PRIORITY); |
|
56 TEST(displayText->iClearScreenTrigger==DSATTSY_CLEAR_SCREEN_TRIGGER); |
|
57 TEST(displayText->iText==DSATTSY_TEXT_TO_DISPLAY); |
|
58 TEST(displayText->iIconId.iIdentifier==DSATTSY_ICON_ID1); |
|
59 TEST(displayText->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1); |
|
60 TEST(displayText->iImmediateRsp==DSATTSY_IMMEDIATE_RSP); |
|
61 TEST(displayText->iDuration.iTimeUnit==DSATTSY_TIME_UNIT); |
|
62 TEST(displayText->iDuration.iNumOfUnits==DSATTSY_NUM_OF_UNITS); |
|
63 INFO_PRINTF2(_L("Test %d - RSat::NotifyDisplayTextPCmd with RSat::TDisplayTextV2 passed"),iTestCount++); |
|
64 |
|
65 //Display Text Cancel with RSat::TDisplayTextV2 |
|
66 sat.NotifyDisplayTextPCmd(reqStatus,*displayTextPckg); |
|
67 sat.CancelAsyncRequest(ESatNotifyDisplayTextPCmd); |
|
68 |
|
69 User::WaitForRequest(reqStatus); |
|
70 TEST(reqStatus.Int()==KErrCancel); |
|
71 INFO_PRINTF2(_L("Test %d - RSat::NotifyDisplayTextPCmdCancel with RSat::TDisplayTextV2 passed"),iTestCount++); |
|
72 |
|
73 // Display Text with RSat::TDisplayTextV5 |
|
74 RSat::TDisplayTextV5* displayTextV5 = new (ELeave) RSat::TDisplayTextV5; |
|
75 CleanupStack::PushL(displayTextV5); |
|
76 RSat::TDisplayTextV5Pckg* displayTextV5Pckg = new (ELeave) RSat::TDisplayTextV5Pckg(*displayTextV5); |
|
77 CleanupStack::PushL(displayTextV5Pckg); |
|
78 |
|
79 TEST(displayTextV5->ExtensionId() == RSat::KSatV5); |
|
80 TEST(displayTextV5->iTextAttribute.iStatus == RSat::ETextAttributeNotSet); |
|
81 |
|
82 sat.NotifyDisplayTextPCmd(reqStatus,*displayTextV5Pckg); |
|
83 User::WaitForRequest(reqStatus); |
|
84 TEST(reqStatus.Int()==KErrNone); |
|
85 |
|
86 TEST(displayTextV5->PCmdNumber()==DSATTSY_DISPLAY_TEXT_NUMBER); |
|
87 TEST(displayTextV5->iPriority==DSATTSY_TEXT_PRIORITY); |
|
88 TEST(displayTextV5->iClearScreenTrigger==DSATTSY_CLEAR_SCREEN_TRIGGER); |
|
89 TEST(displayTextV5->iText==DSATTSY_TEXT_TO_DISPLAY); |
|
90 TEST(displayTextV5->iIconId.iIdentifier==DSATTSY_ICON_ID1); |
|
91 TEST(displayTextV5->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1); |
|
92 TEST(displayTextV5->iImmediateRsp==DSATTSY_IMMEDIATE_RSP); |
|
93 TEST(displayTextV5->iDuration.iTimeUnit==DSATTSY_TIME_UNIT); |
|
94 TEST(displayTextV5->iDuration.iNumOfUnits==DSATTSY_NUM_OF_UNITS); |
|
95 |
|
96 // V5 parameters |
|
97 RSat::TTextAttribute textAttribute; |
|
98 textAttribute.iStatus = DSATTSY_TEXT_ATTRIBUTE_STATUS; |
|
99 const TUint8 textAttributeData[DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH] = DSATTSY_TEXT_ATTRIBUTE_DATA; |
|
100 textAttribute.iTextAttributeData.Append(textAttributeData, DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH); |
|
101 |
|
102 TEST(displayTextV5->iTextAttribute.iStatus == textAttribute.iStatus); |
|
103 TEST(displayTextV5->iTextAttribute.iTextAttributeData == textAttribute.iTextAttributeData); |
|
104 |
|
105 INFO_PRINTF2(_L("Test %d - RSat::NotifyDisplayTextPCmd with RSat::TDisplayTextV5 passed"),iTestCount++); |
|
106 |
|
107 //Display Text Cancel with RSat::TDisplayTextV5 |
|
108 sat.NotifyDisplayTextPCmd(reqStatus,*displayTextV5Pckg); |
|
109 sat.CancelAsyncRequest(ESatNotifyDisplayTextPCmd); |
|
110 |
|
111 User::WaitForRequest(reqStatus); |
|
112 TEST(reqStatus.Int()==KErrCancel); |
|
113 INFO_PRINTF2(_L("Test %d - RSat::NotifyDisplayTextPCmdCancel with RSat::TDisplayTextV5 passed"),iTestCount++); |
|
114 |
|
115 // Display Text Terminal Response |
|
116 sat.NotifyDisplayTextPCmd(reqStatus, *displayTextPckg); |
|
117 User::WaitForRequest(reqStatus); |
|
118 TEST(reqStatus.Int()==KErrNone); |
|
119 |
|
120 RSat::TDisplayTextRspV1* displayTextRsp = new (ELeave) RSat::TDisplayTextRspV1; |
|
121 CleanupStack::PushL(displayTextRsp); |
|
122 |
|
123 RSat::TDisplayTextRspV1Pckg* displayTextRspPckg = new (ELeave) RSat::TDisplayTextRspV1Pckg(*displayTextRsp); |
|
124 CleanupStack::PushL(displayTextRspPckg); |
|
125 |
|
126 displayTextRsp->SetPCmdNumber(displayText->PCmdNumber()); |
|
127 displayTextRsp->iGeneralResult = DSATTSY_PCMD_RESULT_SUCCESS; |
|
128 displayTextRsp->iInfoType = DSATTSY_PCMD_RSP_NO_INFO; |
|
129 displayTextRsp->iAdditionalInfo=DSATTSY_NULL_BUF; |
|
130 |
|
131 sat.TerminalRsp(reqStatus, RSat::EDisplayText, *displayTextRspPckg); |
|
132 User::WaitForRequest(reqStatus); |
|
133 TEST(reqStatus.Int()==KErrNone); |
|
134 INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp passed"),iTestCount++); |
|
135 |
|
136 // Display Text Terminal Rsp Cancel |
|
137 // This will be the only Terminal Rsp cancel |
|
138 // no need to test it for each PCmd |
|
139 sat.TerminalRsp(reqStatus, RSat::EDisplayText, *displayTextRspPckg); |
|
140 sat.CancelAsyncRequest(ESatTerminalRsp); |
|
141 |
|
142 User::WaitForRequest(reqStatus); |
|
143 TEST(reqStatus.Int()==KErrCancel); |
|
144 INFO_PRINTF2(_L("Test %d - RSat::TerminalRspCancel passed"),iTestCount++); |
|
145 |
|
146 CleanupStack::PopAndDestroy(6, displayText); |
|
147 |
|
148 // GetInkey with V2 |
|
149 RSat::TGetInkeyV2* getInkey = new (ELeave) RSat::TGetInkeyV2; |
|
150 CleanupStack::PushL(getInkey); |
|
151 RSat::TGetInkeyV2Pckg* getInkeyPckg = new (ELeave) RSat::TGetInkeyV2Pckg(*getInkey); |
|
152 CleanupStack::PushL(getInkeyPckg); |
|
153 |
|
154 sat.NotifyGetInkeyPCmd(reqStatus,*getInkeyPckg); |
|
155 User::WaitForRequest(reqStatus); |
|
156 TEST(reqStatus.Int()==KErrNone); |
|
157 |
|
158 TEST(getInkey->PCmdNumber()==DSATTSY_GET_INKEY_NUMBER); |
|
159 TEST(getInkey->iRspFormat==RSat::EDigitOnly); |
|
160 TEST(getInkey->iText==DSATTSY_TEXT_TO_DISPLAY); |
|
161 TEST(getInkey->iIconId.iIdentifier==DSATTSY_ICON_ID1); |
|
162 TEST(getInkey->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1); |
|
163 TEST(getInkey->iHelp==RSat::ENoHelpAvailable); |
|
164 TEST(getInkey->iDuration.iTimeUnit==DSATTSY_TIME_UNIT); |
|
165 TEST(getInkey->iDuration.iNumOfUnits==DSATTSY_NUM_OF_UNITS); |
|
166 TEST(getInkey->iMode==DSATTSY_GET_INKEY_RSP_MODE); |
|
167 INFO_PRINTF2(_L("Test %d - RSat::NotifyGetInkeyPCmd with RSat::TGetInkeyV2 passed"),iTestCount++); |
|
168 |
|
169 // Get Inkey Cancel with V2 |
|
170 sat.NotifyGetInkeyPCmd(reqStatus,*getInkeyPckg); |
|
171 sat.CancelAsyncRequest(ESatNotifyGetInkeyPCmd); |
|
172 |
|
173 User::WaitForRequest(reqStatus); |
|
174 TEST(reqStatus.Int()==KErrCancel); |
|
175 INFO_PRINTF2(_L("Test %d - RSat::GetInkeyCancel with RSat::TGetInkeyV2 passed"),iTestCount++); |
|
176 |
|
177 // GetInkey with V5 |
|
178 RSat::TGetInkeyV5* getInkeyV5 = new (ELeave) RSat::TGetInkeyV5; |
|
179 CleanupStack::PushL(getInkeyV5); |
|
180 RSat::TGetInkeyV5Pckg* getInkeyV5Pckg = new (ELeave) RSat::TGetInkeyV5Pckg(*getInkeyV5); |
|
181 CleanupStack::PushL(getInkeyV5Pckg); |
|
182 |
|
183 TEST(getInkeyV5->ExtensionId() == RSat::KSatV5); |
|
184 TEST(getInkeyV5->iTextAttribute.iStatus == RSat::ETextAttributeNotSet); |
|
185 |
|
186 sat.NotifyGetInkeyPCmd(reqStatus,*getInkeyV5Pckg); |
|
187 User::WaitForRequest(reqStatus); |
|
188 TEST(reqStatus.Int()==KErrNone); |
|
189 |
|
190 TEST(getInkeyV5->PCmdNumber()==DSATTSY_GET_INKEY_NUMBER); |
|
191 TEST(getInkeyV5->iRspFormat==RSat::EDigitOnly); |
|
192 TEST(getInkeyV5->iText==DSATTSY_TEXT_TO_DISPLAY); |
|
193 TEST(getInkeyV5->iIconId.iIdentifier==DSATTSY_ICON_ID1); |
|
194 TEST(getInkeyV5->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1); |
|
195 TEST(getInkeyV5->iHelp==RSat::ENoHelpAvailable); |
|
196 TEST(getInkeyV5->iDuration.iTimeUnit==DSATTSY_TIME_UNIT); |
|
197 TEST(getInkeyV5->iDuration.iNumOfUnits==DSATTSY_NUM_OF_UNITS); |
|
198 TEST(getInkeyV5->iMode==DSATTSY_GET_INKEY_RSP_MODE); |
|
199 // Version 5 parameters |
|
200 TEST(getInkeyV5->iTextAttribute.iStatus == textAttribute.iStatus); |
|
201 TEST(getInkeyV5->iTextAttribute.iTextAttributeData == textAttribute.iTextAttributeData); |
|
202 |
|
203 INFO_PRINTF2(_L("Test %d - RSat::NotifyGetInkeyPCmd with RSat::TGetInkeyV5 passed"),iTestCount++); |
|
204 |
|
205 // Get Inkey Cancel with V5 |
|
206 sat.NotifyGetInkeyPCmd(reqStatus,*getInkeyV5Pckg); |
|
207 sat.CancelAsyncRequest(ESatNotifyGetInkeyPCmd); |
|
208 |
|
209 User::WaitForRequest(reqStatus); |
|
210 TEST(reqStatus.Int()==KErrCancel); |
|
211 INFO_PRINTF2(_L("Test %d - RSat::GetInkeyCancel with RSat::TGetInkeyV5 passed"),iTestCount++); |
|
212 |
|
213 // GetInkey Terminal Response |
|
214 sat.NotifyGetInkeyPCmd(reqStatus,*getInkeyPckg); |
|
215 User::WaitForRequest(reqStatus); |
|
216 TEST(reqStatus.Int()==KErrNone); |
|
217 |
|
218 RSat::TGetInkeyRspV2* getInkeyRsp = new (ELeave) RSat::TGetInkeyRspV2; |
|
219 CleanupStack::PushL(getInkeyRsp); |
|
220 RSat::TGetInkeyRspV2Pckg* getInkeyRspPckg = new (ELeave) RSat::TGetInkeyRspV2Pckg(*getInkeyRsp); |
|
221 CleanupStack::PushL(getInkeyRspPckg); |
|
222 |
|
223 getInkeyRsp->SetPCmdNumber(getInkey->PCmdNumber()); |
|
224 getInkeyRsp->iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS; |
|
225 getInkeyRsp->iInfoType=DSATTSY_PCMD_RSP_TEXT_STRING; |
|
226 getInkeyRsp->iRspFormat=getInkey->iRspFormat; |
|
227 getInkeyRsp->iAdditionalInfo=DSATTSY_USER_TEXT_INPUT; |
|
228 getInkeyRsp->iDuration.iTimeUnit=DSATTSY_TIME_UNIT; |
|
229 getInkeyRsp->iDuration.iNumOfUnits=DSATTSY_NUM_OF_UNITS; |
|
230 |
|
231 sat.TerminalRsp(reqStatus, RSat::EGetInkey,*getInkeyRspPckg); |
|
232 User::WaitForRequest(reqStatus); |
|
233 TEST(reqStatus.Int()==KErrNone); |
|
234 INFO_PRINTF2(_L("Test %d - RSat::Get Inkey Terminal Rsp passed"),iTestCount++); |
|
235 |
|
236 CleanupStack::PopAndDestroy(6, getInkey); |
|
237 |
|
238 // further tests |
|
239 ExtendedTest1L(reqStatus); |
|
240 |
|
241 sat.Close(); |
|
242 phone.Close(); |
|
243 |
|
244 return TestStepResult(); |
|
245 } |
|
246 |
|
247 // Further tests, seperated to prevent stack overflow |
|
248 void CTestSatPCmds1a::ExtendedTest1L(TRequestStatus& reqStatus) |
|
249 { |
|
250 // Get Input with V1 |
|
251 RSat::TGetInputV1* getInput = new (ELeave) RSat::TGetInputV1; |
|
252 CleanupStack::PushL(getInput); |
|
253 RSat::TGetInputV1Pckg* getInputPckg = new (ELeave) RSat::TGetInputV1Pckg(*getInput); |
|
254 CleanupStack::PushL(getInputPckg); |
|
255 |
|
256 sat.NotifyGetInputPCmd(reqStatus,*getInputPckg); |
|
257 User::WaitForRequest(reqStatus); |
|
258 TEST(reqStatus.Int()==KErrNone); |
|
259 |
|
260 TEST(getInput->PCmdNumber()==DSATTSY_GET_INPUT_NUMBER); |
|
261 TEST(getInput->iInputDisplayOption==DSATTSY_INPUT_DISPLAY_OPTION); |
|
262 TEST(getInput->iRspFormat==DSATTSY_GET_INPUT_RSP_FORMAT); |
|
263 TEST(getInput->iText==DSATTSY_TEXT_TO_DISPLAY); |
|
264 TEST(getInput->iRspLength.iMinRspLength==DSATTSY_MIN_RSP_LENGTH); |
|
265 TEST(getInput->iRspLength.iMaxRspLength==DSATTSY_MAX_RSP_LENGTH); |
|
266 TEST(getInput->iDefaultText==DSATTSY_DEFAULT_TEXT); |
|
267 TEST(getInput->iIconId.iIdentifier==DSATTSY_ICON_ID1); |
|
268 TEST(getInput->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1); |
|
269 TEST(getInput->iHelp==DSATTSY_HELP); |
|
270 INFO_PRINTF2(_L("Test %d - RSat::NotifyGetInputPCmd with RSat::TGetInputV1 passed"),iTestCount++); |
|
271 |
|
272 // Get Input Cancel |
|
273 sat.NotifyGetInputPCmd(reqStatus,*getInputPckg); |
|
274 sat.CancelAsyncRequest(ESatNotifyGetInputPCmd); |
|
275 |
|
276 User::WaitForRequest(reqStatus); |
|
277 TEST(reqStatus.Int()==KErrCancel); |
|
278 INFO_PRINTF2(_L("Test %d - RSat::NotifyGetInputPCmd with RSat::TGetInputV1 passed"),iTestCount++); |
|
279 |
|
280 // Get Input with V5 |
|
281 RSat::TGetInputV5* getInputV5 = new (ELeave) RSat::TGetInputV5; |
|
282 CleanupStack::PushL(getInputV5); |
|
283 RSat::TGetInputV5Pckg* getInputV5Pckg = new (ELeave) RSat::TGetInputV5Pckg(*getInputV5); |
|
284 CleanupStack::PushL(getInputV5Pckg); |
|
285 |
|
286 TEST(getInputV5->ExtensionId() == RSat::KSatV5); |
|
287 TEST(getInputV5->iTextAttribute.iStatus == RSat::ETextAttributeNotSet); |
|
288 |
|
289 sat.NotifyGetInputPCmd(reqStatus,*getInputV5Pckg); |
|
290 User::WaitForRequest(reqStatus); |
|
291 TEST(reqStatus.Int()==KErrNone); |
|
292 |
|
293 TEST(getInputV5->PCmdNumber()==DSATTSY_GET_INPUT_NUMBER); |
|
294 TEST(getInputV5->iInputDisplayOption==DSATTSY_INPUT_DISPLAY_OPTION); |
|
295 TEST(getInputV5->iRspFormat==DSATTSY_GET_INPUT_RSP_FORMAT); |
|
296 TEST(getInputV5->iText==DSATTSY_TEXT_TO_DISPLAY); |
|
297 TEST(getInputV5->iRspLength.iMinRspLength==DSATTSY_MIN_RSP_LENGTH); |
|
298 TEST(getInputV5->iRspLength.iMaxRspLength==DSATTSY_MAX_RSP_LENGTH); |
|
299 TEST(getInputV5->iDefaultText==DSATTSY_DEFAULT_TEXT); |
|
300 TEST(getInputV5->iIconId.iIdentifier==DSATTSY_ICON_ID1); |
|
301 TEST(getInputV5->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1); |
|
302 TEST(getInputV5->iHelp==DSATTSY_HELP); |
|
303 // Version 5 parameters |
|
304 RSat::TTextAttribute textAttribute; |
|
305 textAttribute.iStatus = DSATTSY_TEXT_ATTRIBUTE_STATUS; |
|
306 const TUint8 textAttributeData[DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH] = DSATTSY_TEXT_ATTRIBUTE_DATA; |
|
307 textAttribute.iTextAttributeData.Append(textAttributeData, DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH); |
|
308 TEST(getInputV5->iTextAttribute.iStatus == textAttribute.iStatus); |
|
309 TEST(getInputV5->iTextAttribute.iTextAttributeData == textAttribute.iTextAttributeData); |
|
310 |
|
311 INFO_PRINTF2(_L("Test %d - RSat::NotifyGetInputPCmd with RSat::TGetInputV5 passed"),iTestCount++); |
|
312 |
|
313 // Get Input Cancel |
|
314 sat.NotifyGetInputPCmd(reqStatus,*getInputV5Pckg); |
|
315 sat.CancelAsyncRequest(ESatNotifyGetInputPCmd); |
|
316 |
|
317 User::WaitForRequest(reqStatus); |
|
318 TEST(reqStatus.Int()==KErrCancel); |
|
319 INFO_PRINTF2(_L("Test %d - RSat::GetInputCancel with RSat::TGetInputV5 passed"),iTestCount++); |
|
320 |
|
321 // Get Input Terminal Rsp |
|
322 sat.NotifyGetInputPCmd(reqStatus,*getInputPckg); |
|
323 User::WaitForRequest(reqStatus); |
|
324 TEST(reqStatus.Int()==KErrNone); |
|
325 |
|
326 RSat::TGetInputRspV1* getInputRsp = new (ELeave) RSat::TGetInputRspV1; |
|
327 CleanupStack::PushL(getInputRsp); |
|
328 RSat::TGetInputRspV1Pckg* getInputRspPckg = new (ELeave) RSat::TGetInputRspV1Pckg(*getInputRsp); |
|
329 CleanupStack::PushL(getInputRspPckg); |
|
330 |
|
331 getInputRsp->SetPCmdNumber(getInput->PCmdNumber()); |
|
332 getInputRsp->iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS; |
|
333 getInputRsp->iInfoType=DSATTSY_PCMD_RSP_TEXT_STRING; |
|
334 getInputRsp->iRspFormat=getInput->iRspFormat; |
|
335 getInputRsp->iAdditionalInfo=DSATTSY_USER_TEXT_INPUT; |
|
336 |
|
337 sat.TerminalRsp(reqStatus,RSat::EGetInput,*getInputRspPckg); |
|
338 User::WaitForRequest(reqStatus); |
|
339 TEST(reqStatus.Int()==KErrNone); |
|
340 INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Get Input - passed"),iTestCount++); |
|
341 |
|
342 CleanupStack::PopAndDestroy(6, getInput); |
|
343 |
|
344 // Play Tone with V2 |
|
345 RSat::TPlayToneV2* playTone = new (ELeave) RSat::TPlayToneV2; |
|
346 CleanupStack::PushL(playTone); |
|
347 RSat::TPlayToneV2Pckg* playTonePckg = new (ELeave) RSat::TPlayToneV2Pckg(*playTone); |
|
348 CleanupStack::PushL(playTonePckg); |
|
349 |
|
350 sat.NotifyPlayTonePCmd(reqStatus,*playTonePckg); |
|
351 User::WaitForRequest(reqStatus); |
|
352 TEST(reqStatus.Int()==KErrNone); |
|
353 |
|
354 TEST(playTone->PCmdNumber()==DSATTSY_PLAY_TONE_NUMBER); |
|
355 TEST(playTone->iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1); |
|
356 TEST(playTone->iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS); |
|
357 TEST(playTone->iTone==DSATTSY_TONE); |
|
358 TEST(playTone->iDuration.iTimeUnit==DSATTSY_TIME_UNIT); |
|
359 TEST(playTone->iDuration.iNumOfUnits==DSATTSY_NUM_OF_UNITS); |
|
360 TEST(playTone->iIconId.iIdentifier==DSATTSY_ICON_ID1); |
|
361 TEST(playTone->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1); |
|
362 INFO_PRINTF2(_L("Test %d - RSat::NotifyPlayTonePCmd with RSat::TPlayToneV2 passed"),iTestCount++); |
|
363 |
|
364 // Play Tone Cancel with V2 |
|
365 sat.NotifyPlayTonePCmd(reqStatus,*playTonePckg); |
|
366 sat.CancelAsyncRequest(ESatNotifyPlayTonePCmd); |
|
367 |
|
368 User::WaitForRequest(reqStatus); |
|
369 TEST(reqStatus.Int()==KErrCancel); |
|
370 INFO_PRINTF2(_L("Test %d - RSat::NotifyPlayTonePCmdCancel with RSat::TPlayToneV2 passed"),iTestCount++); |
|
371 |
|
372 // Play Tone with V5 |
|
373 RSat::TPlayToneV5* playToneV5 = new (ELeave) RSat::TPlayToneV5; |
|
374 CleanupStack::PushL(playToneV5); |
|
375 RSat::TPlayToneV5Pckg* playToneV5Pckg = new (ELeave) RSat::TPlayToneV5Pckg(*playToneV5); |
|
376 CleanupStack::PushL(playToneV5Pckg); |
|
377 |
|
378 TEST(playToneV5->ExtensionId() == RSat::KSatV5); |
|
379 TEST(playToneV5->iTextAttribute.iStatus == RSat::ETextAttributeNotSet); |
|
380 |
|
381 sat.NotifyPlayTonePCmd(reqStatus,*playToneV5Pckg); |
|
382 User::WaitForRequest(reqStatus); |
|
383 TEST(reqStatus.Int()==KErrNone); |
|
384 |
|
385 TEST(playToneV5->PCmdNumber()==DSATTSY_PLAY_TONE_NUMBER); |
|
386 TEST(playToneV5->iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1); |
|
387 TEST(playToneV5->iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS); |
|
388 TEST(playToneV5->iTone==DSATTSY_TONE); |
|
389 TEST(playToneV5->iDuration.iTimeUnit==DSATTSY_TIME_UNIT); |
|
390 TEST(playToneV5->iDuration.iNumOfUnits==DSATTSY_NUM_OF_UNITS); |
|
391 TEST(playToneV5->iIconId.iIdentifier==DSATTSY_ICON_ID1); |
|
392 TEST(playToneV5->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1); |
|
393 // Version 5 parameter |
|
394 TEST(playToneV5->iTextAttribute.iStatus == textAttribute.iStatus); |
|
395 TEST(playToneV5->iTextAttribute.iTextAttributeData == textAttribute.iTextAttributeData); |
|
396 |
|
397 INFO_PRINTF2(_L("Test %d - RSat::NotifyPlayTonePCmd with RSat::TPlayToneV5 passed"),iTestCount++); |
|
398 |
|
399 // Play Tone Cancel with V5 |
|
400 sat.NotifyPlayTonePCmd(reqStatus,*playToneV5Pckg); |
|
401 sat.CancelAsyncRequest(ESatNotifyPlayTonePCmd); |
|
402 |
|
403 User::WaitForRequest(reqStatus); |
|
404 TEST(reqStatus.Int()==KErrCancel); |
|
405 INFO_PRINTF2(_L("Test %d - RSat::NotifyPlayTonePCmdCancel with RSat::TPlayToneV5 passed"),iTestCount++); |
|
406 |
|
407 // Play Tone Terminal Rsp |
|
408 sat.NotifyPlayTonePCmd(reqStatus,*playTonePckg); |
|
409 User::WaitForRequest(reqStatus); |
|
410 TEST(reqStatus.Int()==KErrNone); |
|
411 |
|
412 RSat::TPlayToneRspV1* playToneRsp = new (ELeave) RSat::TPlayToneRspV1; |
|
413 CleanupStack::PushL(playToneRsp); |
|
414 RSat::TPlayToneRspV1Pckg* playToneRspPckg = new (ELeave) RSat::TPlayToneRspV1Pckg(*playToneRsp); |
|
415 CleanupStack::PushL(playToneRspPckg); |
|
416 |
|
417 playToneRsp->SetPCmdNumber(playTone->PCmdNumber()); |
|
418 playToneRsp->iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS; |
|
419 playToneRsp->iInfoType=DSATTSY_PCMD_RSP_NO_INFO; |
|
420 playToneRsp->iAdditionalInfo=DSATTSY_NULL_BUF; |
|
421 |
|
422 sat.TerminalRsp(reqStatus,RSat::EPlayTone,*playToneRspPckg); |
|
423 User::WaitForRequest(reqStatus); |
|
424 TEST(reqStatus.Int()==KErrNone); |
|
425 INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Get Inkey - passed"),iTestCount++); |
|
426 |
|
427 CleanupStack::PopAndDestroy(6, playTone); |
|
428 |
|
429 ExtendedTest2L(reqStatus); |
|
430 } |
|
431 |
|
432 void CTestSatPCmds1a::ExtendedTest2L(TRequestStatus& reqStatus) |
|
433 { |
|
434 // Set Up Menu |
|
435 RSat::TSetUpMenuV2* setUpMenu = new (ELeave) RSat::TSetUpMenuV2; |
|
436 CleanupStack::PushL(setUpMenu); |
|
437 RSat::TSetUpMenuV2Pckg* setUpMenuPckg = new RSat::TSetUpMenuV2Pckg(*setUpMenu); |
|
438 CleanupStack::PushL(setUpMenuPckg); |
|
439 |
|
440 // Set Up Menu containing only items |
|
441 |
|
442 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuPckg); |
|
443 User::WaitForRequest(reqStatus); |
|
444 TEST(reqStatus.Int()==KErrNone); |
|
445 |
|
446 TEST(setUpMenu->PCmdNumber()==DSATTSY_SET_UP_MENU_NUMBER); |
|
447 TEST(!setUpMenu->IsRemoveMenu()); |
|
448 TEST(setUpMenu->MenuContent()==DSATTSY_ITEMS); |
|
449 TEST(setUpMenu->NumberOfItems()==0x03); |
|
450 TEST(setUpMenu->iPreference==DSATTSY_SELECTION_PREFERENCE); |
|
451 |
|
452 index=1; |
|
453 TEST(setUpMenu->GetItem(index++,item,action)==KErrNone); |
|
454 TEST(item.iItemId==0x01); |
|
455 TEST(item.iItemString==DSATTSY_ITEM1); |
|
456 TEST(action==KErrNotFound); |
|
457 |
|
458 TEST(setUpMenu->GetItemIcon(index++,item,icon)==KErrNone); |
|
459 TEST(item.iItemId==0x02); |
|
460 TEST(item.iItemString==DSATTSY_ITEM2); |
|
461 TEST(icon==KErrNotFound); |
|
462 |
|
463 TEST(setUpMenu->GetItem(index,item)==KErrNone); |
|
464 TEST(item.iItemId==0x03); |
|
465 TEST(item.iItemString==DSATTSY_ITEM3); |
|
466 |
|
467 /* Test the case where the client use the wrong Get method |
|
468 This is OK - the icon and/or action not available is just |
|
469 returned as KErrNotFound*/ |
|
470 |
|
471 icon=0x00; |
|
472 TEST(setUpMenu->GetItemIcon(index,item,icon)==KErrNone); |
|
473 TEST(item.iItemId==0x03); |
|
474 TEST(item.iItemString==DSATTSY_ITEM3); |
|
475 TEST(icon==KErrNotFound); |
|
476 |
|
477 icon=0x00; |
|
478 action=0x00; |
|
479 TEST(setUpMenu->GetItem(index,item,action,icon)==KErrNone); |
|
480 TEST(item.iItemId==0x03); |
|
481 TEST(item.iItemString==DSATTSY_ITEM3); |
|
482 TEST(icon==KErrNotFound); |
|
483 TEST(action==KErrNotFound); |
|
484 |
|
485 action=0x00; |
|
486 TEST(setUpMenu->GetItem(index,item,action)==KErrNone); |
|
487 TEST(item.iItemId==0x03); |
|
488 TEST(item.iItemString==DSATTSY_ITEM3); |
|
489 TEST(action==KErrNotFound); |
|
490 |
|
491 // Test error cases |
|
492 TUint action4=0x04; |
|
493 TUint icon4=0x04; |
|
494 |
|
495 TEST(setUpMenu->AddItem(item, action4)==KErrNotSupported); |
|
496 TEST(setUpMenu->AddItemIcon(item, icon4)==KErrNotSupported); |
|
497 TEST(setUpMenu->AddItem(item, action4,icon4)==KErrNotSupported); |
|
498 TEST(setUpMenu->GetItem(++index,item)==KErrNotFound); |
|
499 |
|
500 TEST(setUpMenu->iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS); |
|
501 TEST(setUpMenu->iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1); |
|
502 TEST(setUpMenu->iHelp==DSATTSY_HELP); |
|
503 TEST(setUpMenu->iIconId.iIdentifier==DSATTSY_ICON_ID1); |
|
504 TEST(setUpMenu->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1); |
|
505 TEST(setUpMenu->iIconListQualifier==DSATTSY_ICON_QUALIFIER2); |
|
506 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd - Items - passed"),iTestCount++); |
|
507 |
|
508 // Set Up Menu Cancel |
|
509 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuPckg); |
|
510 sat.CancelAsyncRequest(ESatNotifySetUpMenuPCmd); |
|
511 |
|
512 User::WaitForRequest(reqStatus); |
|
513 TEST(reqStatus.Int()==KErrCancel); |
|
514 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmdCancel - Items - passed"),iTestCount++); |
|
515 |
|
516 // Set Up Menu - Item & Actions |
|
517 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuPckg); |
|
518 User::WaitForRequest(reqStatus); |
|
519 TEST(reqStatus.Int()==KErrNone); |
|
520 |
|
521 TEST(setUpMenu->MenuContent()==DSATTSY_ITEMS_AND_ACTIONS); |
|
522 TEST(setUpMenu->NumberOfItems()==0x03); |
|
523 |
|
524 index=1; |
|
525 TEST(setUpMenu->GetItem(index++,item, action, icon)==KErrNone); |
|
526 TEST(item.iItemId==0x01); |
|
527 TEST(item.iItemString==DSATTSY_ITEM1); |
|
528 TEST(action==0x01); |
|
529 TEST(icon==KErrNotFound); |
|
530 |
|
531 TEST(setUpMenu->GetItem(index++,item, action)==KErrNone); |
|
532 TEST(item.iItemId==0x02); |
|
533 TEST(item.iItemString==DSATTSY_ITEM2); |
|
534 TEST(action==0x02); |
|
535 |
|
536 icon=0x00; |
|
537 TEST(setUpMenu->GetItem(index++,item, action, icon)==KErrNone); |
|
538 TEST(item.iItemId==0x03); |
|
539 TEST(item.iItemString==DSATTSY_ITEM3); |
|
540 TEST(action==0x03); |
|
541 TEST(icon==KErrNotFound); |
|
542 |
|
543 index=1; |
|
544 TEST(setUpMenu->GetItem(index++,item)==KErrNone); |
|
545 TEST(item.iItemId==0x01); |
|
546 TEST(item.iItemString==DSATTSY_ITEM1); |
|
547 |
|
548 TEST(setUpMenu->GetItemIcon(index++,item, icon)==KErrNone); |
|
549 TEST(item.iItemId==0x02); |
|
550 TEST(item.iItemString==DSATTSY_ITEM2); |
|
551 TEST(icon==KErrNotFound); |
|
552 |
|
553 TEST(setUpMenu->GetItem(index++,item)==KErrNone); |
|
554 TEST(item.iItemId==0x03); |
|
555 TEST(item.iItemString==DSATTSY_ITEM3); |
|
556 |
|
557 // Test error cases |
|
558 TEST(setUpMenu->GetItem(index++,item, action)==KErrNotFound); |
|
559 TEST(setUpMenu->AddItem(item)==KErrNotSupported); |
|
560 TEST(setUpMenu->AddItem(item, action, icon)==KErrNotSupported); |
|
561 TEST(setUpMenu->AddItemIcon(item, icon)==KErrNotSupported); |
|
562 |
|
563 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd - Items and actions - passed"),iTestCount++); |
|
564 |
|
565 // Set Up Menu Cancel |
|
566 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuPckg); |
|
567 sat.CancelAsyncRequest(ESatNotifySetUpMenuPCmd); |
|
568 |
|
569 User::WaitForRequest(reqStatus); |
|
570 TEST(reqStatus.Int()==KErrCancel); |
|
571 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmdCancel - Items and actions - passed"),iTestCount++); |
|
572 |
|
573 // Set Up Menu - Item & Icons |
|
574 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuPckg); |
|
575 User::WaitForRequest(reqStatus); |
|
576 TEST(reqStatus.Int()==KErrNone); |
|
577 |
|
578 TEST(setUpMenu->MenuContent()==DSATTSY_ITEMS_AND_ICONS); |
|
579 TEST(setUpMenu->NumberOfItems()==0x03); |
|
580 |
|
581 index=1; |
|
582 TEST(setUpMenu->GetItem(index++,item,action,icon)==KErrNone); |
|
583 TEST(item.iItemId==0x01); |
|
584 TEST(item.iItemString==DSATTSY_ITEM1); |
|
585 TEST(icon==0x01); |
|
586 TEST(action==KErrNotFound); |
|
587 |
|
588 TEST(setUpMenu->GetItemIcon(index++,item, icon)==KErrNone); |
|
589 TEST(item.iItemId==0x02); |
|
590 TEST(item.iItemString==DSATTSY_ITEM2); |
|
591 TEST(icon==0x02); |
|
592 |
|
593 TEST(setUpMenu->GetItemIcon(index++,item, icon)==KErrNone); |
|
594 TEST(item.iItemId==0x03); |
|
595 TEST(item.iItemString==DSATTSY_ITEM3); |
|
596 TEST(icon==0x03); |
|
597 |
|
598 index=1; |
|
599 TEST(setUpMenu->GetItem(index++,item)==KErrNone); |
|
600 TEST(item.iItemId==0x01); |
|
601 TEST(item.iItemString==DSATTSY_ITEM1); |
|
602 |
|
603 TEST(setUpMenu->GetItem(index++,item, action)==KErrNone); |
|
604 TEST(item.iItemId==0x02); |
|
605 TEST(item.iItemString==DSATTSY_ITEM2); |
|
606 TEST(action==KErrNotFound); |
|
607 |
|
608 TEST(setUpMenu->GetItem(index++,item, action, icon)==KErrNone); |
|
609 TEST(item.iItemId==0x03); |
|
610 TEST(item.iItemString==DSATTSY_ITEM3); |
|
611 TEST(icon==0x03); |
|
612 TEST(action==KErrNotFound); |
|
613 |
|
614 // Test error cases |
|
615 TEST(setUpMenu->GetItem(index++,item)==KErrNotFound); |
|
616 TEST(setUpMenu->AddItem(item)==KErrNotSupported); |
|
617 TEST(setUpMenu->AddItem(item, action, icon)==KErrNotSupported); |
|
618 TEST(setUpMenu->AddItem(item, action)==KErrNotSupported); |
|
619 |
|
620 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd - Items and icons - passed"),iTestCount++); |
|
621 |
|
622 // Set Up Menu Cancel |
|
623 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuPckg); |
|
624 sat.CancelAsyncRequest(ESatNotifySetUpMenuPCmd); |
|
625 |
|
626 User::WaitForRequest(reqStatus); |
|
627 TEST(reqStatus.Int()==KErrCancel); |
|
628 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmdCancel - Items and icons - passed"),iTestCount++); |
|
629 |
|
630 // Set Up Menu - Items & Icons & Actions |
|
631 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuPckg); |
|
632 User::WaitForRequest(reqStatus); |
|
633 TEST(reqStatus.Int()==KErrNone); |
|
634 |
|
635 TEST(setUpMenu->MenuContent()==DSATTSY_ITEMS_ACTIONS_AND_ICONS); |
|
636 TEST(setUpMenu->NumberOfItems()==0x03); |
|
637 |
|
638 index=1; |
|
639 TEST(setUpMenu->GetItem(index++,item,action,icon)==KErrNone); |
|
640 |
|
641 TEST(item.iItemId==0x01); |
|
642 TEST(item.iItemString==DSATTSY_ITEM1); |
|
643 TEST(action==0x01); |
|
644 TEST(icon==0x01); |
|
645 |
|
646 TEST(setUpMenu->GetItem(index++,item,action,icon)==KErrNone); |
|
647 TEST(item.iItemId==0x02); |
|
648 TEST(item.iItemString==DSATTSY_ITEM2); |
|
649 TEST(action==0x02); |
|
650 TEST(icon==0x02); |
|
651 |
|
652 TEST(setUpMenu->GetItem(index++,item,action,icon)==KErrNone); |
|
653 TEST(item.iItemId==0x03); |
|
654 TEST(item.iItemString==DSATTSY_ITEM3); |
|
655 TEST(action==0x03); |
|
656 TEST(icon==0x03); |
|
657 |
|
658 TEST(setUpMenu->GetItem(index++,item, action, icon)==KErrNotFound); |
|
659 |
|
660 index=1; |
|
661 TEST(setUpMenu->GetItem(index++,item,action)==KErrNone); |
|
662 |
|
663 TEST(item.iItemId==0x01); |
|
664 TEST(item.iItemString==DSATTSY_ITEM1); |
|
665 TEST(action==0x01); |
|
666 |
|
667 TEST(setUpMenu->GetItem(index++,item)==KErrNone); |
|
668 TEST(item.iItemId==0x02); |
|
669 TEST(item.iItemString==DSATTSY_ITEM2); |
|
670 |
|
671 TEST(setUpMenu->GetItemIcon(index++,item, icon)==KErrNone); |
|
672 TEST(item.iItemId==0x03); |
|
673 TEST(item.iItemString==DSATTSY_ITEM3); |
|
674 TEST(icon==0x03); |
|
675 |
|
676 // Test error cases |
|
677 TEST(setUpMenu->GetItem(index++,item)==KErrNotFound); |
|
678 TEST(setUpMenu->AddItem(item)==KErrNotSupported); |
|
679 TEST(setUpMenu->AddItemIcon(item, icon)==KErrNotSupported); |
|
680 TEST(setUpMenu->AddItem(item, action)==KErrNotSupported); |
|
681 |
|
682 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd - Items, actions and icons - passed"),iTestCount++); |
|
683 |
|
684 // Set Up Menu Cancel |
|
685 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuPckg); |
|
686 sat.CancelAsyncRequest(ESatNotifySetUpMenuPCmd); |
|
687 |
|
688 User::WaitForRequest(reqStatus); |
|
689 TEST(reqStatus.Int()==KErrCancel); |
|
690 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmdCancel passed"),iTestCount++); |
|
691 |
|
692 // |
|
693 // TSetUpMenuV5 tests |
|
694 // |
|
695 |
|
696 /* General format of the tests TMenuItemBaseV5::GetItem |
|
697 and TMenuItemBaseV5::AddItem tests: |
|
698 |
|
699 RSat::TSetUpMenuV5 added support for text attributes |
|
700 in menus. |
|
701 This added the following four new types of menu structure: |
|
702 |
|
703 1. Menu items with item text attributes only |
|
704 2. Menu items with item text attributes and item next |
|
705 actions only |
|
706 3. Menu items with item text attributes and item icon IDs only |
|
707 4. Menu items with item text attributes and item next actions |
|
708 and icon IDs. |
|
709 |
|
710 The following set of tests set up menus containing each |
|
711 of these structures and for each one: |
|
712 |
|
713 1. Uses the correct TMenuItemBaseV5::GetItem / GetItemIcon |
|
714 method to retrieve all of the information |
|
715 present in each of the menu items. |
|
716 2. Uses the other TMenuItemBaseV5::GetItem / GetItemIcon |
|
717 methods to retrieve information about the menu items. |
|
718 3. Uses the base class TMenuItemBaseV1::GetItem / GetItemIcon |
|
719 methods to retrieve information about the menu items. |
|
720 4. Tests error cases where the user tries to add new items |
|
721 to the menu using the wrong TMenuItemBaseV5::AddItem |
|
722 method. |
|
723 |
|
724 The tests then do steps 1, 2 and 4 immediately above with |
|
725 each of the existing menu structures: |
|
726 |
|
727 1. Menu items without item text attributes only |
|
728 2. Menu items without item text attributes but with item next |
|
729 actions only |
|
730 3. Menu items without item text attributes but with item icon IDs only |
|
731 4. Menu items without item text attributes but with item next actions |
|
732 and icon IDs. |
|
733 |
|
734 This ensures that the version 5 menus are backwards compatible with |
|
735 the version 1 and 2 menus. |
|
736 (step 3 has been tested in the TMenuItemBaseV1 test code). |
|
737 */ |
|
738 |
|
739 // |
|
740 // TSetUpMenuV5 - Set Up Menu - Items with text attributes |
|
741 // |
|
742 |
|
743 // Text attribute parameters used for tests |
|
744 RSat::TTextAttribute textAttribute1, textAttribute2, textAttribute3, textAttribute4; |
|
745 |
|
746 textAttribute1.iStatus = DSATTSY_TEXT_ATTRIBUTE_STATUS; |
|
747 const TUint8 textAttributeData[DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH] = DSATTSY_TEXT_ATTRIBUTE_DATA; |
|
748 textAttribute1.iTextAttributeData.Append(textAttributeData, DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH); |
|
749 |
|
750 textAttribute2.iStatus = DSATTSY_TEXT_ATTRIBUTE_STATUS2; |
|
751 const TUint8 textAttributeData2[DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH] = DSATTSY_TEXT_ATTRIBUTE_DATA2; |
|
752 textAttribute2.iTextAttributeData.Append(textAttributeData2, DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH); |
|
753 |
|
754 textAttribute3.iStatus = DSATTSY_TEXT_ATTRIBUTE_STATUS3; |
|
755 const TUint8 textAttributeData3[DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH] = DSATTSY_TEXT_ATTRIBUTE_DATA3; |
|
756 textAttribute3.iTextAttributeData.Append(textAttributeData3, DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH); |
|
757 |
|
758 textAttribute4.iStatus = DSATTSY_TEXT_ATTRIBUTE_STATUS4; |
|
759 const TUint8 textAttributeData4[DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH] = DSATTSY_TEXT_ATTRIBUTE_DATA4; |
|
760 textAttribute4.iTextAttributeData.Append(textAttributeData4, DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH); |
|
761 |
|
762 RSat::TSetUpMenuV5* setUpMenuV5 = new (ELeave) RSat::TSetUpMenuV5; |
|
763 CleanupStack::PushL(setUpMenuV5); |
|
764 RSat::TSetUpMenuV5Pckg* setUpMenuV5Pckg = new (ELeave) RSat::TSetUpMenuV5Pckg(*setUpMenuV5); |
|
765 CleanupStack::PushL(setUpMenuV5Pckg); |
|
766 |
|
767 // Test default parameters set up correctly |
|
768 // when the RSat::TSetUpMenuV5 object is created. |
|
769 TEST(setUpMenuV5->ExtensionId()==RSat::KSatV5); |
|
770 TEST(setUpMenuV5->iAlphaId.iStatus==RSat::EAlphaIdNotSet); |
|
771 TEST(setUpMenuV5->iHelp==RSat::EHelpNotSet); |
|
772 TEST(setUpMenuV5->iIconId.iQualifier==RSat::EIconQualifierNotSet); |
|
773 TEST(setUpMenuV5->iIconId.iIdentifier==0); |
|
774 TEST(setUpMenuV5->iIconListQualifier==RSat::EIconQualifierNotSet); |
|
775 TEST(setUpMenuV5->iPreference==RSat::ESelectionPreferenceNotSet); |
|
776 TEST(setUpMenuV5->iTextAttribute.iStatus==RSat::ETextAttributeNotSet); |
|
777 TEST(setUpMenuV5->MenuContent()==0); |
|
778 TEST(setUpMenuV5->IsRemoveMenu()); |
|
779 |
|
780 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
781 User::WaitForRequest(reqStatus); |
|
782 TEST(reqStatus.Int()==KErrNone); |
|
783 |
|
784 TEST(setUpMenuV5->PCmdNumber()==DSATTSY_SET_UP_MENU_NUMBER); |
|
785 TEST(!setUpMenuV5->IsRemoveMenu()); |
|
786 TEST(setUpMenuV5->MenuContent()==DSATTSY_ITEMS_WITH_TEXT_ATTRIBUTES); |
|
787 TEST(setUpMenuV5->NumberOfItems()==0x04); |
|
788 TEST(setUpMenuV5->iPreference==DSATTSY_SELECTION_PREFERENCE); |
|
789 TEST(setUpMenuV5->iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS); |
|
790 TEST(setUpMenuV5->iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1); |
|
791 TEST(setUpMenuV5->iHelp==DSATTSY_HELP); |
|
792 TEST(setUpMenuV5->iIconId.iIdentifier==DSATTSY_ICON_ID1); |
|
793 TEST(setUpMenuV5->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1); |
|
794 TEST(setUpMenuV5->iIconListQualifier==DSATTSY_ICON_QUALIFIER2); |
|
795 TEST(setUpMenuV5->iTextAttribute.iStatus==textAttribute1.iStatus); |
|
796 TEST(setUpMenuV5->iTextAttribute.iTextAttributeData == textAttribute1.iTextAttributeData); |
|
797 |
|
798 // Test GetItem methods for getting the item and the text attribute |
|
799 index = 1; |
|
800 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
801 TEST(item.iItemId==0x01); |
|
802 TEST(item.iItemString==DSATTSY_ITEM1); |
|
803 TEST(iTextAttribute.iStatus == textAttribute1.iStatus); |
|
804 TEST(iTextAttribute.iTextAttributeData == textAttribute1.iTextAttributeData); |
|
805 |
|
806 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
807 TEST(item.iItemId==0x02); |
|
808 TEST(item.iItemString==DSATTSY_ITEM2); |
|
809 TEST(iTextAttribute.iStatus == textAttribute2.iStatus); |
|
810 TEST(iTextAttribute.iTextAttributeData == textAttribute2.iTextAttributeData); |
|
811 |
|
812 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
813 TEST(item.iItemId==0x03); |
|
814 TEST(item.iItemString==DSATTSY_ITEM3); |
|
815 TEST(iTextAttribute.iStatus == textAttribute3.iStatus); |
|
816 TEST(iTextAttribute.iTextAttributeData == textAttribute3.iTextAttributeData); |
|
817 |
|
818 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
819 TEST(item.iItemId==0x04); |
|
820 TEST(item.iItemString==DSATTSY_ITEM4); |
|
821 TEST(iTextAttribute.iStatus == textAttribute4.iStatus); |
|
822 TEST(iTextAttribute.iTextAttributeData == textAttribute4.iTextAttributeData); |
|
823 |
|
824 TEST(setUpMenuV5->GetItem(index++,item, iTextAttribute)==KErrNotFound); |
|
825 |
|
826 // Test other TMenuItemBaseV5::GetItem methods which get the item and the text attribute |
|
827 // The item and text attribute should be returned correctly. |
|
828 // Since there are no icons or actions in the menu, if the client uses one |
|
829 // of the GetItem methods that requests them, then KErrNotFound should be returned |
|
830 // via the parameter supplied by the client. |
|
831 index = 1; |
|
832 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
833 TEST(item.iItemId==0x01); |
|
834 TEST(item.iItemString==DSATTSY_ITEM1); |
|
835 TEST(iTextAttribute.iStatus == textAttribute1.iStatus); |
|
836 TEST(iTextAttribute.iTextAttributeData == textAttribute1.iTextAttributeData); |
|
837 TEST(action==KErrNotFound); |
|
838 |
|
839 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
840 TEST(item.iItemId==0x02); |
|
841 TEST(item.iItemString==DSATTSY_ITEM2); |
|
842 TEST(iTextAttribute.iStatus == textAttribute2.iStatus); |
|
843 TEST(iTextAttribute.iTextAttributeData == textAttribute2.iTextAttributeData); |
|
844 TEST(icon==KErrNotFound); |
|
845 |
|
846 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
847 TEST(item.iItemId==0x03); |
|
848 TEST(item.iItemString==DSATTSY_ITEM3); |
|
849 TEST(iTextAttribute.iStatus == textAttribute3.iStatus); |
|
850 TEST(iTextAttribute.iTextAttributeData == textAttribute3.iTextAttributeData); |
|
851 TEST(action==KErrNotFound); |
|
852 TEST(icon==KErrNotFound); |
|
853 |
|
854 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
855 TEST(item.iItemId==0x04); |
|
856 TEST(item.iItemString==DSATTSY_ITEM4); |
|
857 TEST(iTextAttribute.iStatus == textAttribute4.iStatus); |
|
858 TEST(iTextAttribute.iTextAttributeData == textAttribute4.iTextAttributeData); |
|
859 TEST(action==KErrNotFound); |
|
860 |
|
861 TEST(setUpMenuV5->GetItem(index++,item, iTextAttribute)==KErrNotFound); |
|
862 |
|
863 TEST(setUpMenuV5->AddItem(item, textAttribute1)==KErrNone); |
|
864 |
|
865 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::GetItem and GetItemIcon with TSetUpMenuV5 containing items and text attributes passed"),iTestCount++); |
|
866 |
|
867 // Test TMenuItemBaseV1::GetItem methods which do not get the text attribute. |
|
868 // It should still be possible to get the item even when the menu item contains |
|
869 // text attribute information as well. |
|
870 index = 1; |
|
871 TEST(setUpMenuV5->GetItem(index++, item)==KErrNone); |
|
872 TEST(item.iItemId==0x01); |
|
873 TEST(item.iItemString==DSATTSY_ITEM1); |
|
874 |
|
875 TEST(setUpMenuV5->GetItem(index++, item, action)==KErrNone); |
|
876 TEST(item.iItemId==0x02); |
|
877 TEST(item.iItemString==DSATTSY_ITEM2); |
|
878 TEST(action==KErrNotFound); |
|
879 |
|
880 TEST(setUpMenuV5->GetItemIcon(index++, item, icon)==KErrNone); |
|
881 TEST(item.iItemId==0x03); |
|
882 TEST(item.iItemString==DSATTSY_ITEM3); |
|
883 TEST(icon==KErrNotFound); |
|
884 |
|
885 TEST(setUpMenuV5->GetItem(index++, item, action, icon)==KErrNone); |
|
886 TEST(item.iItemId==0x04); |
|
887 TEST(item.iItemString==DSATTSY_ITEM4); |
|
888 TEST(action==KErrNotFound); |
|
889 TEST(icon==KErrNotFound); |
|
890 |
|
891 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::GetItem and GetItemIcon with TSetUpMenuV5 containing items and text attributes passed"),iTestCount++); |
|
892 |
|
893 // Test Error Cases - adding actions or icons when the menu can now |
|
894 // only contain items ALL with item text attributes. |
|
895 TUint action5=0x05; |
|
896 TUint icon5=0x05; |
|
897 // TMenuItemBaseV1::AddItem methods |
|
898 TEST(setUpMenuV5->AddItem(item)==KErrNotSupported); |
|
899 TEST(setUpMenuV5->AddItem(item, action5)==KErrNotSupported); |
|
900 TEST(setUpMenuV5->AddItem(item, action5, icon5)==KErrNotSupported); |
|
901 TEST(setUpMenuV5->AddItemIcon(item, icon5)==KErrNotSupported); |
|
902 |
|
903 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::AddItem and AddItemIcon with TSetUpMenuV5 containing items and text attributes passed"),iTestCount++); |
|
904 |
|
905 // TMenuItemBaseV5::AddItem methods |
|
906 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5)==KErrNotSupported); |
|
907 TEST(setUpMenuV5->AddItemIcon(item, textAttribute1, icon5)==KErrNotSupported); |
|
908 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5, icon5)==KErrNotSupported); |
|
909 |
|
910 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::AddItem with TSetUpMenuV5 containing items and text attributes passed"),iTestCount++); |
|
911 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd with TSetUpMenuV5 containing items and text attributes passed"),iTestCount++); |
|
912 |
|
913 // Set Up Menu Cancel |
|
914 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
915 sat.CancelAsyncRequest(ESatNotifySetUpMenuPCmd); |
|
916 |
|
917 User::WaitForRequest(reqStatus); |
|
918 TEST(reqStatus.Int()==KErrCancel); |
|
919 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmdCancel with TSetUpMenuV5 containing items and text attributes passed"),iTestCount++); |
|
920 |
|
921 // |
|
922 // TSetUpMenuV5 - Set Up Menu - Items with text attributes and actions |
|
923 // |
|
924 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
925 User::WaitForRequest(reqStatus); |
|
926 TEST(reqStatus.Int()==KErrNone); |
|
927 |
|
928 TEST(setUpMenuV5->PCmdNumber()==DSATTSY_SET_UP_MENU_NUMBER); |
|
929 TEST(!setUpMenuV5->IsRemoveMenu()); |
|
930 TEST(setUpMenuV5->MenuContent()==DSATTSY_ITEMS_WITH_TEXT_ATTRIBUTES_AND_ACTIONS); |
|
931 TEST(setUpMenuV5->NumberOfItems()==0x04); |
|
932 |
|
933 // Test GetItem methods for getting the item, the text attribute and action |
|
934 index = 1; |
|
935 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
936 TEST(item.iItemId==0x01); |
|
937 TEST(item.iItemString==DSATTSY_ITEM1); |
|
938 TEST(iTextAttribute.iStatus == textAttribute1.iStatus); |
|
939 TEST(iTextAttribute.iTextAttributeData == textAttribute1.iTextAttributeData); |
|
940 TEST(action==0x01); |
|
941 |
|
942 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
943 TEST(item.iItemId==0x02); |
|
944 TEST(item.iItemString==DSATTSY_ITEM2); |
|
945 TEST(iTextAttribute.iStatus == textAttribute2.iStatus); |
|
946 TEST(iTextAttribute.iTextAttributeData == textAttribute2.iTextAttributeData); |
|
947 TEST(action==0x02); |
|
948 |
|
949 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
950 TEST(item.iItemId==0x03); |
|
951 TEST(item.iItemString==DSATTSY_ITEM3); |
|
952 TEST(iTextAttribute.iStatus == textAttribute3.iStatus); |
|
953 TEST(iTextAttribute.iTextAttributeData == textAttribute3.iTextAttributeData); |
|
954 TEST(action==0x03); |
|
955 |
|
956 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
957 TEST(item.iItemId==0x04); |
|
958 TEST(item.iItemString==DSATTSY_ITEM4); |
|
959 TEST(iTextAttribute.iStatus == textAttribute4.iStatus); |
|
960 TEST(iTextAttribute.iTextAttributeData == textAttribute4.iTextAttributeData); |
|
961 TEST(action==0x04); |
|
962 |
|
963 TEST(setUpMenuV5->GetItem(index,item, iTextAttribute, action)==KErrNotFound); |
|
964 |
|
965 // Test other TMenuItemBaseV5::GetItem methods which get the item, the text attribute |
|
966 // and the icon. |
|
967 // The item and text attribute and the action should be returned correctly. |
|
968 // Since there are no icons in the menu, if the client uses one |
|
969 // of the GetItem methods that requests them, then KErrNotFound should be returned |
|
970 // via the parameter supplied by the client. |
|
971 index = 1; |
|
972 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
973 TEST(item.iItemId==0x01); |
|
974 TEST(item.iItemString==DSATTSY_ITEM1); |
|
975 TEST(iTextAttribute.iStatus == textAttribute1.iStatus); |
|
976 TEST(iTextAttribute.iTextAttributeData == textAttribute1.iTextAttributeData); |
|
977 |
|
978 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
979 TEST(item.iItemId==0x02); |
|
980 TEST(item.iItemString==DSATTSY_ITEM2); |
|
981 TEST(iTextAttribute.iStatus == textAttribute2.iStatus); |
|
982 TEST(iTextAttribute.iTextAttributeData == textAttribute2.iTextAttributeData); |
|
983 TEST(action==0x02); |
|
984 TEST(icon==KErrNotFound); |
|
985 |
|
986 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
987 TEST(item.iItemId==0x03); |
|
988 TEST(item.iItemString==DSATTSY_ITEM3); |
|
989 TEST(iTextAttribute.iStatus == textAttribute3.iStatus); |
|
990 TEST(iTextAttribute.iTextAttributeData == textAttribute3.iTextAttributeData); |
|
991 |
|
992 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
993 TEST(item.iItemId==0x04); |
|
994 TEST(item.iItemString==DSATTSY_ITEM4); |
|
995 TEST(iTextAttribute.iStatus == textAttribute4.iStatus); |
|
996 TEST(iTextAttribute.iTextAttributeData == textAttribute4.iTextAttributeData); |
|
997 TEST(icon==KErrNotFound); |
|
998 |
|
999 TEST(setUpMenuV5->AddItem(item, textAttribute1, action)==KErrNone); |
|
1000 |
|
1001 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::GetItem and GetItemIcon with TSetUpMenuV5 containing items, item text attributes and actions passed"),iTestCount++); |
|
1002 |
|
1003 // Test GetItem methods which do not get the text attribute |
|
1004 // It should still be possible to get the item and action even when |
|
1005 // the menu item contains |
|
1006 // text attribute information as well. |
|
1007 index = 1; |
|
1008 TEST(setUpMenuV5->GetItem(index++, item)==KErrNone); |
|
1009 TEST(item.iItemId==0x01); |
|
1010 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1011 |
|
1012 TEST(setUpMenuV5->GetItem(index++, item, action)==KErrNone); |
|
1013 TEST(item.iItemId==0x02); |
|
1014 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1015 TEST(action==0x02); |
|
1016 |
|
1017 TEST(setUpMenuV5->GetItemIcon(index++, item, icon)==KErrNone); |
|
1018 TEST(item.iItemId==0x03); |
|
1019 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1020 TEST(icon==KErrNotFound); |
|
1021 |
|
1022 TEST(setUpMenuV5->GetItem(index++, item, action, icon)==KErrNone); |
|
1023 TEST(item.iItemId==0x04); |
|
1024 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1025 TEST(action==0x04); |
|
1026 TEST(icon==KErrNotFound); |
|
1027 |
|
1028 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::GetItem and GetItemIcon with TSetUpMenuV5 containing items, item text attributes and actions passed"),iTestCount++); |
|
1029 |
|
1030 // Test Error Cases - adding icons when the menu can now only contain |
|
1031 // items with item text attributes and actions. |
|
1032 action5=0x00; |
|
1033 icon5=0x00; |
|
1034 |
|
1035 TEST(setUpMenuV5->AddItem(item)==KErrNotSupported); |
|
1036 TEST(setUpMenuV5->AddItem(item, action5)==KErrNotSupported); |
|
1037 TEST(setUpMenuV5->AddItem(item, action5, icon5)==KErrNotSupported); |
|
1038 TEST(setUpMenuV5->AddItemIcon(item, icon5)==KErrNotSupported); |
|
1039 |
|
1040 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::AddItem with TSetUpMenuV5 containing items, item text attributes and actions passed"),iTestCount++); |
|
1041 |
|
1042 TEST(setUpMenuV5->AddItem(item, textAttribute1)==KErrNotSupported); |
|
1043 TEST(setUpMenuV5->AddItemIcon(item, textAttribute1, icon5)==KErrNotSupported); |
|
1044 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5, icon5)==KErrNotSupported); |
|
1045 |
|
1046 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::AddItem with TSetUpMenuV5 containing items, item text attributes and actions passed"),iTestCount++); |
|
1047 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd with TSetUpMenuV5 containing items, item text attributes and actions passed"),iTestCount++); |
|
1048 |
|
1049 // Set Up Menu Cancel |
|
1050 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1051 sat.CancelAsyncRequest(ESatNotifySetUpMenuPCmd); |
|
1052 |
|
1053 User::WaitForRequest(reqStatus); |
|
1054 TEST(reqStatus.Int()==KErrCancel); |
|
1055 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmdCancel with TSetUpMenuV5 containing items, item text attributes and actions passed"),iTestCount++); |
|
1056 |
|
1057 |
|
1058 // TSetUpMenuV5 - Set Up Menu - Items with text attributes and icons |
|
1059 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1060 User::WaitForRequest(reqStatus); |
|
1061 TEST(reqStatus.Int()==KErrNone); |
|
1062 |
|
1063 TEST(setUpMenuV5->PCmdNumber()==DSATTSY_SET_UP_MENU_NUMBER); |
|
1064 TEST(!setUpMenuV5->IsRemoveMenu()); |
|
1065 TEST(setUpMenuV5->MenuContent()==DSATTSY_ITEMS_WITH_TEXT_ATTRIBUTES_AND_ICONS); |
|
1066 TEST(setUpMenuV5->NumberOfItems()==0x04); |
|
1067 |
|
1068 // Get all the items, text attributes and icons in the menu |
|
1069 index = 1; |
|
1070 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
1071 TEST(item.iItemId==0x01); |
|
1072 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1073 TEST(iTextAttribute.iStatus == textAttribute1.iStatus); |
|
1074 TEST(iTextAttribute.iTextAttributeData == textAttribute1.iTextAttributeData); |
|
1075 TEST(icon==0x01); |
|
1076 |
|
1077 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
1078 TEST(item.iItemId==0x02); |
|
1079 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1080 TEST(iTextAttribute.iStatus == textAttribute2.iStatus); |
|
1081 TEST(iTextAttribute.iTextAttributeData == textAttribute2.iTextAttributeData); |
|
1082 TEST(icon==0x02); |
|
1083 |
|
1084 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
1085 TEST(item.iItemId==0x03); |
|
1086 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1087 TEST(iTextAttribute.iStatus == textAttribute3.iStatus); |
|
1088 TEST(iTextAttribute.iTextAttributeData == textAttribute3.iTextAttributeData); |
|
1089 TEST(icon==0x03); |
|
1090 |
|
1091 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
1092 TEST(item.iItemId==0x04); |
|
1093 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1094 TEST(iTextAttribute.iStatus == textAttribute4.iStatus); |
|
1095 TEST(iTextAttribute.iTextAttributeData == textAttribute4.iTextAttributeData); |
|
1096 TEST(icon==0x04); |
|
1097 |
|
1098 TEST(setUpMenuV5->GetItemIcon(index,item, iTextAttribute, action)==KErrNotFound); |
|
1099 |
|
1100 TEST(setUpMenuV5->AddItemIcon(item, textAttribute1, icon)==KErrNone); |
|
1101 |
|
1102 // Test other TMenuItemBaseV5::GetItem methods which get the |
|
1103 // item and the text attribute. |
|
1104 // The item and text attribute and icon (when requested) |
|
1105 // should be returned correctly. |
|
1106 // Since there are no actions in the menu, if the client uses one |
|
1107 // of the GetItem methods that requests one, then KErrNotFound should |
|
1108 // be returned |
|
1109 // via the parameter supplied by the client. |
|
1110 index = 1; |
|
1111 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
1112 TEST(item.iItemId==0x01); |
|
1113 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1114 TEST(iTextAttribute.iStatus == textAttribute1.iStatus); |
|
1115 TEST(iTextAttribute.iTextAttributeData == textAttribute1.iTextAttributeData); |
|
1116 |
|
1117 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
1118 TEST(item.iItemId==0x02); |
|
1119 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1120 TEST(iTextAttribute.iStatus == textAttribute2.iStatus); |
|
1121 TEST(iTextAttribute.iTextAttributeData == textAttribute2.iTextAttributeData); |
|
1122 TEST(action==KErrNotFound); |
|
1123 |
|
1124 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1125 TEST(item.iItemId==0x03); |
|
1126 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1127 TEST(iTextAttribute.iStatus == textAttribute3.iStatus); |
|
1128 TEST(iTextAttribute.iTextAttributeData == textAttribute3.iTextAttributeData); |
|
1129 TEST(action==KErrNotFound); |
|
1130 TEST(icon==0x03); |
|
1131 |
|
1132 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
1133 TEST(item.iItemId==0x04); |
|
1134 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1135 TEST(iTextAttribute.iStatus == textAttribute4.iStatus); |
|
1136 TEST(iTextAttribute.iTextAttributeData == textAttribute4.iTextAttributeData); |
|
1137 TEST(action==KErrNotFound); |
|
1138 |
|
1139 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::GetItem and GetItemIcon with TSetUpMenuV5 containing items, item text attributes and icons passed"),iTestCount++); |
|
1140 |
|
1141 // Test GetItem methods which do not get the text attribute |
|
1142 // It should still be possible to get the item even when the menu item contains |
|
1143 // text attribute information as well. |
|
1144 index = 1; |
|
1145 TEST(setUpMenuV5->GetItem(index++, item)==KErrNone); |
|
1146 TEST(item.iItemId==0x01); |
|
1147 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1148 |
|
1149 TEST(setUpMenuV5->GetItem(index++, item, action)==KErrNone); |
|
1150 TEST(item.iItemId==0x02); |
|
1151 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1152 TEST(action==KErrNotFound); |
|
1153 |
|
1154 TEST(setUpMenuV5->GetItemIcon(index++, item, icon)==KErrNone); |
|
1155 TEST(item.iItemId==0x03); |
|
1156 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1157 TEST(icon==0x03); |
|
1158 |
|
1159 TEST(setUpMenuV5->GetItem(index++, item, action, icon)==KErrNone); |
|
1160 TEST(item.iItemId==0x04); |
|
1161 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1162 TEST(action==KErrNotFound); |
|
1163 TEST(icon==0x04); |
|
1164 |
|
1165 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::GetItem and GetItemIcon with TSetUpMenuV5 containing items, item text attributes and icons passed"),iTestCount++); |
|
1166 |
|
1167 // Test Error Cases - adding actions when the menu can now only contain |
|
1168 // items ALL with item text attributes and icons. |
|
1169 action5=0x00; |
|
1170 icon5=0x00; |
|
1171 |
|
1172 TEST(setUpMenuV5->AddItem(item)==KErrNotSupported); |
|
1173 TEST(setUpMenuV5->AddItem(item, action5)==KErrNotSupported); |
|
1174 TEST(setUpMenuV5->AddItem(item, action5, icon5)==KErrNotSupported); |
|
1175 TEST(setUpMenuV5->AddItemIcon(item, icon5)==KErrNotSupported); |
|
1176 |
|
1177 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::AddItem and AddItemIcon with TSetUpMenuV5 containing items, item text attributes and icons passed"),iTestCount++); |
|
1178 |
|
1179 TEST(setUpMenuV5->AddItem(item, textAttribute1)==KErrNotSupported); |
|
1180 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5)==KErrNotSupported); |
|
1181 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5, icon5)==KErrNotSupported); |
|
1182 |
|
1183 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::AddItem with TSetUpMenuV5 containing items, item text attributes and icons passed"),iTestCount++); |
|
1184 |
|
1185 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd with TSetUpMenuV5 containing items, item text attributes and icons passed"),iTestCount++); |
|
1186 |
|
1187 // Set Up Menu Cancel |
|
1188 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1189 sat.CancelAsyncRequest(ESatNotifySetUpMenuPCmd); |
|
1190 |
|
1191 User::WaitForRequest(reqStatus); |
|
1192 TEST(reqStatus.Int()==KErrCancel); |
|
1193 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmdCancel with TSetUpMenuV5 containing items, item text attributes and icons passed"),iTestCount++); |
|
1194 |
|
1195 // |
|
1196 // TSetUpMenuV5 - Set Up Menu - Items with text attributes, actions and icons |
|
1197 // |
|
1198 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1199 User::WaitForRequest(reqStatus); |
|
1200 TEST(reqStatus.Int()==KErrNone); |
|
1201 |
|
1202 TEST(setUpMenuV5->PCmdNumber()==DSATTSY_SET_UP_MENU_NUMBER); |
|
1203 TEST(!setUpMenuV5->IsRemoveMenu()); |
|
1204 TEST(setUpMenuV5->MenuContent()==DSATTSY_ITEMS_WITH_TEXT_ATTRIBUTES_ACTIONS_AND_ICONS); |
|
1205 TEST(setUpMenuV5->NumberOfItems()==0x04); |
|
1206 |
|
1207 index = 1; |
|
1208 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1209 TEST(item.iItemId==0x01); |
|
1210 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1211 TEST(iTextAttribute.iStatus == textAttribute1.iStatus); |
|
1212 TEST(iTextAttribute.iTextAttributeData == textAttribute1.iTextAttributeData); |
|
1213 TEST(icon==0x01); |
|
1214 TEST(action==0x01); |
|
1215 |
|
1216 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1217 TEST(item.iItemId==0x02); |
|
1218 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1219 TEST(iTextAttribute.iStatus == textAttribute2.iStatus); |
|
1220 TEST(iTextAttribute.iTextAttributeData == textAttribute2.iTextAttributeData); |
|
1221 TEST(icon==0x02); |
|
1222 TEST(action==0x02); |
|
1223 |
|
1224 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1225 TEST(item.iItemId==0x03); |
|
1226 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1227 TEST(iTextAttribute.iStatus == textAttribute3.iStatus); |
|
1228 TEST(iTextAttribute.iTextAttributeData == textAttribute3.iTextAttributeData); |
|
1229 TEST(icon==0x03); |
|
1230 TEST(action==0x03); |
|
1231 |
|
1232 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1233 TEST(item.iItemId==0x04); |
|
1234 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1235 TEST(iTextAttribute.iStatus == textAttribute4.iStatus); |
|
1236 TEST(iTextAttribute.iTextAttributeData == textAttribute4.iTextAttributeData); |
|
1237 TEST(icon==0x04); |
|
1238 TEST(action==0x04); |
|
1239 |
|
1240 TEST(setUpMenuV5->GetItem(index++,item, iTextAttribute, action)==KErrNotFound); |
|
1241 |
|
1242 TEST(setUpMenuV5->AddItem(item, iTextAttribute, action, icon)==KErrNone); |
|
1243 |
|
1244 // Test other TMenuItemBaseV5::GetItem methods which get the item and the text attribute |
|
1245 // The item and text attribute should be returned correctly. |
|
1246 // Where requested, the icon and action should also be returned correctly. |
|
1247 index = 1; |
|
1248 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
1249 TEST(item.iItemId==0x01); |
|
1250 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1251 TEST(iTextAttribute.iStatus == textAttribute1.iStatus); |
|
1252 TEST(iTextAttribute.iTextAttributeData == textAttribute1.iTextAttributeData); |
|
1253 |
|
1254 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
1255 TEST(item.iItemId==0x02); |
|
1256 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1257 TEST(iTextAttribute.iStatus == textAttribute2.iStatus); |
|
1258 TEST(iTextAttribute.iTextAttributeData == textAttribute2.iTextAttributeData); |
|
1259 TEST(action==0x02); |
|
1260 |
|
1261 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1262 TEST(item.iItemId==0x03); |
|
1263 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1264 TEST(iTextAttribute.iStatus == textAttribute3.iStatus); |
|
1265 TEST(iTextAttribute.iTextAttributeData == textAttribute3.iTextAttributeData); |
|
1266 TEST(action==0x03); |
|
1267 TEST(icon==0x03); |
|
1268 |
|
1269 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
1270 TEST(item.iItemId==0x04); |
|
1271 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1272 TEST(iTextAttribute.iStatus == textAttribute4.iStatus); |
|
1273 TEST(iTextAttribute.iTextAttributeData == textAttribute4.iTextAttributeData); |
|
1274 TEST(icon==0x04); |
|
1275 |
|
1276 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::GetItem and GetItemIcon with TSetUpMenuV5 containing items, item text attributes, actions and icons passed"),iTestCount++); |
|
1277 |
|
1278 // Test GetItem methods which do not get the text attribute |
|
1279 // It should still be possible to get the item even when the menu item contains |
|
1280 // text attribute, icon and action information as well. |
|
1281 index = 1; |
|
1282 TEST(setUpMenuV5->GetItem(index++, item)==KErrNone); |
|
1283 TEST(item.iItemId==0x01); |
|
1284 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1285 |
|
1286 TEST(setUpMenuV5->GetItem(index++, item, action)==KErrNone); |
|
1287 TEST(item.iItemId==0x02); |
|
1288 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1289 TEST(action==0x02); |
|
1290 |
|
1291 TEST(setUpMenuV5->GetItemIcon(index++, item, icon)==KErrNone); |
|
1292 TEST(item.iItemId==0x03); |
|
1293 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1294 TEST(icon==0x03); |
|
1295 |
|
1296 TEST(setUpMenuV5->GetItem(index++, item, action, icon)==KErrNone); |
|
1297 TEST(item.iItemId==0x04); |
|
1298 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1299 TEST(action==0x04); |
|
1300 TEST(icon==0x04); |
|
1301 |
|
1302 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::GetItem and GetItemIcon with TSetUpMenuV5 containing items, item text attributes, actions and icons passed"),iTestCount++); |
|
1303 |
|
1304 // Test Error Cases |
|
1305 action5=0x00; |
|
1306 icon5=0x00; |
|
1307 |
|
1308 TEST(setUpMenuV5->AddItem(item)==KErrNotSupported); |
|
1309 TEST(setUpMenuV5->AddItem(item, action5)==KErrNotSupported); |
|
1310 TEST(setUpMenuV5->AddItem(item, action5, icon5)==KErrNotSupported); |
|
1311 TEST(setUpMenuV5->AddItemIcon(item, icon5)==KErrNotSupported); |
|
1312 |
|
1313 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::AddItem and AddItemIcon with TSetUpMenuV5 containing items, item text attributes, actions and icons passed"),iTestCount++); |
|
1314 |
|
1315 TEST(setUpMenuV5->AddItem(item, textAttribute1)==KErrNotSupported); |
|
1316 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5)==KErrNotSupported); |
|
1317 TEST(setUpMenuV5->AddItemIcon(item, textAttribute1, icon5)==KErrNotSupported); |
|
1318 |
|
1319 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::AddItem and AddItemIcon with TSetUpMenuV5 containing items, item text attributes, actions and icons passed"),iTestCount++); |
|
1320 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd with TSetUpMenuV5 containing items, item text attributes, actions and icons passed"),iTestCount++); |
|
1321 |
|
1322 // Set Up Menu Cancel |
|
1323 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1324 sat.CancelAsyncRequest(ESatNotifySetUpMenuPCmd); |
|
1325 |
|
1326 User::WaitForRequest(reqStatus); |
|
1327 TEST(reqStatus.Int()==KErrCancel); |
|
1328 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmdCancel with TSetUpMenuV5 containing items, item text attributes, actions and icons passed"),iTestCount++); |
|
1329 |
|
1330 // |
|
1331 // TSetUpMenuV5 - Set Up Menu - Items with NO text attributes, actions or icons (i.e. just plain items) |
|
1332 // |
|
1333 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1334 User::WaitForRequest(reqStatus); |
|
1335 TEST(reqStatus.Int()==KErrNone); |
|
1336 |
|
1337 TEST(setUpMenuV5->PCmdNumber()==DSATTSY_SET_UP_MENU_NUMBER); |
|
1338 TEST(!setUpMenuV5->IsRemoveMenu()); |
|
1339 TEST(setUpMenuV5->MenuContent()==DSATTSY_ITEMS); |
|
1340 TEST(setUpMenuV5->NumberOfItems()==0x04); |
|
1341 |
|
1342 index = 1; |
|
1343 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1344 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
1345 TEST(item.iItemId==0x01); |
|
1346 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1347 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1348 |
|
1349 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1350 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
1351 TEST(item.iItemId==0x02); |
|
1352 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1353 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1354 |
|
1355 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1356 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
1357 TEST(item.iItemId==0x03); |
|
1358 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1359 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1360 |
|
1361 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1362 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
1363 TEST(item.iItemId==0x04); |
|
1364 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1365 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1366 |
|
1367 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNotFound); |
|
1368 |
|
1369 TEST(setUpMenuV5->AddItem(item)==KErrNone); |
|
1370 |
|
1371 // Test other TMenuItemBaseV5::GetItem which get the item. |
|
1372 // The item should be returned correctly. |
|
1373 // If the client also requests to get the, |
|
1374 // action or icon, KErrNotFound should be returned in |
|
1375 // the relevant parameter. |
|
1376 // Since the menu does not contain text attributes, the |
|
1377 // TTextAttribute::iStatus will contain |
|
1378 // RSat::ETextAttributeNotPresent after the request. |
|
1379 index = 1; |
|
1380 TEST(setUpMenuV5->GetItem(index++, item)==KErrNone); |
|
1381 TEST(item.iItemId==0x01); |
|
1382 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1383 |
|
1384 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1385 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
1386 TEST(item.iItemId==0x02); |
|
1387 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1388 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1389 TEST(action==KErrNotFound); |
|
1390 |
|
1391 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1392 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1393 TEST(item.iItemId==0x03); |
|
1394 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1395 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1396 TEST(action==KErrNotFound); |
|
1397 TEST(icon==KErrNotFound); |
|
1398 |
|
1399 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1400 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
1401 TEST(item.iItemId==0x04); |
|
1402 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1403 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1404 TEST(icon==KErrNotFound); |
|
1405 |
|
1406 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::GetItem and GetItemIcon with TSetUpMenuV5 containing only items with no text attributes passed"),iTestCount++); |
|
1407 |
|
1408 // Test Error Cases |
|
1409 action5=0x00; |
|
1410 icon5=0x00; |
|
1411 TEST(setUpMenuV5->AddItem(item, action5)==KErrNotSupported); |
|
1412 TEST(setUpMenuV5->AddItem(item, action5, icon5)==KErrNotSupported); |
|
1413 TEST(setUpMenuV5->AddItemIcon(item, icon5)==KErrNotSupported); |
|
1414 |
|
1415 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::AddItem and AddItemIcon with TSetUpMenuV5 containing only items with no text attributes passed"),iTestCount++); |
|
1416 |
|
1417 TEST(setUpMenuV5->AddItem(item, textAttribute1)==KErrNotSupported); |
|
1418 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5)==KErrNotSupported); |
|
1419 TEST(setUpMenuV5->AddItemIcon(item, textAttribute1, icon5)==KErrNotSupported); |
|
1420 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5, icon5)==KErrNotSupported); |
|
1421 |
|
1422 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::AddItem and AddItemIcon with TSetUpMenuV5 containing only items with no text attributes passed"),iTestCount++); |
|
1423 |
|
1424 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd with TSetUpMenuV5 containing only items with no text attributes passed"),iTestCount++); |
|
1425 |
|
1426 // Set Up Menu Cancel |
|
1427 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1428 sat.CancelAsyncRequest(ESatNotifySetUpMenuPCmd); |
|
1429 |
|
1430 User::WaitForRequest(reqStatus); |
|
1431 TEST(reqStatus.Int()==KErrCancel); |
|
1432 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmdCancel with TSetUpMenuV5 containing only items with no text attributes passed"),iTestCount++); |
|
1433 |
|
1434 // |
|
1435 // TSetUpMenuV5 - Set Up Menu - Items and actions (no text attributes) |
|
1436 // |
|
1437 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1438 User::WaitForRequest(reqStatus); |
|
1439 TEST(reqStatus.Int()==KErrNone); |
|
1440 |
|
1441 TEST(setUpMenuV5->PCmdNumber()==DSATTSY_SET_UP_MENU_NUMBER); |
|
1442 TEST(!setUpMenuV5->IsRemoveMenu()); |
|
1443 TEST(setUpMenuV5->MenuContent()==DSATTSY_ITEMS_AND_ACTIONS); |
|
1444 TEST(setUpMenuV5->NumberOfItems()==0x04); |
|
1445 |
|
1446 // Test GetItem methods for getting the item and action |
|
1447 index = 1; |
|
1448 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1449 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
1450 TEST(item.iItemId==0x01); |
|
1451 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1452 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1453 |
|
1454 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1455 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
1456 TEST(item.iItemId==0x02); |
|
1457 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1458 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1459 |
|
1460 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1461 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
1462 TEST(item.iItemId==0x03); |
|
1463 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1464 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1465 |
|
1466 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1467 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
1468 TEST(item.iItemId==0x04); |
|
1469 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1470 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1471 |
|
1472 TEST(setUpMenuV5->GetItem(index, item, iTextAttribute, action)==KErrNotFound); |
|
1473 |
|
1474 TEST(setUpMenuV5->AddItem(item, action)==KErrNone); |
|
1475 |
|
1476 // Test other TMenuItemBaseV5::GetItem methods which get the item, the text attribute |
|
1477 // and the icon. |
|
1478 // The item and text attribute and the action should be returned correctly. |
|
1479 // Since there are no icons in the menu, if the client uses one |
|
1480 // of the GetItem methods that requests them, then KErrNotFound should be returned |
|
1481 // via the parameter supplied by the client. |
|
1482 index = 1; |
|
1483 TEST(setUpMenuV5->GetItem(index++, item)==KErrNone); |
|
1484 TEST(item.iItemId==0x01); |
|
1485 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1486 |
|
1487 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1488 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1489 TEST(item.iItemId==0x02); |
|
1490 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1491 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1492 TEST(action==0x02); |
|
1493 TEST(icon==KErrNotFound); |
|
1494 |
|
1495 TEST(setUpMenuV5->GetItem(index++, item, action)==KErrNone); |
|
1496 TEST(item.iItemId==0x03); |
|
1497 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1498 TEST(action==0x03); |
|
1499 |
|
1500 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1501 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
1502 TEST(item.iItemId==0x04); |
|
1503 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1504 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1505 TEST(icon==KErrNotFound); |
|
1506 |
|
1507 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::GetItem and GetItemIcon with TSetUpMenuV5 containing items and actions only (no text attributes) passed"),iTestCount++); |
|
1508 |
|
1509 // Test Error Cases - adding icons when the menu can now only contain |
|
1510 // items with item text attributes and actions. |
|
1511 action5=0x00; |
|
1512 icon5=0x00; |
|
1513 |
|
1514 TEST(setUpMenuV5->AddItem(item)==KErrNotSupported); |
|
1515 TEST(setUpMenuV5->AddItem(item, action5, icon5)==KErrNotSupported); |
|
1516 TEST(setUpMenuV5->AddItemIcon(item, icon5)==KErrNotSupported); |
|
1517 |
|
1518 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::AddItem and AddItemIcon with TSetUpMenuV5 containing items and actions only (no text attributes) passed"),iTestCount++); |
|
1519 |
|
1520 TEST(setUpMenuV5->AddItem(item, textAttribute1)==KErrNotSupported); |
|
1521 TEST(setUpMenuV5->AddItemIcon(item, textAttribute1, icon5)==KErrNotSupported); |
|
1522 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5)==KErrNotSupported); |
|
1523 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5, icon5)==KErrNotSupported); |
|
1524 |
|
1525 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::AddItem and AddItemIcon with TSetUpMenuV5 containing items and actions only (no text attributes) passed"),iTestCount++); |
|
1526 |
|
1527 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd with TSetUpMenuV5 containing items and actions only (no text attributes) passed"),iTestCount++); |
|
1528 |
|
1529 // Set Up Menu Cancel |
|
1530 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1531 sat.CancelAsyncRequest(ESatNotifySetUpMenuPCmd); |
|
1532 |
|
1533 User::WaitForRequest(reqStatus); |
|
1534 TEST(reqStatus.Int()==KErrCancel); |
|
1535 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmdCancel with TSetUpMenuV5 containing items and actions only (no text attributes) passed"),iTestCount++); |
|
1536 |
|
1537 // |
|
1538 // TSetUpMenuV5 - Set Up Menu - Items with NO text attributes but with icons |
|
1539 // |
|
1540 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1541 User::WaitForRequest(reqStatus); |
|
1542 TEST(reqStatus.Int()==KErrNone); |
|
1543 |
|
1544 TEST(setUpMenuV5->PCmdNumber()==DSATTSY_SET_UP_MENU_NUMBER); |
|
1545 TEST(!setUpMenuV5->IsRemoveMenu()); |
|
1546 TEST(setUpMenuV5->MenuContent()==DSATTSY_ITEMS_AND_ICONS); |
|
1547 TEST(setUpMenuV5->NumberOfItems()==0x04); |
|
1548 |
|
1549 // Get all the items and icons in the menu |
|
1550 index = 1; |
|
1551 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1552 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
1553 TEST(item.iItemId==0x01); |
|
1554 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1555 TEST(icon==0x01); |
|
1556 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1557 |
|
1558 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1559 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
1560 TEST(item.iItemId==0x02); |
|
1561 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1562 TEST(icon==0x02); |
|
1563 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1564 |
|
1565 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1566 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
1567 TEST(item.iItemId==0x03); |
|
1568 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1569 TEST(icon==0x03); |
|
1570 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1571 |
|
1572 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1573 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
1574 TEST(item.iItemId==0x04); |
|
1575 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1576 TEST(icon==0x04); |
|
1577 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1578 |
|
1579 TEST(setUpMenuV5->GetItemIcon(index, item, iTextAttribute, icon)==KErrNotFound); |
|
1580 |
|
1581 TEST(setUpMenuV5->AddItemIcon(item, icon)==KErrNone); |
|
1582 |
|
1583 // Test other TMenuItemBaseV5::GetItem methods which get the |
|
1584 // item and the text attribute. |
|
1585 // The item and text attribute and icon (when requested) |
|
1586 // should be returned correctly. |
|
1587 // Since there are no actions in the menu, if the client uses one |
|
1588 // of the GetItem methods that requests one, then KErrNotFound should |
|
1589 // be returned |
|
1590 // via the parameter supplied by the client. |
|
1591 index = 1; |
|
1592 |
|
1593 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1594 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute)==KErrNone); |
|
1595 TEST(item.iItemId==0x01); |
|
1596 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1597 |
|
1598 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1599 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
1600 TEST(item.iItemId==0x02); |
|
1601 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1602 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1603 TEST(action==KErrNotFound); |
|
1604 |
|
1605 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1606 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1607 TEST(item.iItemId==0x03); |
|
1608 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1609 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1610 TEST(action==KErrNotFound); |
|
1611 TEST(icon==0x03); |
|
1612 |
|
1613 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1614 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
1615 TEST(item.iItemId==0x04); |
|
1616 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1617 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1618 TEST(action==KErrNotFound); |
|
1619 |
|
1620 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::GetItem and GetItemIcon with TSetUpMenuV5 containing items with no text attributes but with icons passed"),iTestCount++); |
|
1621 |
|
1622 // Test Error Cases - adding actions when the menu can now only contain |
|
1623 // items ALL with item text attributes and icons. |
|
1624 action5=0x00; |
|
1625 icon5=0x00; |
|
1626 |
|
1627 TEST(setUpMenuV5->AddItem(item)==KErrNotSupported); |
|
1628 TEST(setUpMenuV5->AddItem(item, action5)==KErrNotSupported); |
|
1629 TEST(setUpMenuV5->AddItem(item, action5, icon5)==KErrNotSupported); |
|
1630 |
|
1631 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::AddItem with TSetUpMenuV5 containing items with no text attributes but with icons passed"),iTestCount++); |
|
1632 |
|
1633 TEST(setUpMenuV5->AddItem(item, textAttribute1)==KErrNotSupported); |
|
1634 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5)==KErrNotSupported); |
|
1635 TEST(setUpMenuV5->AddItemIcon(item, textAttribute1, icon5)==KErrNotSupported); |
|
1636 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5, icon5)==KErrNotSupported); |
|
1637 |
|
1638 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::AddItem and AddItemIcon with TSetUpMenuV5 containing items with no text attributes but with icons passed"),iTestCount++); |
|
1639 |
|
1640 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd with TSetUpMenuV5 containing items with no text attributes but with icons passed"),iTestCount++); |
|
1641 |
|
1642 // Set Up Menu Cancel |
|
1643 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1644 sat.CancelAsyncRequest(ESatNotifySetUpMenuPCmd); |
|
1645 |
|
1646 User::WaitForRequest(reqStatus); |
|
1647 TEST(reqStatus.Int()==KErrCancel); |
|
1648 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmdCancel with TSetUpMenuV5 containing items with no text attributes but with icons passed"),iTestCount++); |
|
1649 |
|
1650 // |
|
1651 // TSetUpMenuV5 - Set Up Menu - Items with actions and icons but no text attributes |
|
1652 // |
|
1653 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1654 User::WaitForRequest(reqStatus); |
|
1655 TEST(reqStatus.Int()==KErrNone); |
|
1656 |
|
1657 TEST(setUpMenuV5->PCmdNumber()==DSATTSY_SET_UP_MENU_NUMBER); |
|
1658 TEST(!setUpMenuV5->IsRemoveMenu()); |
|
1659 TEST(setUpMenuV5->MenuContent()==DSATTSY_ITEMS_ACTIONS_AND_ICONS); |
|
1660 TEST(setUpMenuV5->NumberOfItems()==0x04); |
|
1661 |
|
1662 index = 1; |
|
1663 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1664 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1665 TEST(item.iItemId==0x01); |
|
1666 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1667 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1668 TEST(icon==0x01); |
|
1669 TEST(action==0x01); |
|
1670 |
|
1671 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1672 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1673 TEST(item.iItemId==0x02); |
|
1674 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1675 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1676 TEST(icon==0x02); |
|
1677 TEST(action==0x02); |
|
1678 |
|
1679 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1680 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1681 TEST(item.iItemId==0x03); |
|
1682 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1683 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1684 TEST(icon==0x03); |
|
1685 TEST(action==0x03); |
|
1686 |
|
1687 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1688 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action, icon)==KErrNone); |
|
1689 TEST(item.iItemId==0x04); |
|
1690 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1691 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1692 TEST(icon==0x04); |
|
1693 TEST(action==0x04); |
|
1694 |
|
1695 TEST(setUpMenuV5->GetItem(index++,item, iTextAttribute, action, icon)==KErrNotFound); |
|
1696 |
|
1697 TEST(setUpMenuV5->AddItem(item, action, icon)==KErrNone); |
|
1698 |
|
1699 // Test other TMenuItemBaseV5::GetItem methods which get the item and the text attribute |
|
1700 // The item and text attribute should be returned correctly. |
|
1701 // Where requested, the icon and action should also be returned correctly. |
|
1702 index = 1; |
|
1703 TEST(setUpMenuV5->GetItem(index++, item)==KErrNone); |
|
1704 TEST(item.iItemId==0x01); |
|
1705 TEST(item.iItemString==DSATTSY_ITEM1); |
|
1706 |
|
1707 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1708 TEST(setUpMenuV5->GetItem(index++, item, iTextAttribute, action)==KErrNone); |
|
1709 TEST(item.iItemId==0x02); |
|
1710 TEST(item.iItemString==DSATTSY_ITEM2); |
|
1711 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1712 TEST(action==0x02); |
|
1713 |
|
1714 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1715 TEST(setUpMenuV5->GetItem(index++, item, action, icon)==KErrNone); |
|
1716 TEST(item.iItemId==0x03); |
|
1717 TEST(item.iItemString==DSATTSY_ITEM3); |
|
1718 TEST(action==0x03); |
|
1719 TEST(icon==0x03); |
|
1720 |
|
1721 iTextAttribute.iStatus = RSat::ETextAttributeNotSet; |
|
1722 TEST(setUpMenuV5->GetItemIcon(index++, item, iTextAttribute, icon)==KErrNone); |
|
1723 TEST(item.iItemId==0x04); |
|
1724 TEST(item.iItemString==DSATTSY_ITEM4); |
|
1725 TEST(iTextAttribute.iStatus == RSat::ETextAttributeNotPresent); |
|
1726 TEST(icon==0x04); |
|
1727 |
|
1728 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::GetItem and GetItemIcon with TSetUpMenuV5 containing items, actions and icons but no text attributes passed"),iTestCount++); |
|
1729 |
|
1730 // Test Error Cases |
|
1731 action5=0x00; |
|
1732 icon5=0x00; |
|
1733 |
|
1734 TEST(setUpMenuV5->AddItem(item)==KErrNotSupported); |
|
1735 TEST(setUpMenuV5->AddItem(item, action5)==KErrNotSupported); |
|
1736 TEST(setUpMenuV5->AddItemIcon(item, icon5)==KErrNotSupported); |
|
1737 |
|
1738 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::AddItem and AddItemIcon with TSetUpMenuV5 containing items, actions and icons but no text attributes passed"),iTestCount++); |
|
1739 |
|
1740 TEST(setUpMenuV5->AddItem(item, textAttribute1)==KErrNotSupported); |
|
1741 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5)==KErrNotSupported); |
|
1742 TEST(setUpMenuV5->AddItemIcon(item, textAttribute1, icon5)==KErrNotSupported); |
|
1743 TEST(setUpMenuV5->AddItem(item, textAttribute1, action5, icon5)==KErrNotSupported); |
|
1744 |
|
1745 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::AddItem and AddItemIcon with TSetUpMenuV5 containing items, actions and icons but no text attributes passed"),iTestCount++); |
|
1746 |
|
1747 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd with TSetUpMenuV5 containing items, actions and icons but no text attributes passed"),iTestCount++); |
|
1748 |
|
1749 // Set Up Menu Cancel |
|
1750 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuV5Pckg); |
|
1751 sat.CancelAsyncRequest(ESatNotifySetUpMenuPCmd); |
|
1752 |
|
1753 User::WaitForRequest(reqStatus); |
|
1754 TEST(reqStatus.Int()==KErrCancel); |
|
1755 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmdCancel with TSetUpMenuV5 containing items, actions and icons but no text attributes passed"),iTestCount++); |
|
1756 |
|
1757 // Set Up Menu - Remove Menu |
|
1758 sat.NotifySetUpMenuPCmd(reqStatus,*setUpMenuPckg); |
|
1759 User::WaitForRequest(reqStatus); |
|
1760 TEST(reqStatus.Int()==KErrNone); |
|
1761 |
|
1762 TEST(setUpMenu->IsRemoveMenu()); |
|
1763 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd - Remove menu - passed"),iTestCount++); |
|
1764 |
|
1765 // Set Up Menu Terminal Rsp |
|
1766 RSat::TSetUpMenuRspV1* setUpMenuRsp = new (ELeave) RSat::TSetUpMenuRspV1; |
|
1767 CleanupStack::PushL(setUpMenuRsp); |
|
1768 RSat::TSetUpMenuRspV1Pckg* setUpMenuRspPckg = new (ELeave) RSat::TSetUpMenuRspV1Pckg(*setUpMenuRsp); |
|
1769 CleanupStack::PushL(setUpMenuRspPckg); |
|
1770 |
|
1771 setUpMenuRsp->SetPCmdNumber(setUpMenu->PCmdNumber()); |
|
1772 setUpMenuRsp->iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS; |
|
1773 setUpMenuRsp->iInfoType=DSATTSY_PCMD_RSP_NO_INFO; |
|
1774 setUpMenuRsp->iAdditionalInfo=DSATTSY_NULL_BUF; |
|
1775 |
|
1776 sat.TerminalRsp(reqStatus, RSat::ESetUpMenu, *setUpMenuRspPckg); |
|
1777 User::WaitForRequest(reqStatus); |
|
1778 TEST(reqStatus.Int()==KErrNone); |
|
1779 INFO_PRINTF2(_L("Test %d - RSat::NotifySetUpMenuPCmd - Set Up Menu - passed"),iTestCount++); |
|
1780 |
|
1781 CleanupStack::PopAndDestroy(6, setUpMenu); |
|
1782 |
|
1783 ExtendedTest3L(); |
|
1784 } |
|
1785 |
|
1786 void CTestSatPCmds1a::ExtendedTest3L() |
|
1787 { |
|
1788 RSat::TMenuItemBaseV1* menu = new (ELeave) RSat::TMenuItemBaseV1; // Load menu then reset |
|
1789 CleanupStack::PushL(menu); |
|
1790 |
|
1791 TInt i; |
|
1792 |
|
1793 for (i=0; i<69; i++) |
|
1794 { |
|
1795 TEST(menu->AddItem(item)==KErrNone); |
|
1796 } |
|
1797 TEST(menu->AddItem(item)==KErrNoMemory); |
|
1798 |
|
1799 menu->Reset(); |
|
1800 TEST(menu->NumberOfItems() == 0); |
|
1801 |
|
1802 for (i=0; i<69; i++) // Reload menu 1 for other tests... |
|
1803 { |
|
1804 TEST(menu->AddItem(item)==KErrNone); |
|
1805 } |
|
1806 TEST(menu->AddItem(item)==KErrNoMemory); |
|
1807 |
|
1808 RSat::TMenuItemBaseV1* menu2 = new (ELeave) RSat::TMenuItemBaseV1; |
|
1809 CleanupStack::PushL(menu2); |
|
1810 |
|
1811 for (i=0; i<54 ; i++) |
|
1812 { |
|
1813 TEST(menu2->AddItem(item,action)==KErrNone); |
|
1814 } |
|
1815 TEST(menu2->AddItem(item,action)==KErrNoMemory); |
|
1816 |
|
1817 RSat::TMenuItemBaseV1* menu3 = new (ELeave) RSat::TMenuItemBaseV1; |
|
1818 CleanupStack::PushL(menu3); |
|
1819 |
|
1820 for (i=0; i<54 ; i++) |
|
1821 { |
|
1822 TEST(menu3->AddItemIcon(item,icon)==KErrNone); |
|
1823 } |
|
1824 TEST(menu3->AddItemIcon(item,icon)==KErrNoMemory); |
|
1825 |
|
1826 RSat::TMenuItemBaseV1* menu4 = new (ELeave) RSat::TMenuItemBaseV1; |
|
1827 CleanupStack::PushL(menu4); |
|
1828 |
|
1829 for (i=0; i<44 ; i++) |
|
1830 { |
|
1831 TEST(menu4->AddItem(item,action, icon)==KErrNone); |
|
1832 } |
|
1833 TEST(menu4->AddItem(item,action, icon)==KErrNoMemory); |
|
1834 |
|
1835 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV1::AddItem - passed"),iTestCount++); |
|
1836 |
|
1837 RSat::TMenuItemBaseV5* menu5 = new (ELeave) RSat::TMenuItemBaseV5; |
|
1838 CleanupStack::PushL(menu5); |
|
1839 |
|
1840 for (i=0; i<44; i++) |
|
1841 { |
|
1842 TEST(menu5->AddItem(item, iTextAttribute)==KErrNone); |
|
1843 } |
|
1844 TEST(menu5->AddItem(item, iTextAttribute)==KErrNoMemory); |
|
1845 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::AddItem - Items with text attributes - passed"),iTestCount++); |
|
1846 |
|
1847 menu5->Reset(); |
|
1848 TEST(menu5->NumberOfItems() == 0); |
|
1849 |
|
1850 for (i=0; i<37; i++) |
|
1851 { |
|
1852 TEST(menu5->AddItem(item, iTextAttribute, action)==KErrNone); |
|
1853 } |
|
1854 TEST(menu5->AddItem(item, iTextAttribute, action)==KErrNoMemory); |
|
1855 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::AddItem - Items with text attributes and actions - passed"),iTestCount++); |
|
1856 |
|
1857 menu5->Reset(); |
|
1858 TEST(menu5->NumberOfItems() == 0); |
|
1859 |
|
1860 for (i=0; i<37; i++) |
|
1861 { |
|
1862 TEST(menu5->AddItemIcon(item, iTextAttribute, icon)==KErrNone); |
|
1863 } |
|
1864 TEST(menu5->AddItemIcon(item, iTextAttribute, icon)==KErrNoMemory); |
|
1865 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::AddItem - Items with text attributes and icons - passed"),iTestCount++); |
|
1866 |
|
1867 menu5->Reset(); |
|
1868 TEST(menu5->NumberOfItems() == 0); |
|
1869 |
|
1870 for (i=0; i<32; i++) |
|
1871 { |
|
1872 TEST(menu5->AddItem(item, iTextAttribute, action, icon)==KErrNone); |
|
1873 } |
|
1874 TEST(menu5->AddItem(item, iTextAttribute, action, icon)==KErrNoMemory); |
|
1875 INFO_PRINTF2(_L("Test %d - RSat::TMenuItemBaseV5::AddItem - Items with text attributes and actions and icons - passed"),iTestCount++); |
|
1876 |
|
1877 menu5->Reset(); |
|
1878 TEST(menu5->NumberOfItems() == 0); |
|
1879 |
|
1880 CleanupStack::PopAndDestroy(5, menu); |
|
1881 } |
|
1882 |
|
1883 |
|
1884 |