|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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 the License "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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // [INCLUDE FILES] - do not remove |
|
22 #include <e32svr.h> |
|
23 #include <StifParser.h> |
|
24 #include <Stiftestinterface.h> |
|
25 #include "tlogprovidertest.h" |
|
26 #include "teventdetails.h" |
|
27 #include "tfilterdetails.h" |
|
28 #include "serviceerrno.h" |
|
29 //#include <logwrap.hrh> |
|
30 // EXTERNAL DATA STRUCTURES |
|
31 //extern ?external_data; |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 // ============================ MEMBER FUNCTIONS =============================== |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // Ctlogprovidertest::Delete |
|
44 // Delete here all resources allocated and opened from test methods. |
|
45 // Called from destructor. |
|
46 // ----------------------------------------------------------------------------- |
|
47 // |
|
48 void Ctlogprovidertest::Delete() |
|
49 { |
|
50 |
|
51 } |
|
52 |
|
53 // ----------------------------------------------------------------------------- |
|
54 // Ctlogprovidertest::RunMethodL |
|
55 // Run specified method. Contains also table of test mothods and their names. |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 TInt Ctlogprovidertest::RunMethodL( |
|
59 CStifItemParser& aItem ) |
|
60 { |
|
61 |
|
62 static TStifFunctionInfo const KFunctions[] = |
|
63 { |
|
64 // Copy this line for every implemented function. |
|
65 // First string is the function name used in TestScripter script file. |
|
66 // Second is the actual implementation member function. |
|
67 ENTRY( "addL", Ctlogprovidertest::addL ), |
|
68 ENTRY( "add2L", Ctlogprovidertest::add2L ), |
|
69 ENTRY( "get1L", Ctlogprovidertest::get1L ), |
|
70 ENTRY( "get2L", Ctlogprovidertest::get2L ), |
|
71 ENTRY( "delete1L", Ctlogprovidertest::delete1L ), |
|
72 ENTRY( "delete2L", Ctlogprovidertest::delete2L ), |
|
73 ENTRY( "deleteneg1L", Ctlogprovidertest::deleteneg1L ), |
|
74 ENTRY( "cancel1L", Ctlogprovidertest::cancel1L ), |
|
75 ENTRY( "cancel2L", Ctlogprovidertest::cancel2L ), |
|
76 ENTRY( "sapierrorsL", Ctlogprovidertest::sapierrorsL ), |
|
77 ENTRY( "wronginterfaceL", Ctlogprovidertest::wronginterfaceL ), |
|
78 ENTRY( "loadtwiceL", Ctlogprovidertest::loadtwiceL ), |
|
79 ENTRY( "wrongcommandL", Ctlogprovidertest::wrongcommandL ), |
|
80 |
|
81 |
|
82 }; |
|
83 |
|
84 const TInt count = sizeof( KFunctions ) / |
|
85 sizeof( TStifFunctionInfo ); |
|
86 |
|
87 return RunInternalL( KFunctions, count, aItem ); |
|
88 |
|
89 } |
|
90 |
|
91 // ----------------------------------------------------------------------------- |
|
92 // Ctlogprovidertest::ExampleL |
|
93 // Example test method function. |
|
94 // (other items were commented in a header). |
|
95 // ----------------------------------------------------------------------------- |
|
96 // |
|
97 TInt Ctlogprovidertest::addL( CStifItemParser& aItem ) |
|
98 { |
|
99 TInt ret = 0; |
|
100 |
|
101 __UHEAP_MARK ; |
|
102 |
|
103 CEventDetails *eventDetails = CEventDetails :: NewL() ; |
|
104 |
|
105 |
|
106 TInt ParsedValue ; |
|
107 |
|
108 TBufC<100> String; |
|
109 TPtrC sptr; |
|
110 sptr.Set(String); |
|
111 // TInt ParsedValue1 ; |
|
112 |
|
113 //1 seteventype |
|
114 |
|
115 aItem.GetNextInt( ParsedValue); |
|
116 eventDetails->SetEventType(ParsedValue) ; |
|
117 |
|
118 |
|
119 |
|
120 //2 setduration |
|
121 |
|
122 aItem.GetNextInt(ParsedValue); |
|
123 eventDetails->SetDurationType(ParsedValue) ; |
|
124 |
|
125 //3 setcontact |
|
126 aItem.GetNextInt(ParsedValue); |
|
127 eventDetails->SetContactType(ParsedValue) ; |
|
128 |
|
129 |
|
130 //4 setlinktype |
|
131 aItem.GetNextInt(ParsedValue); |
|
132 eventDetails->SetLinkType(ParsedValue) ; |
|
133 |
|
134 //5 settimer |
|
135 aItem.GetNextInt(ParsedValue); |
|
136 |
|
137 TTime time(ParsedValue); |
|
138 eventDetails->SetTimer(time) ; |
|
139 |
|
140 |
|
141 |
|
142 //6 setsubject |
|
143 aItem.GetNextString(sptr); |
|
144 eventDetails->SetSubjectType(sptr) ; |
|
145 |
|
146 //7 setnumbertype |
|
147 aItem.GetNextString(sptr); |
|
148 eventDetails->SetNumberType(sptr) ; |
|
149 |
|
150 //8 setremoteparty |
|
151 aItem.GetNextString(sptr); |
|
152 eventDetails->SetRemotePartyType(sptr) ; |
|
153 |
|
154 //9 setdirectiontype |
|
155 aItem.GetNextInt(ParsedValue); |
|
156 eventDetails->SetDirectionType(ParsedValue) ; |
|
157 |
|
158 |
|
159 //10 setdescriptiontype |
|
160 aItem.GetNextString(sptr); |
|
161 eventDetails->SetDescriptionType(sptr) ; |
|
162 |
|
163 //11 setstatustype |
|
164 aItem.GetNextInt(ParsedValue); |
|
165 eventDetails->SetStatusType(ParsedValue) ; |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 TRAPD(error , addtest1L(eventDetails)) ; |
|
174 delete eventDetails; |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 __UHEAP_MARKEND; |
|
180 |
|
181 return KErrNone; |
|
182 |
|
183 } |
|
184 |
|
185 |
|
186 |
|
187 TInt Ctlogprovidertest::add2L( CStifItemParser& aItem ) |
|
188 { |
|
189 |
|
190 __UHEAP_MARK; |
|
191 |
|
192 TInt ret = 0; |
|
193 |
|
194 |
|
195 |
|
196 CEventDetails *eventDetails = CEventDetails :: NewL() ; |
|
197 |
|
198 |
|
199 TInt ParsedValue ; |
|
200 |
|
201 TBufC<100> String; |
|
202 TPtrC sptr; |
|
203 sptr.Set(String); |
|
204 TInt ParsedValue1 ; |
|
205 |
|
206 |
|
207 |
|
208 if(aItem.GetNextInt( ParsedValue) != KErrNone ) |
|
209 { |
|
210 |
|
211 User :: Leave(KErrArgument) ; |
|
212 } |
|
213 |
|
214 |
|
215 |
|
216 |
|
217 if((ParsedValue >= KCallEvent ) && (ParsedValue <=KLogLbsAssistanceDataEvent)) |
|
218 { |
|
219 eventDetails->SetEventType(ParsedValue) ; |
|
220 } |
|
221 |
|
222 else |
|
223 { |
|
224 ; |
|
225 } |
|
226 |
|
227 |
|
228 |
|
229 |
|
230 |
|
231 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
232 { |
|
233 |
|
234 User :: Leave(KErrArgument) ; |
|
235 } |
|
236 |
|
237 if(ParsedValue > 0 ) |
|
238 { |
|
239 eventDetails->SetDurationType(ParsedValue) ; |
|
240 } |
|
241 |
|
242 |
|
243 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
244 { |
|
245 |
|
246 User :: Leave(KErrArgument) ; |
|
247 } |
|
248 |
|
249 if(ParsedValue > 0 ) |
|
250 { |
|
251 eventDetails->SetContactType(ParsedValue) ; |
|
252 } |
|
253 |
|
254 |
|
255 |
|
256 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
257 { |
|
258 |
|
259 User :: Leave(KErrArgument) ; |
|
260 } |
|
261 |
|
262 if(ParsedValue > 0 ) |
|
263 { |
|
264 eventDetails->SetLinkType(ParsedValue) ; |
|
265 } |
|
266 |
|
267 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
268 { |
|
269 |
|
270 User :: Leave(KErrArgument) ; |
|
271 } |
|
272 |
|
273 if(ParsedValue> 0 ) |
|
274 { |
|
275 |
|
276 TTime time(ParsedValue); |
|
277 eventDetails->SetTimer(time) ; |
|
278 } |
|
279 |
|
280 _LIT(KNull,"NULL"); |
|
281 |
|
282 if(aItem.GetNextString(sptr) !=KErrNone) |
|
283 { |
|
284 |
|
285 User :: Leave(KErrArgument) ; |
|
286 } |
|
287 |
|
288 if((sptr.Compare(KNull))) |
|
289 { |
|
290 eventDetails->SetSubjectType(sptr) ; |
|
291 } |
|
292 |
|
293 if(aItem.GetNextString(sptr) !=KErrNone) |
|
294 { |
|
295 |
|
296 User :: Leave(KErrArgument) ; |
|
297 } |
|
298 |
|
299 if((sptr.Compare(KNull))) |
|
300 { |
|
301 eventDetails->SetNumberType(sptr) ; |
|
302 } |
|
303 |
|
304 if(aItem.GetNextString(sptr) !=KErrNone) |
|
305 { |
|
306 |
|
307 User :: Leave(KErrArgument) ; |
|
308 } |
|
309 |
|
310 if((sptr.Compare(KNull))) |
|
311 { |
|
312 eventDetails->SetRemotePartyType(sptr) ; |
|
313 } |
|
314 |
|
315 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
316 { |
|
317 |
|
318 User :: Leave(KErrArgument) ; |
|
319 } |
|
320 |
|
321 if(ParsedValue >= 0) |
|
322 { |
|
323 eventDetails->SetDirectionType(ParsedValue) ; |
|
324 } |
|
325 |
|
326 |
|
327 |
|
328 if(aItem.GetNextString(sptr) !=KErrNone) |
|
329 { |
|
330 |
|
331 |
|
332 User :: Leave(KErrArgument) ; |
|
333 } |
|
334 |
|
335 if((sptr.Compare(KNull))) |
|
336 { |
|
337 eventDetails->SetDescriptionType(sptr) ; |
|
338 } |
|
339 |
|
340 if(aItem.GetNextInt(ParsedValue) !=KErrNone) |
|
341 { |
|
342 |
|
343 User :: Leave(KErrArgument) ; |
|
344 } |
|
345 |
|
346 if(ParsedValue >= 0) |
|
347 { |
|
348 eventDetails->SetStatusType(ParsedValue) ; |
|
349 } |
|
350 |
|
351 |
|
352 |
|
353 if(aItem.GetNextInt(ParsedValue1) != KErrNone) |
|
354 { |
|
355 |
|
356 User :: Leave(KErrArgument) ; |
|
357 } |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 if(aItem.GetNextInt(ParsedValue) != KErrNone ) |
|
367 { |
|
368 |
|
369 ret = KErrNone ; |
|
370 } |
|
371 else |
|
372 { |
|
373 ret = ParsedValue ; |
|
374 } |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 TRAPD(error , addtest2L(eventDetails)) ; |
|
382 delete eventDetails; |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 __UHEAP_MARKEND; |
|
390 |
|
391 |
|
392 return KErrNone; |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 // return ret; |
|
400 |
|
401 } |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 TInt Ctlogprovidertest::get1L( CStifItemParser& aItem ) |
|
409 { |
|
410 TInt ret = 0 ; |
|
411 |
|
412 |
|
413 |
|
414 __UHEAP_MARK ; |
|
415 |
|
416 CFilterDetails *filterDetails = CFilterDetails::NewL() ; |
|
417 |
|
418 TInt ParsedValue ; |
|
419 |
|
420 TBufC<100> String; |
|
421 TPtrC sptr; |
|
422 sptr.Set(String); |
|
423 TInt ParsedValue1 ; |
|
424 |
|
425 |
|
426 _LIT(KNull,"NULL"); |
|
427 |
|
428 |
|
429 if(aItem.GetNextString(sptr) !=KErrNone) |
|
430 { |
|
431 _LIT(KLog , "id not found") ; |
|
432 iLog->Log(KLog) ; |
|
433 User :: Leave(KErrArgument) ; |
|
434 } |
|
435 |
|
436 if((sptr.Compare(KNull))) |
|
437 { |
|
438 filterDetails->SetEventId(sptr) ; |
|
439 } |
|
440 |
|
441 |
|
442 |
|
443 if(aItem.GetNextInt( ParsedValue) != KErrNone ) |
|
444 { |
|
445 |
|
446 User :: Leave(KErrArgument) ; |
|
447 } |
|
448 |
|
449 |
|
450 if((ParsedValue >= KCallEvent ) && (ParsedValue <=KLogLbsAssistanceDataEvent)) |
|
451 { |
|
452 filterDetails->SetEventType(ParsedValue) ; |
|
453 } |
|
454 |
|
455 else |
|
456 { |
|
457 ; |
|
458 } |
|
459 |
|
460 |
|
461 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
462 { |
|
463 |
|
464 User :: Leave(KErrArgument) ; |
|
465 } |
|
466 |
|
467 if(ParsedValue > 0 ) |
|
468 { |
|
469 filterDetails->SetContactType(ParsedValue) ; |
|
470 } |
|
471 |
|
472 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
473 { |
|
474 |
|
475 User :: Leave(KErrArgument) ; |
|
476 } |
|
477 |
|
478 if(ParsedValue> 0 ) |
|
479 { |
|
480 |
|
481 TTime time(ParsedValue); |
|
482 filterDetails->SetTimer(time) ; |
|
483 } |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 if(aItem.GetNextString(sptr) !=KErrNone) |
|
489 { |
|
490 |
|
491 User :: Leave(KErrArgument) ; |
|
492 } |
|
493 |
|
494 if((sptr.Compare(KNull))) |
|
495 { |
|
496 filterDetails->SetNumberType(sptr) ; |
|
497 } |
|
498 |
|
499 if(aItem.GetNextString(sptr) !=KErrNone) |
|
500 { |
|
501 |
|
502 User :: Leave(KErrArgument) ; |
|
503 } |
|
504 |
|
505 if((sptr.Compare(KNull))) |
|
506 { |
|
507 filterDetails->SetRemotePartyType(sptr) ; |
|
508 } |
|
509 |
|
510 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
511 { |
|
512 |
|
513 User :: Leave(KErrArgument) ; |
|
514 } |
|
515 |
|
516 if(ParsedValue >= 0 ) |
|
517 { |
|
518 filterDetails->SetDirectionType(ParsedValue) ; |
|
519 } |
|
520 |
|
521 if(aItem.GetNextInt(ParsedValue) !=KErrNone) |
|
522 { |
|
523 |
|
524 User :: Leave(KErrArgument) ; |
|
525 } |
|
526 |
|
527 if(ParsedValue >= 0 ) |
|
528 { |
|
529 filterDetails->SetStatusType(ParsedValue) ; |
|
530 } |
|
531 |
|
532 |
|
533 |
|
534 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
535 { |
|
536 |
|
537 User :: Leave(KErrArgument) ; |
|
538 } |
|
539 |
|
540 |
|
541 |
|
542 if(ParsedValue == 0 || ParsedValue < -1 ) |
|
543 { |
|
544 ; |
|
545 } |
|
546 else |
|
547 { |
|
548 filterDetails->SetRecentList(ParsedValue) ; |
|
549 } |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 if(aItem.GetNextInt( ParsedValue) != KErrNone ) |
|
555 { |
|
556 |
|
557 User :: Leave(KErrArgument) ; |
|
558 } |
|
559 |
|
560 |
|
561 if(ParsedValue == 0 ) |
|
562 { |
|
563 filterDetails->SetAllEvent(FALSE) ; |
|
564 } |
|
565 else if(ParsedValue == 1) |
|
566 |
|
567 { |
|
568 filterDetails->SetAllEvent(TRUE); |
|
569 } |
|
570 |
|
571 |
|
572 |
|
573 |
|
574 if(aItem.GetNextInt(ParsedValue1) != KErrNone) |
|
575 { |
|
576 |
|
577 User :: Leave(KErrArgument) ; |
|
578 } |
|
579 |
|
580 |
|
581 if(aItem.GetNextInt(ParsedValue) != KErrNone ) |
|
582 { |
|
583 |
|
584 ret = KErrNone ; |
|
585 } |
|
586 else |
|
587 { |
|
588 ret = ParsedValue ; |
|
589 } |
|
590 |
|
591 |
|
592 TRAPD(error , getlist1L(filterDetails)) ; |
|
593 delete filterDetails; |
|
594 |
|
595 __UHEAP_MARKEND; |
|
596 |
|
597 if(error == ret) |
|
598 { |
|
599 return KErrNone; |
|
600 } |
|
601 return error; |
|
602 |
|
603 |
|
604 } |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 TInt Ctlogprovidertest::get2L( CStifItemParser& aItem ) |
|
611 { |
|
612 TInt ret = 0 ; |
|
613 |
|
614 |
|
615 |
|
616 __UHEAP_MARK ; |
|
617 |
|
618 CFilterDetails *filterDetails = CFilterDetails::NewL() ; |
|
619 |
|
620 TInt ParsedValue ; |
|
621 |
|
622 TBufC<100> String; |
|
623 TPtrC sptr; |
|
624 sptr.Set(String); |
|
625 TInt ParsedValue1 ; |
|
626 |
|
627 |
|
628 _LIT(KNull,"NULL"); |
|
629 |
|
630 if(aItem.GetNextString(sptr) !=KErrNone) |
|
631 { |
|
632 _LIT(KLog , "id not found") ; |
|
633 iLog->Log(KLog) ; |
|
634 User :: Leave(KErrArgument) ; |
|
635 } |
|
636 |
|
637 if((sptr.Compare(KNull))) |
|
638 { |
|
639 filterDetails->SetEventId(sptr) ; |
|
640 |
|
641 } |
|
642 |
|
643 |
|
644 if(aItem.GetNextInt( ParsedValue) != KErrNone ) |
|
645 { |
|
646 |
|
647 User :: Leave(KErrArgument) ; |
|
648 } |
|
649 |
|
650 |
|
651 |
|
652 if((ParsedValue >= KCallEvent ) && (ParsedValue <=KLogLbsAssistanceDataEvent)) |
|
653 { |
|
654 filterDetails->SetEventType(ParsedValue) ; |
|
655 } |
|
656 |
|
657 else |
|
658 { |
|
659 ; |
|
660 } |
|
661 |
|
662 |
|
663 |
|
664 |
|
665 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
666 { |
|
667 _LIT(KLog , "contact id not found") ; |
|
668 iLog->Log(KLog) ; |
|
669 User :: Leave(KErrArgument) ; |
|
670 } |
|
671 |
|
672 if(ParsedValue > 0 ) |
|
673 { |
|
674 filterDetails->SetContactType(ParsedValue) ; |
|
675 } |
|
676 |
|
677 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
678 { |
|
679 |
|
680 User :: Leave(KErrArgument) ; |
|
681 } |
|
682 |
|
683 if(ParsedValue> 0 ) |
|
684 { |
|
685 |
|
686 TTime time(ParsedValue); |
|
687 filterDetails->SetTimer(time) ; |
|
688 } |
|
689 |
|
690 |
|
691 |
|
692 |
|
693 if(aItem.GetNextString(sptr) !=KErrNone) |
|
694 { |
|
695 |
|
696 User :: Leave(KErrArgument) ; |
|
697 } |
|
698 |
|
699 if((sptr.Compare(KNull))) |
|
700 { |
|
701 filterDetails->SetNumberType(sptr) ; |
|
702 } |
|
703 |
|
704 if(aItem.GetNextString(sptr) !=KErrNone) |
|
705 { |
|
706 |
|
707 User :: Leave(KErrArgument) ; |
|
708 } |
|
709 |
|
710 if((sptr.Compare(KNull))) |
|
711 { |
|
712 filterDetails->SetRemotePartyType(sptr) ; |
|
713 } |
|
714 |
|
715 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
716 { |
|
717 |
|
718 User :: Leave(KErrArgument) ; |
|
719 } |
|
720 |
|
721 if(ParsedValue >= 0 ) |
|
722 { |
|
723 filterDetails->SetDirectionType(ParsedValue) ; |
|
724 } |
|
725 |
|
726 if(aItem.GetNextInt(ParsedValue) !=KErrNone) |
|
727 { |
|
728 |
|
729 User :: Leave(KErrArgument) ; |
|
730 } |
|
731 |
|
732 if(ParsedValue >= 0 ) |
|
733 { |
|
734 filterDetails->SetStatusType(ParsedValue) ; |
|
735 } |
|
736 |
|
737 |
|
738 |
|
739 if(aItem.GetNextInt(ParsedValue) != KErrNone) |
|
740 { |
|
741 |
|
742 User :: Leave(KErrArgument) ; |
|
743 } |
|
744 |
|
745 |
|
746 |
|
747 if(ParsedValue == 0 || ParsedValue < -1 ) |
|
748 { |
|
749 ; |
|
750 } |
|
751 else |
|
752 { |
|
753 filterDetails->SetRecentList(ParsedValue) ; |
|
754 } |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 if(aItem.GetNextInt( ParsedValue) != KErrNone ) |
|
760 { |
|
761 |
|
762 User :: Leave(KErrArgument) ; |
|
763 } |
|
764 |
|
765 |
|
766 if(ParsedValue == 0 ) |
|
767 { |
|
768 filterDetails->SetAllEvent(FALSE) ; |
|
769 } |
|
770 else if(ParsedValue == 1) |
|
771 |
|
772 { |
|
773 filterDetails->SetAllEvent(TRUE); |
|
774 } |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 if(aItem.GetNextInt(ParsedValue1) != KErrNone) |
|
780 { |
|
781 |
|
782 User :: Leave(KErrArgument) ; |
|
783 } |
|
784 |
|
785 |
|
786 if(aItem.GetNextInt(ParsedValue) != KErrNone ) |
|
787 { |
|
788 |
|
789 ret = KErrNone ; |
|
790 } |
|
791 else |
|
792 { |
|
793 ret = ParsedValue ; |
|
794 } |
|
795 |
|
796 |
|
797 TRAPD(error , getlist2L(filterDetails)) ; |
|
798 delete filterDetails; |
|
799 |
|
800 __UHEAP_MARKEND; |
|
801 |
|
802 |
|
803 return ret; |
|
804 |
|
805 |
|
806 } |
|
807 |
|
808 |
|
809 |
|
810 TInt Ctlogprovidertest::delete1L( CStifItemParser& aItem ) |
|
811 { |
|
812 |
|
813 TInt ret = 0; |
|
814 |
|
815 __UHEAP_MARK ; |
|
816 |
|
817 CEventDetails *eventDetails = CEventDetails :: NewL() ; |
|
818 |
|
819 |
|
820 TInt ParsedValue ; |
|
821 |
|
822 TBufC<100> String; |
|
823 TPtrC sptr; |
|
824 sptr.Set(String); |
|
825 // TInt ParsedValue1 ; |
|
826 |
|
827 //1 seteventype |
|
828 |
|
829 aItem.GetNextInt( ParsedValue); |
|
830 eventDetails->SetEventType(ParsedValue) ; |
|
831 |
|
832 |
|
833 |
|
834 //2 setduration |
|
835 |
|
836 aItem.GetNextInt(ParsedValue); |
|
837 eventDetails->SetDurationType(ParsedValue) ; |
|
838 |
|
839 //3 setcontact |
|
840 aItem.GetNextInt(ParsedValue); |
|
841 eventDetails->SetContactType(ParsedValue) ; |
|
842 |
|
843 |
|
844 //4 setlinktype |
|
845 aItem.GetNextInt(ParsedValue); |
|
846 eventDetails->SetLinkType(ParsedValue) ; |
|
847 |
|
848 //5 settimer |
|
849 aItem.GetNextInt(ParsedValue); |
|
850 |
|
851 TTime time(ParsedValue); |
|
852 eventDetails->SetTimer(time) ; |
|
853 |
|
854 |
|
855 |
|
856 //6 setsubject |
|
857 aItem.GetNextString(sptr); |
|
858 eventDetails->SetSubjectType(sptr) ; |
|
859 |
|
860 //7 setnumbertype |
|
861 aItem.GetNextString(sptr); |
|
862 eventDetails->SetNumberType(sptr) ; |
|
863 |
|
864 //8 setremoteparty |
|
865 aItem.GetNextString(sptr); |
|
866 eventDetails->SetRemotePartyType(sptr) ; |
|
867 |
|
868 //9 setdirectiontype |
|
869 aItem.GetNextInt(ParsedValue); |
|
870 eventDetails->SetDirectionType(ParsedValue) ; |
|
871 |
|
872 |
|
873 //10 setdescriptiontype |
|
874 aItem.GetNextString(sptr); |
|
875 eventDetails->SetDescriptionType(sptr) ; |
|
876 |
|
877 //11 setstatustype |
|
878 aItem.GetNextInt(ParsedValue); |
|
879 eventDetails->SetStatusType(ParsedValue) ; |
|
880 |
|
881 //12 |
|
882 aItem.GetNextInt(ParsedValue); |
|
883 |
|
884 |
|
885 if(ParsedValue == 0) |
|
886 { |
|
887 |
|
888 |
|
889 |
|
890 TRAPD(error , deletetest1L(eventDetails)) ; |
|
891 } |
|
892 else |
|
893 { |
|
894 TRAPD(error , deletetest1_0L(eventDetails)) ; |
|
895 } |
|
896 delete eventDetails; |
|
897 |
|
898 __UHEAP_MARKEND; |
|
899 |
|
900 |
|
901 return ret; |
|
902 |
|
903 |
|
904 } |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 |
|
911 |
|
912 |
|
913 |
|
914 |
|
915 |
|
916 |
|
917 |
|
918 |
|
919 TInt Ctlogprovidertest::delete2L( CStifItemParser& aItem ) |
|
920 { |
|
921 |
|
922 TInt ret = 0; |
|
923 |
|
924 __UHEAP_MARK ; |
|
925 |
|
926 CEventDetails *eventDetails = CEventDetails :: NewL() ; |
|
927 |
|
928 |
|
929 TInt ParsedValue ; |
|
930 |
|
931 TBufC<100> String; |
|
932 TPtrC sptr; |
|
933 sptr.Set(String); |
|
934 // TInt ParsedValue1 ; |
|
935 |
|
936 //1 seteventype |
|
937 |
|
938 aItem.GetNextInt( ParsedValue); |
|
939 eventDetails->SetEventType(ParsedValue) ; |
|
940 |
|
941 |
|
942 |
|
943 //2 setduration |
|
944 |
|
945 aItem.GetNextInt(ParsedValue); |
|
946 eventDetails->SetDurationType(ParsedValue) ; |
|
947 |
|
948 //3 setcontact |
|
949 aItem.GetNextInt(ParsedValue); |
|
950 eventDetails->SetContactType(ParsedValue) ; |
|
951 |
|
952 |
|
953 //4 setlinktype |
|
954 aItem.GetNextInt(ParsedValue); |
|
955 eventDetails->SetLinkType(ParsedValue) ; |
|
956 |
|
957 //5 settimer |
|
958 aItem.GetNextInt(ParsedValue); |
|
959 |
|
960 TTime time(ParsedValue); |
|
961 eventDetails->SetTimer(time) ; |
|
962 |
|
963 |
|
964 |
|
965 //6 setsubject |
|
966 aItem.GetNextString(sptr); |
|
967 eventDetails->SetSubjectType(sptr) ; |
|
968 |
|
969 //7 setnumbertype |
|
970 aItem.GetNextString(sptr); |
|
971 eventDetails->SetNumberType(sptr) ; |
|
972 |
|
973 //8 setremoteparty |
|
974 aItem.GetNextString(sptr); |
|
975 eventDetails->SetRemotePartyType(sptr) ; |
|
976 |
|
977 //9 setdirectiontype |
|
978 aItem.GetNextInt(ParsedValue); |
|
979 eventDetails->SetDirectionType(ParsedValue) ; |
|
980 |
|
981 |
|
982 //10 setdescriptiontype |
|
983 aItem.GetNextString(sptr); |
|
984 eventDetails->SetDescriptionType(sptr) ; |
|
985 |
|
986 //11 setstatustype |
|
987 aItem.GetNextInt(ParsedValue); |
|
988 eventDetails->SetStatusType(ParsedValue) ; |
|
989 |
|
990 |
|
991 |
|
992 |
|
993 |
|
994 |
|
995 TRAPD(error , deletetest2L(eventDetails)) ; |
|
996 delete eventDetails; |
|
997 |
|
998 __UHEAP_MARKEND; |
|
999 |
|
1000 |
|
1001 return ret; |
|
1002 |
|
1003 |
|
1004 } |
|
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 TInt Ctlogprovidertest::deleteneg1L( CStifItemParser& aItem ) |
|
1011 { |
|
1012 |
|
1013 |
|
1014 |
|
1015 TInt ParsedValue ; |
|
1016 |
|
1017 CLiwServiceHandler* ServiceHandler = CLiwServiceHandler::NewL(); |
|
1018 // Input and output parameter list |
|
1019 CLiwGenericParamList* inputlist = &(ServiceHandler->InParamListL()); |
|
1020 |
|
1021 CLiwGenericParamList* outputlist = &(ServiceHandler->OutParamListL()); |
|
1022 |
|
1023 CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KDsInterfaceName , KLoggingContents) ; |
|
1024 |
|
1025 |
|
1026 |
|
1027 crit->SetServiceClass(TUid::Uid(KLiwClassBase)); |
|
1028 |
|
1029 RCriteriaArray a; |
|
1030 |
|
1031 |
|
1032 a.AppendL(crit); |
|
1033 |
|
1034 |
|
1035 |
|
1036 |
|
1037 ServiceHandler->AttachL(a) ; |
|
1038 |
|
1039 |
|
1040 ServiceHandler->ExecuteServiceCmdL(*crit, *inputlist, *outputlist); |
|
1041 |
|
1042 |
|
1043 |
|
1044 |
|
1045 TInt pos = 0; |
|
1046 |
|
1047 |
|
1048 const TLiwGenericParam *genericparm = outputlist->FindFirst(pos , KDsInterfaceName); |
|
1049 |
|
1050 if(!genericparm) |
|
1051 { |
|
1052 |
|
1053 |
|
1054 User :: Leave(KErrArgument) ; |
|
1055 } |
|
1056 |
|
1057 MLiwInterface* LogInterface = (genericparm->Value()).AsInterface(); |
|
1058 |
|
1059 |
|
1060 |
|
1061 TBuf16 <10> Contents(KContentType) ; |
|
1062 |
|
1063 |
|
1064 aItem.GetNextInt(ParsedValue); |
|
1065 |
|
1066 |
|
1067 TInt itemid = ParsedValue; |
|
1068 |
|
1069 //TInt itemid = 12; |
|
1070 // TBuf<8> des; |
|
1071 //des.Num(itemid); |
|
1072 |
|
1073 inputlist->Reset() ; outputlist->Reset() ; |
|
1074 |
|
1075 |
|
1076 //Insert the contenttype to inputlist |
|
1077 CLiwDefaultMap *Idmap = CLiwDefaultMap :: NewL() ; |
|
1078 Idmap->InsertL(KLogId ,TLiwVariant(itemid)) ; |
|
1079 |
|
1080 TBufC16<10> contentType(KContentType) ; |
|
1081 //Insert the contenttype to inputlist |
|
1082 inputlist->AppendL(TLiwGenericParam(KContentTypeKey , TLiwVariant(contentType))) ; |
|
1083 |
|
1084 |
|
1085 // inputlist->AppendL(TLiwGenericParam(KLogId , TLiwVariant((TInt32)itemid))) ; |
|
1086 inputlist->AppendL(TLiwGenericParam(KData , TLiwVariant(Idmap))) ; |
|
1087 Idmap->DecRef(); |
|
1088 // CmdBuf = KCmdDelete ; |
|
1089 |
|
1090 TBufC8<20>CmdBuf(KCmdDelete) ; |
|
1091 LogInterface->ExecuteCmdL(CmdBuf , *inputlist , *outputlist) ; |
|
1092 |
|
1093 pos = 0 ; |
|
1094 const TLiwGenericParam *Errprm = outputlist->FindFirst(pos , KErrCode ) ; |
|
1095 |
|
1096 if(!Errprm) |
|
1097 { |
|
1098 |
|
1099 User :: Leave(KErrArgument) ; |
|
1100 } |
|
1101 |
|
1102 TInt retval1 = Errprm->Value().AsTInt32() ; |
|
1103 |
|
1104 if(retval1 != SErrBadArgumentType ) |
|
1105 { |
|
1106 |
|
1107 User :: Leave(KErrArgument) ; |
|
1108 } |
|
1109 |
|
1110 |
|
1111 |
|
1112 |
|
1113 LogInterface->Close() ; |
|
1114 delete ServiceHandler; |
|
1115 // delete crit; |
|
1116 |
|
1117 a.ResetAndDestroy(); |
|
1118 a.Close(); |
|
1119 return SErrNone; |
|
1120 |
|
1121 } |
|
1122 |
|
1123 |
|
1124 |
|
1125 |
|
1126 |
|
1127 |
|
1128 |
|
1129 |
|
1130 |
|
1131 TInt Ctlogprovidertest::cancel1L( CStifItemParser& aItem ) |
|
1132 { |
|
1133 TInt ret = 0; |
|
1134 |
|
1135 __UHEAP_MARK ; |
|
1136 |
|
1137 CEventDetails *eventDetails = CEventDetails :: NewL() ; |
|
1138 |
|
1139 |
|
1140 TInt ParsedValue ; |
|
1141 |
|
1142 TBufC<100> String; |
|
1143 TPtrC sptr; |
|
1144 sptr.Set(String); |
|
1145 // TInt ParsedValue1 ; |
|
1146 |
|
1147 //1 seteventype |
|
1148 |
|
1149 aItem.GetNextInt( ParsedValue); |
|
1150 eventDetails->SetEventType(ParsedValue) ; |
|
1151 |
|
1152 |
|
1153 |
|
1154 //2 setduration |
|
1155 |
|
1156 aItem.GetNextInt(ParsedValue); |
|
1157 eventDetails->SetDurationType(ParsedValue) ; |
|
1158 |
|
1159 //3 setcontact |
|
1160 aItem.GetNextInt(ParsedValue); |
|
1161 eventDetails->SetContactType(ParsedValue) ; |
|
1162 |
|
1163 |
|
1164 //4 setlinktype |
|
1165 aItem.GetNextInt(ParsedValue); |
|
1166 eventDetails->SetLinkType(ParsedValue) ; |
|
1167 |
|
1168 //5 settimer |
|
1169 aItem.GetNextInt(ParsedValue); |
|
1170 |
|
1171 TTime time(ParsedValue); |
|
1172 eventDetails->SetTimer(time) ; |
|
1173 |
|
1174 |
|
1175 |
|
1176 //6 setsubject |
|
1177 aItem.GetNextString(sptr); |
|
1178 eventDetails->SetSubjectType(sptr) ; |
|
1179 |
|
1180 //7 setnumbertype |
|
1181 aItem.GetNextString(sptr); |
|
1182 eventDetails->SetNumberType(sptr) ; |
|
1183 |
|
1184 //8 setremoteparty |
|
1185 aItem.GetNextString(sptr); |
|
1186 eventDetails->SetRemotePartyType(sptr) ; |
|
1187 |
|
1188 //9 setdirectiontype |
|
1189 aItem.GetNextInt(ParsedValue); |
|
1190 eventDetails->SetDirectionType(ParsedValue) ; |
|
1191 |
|
1192 |
|
1193 //10 setdescriptiontype |
|
1194 aItem.GetNextString(sptr); |
|
1195 eventDetails->SetDescriptionType(sptr) ; |
|
1196 |
|
1197 //11 setstatustype |
|
1198 aItem.GetNextInt(ParsedValue); |
|
1199 eventDetails->SetStatusType(ParsedValue) ; |
|
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 TRAPD(error , cancel1_0L(eventDetails)) ; |
|
1208 delete eventDetails; |
|
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 __UHEAP_MARKEND; |
|
1214 |
|
1215 return KErrNone; |
|
1216 |
|
1217 } |
|
1218 |
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 TInt Ctlogprovidertest::cancel2L( CStifItemParser& aItem ) |
|
1226 { |
|
1227 TInt ret = 0; |
|
1228 |
|
1229 __UHEAP_MARK ; |
|
1230 |
|
1231 CEventDetails *eventDetails = CEventDetails :: NewL() ; |
|
1232 |
|
1233 |
|
1234 TInt ParsedValue ; |
|
1235 |
|
1236 TBufC<100> String; |
|
1237 TPtrC sptr; |
|
1238 sptr.Set(String); |
|
1239 // TInt ParsedValue1 ; |
|
1240 |
|
1241 //1 seteventype |
|
1242 |
|
1243 aItem.GetNextInt( ParsedValue); |
|
1244 eventDetails->SetEventType(ParsedValue) ; |
|
1245 |
|
1246 |
|
1247 |
|
1248 //2 setduration |
|
1249 |
|
1250 aItem.GetNextInt(ParsedValue); |
|
1251 eventDetails->SetDurationType(ParsedValue) ; |
|
1252 |
|
1253 //3 setcontact |
|
1254 aItem.GetNextInt(ParsedValue); |
|
1255 eventDetails->SetContactType(ParsedValue) ; |
|
1256 |
|
1257 |
|
1258 //4 setlinktype |
|
1259 aItem.GetNextInt(ParsedValue); |
|
1260 eventDetails->SetLinkType(ParsedValue) ; |
|
1261 |
|
1262 //5 settimer |
|
1263 aItem.GetNextInt(ParsedValue); |
|
1264 |
|
1265 TTime time(ParsedValue); |
|
1266 eventDetails->SetTimer(time) ; |
|
1267 |
|
1268 |
|
1269 |
|
1270 //6 setsubject |
|
1271 aItem.GetNextString(sptr); |
|
1272 eventDetails->SetSubjectType(sptr) ; |
|
1273 |
|
1274 //7 setnumbertype |
|
1275 aItem.GetNextString(sptr); |
|
1276 eventDetails->SetNumberType(sptr) ; |
|
1277 |
|
1278 //8 setremoteparty |
|
1279 aItem.GetNextString(sptr); |
|
1280 eventDetails->SetRemotePartyType(sptr) ; |
|
1281 |
|
1282 //9 setdirectiontype |
|
1283 aItem.GetNextInt(ParsedValue); |
|
1284 eventDetails->SetDirectionType(ParsedValue) ; |
|
1285 |
|
1286 |
|
1287 //10 setdescriptiontype |
|
1288 aItem.GetNextString(sptr); |
|
1289 eventDetails->SetDescriptionType(sptr) ; |
|
1290 |
|
1291 //11 setstatustype |
|
1292 aItem.GetNextInt(ParsedValue); |
|
1293 eventDetails->SetStatusType(ParsedValue) ; |
|
1294 |
|
1295 |
|
1296 |
|
1297 |
|
1298 |
|
1299 |
|
1300 |
|
1301 TRAPD(error , cancel1_1L(eventDetails)) ; |
|
1302 delete eventDetails; |
|
1303 |
|
1304 |
|
1305 __UHEAP_MARKEND; |
|
1306 |
|
1307 |
|
1308 |
|
1309 return KErrNone; |
|
1310 |
|
1311 } |
|
1312 |
|
1313 |
|
1314 |
|
1315 |
|
1316 |
|
1317 |
|
1318 |
|
1319 |
|
1320 |
|
1321 |
|
1322 TInt Ctlogprovidertest::sapierrorsL( CStifItemParser& aItem ) |
|
1323 { |
|
1324 |
|
1325 TInt ret = 0; |
|
1326 __UHEAP_MARK; |
|
1327 |
|
1328 ret = sapierrors(); |
|
1329 |
|
1330 __UHEAP_MARKEND; |
|
1331 |
|
1332 return ret; |
|
1333 } |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 TInt Ctlogprovidertest::wronginterfaceL( CStifItemParser& aItem ) |
|
1339 { |
|
1340 |
|
1341 |
|
1342 //__UHEAP_MARK; |
|
1343 TInt ret = 0; |
|
1344 |
|
1345 __UHEAP_MARK ; |
|
1346 |
|
1347 CEventDetails *eventDetails = CEventDetails :: NewL() ; |
|
1348 |
|
1349 |
|
1350 |
|
1351 |
|
1352 //1 seteventype |
|
1353 |
|
1354 // aItem.GetNextInt( ParsedValue); |
|
1355 eventDetails->SetEventType(0) ; |
|
1356 |
|
1357 |
|
1358 |
|
1359 |
|
1360 |
|
1361 TRAP(ret, wronginterface1(eventDetails)); |
|
1362 |
|
1363 delete eventDetails; |
|
1364 __UHEAP_MARKEND; |
|
1365 if(ret == KErrArgument) |
|
1366 return KErrNone; |
|
1367 } |
|
1368 |
|
1369 |
|
1370 |
|
1371 |
|
1372 TInt Ctlogprovidertest::loadtwiceL( CStifItemParser& aItem ) |
|
1373 { |
|
1374 |
|
1375 |
|
1376 __UHEAP_MARK; |
|
1377 TInt ret = 0; |
|
1378 |
|
1379 |
|
1380 |
|
1381 CEventDetails *eventDetails = CEventDetails :: NewL() ; |
|
1382 |
|
1383 |
|
1384 |
|
1385 |
|
1386 //1 seteventype |
|
1387 |
|
1388 // aItem.GetNextInt( ParsedValue); |
|
1389 eventDetails->SetEventType(0) ; |
|
1390 |
|
1391 |
|
1392 |
|
1393 TRAP(ret , loadtwice(eventDetails)) ; |
|
1394 |
|
1395 |
|
1396 |
|
1397 delete eventDetails; |
|
1398 __UHEAP_MARKEND; |
|
1399 return ret; |
|
1400 } |
|
1401 |
|
1402 |
|
1403 |
|
1404 TInt Ctlogprovidertest::wrongcommandL( CStifItemParser& aItem ) |
|
1405 { |
|
1406 |
|
1407 |
|
1408 __UHEAP_MARK; |
|
1409 TInt ret = 0; |
|
1410 |
|
1411 // __UHEAP_MARK ; |
|
1412 |
|
1413 CEventDetails *eventDetails = CEventDetails :: NewL() ; |
|
1414 |
|
1415 |
|
1416 |
|
1417 |
|
1418 //1 seteventype |
|
1419 |
|
1420 // aItem.GetNextInt( ParsedValue); |
|
1421 eventDetails->SetEventType(0) ; |
|
1422 |
|
1423 |
|
1424 |
|
1425 TRAP(ret , wrongcommand(eventDetails)) ; |
|
1426 |
|
1427 |
|
1428 |
|
1429 delete eventDetails; |
|
1430 __UHEAP_MARKEND; |
|
1431 return ret; |
|
1432 } |
|
1433 |