|
1 /* |
|
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: SendUIAPITestBlocks implementation |
|
15 |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 // [INCLUDE FILES] - do not remove |
|
29 #include <e32svr.h> |
|
30 #include <StifParser.h> |
|
31 #include <Stiftestinterface.h> |
|
32 #include "SendUIAPITest.h" |
|
33 #include <SendUi.h> |
|
34 #include <EIKENV.H> |
|
35 #include <CMessageData.h> |
|
36 #include <CMessageAddress.h> |
|
37 #include <TSendingCapabilities.h> |
|
38 #include <TXTRICH.H> |
|
39 #include <EIKDEF.H> |
|
40 #include <eikmobs.h> |
|
41 #include <f32file.h> |
|
42 #include <S32MEM.H> |
|
43 #include <CSendingServiceInfo.h> |
|
44 #include <SendUiConsts.h> |
|
45 |
|
46 |
|
47 // EXTERNAL DATA STRUCTURES |
|
48 //extern ?external_data; |
|
49 |
|
50 // EXTERNAL FUNCTION PROTOTYPES |
|
51 //extern ?external_function( ?arg_type,?arg_type ); |
|
52 |
|
53 // CONSTANTS |
|
54 //const ?type ?constant_var = ?constant; |
|
55 _LIT( KTestText, "TestText1234567910"); |
|
56 const TInt KMessageBufferSize = 4 * sizeof(TUint32); |
|
57 const TInt KFilePathSize = 256; |
|
58 const TUid KServideId = {0x10005522}; |
|
59 |
|
60 |
|
61 // MACROS |
|
62 //#define ?macro ?macro_def |
|
63 |
|
64 // LOCAL CONSTANTS AND MACROS |
|
65 //const ?type ?constant_var = ?constant; |
|
66 //#define ?macro_name ?macro_def |
|
67 |
|
68 // MODULE DATA STRUCTURES |
|
69 //enum ?declaration |
|
70 //typedef ?declaration |
|
71 |
|
72 // LOCAL FUNCTION PROTOTYPES |
|
73 //?type ?function_name( ?arg_type, ?arg_type ); |
|
74 |
|
75 // FORWARD DECLARATIONS |
|
76 //class ?FORWARD_CLASSNAME; |
|
77 |
|
78 // ============================= LOCAL FUNCTIONS =============================== |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // ?function_name ?description. |
|
82 // ?description |
|
83 // Returns: ?value_1: ?description |
|
84 // ?value_n: ?description_line1 |
|
85 // ?description_line2 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 CMessageData* CSendUIAPITest::InitL( |
|
89 ) |
|
90 { |
|
91 if(!iMessageData) |
|
92 { |
|
93 iMessageData = CMessageData::NewL(); |
|
94 } |
|
95 return iMessageData; |
|
96 } |
|
97 |
|
98 // ============================ MEMBER FUNCTIONS =============================== |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CSendUIAPITest::Delete |
|
102 // Delete here all resources allocated and opened from test methods. |
|
103 // Called from destructor. |
|
104 // ----------------------------------------------------------------------------- |
|
105 // |
|
106 void CSendUIAPITest::Delete() |
|
107 { |
|
108 // Print to UI |
|
109 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
110 _LIT( KDelete, "In Delete" ); |
|
111 TestModuleIf().Printf( 0, KSendUIAPITest, KDelete ); |
|
112 // Print to log file |
|
113 iLog->Log( KDelete ); |
|
114 |
|
115 if(iMessageData) |
|
116 { |
|
117 // Delete Message Data Object |
|
118 _LIT( KDeleteObj, "Delete CMessageData Object" ); |
|
119 iLog->Log( KDeleteObj ); |
|
120 delete iMessageData; |
|
121 iMessageData = NULL; |
|
122 } |
|
123 if(iMessageAddress) |
|
124 { |
|
125 // Print to log file |
|
126 _LIT( KDeleteMsgAdrObj, "Delete CMessageAddress Object" ); |
|
127 iLog->Log( KDeleteMsgAdrObj ); |
|
128 delete iMessageAddress; |
|
129 iMessageAddress = NULL; |
|
130 } |
|
131 } |
|
132 |
|
133 // ----------------------------------------------------------------------------- |
|
134 // CSendUIAPITest::RunMethodL |
|
135 // Run specified method. Contains also table of test mothods and their names. |
|
136 // ----------------------------------------------------------------------------- |
|
137 // |
|
138 TInt CSendUIAPITest::RunMethodL( |
|
139 CStifItemParser& aItem ) |
|
140 { |
|
141 |
|
142 static TStifFunctionInfo const KFunctions[] = |
|
143 { |
|
144 // Copy this line for every implemented function. |
|
145 // First string is the function name used in TestScripter script file. |
|
146 // Second is the actual implementation member function. |
|
147 //ENTRY( "Example", CSendUIAPITest::ExampleL ), |
|
148 //CMessageData |
|
149 ENTRY( "MessageDataNewL", CSendUIAPITest::TestMessageDataNewL ), |
|
150 ENTRY( "MessageDataSetSubjectL", CSendUIAPITest::TestMessageDataSetSubjectL ), |
|
151 ENTRY( "MessageDataSubject", CSendUIAPITest::TestMessageDataSubjectL ), |
|
152 ENTRY( "MessageDataAppendAttachmentL", CSendUIAPITest::TestMessageDataAppendAttachmentL ), |
|
153 ENTRY( "MessageDataAttachmentArray", CSendUIAPITest::TestMessageDataAttachmentArrayL ), |
|
154 ENTRY( "MessageDataClearAttachmentArray", CSendUIAPITest::TestMessageDataClearAttachmentArrayL ), |
|
155 ENTRY( "MessageDataAppendToAddressL", CSendUIAPITest::TestMessageDataAppendToAddressL ), |
|
156 ENTRY( "MessageDataToAddressArray", CSendUIAPITest::TestMessageDataToAddressArrayL ), |
|
157 ENTRY( "MessageDataAppendCcAddressL", CSendUIAPITest::TestMessageDataAppendCcAddressL ), |
|
158 ENTRY( "MessageDataCcAddressArray", CSendUIAPITest::TestMessageDataCcAddressArrayL ), |
|
159 ENTRY( "MessageDataAppendBccAddressL", CSendUIAPITest::TestMessageDataAppendBccAddressL ), |
|
160 ENTRY( "MessageDataBccAddressArray", CSendUIAPITest::TestMessageDataBccAddressArrayL ), |
|
161 ENTRY( "MessageDataSetBodyTextL", CSendUIAPITest::TestMessageDataSetBodyTextL ), |
|
162 ENTRY( "MessageDataBodyText", CSendUIAPITest::TestMessageDataBodyTextL ), |
|
163 ENTRY( "MessageDataAppendAttachmentHandleL", CSendUIAPITest::TestAppendAttachmentHandleL ), |
|
164 ENTRY( "MessageDataAttachmentHandleArray", CSendUIAPITest::TestAttachmentHandleArrayL ), |
|
165 ENTRY( "MessageDataDataType", CSendUIAPITest::TestDataTypeL ), |
|
166 ENTRY( "MessageDataClearAddresses", CSendUIAPITest::ClearAddressesL ), |
|
167 ENTRY( "MessageDataExternalizeLnInternalizeL", CSendUIAPITest::TestExternalizeLnInternalizeL ), |
|
168 //CMessageAddress |
|
169 ENTRY( "MessageAddressNewL", CSendUIAPITest::TestCMessageAddressNewL ), |
|
170 ENTRY( "MessageAddressSetAddressL", CSendUIAPITest::TestMsgAdrsSetAddressL ), |
|
171 ENTRY( "MessageAddressAddress", CSendUIAPITest::TestMsgAdrsAddress ), |
|
172 ENTRY( "MessageAddressSetAliasL", CSendUIAPITest::TestMsgAdrsSetAliasL ), |
|
173 ENTRY( "MessageAddressAlias", CSendUIAPITest::TestMsgAdrsAlias ), |
|
174 |
|
175 ENTRY( "MessageAddressExternalizeL", CSendUIAPITest::TestMsgAdrsExternalizeL ), |
|
176 ENTRY( "MessageAddressInternalizeL", CSendUIAPITest::TestMsgAdrsInternalizeL ), |
|
177 ENTRY( "MessageDataSetOpaqueDataL", CSendUIAPITest::TestSetOpaqueDataL ), |
|
178 ENTRY( "MessageDataOpaqueDataL", CSendUIAPITest::TestOpaqueDataL ), |
|
179 ENTRY( "SendingServiceInfoCopyLC", CSendUIAPITest::TestCopyLC ), |
|
180 ENTRY( "SendingServiceInfoSetTechnologyTypeId", CSendUIAPITest::TestSetTechnologyTypeIdL ), |
|
181 |
|
182 //TSendingCapabilities |
|
183 ENTRY( "TSendingCapabilities", CSendUIAPITest::TestTSendingCapabilities ), |
|
184 //CSendingServiceInfo |
|
185 ENTRY( "SendingServiceInfoServiceID", CSendUIAPITest::TestServiceIDL ), |
|
186 ENTRY( "SendingServiceInfoServiceProviderID", CSendUIAPITest::TestServiceProviderIDL ), |
|
187 ENTRY( "SendingServiceInfoServiceCapabilities", CSendUIAPITest::TestServiceCapabilitiesL ), |
|
188 //ADD NEW ENTRY HERE |
|
189 // [test cases entries] - Do not remove |
|
190 |
|
191 }; |
|
192 |
|
193 const TInt count = sizeof( KFunctions ) / |
|
194 sizeof( TStifFunctionInfo ); |
|
195 |
|
196 return RunInternalL( KFunctions, count, aItem ); |
|
197 |
|
198 } |
|
199 |
|
200 // ----------------------------------------------------------------------------- |
|
201 // CSendUIAPITest::ExampleL |
|
202 // Example test method function. |
|
203 // (other items were commented in a header). |
|
204 // ----------------------------------------------------------------------------- |
|
205 // |
|
206 TInt CSendUIAPITest::ExampleL( CStifItemParser& aItem ) |
|
207 { |
|
208 |
|
209 // Print to UI |
|
210 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
211 _LIT( KExample, "In Example" ); |
|
212 TestModuleIf().Printf( 0, KSendUIAPITest, KExample ); |
|
213 // Print to log file |
|
214 iLog->Log( KExample ); |
|
215 |
|
216 TInt i = 0; |
|
217 TPtrC string; |
|
218 _LIT( KParam, "Param[%i]: %S" ); |
|
219 while ( aItem.GetNextString ( string ) == KErrNone ) |
|
220 { |
|
221 TestModuleIf().Printf( i, KSendUIAPITest, |
|
222 KParam, i, &string ); |
|
223 i++; |
|
224 } |
|
225 return KErrNone; |
|
226 |
|
227 } |
|
228 |
|
229 // ----------------------------------------------------------------------------- |
|
230 // CSendUIAPITest::?TestMessageDataNewL |
|
231 // ?Test Case for Calling CMessageData's NewL fun |
|
232 // (other items were commented in a header). |
|
233 // ----------------------------------------------------------------------------- |
|
234 // |
|
235 |
|
236 TInt CSendUIAPITest::TestMessageDataNewL( CStifItemParser& aItem ) |
|
237 { |
|
238 // Print to UI |
|
239 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
240 _LIT( KNewL, "In NewL" ); |
|
241 TestModuleIf().Printf( 0, KSendUIAPITest, KNewL ); |
|
242 // Print to log file |
|
243 iLog->Log( KNewL); |
|
244 |
|
245 //Create the object of CSendUIAPITest |
|
246 CMessageData* messagedata = InitL(); |
|
247 //Check the instance of CMessageData |
|
248 if(messagedata) |
|
249 { |
|
250 return KErrNone; |
|
251 } |
|
252 else |
|
253 { |
|
254 return KErrGeneral; |
|
255 } |
|
256 } |
|
257 |
|
258 // ----------------------------------------------------------------------------- |
|
259 // CSendUIAPITest::?TestMessageDataSetSubjectL |
|
260 // ?Test Case for Calling CMessageData's SetSubjectL fun |
|
261 // (other items were commented in a header). |
|
262 // ----------------------------------------------------------------------------- |
|
263 // |
|
264 |
|
265 TInt CSendUIAPITest::TestMessageDataSetSubjectL( CStifItemParser& aItem ) |
|
266 { |
|
267 // Print to UI |
|
268 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
269 _LIT( KSetSubjectL, "In SetSubjectL" ); |
|
270 TestModuleIf().Printf( 0, KSendUIAPITest, KSetSubjectL ); |
|
271 // Print to log file |
|
272 iLog->Log( KSetSubjectL); |
|
273 |
|
274 //Create the instance of CMessageData |
|
275 CMessageData* messagedata = InitL(); |
|
276 |
|
277 TPtrC subject; |
|
278 //Get the subject from cfg file |
|
279 aItem.GetNextString(subject); |
|
280 //Set the subject |
|
281 TRAPD(err,messagedata->SetSubjectL(&subject)); |
|
282 if(err == KErrNone) |
|
283 { |
|
284 return KErrNone; |
|
285 } |
|
286 else |
|
287 { |
|
288 return err; |
|
289 } |
|
290 } |
|
291 |
|
292 // ----------------------------------------------------------------------------- |
|
293 // CSendUIAPITest::?TestMessageDataSubjectL |
|
294 // ?Test Case for Calling CMessageData's Subject fun |
|
295 // (other items were commented in a header). |
|
296 // ----------------------------------------------------------------------------- |
|
297 // |
|
298 |
|
299 TInt CSendUIAPITest::TestMessageDataSubjectL( CStifItemParser& aItem ) |
|
300 { |
|
301 // Print to UI |
|
302 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
303 _LIT( KSubject, "In Subject" ); |
|
304 TestModuleIf().Printf( 0, KSendUIAPITest, KSubject ); |
|
305 // Print to log file |
|
306 iLog->Log( KSubject); |
|
307 |
|
308 //Create the instance of CMessageData |
|
309 CMessageData* messagedata = InitL(); |
|
310 //Get the subject from message data |
|
311 TPtrC msgdatasubject = messagedata->Subject(); |
|
312 |
|
313 TPtrC msgsubject; |
|
314 //Get the subject from cfg file |
|
315 aItem.GetNextString(msgsubject); |
|
316 //Compare the two subjects |
|
317 if(msgdatasubject == msgsubject) |
|
318 { |
|
319 return KErrNone; |
|
320 } |
|
321 else |
|
322 { |
|
323 return KErrGeneral; |
|
324 } |
|
325 } |
|
326 |
|
327 // ----------------------------------------------------------------------------- |
|
328 // CSendUIAPITest::?TestMessageDataAppendAttachmentL |
|
329 // ?Test Case for Calling CMessageData's AppendAttachmentL fun |
|
330 // (other items were commented in a header). |
|
331 // ----------------------------------------------------------------------------- |
|
332 // |
|
333 |
|
334 TInt CSendUIAPITest::TestMessageDataAppendAttachmentL( CStifItemParser& aItem ) |
|
335 { |
|
336 // Print to UI |
|
337 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
338 _LIT( KAppendAttachmentL, "In AppendAttachmentL" ); |
|
339 TestModuleIf().Printf( 0, KSendUIAPITest, KAppendAttachmentL ); |
|
340 // Print to log file |
|
341 iLog->Log( KAppendAttachmentL); |
|
342 |
|
343 //Create the instance of CMessageData |
|
344 CMessageData* messagedata = InitL(); |
|
345 |
|
346 TPtrC filepath; |
|
347 //Get the file path from cfg file |
|
348 aItem.GetNextString(filepath); |
|
349 TDesC filepathdesc(filepath); |
|
350 |
|
351 //Append the file path in message data |
|
352 TRAPD(err,messagedata->AppendAttachmentL(filepath)); |
|
353 if(err == KErrNone) |
|
354 { |
|
355 return KErrNone; |
|
356 } |
|
357 |
|
358 else |
|
359 { |
|
360 return err; |
|
361 } |
|
362 |
|
363 } |
|
364 |
|
365 // ----------------------------------------------------------------------------- |
|
366 // CSendUIAPITest::?TestMessageDataAttachmentArrayL |
|
367 // ?Test Case for Calling CMessageData's AttachmentArray fun |
|
368 // (other items were commented in a header). |
|
369 // ----------------------------------------------------------------------------- |
|
370 // |
|
371 |
|
372 TInt CSendUIAPITest::TestMessageDataAttachmentArrayL( CStifItemParser& aItem ) |
|
373 { |
|
374 // Print to UI |
|
375 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
376 _LIT( KAttachmentArray, "In AttachmentArray" ); |
|
377 TestModuleIf().Printf( 0, KSendUIAPITest, KAttachmentArray ); |
|
378 // Print to log file |
|
379 iLog->Log( KAttachmentArray); |
|
380 |
|
381 //Create the instance of CMessageData |
|
382 CMessageData* messagedata = InitL(); |
|
383 |
|
384 //Get the Array of attachment file paths and check the count |
|
385 TInt count = messagedata->AttachmentArray().Count(); |
|
386 if(count > 0) |
|
387 { |
|
388 return KErrNone; |
|
389 } |
|
390 else |
|
391 { |
|
392 return KErrGeneral; |
|
393 } |
|
394 } |
|
395 |
|
396 // ----------------------------------------------------------------------------- |
|
397 // CSendUIAPITest::?TestMessageDataClearAttachmentArrayL |
|
398 // ?Test Case for Calling CMessageData's ClearAttachmentArray fun |
|
399 // (other items were commented in a header). |
|
400 // ----------------------------------------------------------------------------- |
|
401 // |
|
402 |
|
403 TInt CSendUIAPITest::TestMessageDataClearAttachmentArrayL( CStifItemParser& aItem ) |
|
404 { |
|
405 // Print to UI |
|
406 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
407 _LIT( KClearAttachmentArray, "In ClearAttachmentArray" ); |
|
408 TestModuleIf().Printf( 0, KSendUIAPITest, KClearAttachmentArray ); |
|
409 // Print to log file |
|
410 iLog->Log( KClearAttachmentArray); |
|
411 |
|
412 //Create the instance of CMessageData |
|
413 CMessageData* messagedata = InitL(); |
|
414 |
|
415 //Clears the array of attachment file paths |
|
416 messagedata->ClearAttachmentArray(); |
|
417 |
|
418 TInt attacharraycount; |
|
419 //Get the attachment arry count from cfg file |
|
420 aItem.GetNextInt(attacharraycount); |
|
421 //Compare the two counts |
|
422 if(attacharraycount == messagedata->AttachmentArray().Count()) |
|
423 { |
|
424 return KErrNone; |
|
425 } |
|
426 else |
|
427 { |
|
428 return KErrGeneral; |
|
429 } |
|
430 } |
|
431 |
|
432 // ----------------------------------------------------------------------------- |
|
433 // CSendUIAPITest::?TestMessageDataAppendToAddressL |
|
434 // ?Test Case for Calling CMessageData's AppendToAddressL fun |
|
435 // (other items were commented in a header). |
|
436 // ----------------------------------------------------------------------------- |
|
437 // |
|
438 |
|
439 TInt CSendUIAPITest::TestMessageDataAppendToAddressL( CStifItemParser& aItem ) |
|
440 { |
|
441 // Print to UI |
|
442 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
443 _LIT( KAppendToAddressL, "In AppendToAddressL" ); |
|
444 TestModuleIf().Printf( 0, KSendUIAPITest, KAppendToAddressL ); |
|
445 // Print to log file |
|
446 iLog->Log( KAppendToAddressL); |
|
447 |
|
448 //Create the instance of CMessageData |
|
449 CMessageData* messagedata = InitL(); |
|
450 |
|
451 //Get the address from cfg file to append |
|
452 TPtrC addressone; |
|
453 aItem.GetNextString(addressone); |
|
454 |
|
455 TPtrC aliasone; |
|
456 aItem.GetNextString(aliasone); |
|
457 |
|
458 //Append the address to array |
|
459 TRAPD(err, messagedata->AppendToAddressL( addressone, aliasone )); |
|
460 if(err == KErrNone) |
|
461 { |
|
462 return KErrNone; |
|
463 } |
|
464 else |
|
465 { |
|
466 return err; |
|
467 } |
|
468 } |
|
469 |
|
470 // ----------------------------------------------------------------------------- |
|
471 // CSendUIAPITest::?TestMessageDataToAddressArrayL |
|
472 // ?Test Case for Calling CMessageData's ToAddressArray fun |
|
473 // (other items were commented in a header). |
|
474 // ----------------------------------------------------------------------------- |
|
475 // |
|
476 |
|
477 TInt CSendUIAPITest::TestMessageDataToAddressArrayL( CStifItemParser& aItem ) |
|
478 { |
|
479 // Print to UI |
|
480 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
481 _LIT( KToAddressArray, "In ToAddressArray" ); |
|
482 TestModuleIf().Printf( 0, KSendUIAPITest, KToAddressArray ); |
|
483 // Print to log file |
|
484 iLog->Log( KToAddressArray); |
|
485 |
|
486 //Create the instance of CMessageData |
|
487 CMessageData* messagedata = InitL(); |
|
488 |
|
489 TInt addresscount; |
|
490 aItem.GetNextInt(addresscount); |
|
491 |
|
492 //Get array of addresses and aliases and compare the count |
|
493 if(addresscount == messagedata->ToAddressArray().Count() ) |
|
494 { |
|
495 return KErrNone; |
|
496 } |
|
497 else |
|
498 { |
|
499 return KErrGeneral; |
|
500 } |
|
501 } |
|
502 |
|
503 // ----------------------------------------------------------------------------- |
|
504 // CSendUIAPITest::?TestMessageDataAppendCcAddressL |
|
505 // ?Test Case for Calling CMessageData's AppendCcAddressL fun |
|
506 // (other items were commented in a header). |
|
507 // ----------------------------------------------------------------------------- |
|
508 // |
|
509 |
|
510 TInt CSendUIAPITest::TestMessageDataAppendCcAddressL( CStifItemParser& aItem ) |
|
511 { |
|
512 // Print to UI |
|
513 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
514 _LIT( KAppendCcAddressL, "In AppendCcAddressL" ); |
|
515 TestModuleIf().Printf( 0, KSendUIAPITest, KAppendCcAddressL ); |
|
516 // Print to log file |
|
517 iLog->Log( KAppendCcAddressL); |
|
518 |
|
519 //Create the instance of CMessageData |
|
520 CMessageData* messagedata = InitL(); |
|
521 //Get the two ccaddresses from cfg file |
|
522 TPtrC ccaddressone; |
|
523 aItem.GetNextString(ccaddressone); |
|
524 |
|
525 TPtrC ccaliasone; |
|
526 aItem.GetNextString(ccaliasone); |
|
527 |
|
528 //Append the CC addresses in message data |
|
529 TRAPD(err , messagedata->AppendCcAddressL( ccaddressone, ccaliasone )); |
|
530 if(err == KErrNone) |
|
531 { |
|
532 return KErrNone; |
|
533 } |
|
534 else |
|
535 { |
|
536 return err; |
|
537 } |
|
538 } |
|
539 |
|
540 // ----------------------------------------------------------------------------- |
|
541 // CSendUIAPITest::?TestMessageDataCcAddressArrayL |
|
542 // ?Test Case for Calling CMessageData's CcAddressArray fun |
|
543 // (other items were commented in a header). |
|
544 // ----------------------------------------------------------------------------- |
|
545 // |
|
546 |
|
547 TInt CSendUIAPITest::TestMessageDataCcAddressArrayL( CStifItemParser& aItem ) |
|
548 { |
|
549 // Print to UI |
|
550 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
551 _LIT( KCcAddressArray, "In CcAddressArray" ); |
|
552 TestModuleIf().Printf( 0, KSendUIAPITest, KCcAddressArray ); |
|
553 // Print to log file |
|
554 iLog->Log( KCcAddressArray); |
|
555 |
|
556 //Create the instance of CMessageData |
|
557 CMessageData* messagedata = InitL(); |
|
558 |
|
559 //Get the count of cc address from cfg file |
|
560 TInt ccaddresscount; |
|
561 aItem.GetNextInt(ccaddresscount); |
|
562 |
|
563 //Get the CC address count from message data and compare |
|
564 if(ccaddresscount == messagedata->CcAddressArray().Count()) |
|
565 { |
|
566 return KErrNone; |
|
567 } |
|
568 |
|
569 else |
|
570 { |
|
571 return KErrGeneral; |
|
572 } |
|
573 } |
|
574 |
|
575 // ----------------------------------------------------------------------------- |
|
576 // CSendUIAPITest::?TestMessageDataAppendBccAddressL |
|
577 // ?Test Case for Calling CMessageData's AppendBccAddressL fun |
|
578 // (other items were commented in a header). |
|
579 // ----------------------------------------------------------------------------- |
|
580 // |
|
581 |
|
582 TInt CSendUIAPITest::TestMessageDataAppendBccAddressL( CStifItemParser& aItem ) |
|
583 { |
|
584 // Print to UI |
|
585 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
586 _LIT( KAppendBccAddressL, "In AppendBccAddressL" ); |
|
587 TestModuleIf().Printf( 0, KSendUIAPITest, KAppendBccAddressL ); |
|
588 // Print to log file |
|
589 iLog->Log( KAppendBccAddressL); |
|
590 |
|
591 //Create the instance of CMessageData |
|
592 CMessageData* messagedata = InitL(); |
|
593 |
|
594 //Get the two bccaddresses from cfg file |
|
595 TPtrC bccaddressone; |
|
596 aItem.GetNextString(bccaddressone); |
|
597 |
|
598 TPtrC bccaliasone; |
|
599 aItem.GetNextString(bccaliasone); |
|
600 |
|
601 //Append the BCC addresses to message data |
|
602 TRAPD(err , messagedata->AppendBccAddressL( bccaddressone, bccaliasone )); |
|
603 if(err == KErrNone) |
|
604 { |
|
605 return KErrNone; |
|
606 } |
|
607 else |
|
608 { |
|
609 return err; |
|
610 } |
|
611 } |
|
612 |
|
613 // ----------------------------------------------------------------------------- |
|
614 // CSendUIAPITest::?TestMessageDataBccAddressArrayL |
|
615 // ?Test Case for Calling CMessageData's BccAddressArray fun |
|
616 // (other items were commented in a header). |
|
617 // ----------------------------------------------------------------------------- |
|
618 // |
|
619 |
|
620 TInt CSendUIAPITest::TestMessageDataBccAddressArrayL( CStifItemParser& aItem ) |
|
621 { |
|
622 // Print to UI |
|
623 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
624 _LIT( KBccAddressArray, "In BccAddressArray" ); |
|
625 TestModuleIf().Printf( 0, KSendUIAPITest, KBccAddressArray ); |
|
626 // Print to log file |
|
627 iLog->Log( KBccAddressArray); |
|
628 |
|
629 //Create the instance of CMessageData |
|
630 CMessageData* messagedata = InitL(); |
|
631 |
|
632 //Get the appended cc address count from cfg file |
|
633 TInt ccaddresscount; |
|
634 aItem.GetNextInt(ccaddresscount); |
|
635 |
|
636 //Get the cc address count from message data and compare |
|
637 if(ccaddresscount == messagedata->BccAddressArray().Count()) |
|
638 { |
|
639 return KErrNone; |
|
640 } |
|
641 else |
|
642 { |
|
643 return KErrGeneral; |
|
644 } |
|
645 } |
|
646 |
|
647 // ----------------------------------------------------------------------------- |
|
648 // CSendUIAPITest::?TestMessageDataSetBodyTextL |
|
649 // ?Test Case for Calling CMessageData's SetBodyTextL fun |
|
650 // (other items were commented in a header). |
|
651 // ----------------------------------------------------------------------------- |
|
652 // |
|
653 |
|
654 TInt CSendUIAPITest::TestMessageDataSetBodyTextL( CStifItemParser& aItem ) |
|
655 { |
|
656 // Print to UI |
|
657 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
658 _LIT( KSetBodyTextL, "In SetBodyTextL" ); |
|
659 TestModuleIf().Printf( 0, KSendUIAPITest, KSetBodyTextL ); |
|
660 // Print to log file |
|
661 iLog->Log( KSetBodyTextL); |
|
662 |
|
663 //Create the instance of CMessageData |
|
664 CMessageData* messagedata = InitL(); |
|
665 //Get the Message body from cfg file |
|
666 TPtrC messagesubject; |
|
667 aItem.GetNextString(messagesubject); |
|
668 |
|
669 CEikonEnv* eikonEnv = CEikonEnv::Static(); |
|
670 //Create the rich text object |
|
671 CRichText* bodyText = CRichText::NewL( eikonEnv->SystemParaFormatLayerL(), |
|
672 eikonEnv->SystemCharFormatLayerL() ); |
|
673 CleanupStack::PushL( bodyText ); |
|
674 //Insert the text from cfg file to message body |
|
675 bodyText->InsertL( 0,messagesubject); |
|
676 |
|
677 TRAPD(err, messagedata->SetBodyTextL(bodyText)); |
|
678 if(err == KErrNone) |
|
679 { |
|
680 CleanupStack::PopAndDestroy( bodyText ); |
|
681 return KErrNone; |
|
682 } |
|
683 else |
|
684 { |
|
685 CleanupStack::PopAndDestroy( bodyText ); |
|
686 return err; |
|
687 } |
|
688 } |
|
689 |
|
690 // ----------------------------------------------------------------------------- |
|
691 // CSendUIAPITest::?TestMessageDataBodyTextL |
|
692 // ?Test Case for Calling CMessageData's BodyText fun |
|
693 // (other items were commented in a header). |
|
694 // ----------------------------------------------------------------------------- |
|
695 // |
|
696 |
|
697 TInt CSendUIAPITest::TestMessageDataBodyTextL( CStifItemParser& aItem ) |
|
698 { |
|
699 // Print to UI |
|
700 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
701 _LIT( KBodyText, "In BodyText" ); |
|
702 TestModuleIf().Printf( 0, KSendUIAPITest, KBodyText ); |
|
703 // Print to log file |
|
704 iLog->Log( KBodyText); |
|
705 |
|
706 //Create the instance of CMessageData |
|
707 CMessageData* messagedata = InitL(); |
|
708 //Get the MessageBody text length |
|
709 TInt msgbodylen = messagedata->BodyText()->DocumentLength(); |
|
710 TInt len; |
|
711 aItem.GetNextInt(len); |
|
712 //If the length passed from cfg file and and Body text length same |
|
713 if(len == msgbodylen) |
|
714 { |
|
715 return KErrNone; |
|
716 } |
|
717 else |
|
718 { |
|
719 return KErrGeneral; |
|
720 } |
|
721 } |
|
722 |
|
723 // ----------------------------------------------------------------------------- |
|
724 // CSendUIAPITest::?TestAppendAttachmentHandleL |
|
725 // ?Test Case for Calling CMessageData's AppendAttachmentHandleL fun |
|
726 // (other items were commented in a header). |
|
727 // ----------------------------------------------------------------------------- |
|
728 // |
|
729 |
|
730 TInt CSendUIAPITest::TestAppendAttachmentHandleL( CStifItemParser& aItem ) |
|
731 { |
|
732 // Print to UI |
|
733 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
734 _LIT( KAppendAttachmentHandleL, "In AppendAttachmentHandleL" ); |
|
735 TestModuleIf().Printf( 0, KSendUIAPITest, KAppendAttachmentHandleL ); |
|
736 // Print to log file |
|
737 iLog->Log( KAppendAttachmentHandleL); |
|
738 |
|
739 //Create the instance of CMessageData |
|
740 CMessageData* messagedata = InitL(); |
|
741 |
|
742 RFs fs; |
|
743 User::LeaveIfError(fs.Connect()); |
|
744 fs.ShareProtected(); |
|
745 RFile file; |
|
746 //Get the attachment from cfg file |
|
747 TPtrC attachfile; |
|
748 aItem.GetNextString(attachfile); |
|
749 TDesC attachfiledesc(attachfile); |
|
750 |
|
751 #ifdef __WINSCW__ |
|
752 _LIT( KTestFilePath, "c:\\Data\\TestData\\SendUIAPITest\\%S" ); |
|
753 #else |
|
754 _LIT( KTestFilePath, "e:\\testing\\data\\SendUIAPITest\\%S" ); |
|
755 #endif |
|
756 |
|
757 TBuf16<KFilePathSize> fileName; |
|
758 fileName.Format( KTestFilePath, &attachfile ); |
|
759 //Open the file |
|
760 TInt err = file.Open(fs, fileName, EFileRead); |
|
761 if(err != KErrNone) |
|
762 { |
|
763 _LIT( KFileError, "Unable to Open File" ); |
|
764 iLog->Log(KFileError); |
|
765 fs.Close(); |
|
766 return err; |
|
767 } |
|
768 CleanupClosePushL(file); |
|
769 //Appends attachment handle to the array of attachment handles |
|
770 TRAPD(errtwo, messagedata->AppendAttachmentHandleL(file)); |
|
771 |
|
772 CleanupStack::PopAndDestroy( &file ); |
|
773 fs.Close(); |
|
774 if(errtwo == KErrNone) |
|
775 { |
|
776 return KErrNone; |
|
777 } |
|
778 else |
|
779 { |
|
780 return errtwo; |
|
781 } |
|
782 } |
|
783 |
|
784 // ----------------------------------------------------------------------------- |
|
785 // CSendUIAPITest::?TestAttachmentHandleArrayL |
|
786 // ?Test Case for Calling CMessageData's AttachmentHandleArray fun |
|
787 // return Array of attachment handles. |
|
788 // ----------------------------------------------------------------------------- |
|
789 // |
|
790 |
|
791 TInt CSendUIAPITest::TestAttachmentHandleArrayL( CStifItemParser& aItem ) |
|
792 { |
|
793 // Print to UI |
|
794 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
795 _LIT( KAttachmentHandleArray, "In KAttachmentHandleArray" ); |
|
796 TestModuleIf().Printf( 0, KSendUIAPITest, KAttachmentHandleArray ); |
|
797 // Print to log file |
|
798 iLog->Log( KAttachmentHandleArray); |
|
799 |
|
800 //Create the instance of CMessageData |
|
801 CMessageData* messagedata = InitL(); |
|
802 |
|
803 //Get the count of AttachmentHandle from cfg file |
|
804 TInt attachmentHandleCnt; |
|
805 aItem.GetNextInt(attachmentHandleCnt); |
|
806 |
|
807 const RArray<RFile>& attachments = messagedata->AttachmentHandleArray(); |
|
808 //Compare the two counts |
|
809 if ( attachments.Count() == attachmentHandleCnt ) |
|
810 { |
|
811 return KErrNone; |
|
812 } |
|
813 else |
|
814 { |
|
815 return KErrGeneral; |
|
816 } |
|
817 } |
|
818 |
|
819 // ----------------------------------------------------------------------------- |
|
820 // CSendUIAPITest::?DataTypeL |
|
821 // ?Test Case for Calling CMessageData's DataType fun |
|
822 // return Data type id. |
|
823 // ----------------------------------------------------------------------------- |
|
824 // |
|
825 |
|
826 TInt CSendUIAPITest::TestDataTypeL( CStifItemParser& aItem ) |
|
827 { |
|
828 // Print to UI |
|
829 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
830 _LIT( KDataType, "In DataType" ); |
|
831 TestModuleIf().Printf( 0, KSendUIAPITest, KDataType ); |
|
832 // Print to log file |
|
833 iLog->Log( KDataType); |
|
834 |
|
835 //Create the instance of CMessageData |
|
836 CMessageData* messagedata = InitL(); |
|
837 TUid dType = messagedata->DataType() ; |
|
838 if ( dType != KNullUid ) |
|
839 { |
|
840 return KErrNone; |
|
841 } |
|
842 else |
|
843 { |
|
844 return KErrGeneral; |
|
845 } |
|
846 } |
|
847 |
|
848 // ----------------------------------------------------------------------------- |
|
849 // CSendUIAPITest::?ClearAddressesL |
|
850 // ?Test Case for Calling CMessageData's ClearAddresses fun |
|
851 // Clears all addressee arrays. |
|
852 // ----------------------------------------------------------------------------- |
|
853 // |
|
854 |
|
855 TInt CSendUIAPITest::ClearAddressesL( CStifItemParser& aItem ) |
|
856 { |
|
857 // Print to UI |
|
858 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
859 _LIT( KClearAddresses, "In ClearAddresses" ); |
|
860 TestModuleIf().Printf( 0, KSendUIAPITest, KClearAddresses ); |
|
861 // Print to log file |
|
862 iLog->Log( KClearAddresses); |
|
863 |
|
864 //Create the instance of CMessageData |
|
865 CMessageData* messagedata = InitL(); |
|
866 messagedata->ClearAddresses(); |
|
867 if ( messagedata->ToAddressArray().Count() == 0 ) |
|
868 { |
|
869 return KErrNone; |
|
870 } |
|
871 else |
|
872 { |
|
873 return KErrGeneral; |
|
874 } |
|
875 } |
|
876 // ----------------------------------------------------------------------------- |
|
877 // CSendUIAPITest::?TestExternalizeLnInternalizeL |
|
878 // ?Test Case for Calling CMessageData's ExternalizeL and InternalizeL funs |
|
879 // Externalizes and Internalize message data to and from stream |
|
880 // ----------------------------------------------------------------------------- |
|
881 // |
|
882 TInt CSendUIAPITest::TestExternalizeLnInternalizeL(CStifItemParser& aItem) |
|
883 { |
|
884 // Print to UI |
|
885 #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) |
|
886 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
887 _LIT( KTestExternalizeLnInternalizeL, "In TestExternalizeLnInternalizeL" ); |
|
888 TestModuleIf().Printf( 0, KSendUIAPITest, KTestExternalizeLnInternalizeL ); |
|
889 |
|
890 //Create the instance of CMessageData |
|
891 CMessageData* messagedata = InitL(); |
|
892 |
|
893 //Get the two suject from cfg file |
|
894 TPtrC subjectone; |
|
895 aItem.GetNextString(subjectone); |
|
896 TPtrC subjecttwo; |
|
897 aItem.GetNextString(subjecttwo); |
|
898 |
|
899 //Set the first subject to message data |
|
900 MsgDataSetSubjectL( subjectone); |
|
901 //Externalize the message data class so that first subject is stored |
|
902 ExternalizeL(); |
|
903 //Set the second subject to message data |
|
904 MsgDataSetSubjectL( subjecttwo ); |
|
905 //Internalize the message data class so that stored data can be retrived |
|
906 InternalizeL(); |
|
907 //Get the message-data class stored data and compare with the one stored earlier |
|
908 if(MsgDataCompSubjectL(subjectone) == KErrNone) |
|
909 { |
|
910 //Twwo datas are same |
|
911 return KErrNone; |
|
912 } |
|
913 else |
|
914 { |
|
915 //Twwo datas differ |
|
916 return KErrGeneral; |
|
917 } |
|
918 #endif |
|
919 iLog->Log(_L("test case TestExternalizeLnInternalizeL not intended for 3.0 and 3.1")); |
|
920 return KErrNone; |
|
921 } |
|
922 |
|
923 // ----------------------------------------------------------------------------- |
|
924 // CSendUIAPITest::?ExternalizeL |
|
925 // ?Test Case for Calling CMessageData's ExternalizeL fun |
|
926 // Externalizes message data to a stream |
|
927 // ----------------------------------------------------------------------------- |
|
928 // |
|
929 |
|
930 TInt CSendUIAPITest::ExternalizeL(void) |
|
931 { |
|
932 // Print to UI |
|
933 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
934 _LIT( KExternalizeL, "In ExternalizeL" ); |
|
935 TestModuleIf().Printf( 0, KSendUIAPITest, KExternalizeL ); |
|
936 // Print to log file |
|
937 iLog->Log( KExternalizeL); |
|
938 |
|
939 ibuffer = CBufFlat::NewL( KMessageBufferSize ); |
|
940 CleanupStack::PushL( ibuffer ); |
|
941 //Create a Read Buffer Stream |
|
942 RBufWriteStream bufStream; |
|
943 //Open the Stream |
|
944 bufStream.Open( *ibuffer ); |
|
945 //Externalise the MessageData object |
|
946 TInt err(KErrNone); |
|
947 #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) |
|
948 TRAP(err , iMessageData->ExternalizeL(bufStream )); |
|
949 #endif |
|
950 //Comit and Close the Write Stream |
|
951 bufStream.CommitL(); |
|
952 bufStream.Close(); |
|
953 CleanupStack::Pop( ibuffer ); |
|
954 if(err == KErrNone) |
|
955 { |
|
956 return KErrNone; |
|
957 } |
|
958 else |
|
959 { |
|
960 return err; |
|
961 } |
|
962 } |
|
963 |
|
964 // ----------------------------------------------------------------------------- |
|
965 // CSendUIAPITest::?InternalizeL |
|
966 // ?Test Case for Calling CMessageData's InternalizeL fun |
|
967 // Internalizes message data to from a stream |
|
968 // ----------------------------------------------------------------------------- |
|
969 // |
|
970 |
|
971 TInt CSendUIAPITest::InternalizeL(void) |
|
972 { |
|
973 // Print to UI |
|
974 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
975 _LIT( KInternalizeL, "In InternalizeL" ); |
|
976 TestModuleIf().Printf( 0, KSendUIAPITest, KInternalizeL ); |
|
977 // Print to log file |
|
978 iLog->Log( KInternalizeL); |
|
979 |
|
980 //Create the Read stream and Open it |
|
981 RBufReadStream bufStream; |
|
982 bufStream.Open(*ibuffer); |
|
983 //Internalise the MessageData Object |
|
984 TInt err(KErrNone); |
|
985 #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) |
|
986 TRAP(err, iMessageData->InternalizeL(bufStream)); |
|
987 #endif |
|
988 //Release and Close the Read Stream |
|
989 bufStream.Release(); |
|
990 bufStream.Close(); |
|
991 delete ibuffer; |
|
992 if(err == KErrNone) |
|
993 { |
|
994 return KErrNone; |
|
995 } |
|
996 else |
|
997 { |
|
998 return err; |
|
999 } |
|
1000 } |
|
1001 |
|
1002 // ----------------------------------------------------------------------------- |
|
1003 // CSendUIAPITest::?TestSetOpaqueDataL |
|
1004 // ?Test Case for Calling CMessageData's SetOpaqueDataL fun |
|
1005 // Set opaque data |
|
1006 // ----------------------------------------------------------------------------- |
|
1007 // |
|
1008 |
|
1009 |
|
1010 TInt CSendUIAPITest::TestSetOpaqueDataL( CStifItemParser& aItem ) |
|
1011 { |
|
1012 #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) |
|
1013 // Print to UI |
|
1014 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
1015 _LIT( KSetOpaqueDataL, "In SetOpaqueDataL" ); |
|
1016 TestModuleIf().Printf( 0, KSendUIAPITest, KSetOpaqueDataL ); |
|
1017 // Print to log file |
|
1018 iLog->Log( KSetOpaqueDataL); |
|
1019 |
|
1020 //Create the instance of CMessageData |
|
1021 CMessageData* messagedata = InitL(); |
|
1022 |
|
1023 TPtrC data; |
|
1024 //Get the opaque data from cfg file |
|
1025 aItem.GetNextString(data); |
|
1026 // Copy the data to Tbuf8 |
|
1027 TBuf8<KMessageBufferSize> opaqueData; |
|
1028 opaqueData.Copy(data); |
|
1029 |
|
1030 TUid dType = messagedata->DataType() ; |
|
1031 //Set the Opaque Data to MessageData |
|
1032 TRAPD( err , messagedata->SetOpaqueDataL(&opaqueData, dType )); |
|
1033 if(err == KErrNone) |
|
1034 { |
|
1035 return KErrNone; |
|
1036 } |
|
1037 else |
|
1038 { |
|
1039 return err; |
|
1040 } |
|
1041 #endif |
|
1042 iLog->Log(_L("test case TestSetOpaqueDataL not intended for 3.0 and 3.1")); |
|
1043 return KErrNone; |
|
1044 } |
|
1045 |
|
1046 // ----------------------------------------------------------------------------- |
|
1047 // CSendUIAPITest::?TestOpaqueDataL |
|
1048 // ?Test Case for Calling CMessageData's OpaqueData fun |
|
1049 // Get opaque data |
|
1050 // ----------------------------------------------------------------------------- |
|
1051 // |
|
1052 |
|
1053 TInt CSendUIAPITest::TestOpaqueDataL( CStifItemParser& aItem ) |
|
1054 { |
|
1055 #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) |
|
1056 // Print to UI |
|
1057 _LIT( KSendUIAPITest, "SendUIAPITest" ); |
|
1058 _LIT( KOpaqueData, "In OpaqueData" ); |
|
1059 TestModuleIf().Printf( 0, KSendUIAPITest, KOpaqueData ); |
|
1060 // Print to log file |
|
1061 iLog->Log( KOpaqueData); |
|
1062 |
|
1063 //Create the instance of CMessageData |
|
1064 CMessageData* messagedata = InitL(); |
|
1065 TPtrC data; |
|
1066 //Get the opaque data to compare from cfg file |
|
1067 aItem.GetNextString(data); |
|
1068 // Copy the data to Tbuf8 |
|
1069 TBuf8<KMessageBufferSize> opaqueData; |
|
1070 opaqueData.Copy(data); |
|
1071 //Get the opaque data from MessageData |
|
1072 TPtrC8 ptr = messagedata->OpaqueData(); |
|
1073 //Compare the two values |
|
1074 if(ptr.Compare(opaqueData) == 0) |
|
1075 { |
|
1076 return KErrNone; |
|
1077 } |
|
1078 else |
|
1079 { |
|
1080 return KErrGeneral; |
|
1081 } |
|
1082 #endif |
|
1083 iLog->Log(_L("test case TestOpaqueDataL not intended for 3.0 and 3.1")); |
|
1084 return KErrNone; |
|
1085 } |
|
1086 |
|
1087 // ----------------------------------------------------------------------------- |
|
1088 // CSendUIAPITest::?TestCMessageAddressNewL |
|
1089 // ?Test Case for Two-phased constructor |
|
1090 // ----------------------------------------------------------------------------- |
|
1091 // |
|
1092 |
|
1093 TInt CSendUIAPITest::TestCMessageAddressNewL( CStifItemParser& aItem ) |
|
1094 { |
|
1095 // Print to UI |
|
1096 _LIT( KSendUIAPITest, "SendUIAPITest CMessageAddress" ); |
|
1097 _LIT( KCMessageAddressNewL, "In TestCMessageAddressNewL" ); |
|
1098 TestModuleIf().Printf( 0, KSendUIAPITest, KCMessageAddressNewL ); |
|
1099 // Print to log file |
|
1100 iLog->Log( KCMessageAddressNewL); |
|
1101 |
|
1102 //Construct CMessageAddress object |
|
1103 iMessageAddress = CMessageAddress::NewL(); |
|
1104 if(iMessageAddress) |
|
1105 { |
|
1106 _LIT( KCMessageAddressNewL, "CMessageAddress NewL succesfulley called" ); |
|
1107 iLog->Log( KCMessageAddressNewL); |
|
1108 return KErrNone; |
|
1109 } |
|
1110 else |
|
1111 { |
|
1112 _LIT( KCMessageAddressNewLFail, "CMessageAddress NewL failed" ); |
|
1113 iLog->Log( KCMessageAddressNewLFail); |
|
1114 return KErrGeneral; |
|
1115 } |
|
1116 } |
|
1117 |
|
1118 // ----------------------------------------------------------------------------- |
|
1119 // CSendUIAPITest::?TestMsgAdrsSetAddressL |
|
1120 // ?Test Case for API SetAddressL that Sets real address |
|
1121 // ----------------------------------------------------------------------------- |
|
1122 // |
|
1123 |
|
1124 TInt CSendUIAPITest::TestMsgAdrsSetAddressL( CStifItemParser& aItem ) |
|
1125 { |
|
1126 // Print to UI |
|
1127 _LIT( KSendUIAPITest, "SendUIAPITest CMessageAddress" ); |
|
1128 _LIT( KCMessageAddressSetAddressL, "In TestCMessageAddressSetAddressL" ); |
|
1129 TestModuleIf().Printf( 0, KSendUIAPITest, KCMessageAddressSetAddressL ); |
|
1130 // Print to log file |
|
1131 iLog->Log( KCMessageAddressSetAddressL); |
|
1132 TPtrC address; |
|
1133 //Get the address from cfg file |
|
1134 aItem.GetNextString(address); |
|
1135 //Set the same address to CMessageAddress object |
|
1136 TRAPD( err, iMessageAddress->SetAddressL( address )); |
|
1137 if(err == KErrNone) |
|
1138 { |
|
1139 return KErrNone; |
|
1140 } |
|
1141 else |
|
1142 { |
|
1143 return err; |
|
1144 } |
|
1145 } |
|
1146 |
|
1147 // ----------------------------------------------------------------------------- |
|
1148 // CSendUIAPITest::?TestMsgAdrsAddress |
|
1149 // ?Test Case for API Address that get real address |
|
1150 // ----------------------------------------------------------------------------- |
|
1151 // |
|
1152 |
|
1153 TInt CSendUIAPITest::TestMsgAdrsAddress( CStifItemParser& aItem ) |
|
1154 { |
|
1155 // Print to UI |
|
1156 #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) |
|
1157 _LIT( KSendUIAPITest, "SendUIAPITest CMessageAddress" ); |
|
1158 _LIT( KCMessageAddressAddress, "In TestCMessageAddressAddress" ); |
|
1159 TestModuleIf().Printf( 0, KSendUIAPITest, KCMessageAddressAddress ); |
|
1160 // Print to log file |
|
1161 iLog->Log( KCMessageAddressAddress); |
|
1162 |
|
1163 TPtrC address; |
|
1164 ////Get the address from cfg file |
|
1165 aItem.GetNextString(address); |
|
1166 //Get the address in CMessageAddress and compare with above |
|
1167 if(iMessageAddress->Address().Compare(address) == 0 ) |
|
1168 { |
|
1169 return KErrNone; |
|
1170 } |
|
1171 else |
|
1172 { |
|
1173 return KErrGeneral; |
|
1174 } |
|
1175 #endif |
|
1176 return KErrNone; |
|
1177 iLog->Log(_L("test case TestMsgAdrsAddress not intended for 3.0 and 3.1")); |
|
1178 } |
|
1179 |
|
1180 // ----------------------------------------------------------------------------- |
|
1181 // CSendUIAPITest::?TestMsgAdrsSetAliasL |
|
1182 // ?Test Case for API SetAliasL that Sets alias for the real address. |
|
1183 // ----------------------------------------------------------------------------- |
|
1184 // |
|
1185 |
|
1186 TInt CSendUIAPITest::TestMsgAdrsSetAliasL( CStifItemParser& aItem ) |
|
1187 { |
|
1188 // Print to UI |
|
1189 _LIT( KSendUIAPITest, "SendUIAPITest CMessageAddress" ); |
|
1190 _LIT( KCMessageAddressSetAliasL, "In TestCMessageAddressSetAliasL" ); |
|
1191 TestModuleIf().Printf( 0, KSendUIAPITest, KCMessageAddressSetAliasL ); |
|
1192 // Print to log file |
|
1193 iLog->Log( KCMessageAddressSetAliasL); |
|
1194 TPtrC alias; |
|
1195 //Get the alias for address from cfg file |
|
1196 aItem.GetNextString(alias); |
|
1197 //Set the alias to CMessageAddress's address |
|
1198 TRAPD( err, iMessageAddress->SetAliasL( alias )); |
|
1199 if(err == KErrNone) |
|
1200 { |
|
1201 return KErrNone; |
|
1202 } |
|
1203 else |
|
1204 { |
|
1205 return err; |
|
1206 } |
|
1207 } |
|
1208 |
|
1209 // ----------------------------------------------------------------------------- |
|
1210 // CSendUIAPITest::?TestMsgAdrsAliasL |
|
1211 // ?Test Case for API Alias that returns alias for the address. |
|
1212 // ----------------------------------------------------------------------------- |
|
1213 // |
|
1214 |
|
1215 TInt CSendUIAPITest::TestMsgAdrsAlias( CStifItemParser& aItem ) |
|
1216 { |
|
1217 // Print to UI |
|
1218 _LIT( KSendUIAPITest, "SendUIAPITest CMessageAddress" ); |
|
1219 _LIT( KCMessageAddressAlias, "In TestCMessageAddressAlias" ); |
|
1220 TestModuleIf().Printf( 0, KSendUIAPITest, KCMessageAddressAlias ); |
|
1221 // Print to log file |
|
1222 iLog->Log( KCMessageAddressAlias); |
|
1223 |
|
1224 TPtrC alias; |
|
1225 ////Get the address from cfg file |
|
1226 aItem.GetNextString(alias); |
|
1227 //Get the address in CMessageAddress and compare with above |
|
1228 if(iMessageAddress->Alias().Compare(alias) == 0 ) |
|
1229 { |
|
1230 return KErrNone; |
|
1231 } |
|
1232 else |
|
1233 { |
|
1234 return KErrGeneral; |
|
1235 } |
|
1236 } |
|
1237 |
|
1238 // ----------------------------------------------------------------------------- |
|
1239 // CSendUIAPITest::?TestMsgAdrsExternalizeL |
|
1240 // ?Test Case for API ExternalizeL that Externalizes address data to a stream |
|
1241 // ----------------------------------------------------------------------------- |
|
1242 // |
|
1243 |
|
1244 TInt CSendUIAPITest::TestMsgAdrsExternalizeL( CStifItemParser& aItem ) |
|
1245 { |
|
1246 #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) |
|
1247 // Print to UI |
|
1248 _LIT( KSendUIAPITest, "SendUIAPITest CMessageAddress" ); |
|
1249 _LIT( KCMessageAddressExternalizeL, "In TestCMessageAddressExternalizeL" ); |
|
1250 TestModuleIf().Printf( 0, KSendUIAPITest, KCMessageAddressExternalizeL ); |
|
1251 // Print to log file |
|
1252 iLog->Log( KCMessageAddressExternalizeL); |
|
1253 |
|
1254 iMsgAdrbuffer = CBufFlat::NewL( KMessageBufferSize ); |
|
1255 |
|
1256 //Create a Read Buffer Stream |
|
1257 RBufWriteStream bufStream; |
|
1258 //Open the Stream |
|
1259 bufStream.Open( *iMsgAdrbuffer ); |
|
1260 //Externalise the MessageData object |
|
1261 TRAPD(err , iMessageAddress->ExternalizeL(bufStream )); |
|
1262 //Comit and Close the Write Stream |
|
1263 bufStream.CommitL(); |
|
1264 bufStream.Close(); |
|
1265 |
|
1266 if(err == KErrNone) |
|
1267 { |
|
1268 return KErrNone; |
|
1269 } |
|
1270 else |
|
1271 { |
|
1272 return err; |
|
1273 } |
|
1274 #endif |
|
1275 iLog->Log(_L("test case TestMsgAdrsExternalizeL not intended for 3.0 and 3.1")); |
|
1276 return KErrNone; |
|
1277 } |
|
1278 |
|
1279 // ----------------------------------------------------------------------------- |
|
1280 // CSendUIAPITest::?TestMsgAdrsInternalizeL |
|
1281 // ?Test Case for API InternalizeL that Internalizes message data from a stream |
|
1282 // ----------------------------------------------------------------------------- |
|
1283 // |
|
1284 |
|
1285 TInt CSendUIAPITest::TestMsgAdrsInternalizeL( CStifItemParser& aItem ) |
|
1286 { |
|
1287 #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) |
|
1288 // Print to UI |
|
1289 _LIT( KSendUIAPITest, "SendUIAPITest CMessageAddress" ); |
|
1290 _LIT( KCMessageAddressInternalizeL, "In TestCMessageAddressInternalizeL" ); |
|
1291 TestModuleIf().Printf( 0, KSendUIAPITest, KCMessageAddressInternalizeL ); |
|
1292 // Print to log file |
|
1293 iLog->Log( KCMessageAddressInternalizeL); |
|
1294 |
|
1295 RBufReadStream bufStream; |
|
1296 bufStream.Open(*iMsgAdrbuffer); |
|
1297 //Internalise the MessageData Object |
|
1298 TRAPD(err, iMessageAddress->InternalizeL(bufStream)); |
|
1299 //Release and Close the Read Stream |
|
1300 bufStream.Release(); |
|
1301 bufStream.Close(); |
|
1302 if(iMsgAdrbuffer) |
|
1303 { |
|
1304 delete iMsgAdrbuffer; |
|
1305 iMsgAdrbuffer = NULL; |
|
1306 } |
|
1307 if(err == KErrNone) |
|
1308 { |
|
1309 return KErrNone; |
|
1310 } |
|
1311 else |
|
1312 { |
|
1313 return err; |
|
1314 } |
|
1315 #endif |
|
1316 iLog->Log(_L("test case TestMsgAdrsInternalizeL not intended for 3.0 and 3.1")); |
|
1317 return KErrNone; |
|
1318 } |
|
1319 |
|
1320 // ----------------------------------------------------------------------------- |
|
1321 // CSendUIAPITest::?TestTSendingCapabilities |
|
1322 // ?Test Case for functions in TSendingCapabilities |
|
1323 // ----------------------------------------------------------------------------- |
|
1324 // |
|
1325 |
|
1326 TInt CSendUIAPITest::TestTSendingCapabilities( CStifItemParser& aItem ) |
|
1327 { |
|
1328 //print to UI |
|
1329 _LIT( KSendUIAPITest, "SendUIAPITest TSendingCapabilities" ); |
|
1330 _LIT( KTSendingCapabilities, "In TestTSendingCapabilities" ); |
|
1331 TestModuleIf().Printf( 0, KSendUIAPITest, KTSendingCapabilities ); |
|
1332 // Print to log file |
|
1333 iLog->Log( KTSendingCapabilities); |
|
1334 |
|
1335 _LIT( KTSendingCapabilitiesObj, "Creating TSendingCapabilities Object" ); |
|
1336 iLog->Log( KTSendingCapabilitiesObj); |
|
1337 |
|
1338 _LIT( KTSendingCapabilitiesCtor, "Calling TSendingCapabilities Constructor" ); |
|
1339 iLog->Log( KTSendingCapabilitiesCtor); |
|
1340 |
|
1341 //Create TSendingCapabilities Object |
|
1342 TSendingCapabilities capabilitiesone; |
|
1343 |
|
1344 _LIT( KTSendingCapabilitiesCtord, "TSendingCapabilities Constructor called successfully" ); |
|
1345 iLog->Log( KTSendingCapabilitiesCtord); |
|
1346 |
|
1347 _LIT( KTSendingCapabilitiesParamCtor, "Calling TSendingCapabilities Paramaterised Constructor" ); |
|
1348 iLog->Log( KTSendingCapabilitiesParamCtor); |
|
1349 |
|
1350 //Create TSendingCapabilities Object with parameters |
|
1351 TSendingCapabilities capabilitiestwo = TSendingCapabilities( 0, KMaxTInt, |
|
1352 TSendingCapabilities::ESupportsAttachments ); |
|
1353 |
|
1354 _LIT( KTSendingCapabilitiesParamCtord, "TSendingCapabilities Paramaterised Constructor called successfully" ); |
|
1355 iLog->Log( KTSendingCapabilitiesParamCtord); |
|
1356 |
|
1357 //Create another TSendingCapabilities Object with parameters |
|
1358 TSendingCapabilities capabilitiesthree = TSendingCapabilities( 0, KMaxTInt, |
|
1359 TSendingCapabilities::ESupportsAttachments ); |
|
1360 |
|
1361 _LIT( KTSendingCapabilitiesEqualOptr, "Calling TSendingCapabilities EqualTo Operator" ); |
|
1362 iLog->Log( KTSendingCapabilitiesEqualOptr); |
|
1363 |
|
1364 //Comapre the two object with Equal to operator |
|
1365 if( capabilitiestwo == capabilitiesthree ) |
|
1366 { |
|
1367 _LIT( KTSendingCapabilitiesEqual, "Two TSendingCapabilities Objects are Equal" ); |
|
1368 iLog->Log( KTSendingCapabilitiesEqual); |
|
1369 } |
|
1370 _LIT( KTSendingCapabilitiesNotEqualOptr, "Calling TSendingCapabilities Not EqualTo Operator" ); |
|
1371 iLog->Log( KTSendingCapabilitiesNotEqualOptr); |
|
1372 |
|
1373 //Comapre the two object with Not Equal to operator |
|
1374 if( capabilitiesone != capabilitiestwo ) |
|
1375 { |
|
1376 _LIT( KTSendingCapabilitiesNotEqual, "Two TSendingCapabilities Objects are Not Equal" ); |
|
1377 iLog->Log( KTSendingCapabilitiesNotEqual); |
|
1378 } |
|
1379 return KErrNone; |
|
1380 } |
|
1381 |
|
1382 // ----------------------------------------------------------------------------- |
|
1383 // CSendUIAPITest::TestCopyLC |
|
1384 // Test SetServiceMenuNameL,SetServiceAddressL,SetServiceNameL,SetServiceFeatures and |
|
1385 // CopyLCtest method function. |
|
1386 // ----------------------------------------------------------------------------- |
|
1387 // |
|
1388 |
|
1389 TInt CSendUIAPITest::TestCopyLC( CStifItemParser& aItem ) |
|
1390 { |
|
1391 #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) |
|
1392 //print to UI |
|
1393 _LIT( KSendUIAPITest, "SendUIAPITest CSendingServiceInfo" ); |
|
1394 _LIT( KTestCopyLC, "In TestCopyLC" ); |
|
1395 TestModuleIf().Printf( 0, KSendUIAPITest, KTestCopyLC ); |
|
1396 // Print to log file |
|
1397 iLog->Log( KTestCopyLC); |
|
1398 |
|
1399 _LIT( KNewL, "Calling CSendingServiceInfo::NewL" ); |
|
1400 iLog->Log( KNewL); |
|
1401 //Create the CSendingServiceInfo var |
|
1402 CSendingServiceInfo* serviceInfo = CSendingServiceInfo::NewL(); |
|
1403 |
|
1404 _LIT( KSetServiceMenuNameL, "Calling CSendingServiceInfo's SetServiceMenuNameL" ); |
|
1405 iLog->Log( KSetServiceMenuNameL); |
|
1406 serviceInfo->SetServiceMenuNameL( KTestText ); |
|
1407 |
|
1408 _LIT( KSetServiceAddressL, "Calling CSendingServiceInfo's SetServiceAddressL" ); |
|
1409 iLog->Log( KSetServiceAddressL); |
|
1410 serviceInfo->SetServiceAddressL( KTestText ); |
|
1411 |
|
1412 _LIT( KSetServiceNameL, "Calling CSendingServiceInfo's SetServiceNameL" ); |
|
1413 iLog->Log( KSetServiceNameL); |
|
1414 serviceInfo->SetServiceNameL( KTestText ); |
|
1415 |
|
1416 _LIT( KSetServiceFeatures, "Calling CSendingServiceInfo's SetServiceFeatures" ); |
|
1417 iLog->Log( KSetServiceFeatures); |
|
1418 serviceInfo->SetServiceFeatures( CSendingServiceInfo::EServiceInValid |
|
1419 | CSendingServiceInfo::EServiceHidden |
|
1420 | CSendingServiceInfo::EServiceCanSendDirectly ); |
|
1421 |
|
1422 _LIT( KCopyLC, "Calling CSendingServiceInfo's CopyLC" ); |
|
1423 iLog->Log( KCopyLC); |
|
1424 CSendingServiceInfo* copy; |
|
1425 copy = serviceInfo->CopyLC(); |
|
1426 |
|
1427 //TPtrC |
|
1428 if ( serviceInfo->ServiceName().Compare( copy->ServiceName() ) != 0 || |
|
1429 serviceInfo->ServiceMenuName().Compare( copy->ServiceMenuName() ) != 0 || |
|
1430 serviceInfo->ServiceAddress().Compare( copy->ServiceAddress() ) != 0 || |
|
1431 serviceInfo->ServiceFeatures() != copy->ServiceFeatures() ) |
|
1432 { |
|
1433 iLog->Log( _L("CopyLC failed")); |
|
1434 } |
|
1435 |
|
1436 CleanupStack::PopAndDestroy( copy ); |
|
1437 delete serviceInfo; |
|
1438 return KErrNone; |
|
1439 #endif |
|
1440 iLog->Log(_L("test case TestCopyLC not intended for 3.0 and 3.1")); |
|
1441 return KErrNone; |
|
1442 } |
|
1443 |
|
1444 // ----------------------------------------------------------------------------- |
|
1445 // CSendUIAPITest::TestSetTechnologyTypeId |
|
1446 // SetTechnologyTypeId test method function. |
|
1447 // ----------------------------------------------------------------------------- |
|
1448 // |
|
1449 |
|
1450 TInt CSendUIAPITest::TestSetTechnologyTypeIdL( CStifItemParser& aItem ) |
|
1451 { |
|
1452 #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) |
|
1453 //print to UI |
|
1454 _LIT( KSendUIAPITest, "SendUIAPITest CSendingServiceInfo" ); |
|
1455 _LIT( KTestSetTechnologyTypeId, "In TestSetTechnologyTypeId" ); |
|
1456 TestModuleIf().Printf( 0, KSendUIAPITest, KTestSetTechnologyTypeId ); |
|
1457 // Print to log file |
|
1458 iLog->Log( KTestSetTechnologyTypeId); |
|
1459 |
|
1460 //Create the CSendingServiceInfo Object |
|
1461 CSendingServiceInfo* serviceInfo = CSendingServiceInfo::NewL(); |
|
1462 _LIT( KCSendingServiceInfoObj, "CSendingServiceInfo Object created" ); |
|
1463 iLog->Log( KCSendingServiceInfoObj); |
|
1464 |
|
1465 _LIT( KSetTechnologyTypeId, "Calling CSendingServiceInfo SetTechnologyTypeId" ); |
|
1466 iLog->Log( KSetTechnologyTypeId); |
|
1467 serviceInfo->SetTechnologyTypeId( KServideId ); |
|
1468 |
|
1469 _LIT( KTechnologyTypeId, "Calling CSendingServiceInfo TechnologyTypeId" ); |
|
1470 iLog->Log( KTechnologyTypeId); |
|
1471 //Compare the Technology ID |
|
1472 if ( serviceInfo->TechnologyTypeId() != KServideId ) |
|
1473 { |
|
1474 delete serviceInfo; |
|
1475 return KErrCancel; |
|
1476 } |
|
1477 else |
|
1478 { |
|
1479 delete serviceInfo; |
|
1480 return KErrNone; |
|
1481 } |
|
1482 #endif |
|
1483 iLog->Log(_L("test case TestSetTechnologyTypeIdL not intended for 3.0 and 3.1")); |
|
1484 return KErrNone; |
|
1485 } |
|
1486 |
|
1487 |
|
1488 // ----------------------------------------------------------------------------- |
|
1489 // CSendUIAPITest::TestServiceID |
|
1490 // ServiceID test method function. |
|
1491 // ----------------------------------------------------------------------------- |
|
1492 // |
|
1493 |
|
1494 TInt CSendUIAPITest::TestServiceIDL( CStifItemParser& aItem ) |
|
1495 { |
|
1496 //print to UI |
|
1497 _LIT( KSendUIAPITest, "SendUIAPITest CSendingServiceInfo" ); |
|
1498 _LIT( KTestServiceID, "In TestServiceID" ); |
|
1499 TestModuleIf().Printf( 0, KSendUIAPITest, KTestServiceID ); |
|
1500 // Print to log file |
|
1501 iLog->Log( KTestServiceID); |
|
1502 |
|
1503 TUid id(KDrmLinkSender); |
|
1504 //Create the CSendingServiceInfo var |
|
1505 CSendingServiceInfo* serviceInfo = CSendingServiceInfo::NewL(); |
|
1506 |
|
1507 _LIT( KSetServiceId, "Calling CSendingServiceInfo SetServiceId" ); |
|
1508 iLog->Log( KSetServiceId); |
|
1509 serviceInfo->SetServiceId( id ); |
|
1510 //Compare the ServiceID's |
|
1511 if( serviceInfo->ServiceId() != id ) |
|
1512 { |
|
1513 delete serviceInfo; |
|
1514 return KErrCancel; |
|
1515 } |
|
1516 else |
|
1517 { |
|
1518 delete serviceInfo; |
|
1519 return KErrNone; |
|
1520 } |
|
1521 } |
|
1522 |
|
1523 // ----------------------------------------------------------------------------- |
|
1524 // CSendUIAPITest::TestServiceProviderID |
|
1525 // ServiceProviderID test method function. |
|
1526 // ----------------------------------------------------------------------------- |
|
1527 // |
|
1528 |
|
1529 TInt CSendUIAPITest::TestServiceProviderIDL( CStifItemParser& aItem ) |
|
1530 { |
|
1531 //print to UI |
|
1532 _LIT( KSendUIAPITest, "SendUIAPITest CSendingServiceInfo" ); |
|
1533 _LIT( KTestServiceProviderID, "In TestServiceProviderID" ); |
|
1534 TestModuleIf().Printf( 0, KSendUIAPITest, KTestServiceProviderID ); |
|
1535 // Print to log file |
|
1536 iLog->Log( KTestServiceProviderID); |
|
1537 TUid id(KDrmLinkSender); |
|
1538 //Create the CSendingServiceInfo var |
|
1539 CSendingServiceInfo* serviceInfo = CSendingServiceInfo::NewL(); |
|
1540 |
|
1541 _LIT( KSetServiceProviderId, "Calling CSendingServiceInfo SetServiceProviderId" ); |
|
1542 iLog->Log( KSetServiceProviderId); |
|
1543 serviceInfo->SetServiceProviderId( id ); |
|
1544 //Compare the ServiceProviderID's |
|
1545 if( serviceInfo->ServiceProviderId() != id ) |
|
1546 { |
|
1547 delete serviceInfo; |
|
1548 return KErrCancel; |
|
1549 } |
|
1550 else |
|
1551 { |
|
1552 delete serviceInfo; |
|
1553 return KErrNone; |
|
1554 } |
|
1555 } |
|
1556 |
|
1557 // ----------------------------------------------------------------------------- |
|
1558 // CSendUIAPITest::TestServiceCapabilities |
|
1559 // ServiceCapabilities test method function. |
|
1560 // ----------------------------------------------------------------------------- |
|
1561 // |
|
1562 |
|
1563 TInt CSendUIAPITest::TestServiceCapabilitiesL( CStifItemParser& aItem ) |
|
1564 { |
|
1565 //print to UI |
|
1566 _LIT( KSendUIAPITest, "SendUIAPITest CSendingServiceInfo" ); |
|
1567 _LIT( KTestServiceCapabilities, "In TestServiceCapabilities" ); |
|
1568 TestModuleIf().Printf( 0, KSendUIAPITest, KTestServiceCapabilities ); |
|
1569 // Print to log file |
|
1570 iLog->Log( KTestServiceCapabilities); |
|
1571 //Create the Capabilities |
|
1572 TSendingCapabilities cap(10,100,TSendingCapabilities::EAllServices); |
|
1573 //Create the CSendingServiceInfo var |
|
1574 CSendingServiceInfo* serviceInfo = CSendingServiceInfo::NewL(); |
|
1575 |
|
1576 _LIT( KSetServiceCapabilities, "Calling CSendingServiceInfo SetServiceCapabilities" ); |
|
1577 iLog->Log( KSetServiceCapabilities); |
|
1578 serviceInfo->SetServiceCapabilities( cap ); |
|
1579 //Compare the ServiceCapabilities |
|
1580 if( serviceInfo->ServiceCapabilities() != cap ) |
|
1581 { |
|
1582 delete serviceInfo; |
|
1583 return KErrCancel; |
|
1584 } |
|
1585 else |
|
1586 { |
|
1587 delete serviceInfo; |
|
1588 return KErrNone; |
|
1589 } |
|
1590 } |
|
1591 |
|
1592 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
1593 // None |
|
1594 |
|
1595 // [End of File] - Do not remove |