Update contrib.
1 // Copyright (c) 2003-2010 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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 #include "t_logutil2.h"
22 RTest TheTest(_L("t_logview2"));
24 const TInt KTestEventNum = 20;
25 const TInt KTestErrorEventNum = 3;
26 const TLogContactItemId KTestContact1 = 0x123;
27 const TLogContactItemId KTestContact2 = 0x456;
28 const TLogContactItemId KTestContact3 = 0x789;
29 _LIT(KTestDirection1, "Direction Test 1");
30 _LIT(KTestDirection2, "Direction Test 2");
31 _LIT(KTestDirection3, "Direction Test 3");
32 _LIT(KTestNumber1, "Number Test 1");
33 _LIT(KTestNumber2, "Number Test 2");
34 _LIT(KTestNumber3, "Number Test 3");
35 _LIT(KTestRemote1, "Remote Test 1");
36 _LIT(KTestRemote2, "Remote Test 2");
37 _LIT(KTestRemote3, "Remote Test 3");
38 _LIT(KTestStatus1, "Status Test 1");
39 _LIT(KTestStatus2, "Status Test 2");
40 _LIT(KTestStatus3, "Status Test 3");
41 _LIT(KTestSubject, "Test Subject");
42 const TLogLink KTestLink = 0x123456;
43 _LIT8(KTestData, "Test data");
46 @SYMTestCaseID SYSLIB-LOGENG-CT-0930
47 @SYMTestCaseDesc Tests for the functionality of CLogViewEvent,CLogFilter classes
49 @SYMTestActions Tests for event view after setting filter on the views.
50 Change the filter list configuration and test for the view
51 @SYMTestExpectedResults Test must not fail
54 LOCAL_C void TestEventViewWithFilterListL(CLogClient& aClient)
56 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0930 "));
57 CTestActive* active = new(ELeave)CTestActive;
58 CleanupStack::PushL(active);
60 CLogEvent* event = CLogEvent::NewL();
61 CleanupStack::PushL(event);
63 event->SetEventType(KLogCallEventTypeUid);
64 event->SetContact(KTestContact1);
65 event->SetDirection(KTestDirection1);
66 event->SetDurationType(KLogDurationNone);
67 event->SetNumber(KTestNumber1);
68 event->SetRemoteParty(KTestRemote1);
69 event->SetStatus(KTestStatus1);
73 aClient.AddEvent(*event, active->iStatus);
74 CActiveScheduler::Start();
75 TEST2(active->iStatus.Int(), KErrNone);
77 event->SetEventType(KLogDataEventTypeUid);
78 event->SetContact(KTestContact2);
79 event->SetDirection(KTestDirection2);
80 event->SetDurationType(KLogDurationValid);
81 event->SetNumber(KTestNumber2);
82 event->SetRemoteParty(KTestRemote2);
83 event->SetStatus(KTestStatus2);
87 aClient.AddEvent(*event, active->iStatus);
88 CActiveScheduler::Start();
89 TEST2(active->iStatus.Int(), KErrNone);
91 event->SetEventType(KLogFaxEventTypeUid);
92 event->SetContact(KTestContact3);
93 event->SetDirection(KTestDirection3);
94 event->SetDurationType(KLogDurationData);
95 event->SetNumber(KTestNumber3);
96 event->SetRemoteParty(KTestRemote3);
97 event->SetStatus(KTestStatus3);
101 aClient.AddEvent(*event, active->iStatus);
102 CActiveScheduler::Start();
103 TEST2(active->iStatus.Int(), KErrNone);
105 CLogFilterList* list = new(ELeave)CLogFilterList;
106 CleanupStack::PushL(list);
108 CLogViewEvent* view = CLogViewEvent::NewL(aClient);
109 CleanupStack::PushL(view);
111 CLogFilter* filter = CLogFilter::NewL();
112 CleanupStack::PushL(filter);
115 filter->SetContact(KTestContact1);
117 list->AppendL(filter);
118 CleanupStack::Pop(); // filter
122 TEST(view->SetFilterL(*list, active->iStatus));
123 CActiveScheduler::Start();
124 TEST2(view->CountL(),1);
126 filter = CLogFilter::NewL();
127 CleanupStack::PushL(filter);
130 filter->SetContact(KTestContact2);
132 list->AppendL(filter);
133 CleanupStack::Pop(); // filter
137 TEST(view->SetFilterL(*list, active->iStatus));
138 CActiveScheduler::Start();
139 TEST2(view->CountL(), 2);
141 filter = CLogFilter::NewL();
142 CleanupStack::PushL(filter);
145 filter->SetContact(KTestContact3);
147 list->AppendL(filter);
148 CleanupStack::Pop(); // filter
152 TEST(view->SetFilterL(*list, active->iStatus));
153 CActiveScheduler::Start();
154 TEST2(view->CountL(), 3);
156 list->ResetAndDestroy();
158 /////////////////////////////////////////
160 filter = CLogFilter::NewL();
161 CleanupStack::PushL(filter);
164 filter->SetContact(KTestContact1);
165 filter->SetDirection(KTestDirection1);
167 list->AppendL(filter);
168 CleanupStack::Pop(); // filter
172 TEST(view->SetFilterL(*list, active->iStatus));
173 CActiveScheduler::Start();
174 TEST2(view->CountL(), 1);
176 filter = CLogFilter::NewL();
177 CleanupStack::PushL(filter);
180 filter->SetContact(KTestContact2);
181 filter->SetDirection(KTestDirection2);
183 list->AppendL(filter);
184 CleanupStack::Pop(); // filter
188 TEST(view->SetFilterL(*list, active->iStatus));
189 CActiveScheduler::Start();
190 TEST2(view->CountL(), 2);
192 filter = CLogFilter::NewL();
193 CleanupStack::PushL(filter);
196 filter->SetContact(KTestContact3);
197 filter->SetDirection(KTestDirection3);
199 list->AppendL(filter);
200 CleanupStack::Pop(); // filter
204 TEST(view->SetFilterL(*list, active->iStatus));
205 CActiveScheduler::Start();
206 TEST2(view->CountL(), 3);
208 list->ResetAndDestroy();
210 /////////////////////////////////////////
212 filter = CLogFilter::NewL();
213 CleanupStack::PushL(filter);
216 filter->SetContact(KTestContact1);
217 filter->SetDirection(KTestDirection1);
218 filter->SetDurationType(KLogDurationNone);
220 list->AppendL(filter);
221 CleanupStack::Pop(); // filter
225 TEST(view->SetFilterL(*list, active->iStatus));
226 CActiveScheduler::Start();
227 TEST2(view->CountL(), 1);
229 filter = CLogFilter::NewL();
230 CleanupStack::PushL(filter);
233 filter->SetContact(KTestContact2);
234 filter->SetDirection(KTestDirection2);
235 filter->SetDurationType(KLogDurationValid);
237 list->AppendL(filter);
238 CleanupStack::Pop(); // filter
242 TEST(view->SetFilterL(*list, active->iStatus));
243 CActiveScheduler::Start();
244 TEST2(view->CountL(), 2);
246 filter = CLogFilter::NewL();
247 CleanupStack::PushL(filter);
250 filter->SetContact(KTestContact3);
251 filter->SetDirection(KTestDirection3);
252 filter->SetDurationType(KLogDurationData);
254 list->AppendL(filter);
255 CleanupStack::Pop(); // filter
259 TEST(view->SetFilterL(*list, active->iStatus));
260 CActiveScheduler::Start();
261 TEST2(view->CountL(), 3);
263 list->ResetAndDestroy();
265 /////////////////////////////////////////
267 filter = CLogFilter::NewL();
268 CleanupStack::PushL(filter);
271 filter->SetContact(KTestContact1);
272 filter->SetDirection(KTestDirection1);
273 filter->SetDurationType(KLogDurationNone);
274 filter->SetEventType(KLogCallEventTypeUid);
276 list->AppendL(filter);
277 CleanupStack::Pop(); // filter
281 TEST(view->SetFilterL(*list, active->iStatus));
282 CActiveScheduler::Start();
283 TEST2(view->CountL(), 1);
285 filter = CLogFilter::NewL();
286 CleanupStack::PushL(filter);
289 filter->SetContact(KTestContact2);
290 filter->SetDirection(KTestDirection2);
291 filter->SetDurationType(KLogDurationValid);
292 filter->SetEventType(KLogDataEventTypeUid);
294 list->AppendL(filter);
295 CleanupStack::Pop(); // filter
299 TEST(view->SetFilterL(*list, active->iStatus));
300 CActiveScheduler::Start();
301 TEST2(view->CountL(), 2);
303 filter = CLogFilter::NewL();
304 CleanupStack::PushL(filter);
307 filter->SetContact(KTestContact3);
308 filter->SetDirection(KTestDirection3);
309 filter->SetDurationType(KLogDurationData);
310 filter->SetEventType(KLogFaxEventTypeUid);
312 list->AppendL(filter);
313 CleanupStack::Pop(); // filter
317 TEST(view->SetFilterL(*list, active->iStatus));
318 CActiveScheduler::Start();
319 TEST2(view->CountL(), 3);
321 list->ResetAndDestroy();
323 /////////////////////////////////////////
325 filter = CLogFilter::NewL();
326 CleanupStack::PushL(filter);
329 filter->SetContact(KTestContact1);
330 filter->SetDirection(KTestDirection1);
331 filter->SetDurationType(KLogDurationNone);
332 filter->SetEventType(KLogCallEventTypeUid);
333 filter->SetNumber(KTestNumber1);
335 list->AppendL(filter);
336 CleanupStack::Pop(); // filter
340 TEST(view->SetFilterL(*list, active->iStatus));
341 CActiveScheduler::Start();
342 TEST2(view->CountL(), 1);
344 filter = CLogFilter::NewL();
345 CleanupStack::PushL(filter);
348 filter->SetContact(KTestContact2);
349 filter->SetDirection(KTestDirection2);
350 filter->SetDurationType(KLogDurationValid);
351 filter->SetEventType(KLogDataEventTypeUid);
352 filter->SetNumber(KTestNumber2);
354 list->AppendL(filter);
355 CleanupStack::Pop(); // filter
359 TEST(view->SetFilterL(*list, active->iStatus));
360 CActiveScheduler::Start();
361 TEST2(view->CountL(), 2);
363 filter = CLogFilter::NewL();
364 CleanupStack::PushL(filter);
367 filter->SetContact(KTestContact3);
368 filter->SetDirection(KTestDirection3);
369 filter->SetDurationType(KLogDurationData);
370 filter->SetEventType(KLogFaxEventTypeUid);
371 filter->SetNumber(KTestNumber3);
373 list->AppendL(filter);
374 CleanupStack::Pop(); // filter
378 TEST(view->SetFilterL(*list, active->iStatus));
379 CActiveScheduler::Start();
380 TEST2(view->CountL(), 3);
382 list->ResetAndDestroy();
384 /////////////////////////////////////////
386 filter = CLogFilter::NewL();
387 CleanupStack::PushL(filter);
390 filter->SetContact(KTestContact1);
391 filter->SetDirection(KTestDirection1);
392 filter->SetDurationType(KLogDurationNone);
393 filter->SetEventType(KLogCallEventTypeUid);
394 filter->SetNumber(KTestNumber1);
395 filter->SetRemoteParty(KTestRemote1);
397 list->AppendL(filter);
398 CleanupStack::Pop(); // filter
402 TEST(view->SetFilterL(*list, active->iStatus));
403 CActiveScheduler::Start();
404 TEST2(view->CountL(), 1);
406 filter = CLogFilter::NewL();
407 CleanupStack::PushL(filter);
410 filter->SetContact(KTestContact2);
411 filter->SetDirection(KTestDirection2);
412 filter->SetDurationType(KLogDurationValid);
413 filter->SetEventType(KLogDataEventTypeUid);
414 filter->SetNumber(KTestNumber2);
415 filter->SetRemoteParty(KTestRemote2);
417 list->AppendL(filter);
418 CleanupStack::Pop(); // filter
422 TEST(view->SetFilterL(*list, active->iStatus));
423 CActiveScheduler::Start();
424 TEST2(view->CountL(), 2);
426 filter = CLogFilter::NewL();
427 CleanupStack::PushL(filter);
430 filter->SetContact(KTestContact3);
431 filter->SetDirection(KTestDirection3);
432 filter->SetDurationType(KLogDurationData);
433 filter->SetEventType(KLogFaxEventTypeUid);
434 filter->SetNumber(KTestNumber3);
435 filter->SetRemoteParty(KTestRemote3);
437 list->AppendL(filter);
438 CleanupStack::Pop(); // filter
442 TEST(view->SetFilterL(*list, active->iStatus));
443 CActiveScheduler::Start();
444 TEST2(view->CountL(), 3);
446 list->ResetAndDestroy();
448 /////////////////////////////////////////
450 filter = CLogFilter::NewL();
451 CleanupStack::PushL(filter);
454 filter->SetContact(KTestContact1);
455 filter->SetDirection(KTestDirection1);
456 filter->SetDurationType(KLogDurationNone);
457 filter->SetEventType(KLogCallEventTypeUid);
458 filter->SetNumber(KTestNumber1);
459 filter->SetRemoteParty(KTestRemote1);
460 filter->SetStatus(KTestStatus1);
462 list->AppendL(filter);
463 CleanupStack::Pop(); // filter
467 TEST(view->SetFilterL(*list, active->iStatus));
468 CActiveScheduler::Start();
469 TEST2(view->CountL(), 1);
471 filter = CLogFilter::NewL();
472 CleanupStack::PushL(filter);
475 filter->SetContact(KTestContact2);
476 filter->SetDirection(KTestDirection2);
477 filter->SetDurationType(KLogDurationValid);
478 filter->SetEventType(KLogDataEventTypeUid);
479 filter->SetNumber(KTestNumber2);
480 filter->SetRemoteParty(KTestRemote2);
481 filter->SetStatus(KTestStatus2);
483 list->AppendL(filter);
484 CleanupStack::Pop(); // filter
488 TEST(view->SetFilterL(*list, active->iStatus));
489 CActiveScheduler::Start();
490 TEST2(view->CountL(), 2);
492 filter = CLogFilter::NewL();
493 CleanupStack::PushL(filter);
496 filter->SetContact(KTestContact3);
497 filter->SetDirection(KTestDirection3);
498 filter->SetDurationType(KLogDurationData);
499 filter->SetEventType(KLogFaxEventTypeUid);
500 filter->SetNumber(KTestNumber3);
501 filter->SetRemoteParty(KTestRemote3);
502 filter->SetStatus(KTestStatus3);
504 list->AppendL(filter);
505 CleanupStack::Pop(); // filter
509 TEST(view->SetFilterL(*list, active->iStatus));
510 CActiveScheduler::Start();
511 TEST2(view->CountL(), 3);
513 list->ResetAndDestroy();
515 CleanupStack::PopAndDestroy(4); // list, view, event, active
519 @SYMTestCaseID SYSLIB-LOGENG-CT-3432
520 @SYMTestCaseDesc Test the functionality of CLogViewEvent::SetFilterL with the CLogFilterList parameter containing multiple filters with start time and end time.
521 @SYMTestPriority High
522 @SYMTestActions 1. Add 2 events.
523 2. Setup a CLogFilterList with two filters targeting the first event. Both filters have start and end time. Call SetFilterL.
524 3. Verify view has 1 event and no LogServ panic.
525 4. Clear the filter list.
526 5. Setup filter for first event with start and end time. Call SetFilterL.
527 6. Verify view has one event.
528 7. Setup second filter for second event with start and end time. Append this filter to filter list and call SetFilterL.
529 8. Verify view has 2 events and no LogServ panic.
530 @SYMTestExpectedResults Log view has expected number of events and no LogServ panic.
533 LOCAL_C void TestEventViewWithTimestampsInFilterListL(CLogClient& aClient)
535 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3432 "));
537 testStartTime.UniversalTime();
538 TTime tomorrow = testStartTime + (TTimeIntervalDays)1;
539 TTime twoDaysFromNow = tomorrow + (TTimeIntervalDays)1;
541 CTestActive* active = new(ELeave)CTestActive;
542 CleanupStack::PushL(active);
544 // Get rid of all the events in the log
546 aClient.ClearLog(tomorrow, active->iStatus);
547 CActiveScheduler::Start();
548 TEST2(active->iStatus.Int(), KErrNone);
550 // Wait a second before adding events to log.
551 User::After(1100000);
553 // Add two events to log
554 CLogEvent* event = CLogEvent::NewL();
555 CleanupStack::PushL(event);
558 event->SetEventType(KLogCallEventTypeUid);
559 event->SetContact(KTestContact1);
560 event->SetDirection(KTestDirection1);
561 event->SetDurationType(KLogDurationNone);
562 event->SetNumber(KTestNumber1);
563 event->SetRemoteParty(KTestRemote1);
564 event->SetStatus(KTestStatus1);
567 aClient.AddEvent(*event, active->iStatus);
568 CActiveScheduler::Start();
569 TEST2(active->iStatus.Int(), KErrNone);
572 event->SetEventType(KLogDataEventTypeUid);
573 event->SetContact(KTestContact2);
574 event->SetDirection(KTestDirection2);
575 event->SetDurationType(KLogDurationValid);
576 event->SetNumber(KTestNumber2);
577 event->SetRemoteParty(KTestRemote2);
578 event->SetStatus(KTestStatus2);
581 aClient.AddEvent(*event, active->iStatus);
582 CActiveScheduler::Start();
583 TEST2(active->iStatus.Int(), KErrNone);
586 CLogFilterList* list = new(ELeave)CLogFilterList;
587 CleanupStack::PushL(list);
589 CLogViewEvent* view = CLogViewEvent::NewL(aClient);
590 CleanupStack::PushL(view);
592 CLogFilter* filter = CLogFilter::NewL();
593 CleanupStack::PushL(filter);
596 filter->SetContact(KTestContact1);
597 filter->SetDirection(KTestDirection1);
598 filter->SetDurationType(KLogDurationNone);
599 filter->SetStartTime(testStartTime);
600 TTime t1 = filter->StartTime();
601 TEST(t1 == testStartTime);
602 filter->SetEndTime(tomorrow);
603 TTime t2 = filter->EndTime();
604 TEST(t2 == tomorrow);
606 list->AppendL(filter);
607 CleanupStack::Pop(); // filter
609 // set the other half of filter for event 1
610 filter = CLogFilter::NewL();
611 CleanupStack::PushL(filter);
613 filter->SetEventType(KLogCallEventTypeUid);
614 filter->SetNumber(KTestNumber1);
615 filter->SetRemoteParty(KTestRemote1);
616 filter->SetStatus(KTestStatus1);
618 // start time is duplicate of previous filter,
619 // end time is not duplicate
620 filter->SetStartTime(testStartTime);
621 filter->SetEndTime(twoDaysFromNow);
623 list->AppendL(filter);
624 CleanupStack::Pop(); // filter
628 TEST(view->SetFilterL(*list, active->iStatus));
629 CActiveScheduler::Start();
630 TEST2(view->CountL(),1);
632 list->ResetAndDestroy();
634 // check contents of the event.
635 TBool res = view->FirstL(active->iStatus);
638 CActiveScheduler::Start();
639 TEST2(active->iStatus.Int(), KErrNone);
641 TEST2(view->Event().Contact(), KTestContact1);
642 TEST( view->Event().Number() == KTestNumber1);
643 TEST( view->Event().Status() == KTestStatus1);
644 TEST( view->Event().RemoteParty() == KTestRemote1);
646 /////////////////////////////////////////
648 filter = CLogFilter::NewL();
649 CleanupStack::PushL(filter);
652 filter->SetContact(KTestContact1);
653 filter->SetDirection(KTestDirection1);
654 filter->SetDurationType(KLogDurationNone);
655 filter->SetEventType(KLogCallEventTypeUid);
656 filter->SetNumber(KTestNumber1);
657 filter->SetRemoteParty(KTestRemote1);
658 filter->SetStatus(KTestStatus1);
659 filter->SetStartTime(testStartTime);
660 filter->SetEndTime(tomorrow);
662 list->AppendL(filter);
663 CleanupStack::Pop(); // filter
667 TEST(view->SetFilterL(*list, active->iStatus));
668 CActiveScheduler::Start();
669 TEST2(view->CountL(), 1);
671 filter = CLogFilter::NewL();
672 CleanupStack::PushL(filter);
675 filter->SetContact(KTestContact2);
676 filter->SetDirection(KTestDirection2);
677 filter->SetDurationType(KLogDurationValid);
678 filter->SetEventType(KLogDataEventTypeUid);
679 filter->SetNumber(KTestNumber2);
680 filter->SetRemoteParty(KTestRemote2);
681 filter->SetStatus(KTestStatus2);
683 // start time is duplicate,
684 // end time is not duplicate
685 filter->SetStartTime(testStartTime);
686 filter->SetEndTime(twoDaysFromNow);
688 list->AppendL(filter);
689 CleanupStack::Pop(); // filter
693 TEST(view->SetFilterL(*list, active->iStatus));
694 CActiveScheduler::Start();
695 TEST2(view->CountL(), 2);
697 list->ResetAndDestroy();
699 // check contents of event 2 (most recent)
700 res = view->FirstL(active->iStatus);
703 CActiveScheduler::Start();
704 TEST2(active->iStatus.Int(), KErrNone);
706 TEST2(view->Event().Contact(), KTestContact2);
707 TEST( view->Event().Number() == KTestNumber2);
708 TEST( view->Event().Status() == KTestStatus2);
709 TEST( view->Event().RemoteParty() == KTestRemote2);
711 // check contents of event 1 (older)
712 res = view->NextL(active->iStatus);
715 CActiveScheduler::Start();
716 TEST2(active->iStatus.Int(), KErrNone);
718 TEST2(view->Event().Contact(), KTestContact1);
719 TEST( view->Event().Number() == KTestNumber1);
720 TEST( view->Event().Status() == KTestStatus1);
721 TEST( view->Event().RemoteParty() == KTestRemote1);
723 CleanupStack::PopAndDestroy(4); // list, view, event, active
727 @SYMTestCaseID SYSLIB-LOGENG-CT-0931
728 @SYMTestCaseDesc Tests for recent view list with filters
729 @SYMTestPriority High
730 @SYMTestActions Tests for recent view list,with different settings of the filter.
731 @SYMTestExpectedResults Test must not fail
734 LOCAL_C void TestRecentViewWithFilterL(CLogClient& aClient)
736 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0931 "));
737 CLogEvent* event = CLogEvent::NewL();
738 CleanupStack::PushL(event);
740 CTestActive* active = new(ELeave)CTestActive();
741 CleanupStack::PushL(active);
743 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
744 CleanupStack::PushL(view);
748 aClient.GetString(buf, R_LOG_DIR_IN);
750 event->SetEventType(KLogCallEventTypeUid);
751 event->SetDirection(buf);
752 event->SetNumber(_L("1"));
756 aClient.AddEvent(*event, active->iStatus);
757 CActiveScheduler::Start();
758 TEST2(active->iStatus.Int(), KErrNone);
760 event->SetDurationType(KLogDurationData);
761 event->SetNumber(_L("2"));
765 aClient.AddEvent(*event, active->iStatus);
766 CActiveScheduler::Start();
767 TEST2(active->iStatus.Int(), KErrNone);
769 event->SetStatus(KTestStatus1);
770 event->SetNumber(_L("3"));
774 aClient.AddEvent(*event, active->iStatus);
775 CActiveScheduler::Start();
776 TEST2(active->iStatus.Int(), KErrNone);
778 event->SetContact(KTestContact1);
779 event->SetNumber(_L("4"));
783 aClient.AddEvent(*event, active->iStatus);
784 CActiveScheduler::Start();
785 TEST2(active->iStatus.Int(), KErrNone);
788 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
789 CActiveScheduler::Start();
790 TEST2(view->CountL(), 4);
792 CLogFilter* filter = CLogFilter::NewL();
793 CleanupStack::PushL(filter);
795 // This should make no difference
796 filter->SetEventType(KLogCallEventTypeUid);
799 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
800 CActiveScheduler::Start();
801 TEST2(view->CountL(), 4);
803 // This should make no difference
804 filter->SetDirection(buf);
807 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
808 CActiveScheduler::Start();
809 TEST2(view->CountL(), 4);
811 filter->SetDurationType(KLogDurationData);
814 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
815 CActiveScheduler::Start();
816 TEST2(view->CountL(), 3);
818 filter->SetStatus(KTestStatus1);
821 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
822 CActiveScheduler::Start();
823 TEST2(view->CountL(), 2);
825 filter->SetContact(KTestContact1);
828 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
829 CActiveScheduler::Start();
830 TEST2(view->CountL(), 1);
832 filter->SetStatus(_L("Dummy"));
833 TEST(!view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
835 CleanupStack::PopAndDestroy(4); // filter, view, active, event
839 @SYMTestCaseID SYSLIB-LOGENG-CT-0932
840 @SYMTestCaseDesc Tests for recent view list with filter set for the view
841 @SYMTestPriority High
842 @SYMTestActions Tests for recent view list set by the specified set of filters.
843 @SYMTestExpectedResults Test must not fail
846 LOCAL_C void TestRecentViewWithFilterListL(CLogClient& aClient)
848 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0932 "));
849 CLogEvent* event = CLogEvent::NewL();
850 CleanupStack::PushL(event);
852 CTestActive* active = new(ELeave)CTestActive();
853 CleanupStack::PushL(active);
855 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
856 CleanupStack::PushL(view);
858 // Make sure there are no entries in any recent lists
860 aClient.ClearLog(KLogNullRecentList, active->iStatus);
861 CActiveScheduler::Start();
862 TEST2(active->iStatus.Int(), KErrNone);
866 aClient.GetString(buf, R_LOG_DIR_IN);
868 event->SetEventType(KLogCallEventTypeUid);
869 event->SetDirection(buf);
870 event->SetDurationType(KLogDurationNone);
871 event->SetContact(KTestContact1);
872 event->SetStatus(KTestStatus1);
876 aClient.AddEvent(*event, active->iStatus);
877 CActiveScheduler::Start();
878 TEST2(active->iStatus.Int(), KErrNone);
880 event->SetDurationType(KLogDurationValid);
881 event->SetContact(KTestContact2);
882 event->SetStatus(KTestStatus2);
886 aClient.AddEvent(*event, active->iStatus);
887 CActiveScheduler::Start();
888 TEST2(active->iStatus.Int(), KErrNone);
890 event->SetDurationType(KLogDurationData);
891 event->SetContact(KTestContact3);
892 event->SetStatus(KTestStatus3);
896 aClient.AddEvent(*event, active->iStatus);
897 CActiveScheduler::Start();
898 TEST2(active->iStatus.Int(), KErrNone);
901 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
902 CActiveScheduler::Start();
903 TEST2(active->iStatus.Int(), KErrNone);
904 TEST2(view->CountL(), 3);
906 CLogFilterList* list = new(ELeave)CLogFilterList;
907 CleanupStack::PushL(list);
909 CLogFilter* filter = CLogFilter::NewL();
910 CleanupStack::PushL(filter);
911 list->AppendL(filter);
912 CleanupStack::Pop(); // filter
914 filter->SetDurationType(KLogDurationNone);
915 filter->SetStatus(KTestStatus1);
916 filter->SetContact(KTestContact1);
919 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *list, active->iStatus));
920 CActiveScheduler::Start();
921 TEST2(active->iStatus.Int(), KErrNone);
922 TEST2(view->CountL(), 1);
924 filter = CLogFilter::NewL();
925 CleanupStack::PushL(filter);
926 list->AppendL(filter);
927 CleanupStack::Pop(); // filter
929 filter->SetDurationType(KLogDurationValid);
930 filter->SetStatus(KTestStatus2);
931 filter->SetContact(KTestContact2);
934 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *list, active->iStatus));
935 CActiveScheduler::Start();
936 TEST2(active->iStatus.Int(), KErrNone);
937 TEST2(view->CountL(), 2);
939 filter = CLogFilter::NewL();
940 CleanupStack::PushL(filter);
941 list->AppendL(filter);
942 CleanupStack::Pop(); // filter
944 filter->SetDurationType(KLogDurationData);
945 filter->SetStatus(KTestStatus3);
946 filter->SetContact(KTestContact3);
949 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *list, active->iStatus));
950 CActiveScheduler::Start();
951 TEST2(active->iStatus.Int(), KErrNone);
952 TEST2(view->CountL(), 3);
954 list->ResetAndDestroy();
955 CleanupStack::PopAndDestroy(4); // list, view, active, event
959 @SYMTestCaseID SYSLIB-LOGENG-CT-0933
960 @SYMTestCaseDesc Tests for duplicate event view with filter
961 @SYMTestPriority High
962 @SYMTestActions Tests for duplicate event view count.
963 @SYMTestExpectedResults Test must not fail
966 LOCAL_C void TestDuplicateViewWithFilterL(CLogClient& aClient)
968 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0933 "));
969 CLogEvent* event = CLogEvent::NewL();
970 CleanupStack::PushL(event);
972 CTestActive* active = new(ELeave)CTestActive();
973 CleanupStack::PushL(active);
975 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
976 CleanupStack::PushL(view);
978 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
979 CleanupStack::PushL(duplicate);
981 // Make sure there are no entries in any recent lists
983 aClient.ClearLog(KLogNullRecentList, active->iStatus);
984 CActiveScheduler::Start();
985 TEST2(active->iStatus.Int(), KErrNone);
989 aClient.GetString(buf, R_LOG_DIR_IN);
991 event->SetEventType(KLogCallEventTypeUid);
992 event->SetDirection(buf);
993 event->SetContact(KTestContact1);
997 aClient.AddEvent(*event, active->iStatus);
998 CActiveScheduler::Start();
999 TEST2(active->iStatus.Int(), KErrNone);
1001 event->SetDurationType(KLogDurationValid);
1005 aClient.AddEvent(*event, active->iStatus);
1006 CActiveScheduler::Start();
1007 TEST2(active->iStatus.Int(), KErrNone);
1009 event->SetStatus(KTestStatus1);
1013 aClient.AddEvent(*event, active->iStatus);
1014 CActiveScheduler::Start();
1015 TEST2(active->iStatus.Int(), KErrNone);
1017 event->SetDurationType(KLogDurationNone);
1018 event->SetStatus(KNullDesC);
1020 // Add event - This will be the entry in recent list
1022 aClient.AddEvent(*event, active->iStatus);
1023 CActiveScheduler::Start();
1024 TEST2(active->iStatus.Int(), KErrNone);
1025 TLogId logId1 = event->Id();
1027 // Should only be one event in recent list - the rest are duplicates
1029 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
1030 CActiveScheduler::Start();
1031 TEST2(active->iStatus.Int(), KErrNone);
1032 TEST2(view->CountL(), 1);
1034 TLogRecentList recentList = view->RecentList();
1035 TEST(recentList == KLogRecentIncomingCalls);
1037 // Check duplicate count
1039 TEST(view->DuplicatesL(*duplicate, active->iStatus));
1040 CActiveScheduler::Start();
1041 TEST2(active->iStatus.Int(), KErrNone);
1042 TEST2(duplicate->CountL(), 3);
1044 TLogId logId2 = duplicate->Source();
1045 TEST(logId1 == logId2);
1047 CLogFilter* filter = CLogFilter::NewL();
1048 CleanupStack::PushL(filter);
1051 TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus));
1052 CActiveScheduler::Start();
1053 TEST2(active->iStatus.Int(), KErrNone);
1054 TEST2(duplicate->CountL(), 3);
1056 filter->SetDurationType(KLogDurationValid);
1059 TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus));
1060 CActiveScheduler::Start();
1061 TEST2(active->iStatus.Int(), KErrNone);
1062 TEST2(duplicate->CountL(), 2);
1064 filter->SetStatus(KTestStatus1);
1067 TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus));
1068 CActiveScheduler::Start();
1069 TEST2(active->iStatus.Int(), KErrNone);
1070 TEST2(duplicate->CountL(), 1);
1072 filter->SetStatus(KTestStatus2);
1073 TEST(!view->DuplicatesL(*duplicate, *filter, active->iStatus));
1075 CleanupStack::PopAndDestroy(5); // filter, duplicate, view, active, event
1079 @SYMTestCaseID SYSLIB-LOGENG-CT-0934
1080 @SYMTestCaseDesc Tests for duplicate event view with filter list
1081 @SYMTestPriority High
1082 @SYMTestActions Tests for duplicate event view count,set by the specified set of filters.
1083 @SYMTestExpectedResults Test must not fail
1086 LOCAL_C void TestDuplicateViewWithFilterListL(CLogClient& aClient)
1088 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0934 "));
1089 CLogEvent* event = CLogEvent::NewL();
1090 CleanupStack::PushL(event);
1092 CTestActive* active = new(ELeave)CTestActive();
1093 CleanupStack::PushL(active);
1095 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
1096 CleanupStack::PushL(view);
1098 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
1099 CleanupStack::PushL(duplicate);
1101 // Make sure there are no entries in any recent lists
1103 aClient.ClearLog(KLogNullRecentList, active->iStatus);
1104 CActiveScheduler::Start();
1105 TEST2(active->iStatus.Int(), KErrNone);
1109 aClient.GetString(buf, R_LOG_DIR_IN);
1111 event->SetEventType(KLogCallEventTypeUid);
1112 event->SetDirection(buf);
1113 event->SetContact(KTestContact1);
1115 event->SetDurationType(KLogDurationNone);
1116 event->SetStatus(KNullDesC);
1120 aClient.AddEvent(*event, active->iStatus);
1121 CActiveScheduler::Start();
1122 TEST2(active->iStatus.Int(), KErrNone);
1124 event->SetDurationType(KLogDurationValid);
1127 aClient.AddEvent(*event, active->iStatus);
1128 CActiveScheduler::Start();
1129 TEST2(active->iStatus.Int(), KErrNone);
1131 event->SetDurationType(KLogDurationData);
1134 aClient.AddEvent(*event, active->iStatus);
1135 CActiveScheduler::Start();
1136 TEST2(active->iStatus.Int(), KErrNone);
1138 // Final event will be most recent
1139 event->SetDurationType(KLogDurationNone);
1140 event->SetStatus(KNullDesC);
1144 aClient.AddEvent(*event, active->iStatus);
1145 CActiveScheduler::Start();
1146 TEST2(active->iStatus.Int(), KErrNone);
1148 CLogFilterList* list = new(ELeave)CLogFilterList;
1149 CleanupStack::PushL(list);
1152 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
1153 CActiveScheduler::Start();
1154 TEST2(active->iStatus.Int(), KErrNone);
1155 TEST2(view->CountL(), 1);
1158 TEST(view->DuplicatesL(*duplicate, active->iStatus));
1159 CActiveScheduler::Start();
1160 TEST2(active->iStatus.Int(), KErrNone);
1161 TEST2(duplicate->CountL(), 3);
1163 CLogFilter* filter = CLogFilter::NewL();
1164 CleanupStack::PushL(filter);
1165 list->AppendL(filter);
1166 CleanupStack::Pop(); // filter
1168 filter->SetDurationType(KLogDurationValid);
1171 TEST(view->DuplicatesL(*duplicate, *list, active->iStatus));
1172 CActiveScheduler::Start();
1173 TEST2(active->iStatus.Int(), KErrNone);
1174 TEST2(duplicate->CountL(), 1);
1176 filter = CLogFilter::NewL();
1177 CleanupStack::PushL(filter);
1178 list->AppendL(filter);
1179 CleanupStack::Pop(); // filter
1181 filter->SetDurationType(KLogDurationData);
1184 TEST(view->DuplicatesL(*duplicate, *list, active->iStatus));
1185 CActiveScheduler::Start();
1186 TEST2(active->iStatus.Int(), KErrNone);
1187 TEST2(duplicate->CountL(), 2);
1189 list->ResetAndDestroy();
1190 CleanupStack::PopAndDestroy(5); // list, duplicate, view, active, event
1194 @SYMTestCaseID SYSLIB-LOGENG-CT-0935
1195 @SYMTestCaseDesc Tests for null field set on filter in the event view
1196 Tests for CLogFilter::SetNullFields() function
1197 @SYMTestPriority High
1198 @SYMTestActions Clear the log events and add new events with fields set in.Define null fields in the filter and check the view
1199 @SYMTestExpectedResults Test must not fail
1202 LOCAL_C void TestEventViewForNullFieldsL(CLogClient& aClient)
1204 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0935 "));
1205 CTestActive* active = new(ELeave)CTestActive;
1206 CleanupStack::PushL(active);
1208 CLogEvent* event = CLogEvent::NewL();
1209 CleanupStack::PushL(event);
1210 event->SetEventType(KLogCallEventTypeUid);
1212 CLogViewEvent* view = CLogViewEvent::NewL(aClient);
1213 CleanupStack::PushL(view);
1215 CLogFilter* filter = CLogFilter::NewL();
1216 CleanupStack::PushL(filter);
1219 User::After(1000000);
1222 now.UniversalTime();
1223 now += (TTimeIntervalDays)+1;
1224 // Get rid of all the events in the log
1226 aClient.ClearLog(now, active->iStatus);
1227 CActiveScheduler::Start();
1228 TEST2(active->iStatus.Int(), KErrNone);
1230 // Make sure there are no events
1231 TEST(!view->SetFilterL(*filter, active->iStatus));
1234 aClient.AddEvent(*event, active->iStatus);
1235 CActiveScheduler::Start();
1236 TEST2(active->iStatus.Int(), KErrNone);
1238 event->SetContact(KTestContact1);
1241 aClient.AddEvent(*event, active->iStatus);
1242 CActiveScheduler::Start();
1243 TEST2(active->iStatus.Int(), KErrNone);
1245 event->SetDirection(KTestDirection1);
1248 aClient.AddEvent(*event, active->iStatus);
1249 CActiveScheduler::Start();
1250 TEST2(active->iStatus.Int(), KErrNone);
1252 event->SetNumber(KTestNumber1);
1255 aClient.AddEvent(*event, active->iStatus);
1256 CActiveScheduler::Start();
1257 TEST2(active->iStatus.Int(), KErrNone);
1259 event->SetRemoteParty(KTestRemote1);
1262 aClient.AddEvent(*event, active->iStatus);
1263 CActiveScheduler::Start();
1264 TEST2(active->iStatus.Int(), KErrNone);
1266 event->SetStatus(KTestStatus1);
1269 aClient.AddEvent(*event, active->iStatus);
1270 CActiveScheduler::Start();
1271 TEST2(active->iStatus.Int(), KErrNone);
1273 event->SetSubject(KTestSubject);
1276 aClient.AddEvent(*event, active->iStatus);
1277 CActiveScheduler::Start();
1278 TEST2(active->iStatus.Int(), KErrNone);
1280 event->SetLink(KTestLink);
1283 aClient.AddEvent(*event, active->iStatus);
1284 CActiveScheduler::Start();
1285 TEST2(active->iStatus.Int(), KErrNone);
1287 event->SetDataL(KTestData);
1290 aClient.AddEvent(*event, active->iStatus);
1291 CActiveScheduler::Start();
1292 TEST2(active->iStatus.Int(), KErrNone);
1294 // Test for NULL fields
1297 TEST(view->SetFilterL(*filter, active->iStatus));
1298 CActiveScheduler::Start();
1299 TEST2(active->iStatus.Int(), KErrNone);
1300 TEST2(view->CountL(), 9);
1302 filter->SetNullFields(ELogContactField);
1305 TEST(view->SetFilterL(*filter, active->iStatus));
1306 CActiveScheduler::Start();
1307 TEST2(active->iStatus.Int(), KErrNone);
1308 TEST2(view->CountL(), 1);
1310 filter->SetNullFields(ELogContactField | ELogDirectionField);
1313 TEST(view->SetFilterL(*filter, active->iStatus));
1314 CActiveScheduler::Start();
1315 TEST2(active->iStatus.Int(), KErrNone);
1316 TEST2(view->CountL(), 1);
1318 filter->SetNullFields(ELogContactField | ELogDirectionField);
1321 TEST(view->SetFilterL(*filter, active->iStatus));
1322 CActiveScheduler::Start();
1323 TEST2(active->iStatus.Int(), KErrNone);
1324 TEST2(view->CountL(), 1);
1326 filter->SetNullFields(ELogContactField | ELogDirectionField | ELogNumberField);
1329 TEST(view->SetFilterL(*filter, active->iStatus));
1330 CActiveScheduler::Start();
1331 TEST2(active->iStatus.Int(), KErrNone);
1332 TEST2(view->CountL(), 1);
1334 filter->SetNullFields(ELogContactField | ELogDirectionField | ELogNumberField | ELogRemotePartyField);
1337 TEST(view->SetFilterL(*filter, active->iStatus));
1338 CActiveScheduler::Start();
1339 TEST2(active->iStatus.Int(), KErrNone);
1340 TEST2(view->CountL(), 1);
1342 filter->SetNullFields(ELogContactField | ELogDirectionField | ELogNumberField | ELogRemotePartyField | ELogStatusField);
1345 TEST(view->SetFilterL(*filter, active->iStatus));
1346 CActiveScheduler::Start();
1347 TEST2(active->iStatus.Int(), KErrNone);
1348 TEST2(view->CountL(), 1);
1350 filter->SetNullFields(ELogContactField | ELogDirectionField | ELogNumberField | ELogRemotePartyField | ELogStatusField | ELogSubjectField);
1353 TEST(view->SetFilterL(*filter, active->iStatus));
1354 CActiveScheduler::Start();
1355 TEST2(active->iStatus.Int(), KErrNone);
1356 TEST2(view->CountL(), 1);
1358 filter->SetNullFields(ELogContactField | ELogDirectionField | ELogNumberField | ELogRemotePartyField | ELogStatusField | ELogSubjectField | ELogLinkField);
1361 TEST(view->SetFilterL(*filter, active->iStatus));
1362 CActiveScheduler::Start();
1363 TEST2(active->iStatus.Int(), KErrNone);
1364 TEST2(view->CountL(), 1);
1366 filter->SetNullFields(ELogContactField | ELogDirectionField | ELogNumberField | ELogRemotePartyField | ELogStatusField | ELogSubjectField | ELogLinkField | ELogDataField);
1369 TEST(view->SetFilterL(*filter, active->iStatus));
1370 CActiveScheduler::Start();
1371 TEST2(active->iStatus.Int(), KErrNone);
1372 TEST2(view->CountL(), 1);
1374 CleanupStack::PopAndDestroy(4); // filter, view, event, active
1378 @SYMTestCaseID SYSLIB-LOGENG-CT-0936
1379 @SYMTestCaseDesc Tests for null field set on filter for the recent event view list
1380 @SYMTestPriority High
1381 @SYMTestActions Clear the log events and add new events with fields set in.Define null fields in the filter and check the view
1382 @SYMTestExpectedResults Test must not fail
1385 LOCAL_C void TestRecentViewForNullFieldsL(CLogClient& aClient)
1387 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0936 "));
1388 CLogEvent* event = CLogEvent::NewL();
1389 CleanupStack::PushL(event);
1391 CTestActive* active = new(ELeave)CTestActive();
1392 CleanupStack::PushL(active);
1394 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
1395 CleanupStack::PushL(view);
1399 aClient.GetString(buf, R_LOG_DIR_IN);
1401 event->SetEventType(KLogCallEventTypeUid);
1402 event->SetDirection(buf);
1403 event->SetNumber(_L("1"));
1407 aClient.AddEvent(*event, active->iStatus);
1408 CActiveScheduler::Start();
1409 TEST2(active->iStatus.Int(), KErrNone);
1411 event->SetStatus(KTestStatus1);
1412 event->SetNumber(_L("2"));
1416 aClient.AddEvent(*event, active->iStatus);
1417 CActiveScheduler::Start();
1418 TEST2(active->iStatus.Int(), KErrNone);
1420 event->SetSubject(KTestSubject);
1421 event->SetNumber(_L("3"));
1424 aClient.AddEvent(*event, active->iStatus);
1425 CActiveScheduler::Start();
1426 TEST2(active->iStatus.Int(), KErrNone);
1428 event->SetLink(KTestLink);
1429 event->SetNumber(_L("4"));
1432 aClient.AddEvent(*event, active->iStatus);
1433 CActiveScheduler::Start();
1434 TEST2(active->iStatus.Int(), KErrNone);
1436 event->SetDataL(KTestData);
1437 event->SetNumber(_L("5"));
1440 aClient.AddEvent(*event, active->iStatus);
1441 CActiveScheduler::Start();
1442 TEST2(active->iStatus.Int(), KErrNone);
1445 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
1446 CActiveScheduler::Start();
1447 TEST2(view->CountL(), 5);
1449 CLogFilter* filter = CLogFilter::NewL();
1450 CleanupStack::PushL(filter);
1452 // Test for NULL fields
1454 filter->SetNullFields(ELogStatusField);
1457 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
1458 CActiveScheduler::Start();
1459 TEST2(view->CountL(), 1);
1461 filter->SetNullFields(ELogStatusField | ELogSubjectField);
1464 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
1465 CActiveScheduler::Start();
1466 TEST2(view->CountL(), 1);
1468 filter->SetNullFields(ELogStatusField | ELogSubjectField | ELogLinkField);
1471 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
1472 CActiveScheduler::Start();
1473 TEST2(view->CountL(), 1);
1475 filter->SetNullFields(ELogStatusField | ELogSubjectField | ELogLinkField | ELogDataField);
1478 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
1479 CActiveScheduler::Start();
1480 TEST2(view->CountL(), 1);
1482 CleanupStack::PopAndDestroy(4); // filter, view, active, event
1486 @SYMTestCaseID SYSLIB-LOGENG-CT-0937
1487 @SYMTestCaseDesc Tests for null field set on filter for the duplicate event view list
1488 @SYMTestPriority High
1489 @SYMTestActions Clear the log events and add new events with fields set in.Define null fields in the filter and check the view
1490 @SYMTestExpectedResults Test must not fail
1493 LOCAL_C void TestDuplicateViewForNullFieldsL(CLogClient& aClient)
1495 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0937 "));
1496 CLogEvent* event = CLogEvent::NewL();
1497 CleanupStack::PushL(event);
1499 CTestActive* active = new(ELeave)CTestActive();
1500 CleanupStack::PushL(active);
1502 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
1503 CleanupStack::PushL(view);
1505 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
1506 CleanupStack::PushL(duplicate);
1508 // Make sure there are no entries in any recent lists
1510 aClient.ClearLog(KLogNullRecentList, active->iStatus);
1511 CActiveScheduler::Start();
1512 TEST2(active->iStatus.Int(), KErrNone);
1516 aClient.GetString(buf, R_LOG_DIR_IN);
1518 event->SetEventType(KLogCallEventTypeUid);
1519 event->SetDirection(buf);
1520 event->SetContact(KTestContact1);
1524 aClient.AddEvent(*event, active->iStatus);
1525 CActiveScheduler::Start();
1526 TEST2(active->iStatus.Int(), KErrNone);
1528 event->SetStatus(KTestStatus1);
1532 aClient.AddEvent(*event, active->iStatus);
1533 CActiveScheduler::Start();
1534 TEST2(active->iStatus.Int(), KErrNone);
1536 event->SetSubject(KTestSubject);
1540 aClient.AddEvent(*event, active->iStatus);
1541 CActiveScheduler::Start();
1542 TEST2(active->iStatus.Int(), KErrNone);
1544 event->SetLink(KTestLink);
1548 aClient.AddEvent(*event, active->iStatus);
1549 CActiveScheduler::Start();
1550 TEST2(active->iStatus.Int(), KErrNone);
1552 event->SetDataL(KTestData);
1556 aClient.AddEvent(*event, active->iStatus);
1557 CActiveScheduler::Start();
1558 TEST2(active->iStatus.Int(), KErrNone);
1560 event->SetDurationType(KLogDurationNone);
1561 event->SetStatus(KNullDesC);
1563 // Add event - This will be the entry in recent list
1565 aClient.AddEvent(*event, active->iStatus);
1566 CActiveScheduler::Start();
1567 TEST2(active->iStatus.Int(), KErrNone);
1569 // Should only be one event in recent list - the rest are duplicates
1571 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
1572 CActiveScheduler::Start();
1573 TEST2(active->iStatus.Int(), KErrNone);
1574 TEST2(view->CountL(), 1);
1576 // Check duplicate count
1578 TEST(view->DuplicatesL(*duplicate, active->iStatus));
1579 CActiveScheduler::Start();
1580 TEST2(active->iStatus.Int(), KErrNone);
1581 TEST2(duplicate->CountL(), 5);
1583 CLogFilter* filter = CLogFilter::NewL();
1584 CleanupStack::PushL(filter);
1586 filter->SetNullFields(ELogStatusField);
1589 TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus));
1590 CActiveScheduler::Start();
1591 TEST2(active->iStatus.Int(), KErrNone);
1592 TEST2(duplicate->CountL(), 1);
1594 filter->SetNullFields(ELogStatusField | ELogSubjectField);
1597 TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus));
1598 CActiveScheduler::Start();
1599 TEST2(active->iStatus.Int(), KErrNone);
1600 TEST2(duplicate->CountL(), 1);
1602 filter->SetNullFields(ELogStatusField | ELogSubjectField | ELogLinkField);
1605 TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus));
1606 CActiveScheduler::Start();
1607 TEST2(active->iStatus.Int(), KErrNone);
1608 TEST2(duplicate->CountL(), 1);
1610 filter->SetNullFields(ELogStatusField | ELogSubjectField | ELogLinkField | ELogDataField);
1613 TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus));
1614 CActiveScheduler::Start();
1615 TEST2(active->iStatus.Int(), KErrNone);
1616 TEST2(duplicate->CountL(), 1);
1618 CleanupStack::PopAndDestroy(5); // filter, duplicate, view, active, event
1622 @SYMTestCaseID SYSLIB-LOGENG-CT-0938
1623 @SYMTestCaseDesc Querying event view for flags test
1624 @SYMTestPriority High
1625 @SYMTestActions Clear the log events and add new events with fields set in.Define null fields and set flags in the filter and check the view
1626 @SYMTestExpectedResults Test must not fail
1629 LOCAL_C void TestEventViewForFlagsL(CLogClient& aClient)
1631 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0938 "));
1632 CLogEvent* event = CLogEvent::NewL();
1633 CleanupStack::PushL(event);
1635 CTestActive* active = new(ELeave)CTestActive();
1636 CleanupStack::PushL(active);
1638 CLogViewEvent* view = CLogViewEvent::NewL(aClient);
1639 CleanupStack::PushL(view);
1641 CLogFilter* filter = CLogFilter::NewL();
1642 CleanupStack::PushL(filter);
1645 User::After(1000000);
1648 now.UniversalTime();
1649 now += (TTimeIntervalDays)+1;
1651 // Get rid of all the events in the log
1653 aClient.ClearLog(now, active->iStatus);
1654 CActiveScheduler::Start();
1655 TEST2(active->iStatus.Int(), KErrNone);
1657 // Make sure there are now events
1658 TEST(!view->SetFilterL(*filter, active->iStatus));
1661 event->SetEventType(KLogCallEventTypeUid);
1662 TLogFlags flags = KLogFlagsMask + 1;
1667 event->ClearFlags(0xF);
1668 event->SetFlags(flags);
1672 aClient.AddEvent(*event, active->iStatus);
1673 CActiveScheduler::Start();
1674 TEST2(active->iStatus.Int(), KErrNone);
1677 flags = KLogFlagsMask + 1;
1680 filter->ClearFlags(0xF);
1681 // we use this because, since the events were all created without contact ids
1682 // the log engine looked each one up in the contacts DB and set the flag so we
1683 // need to set it in the flags being looked for
1684 flags2 = static_cast<TLogFlags>(flags | KLogEventContactSearched);
1685 filter->SetFlags(flags2);
1687 TEST(view->SetFilterL(*filter, active->iStatus));
1688 CActiveScheduler::Start();
1689 TEST2(active->iStatus.Int(), KErrNone);
1690 TEST((view->Event().Flags() & flags2) == flags2);
1692 while(view->NextL(active->iStatus))
1695 CActiveScheduler::Start();
1696 TEST2(active->iStatus.Int(), KErrNone);
1697 TEST((view->Event().Flags() & flags2) == flags2);
1701 // Now TEST we can query for the inverse
1702 filter->SetNullFields(ELogFlagsField);
1704 flags = KLogFlagsMask + 1;
1707 filter->ClearFlags(0xF);
1708 // we use this because, since the events were all created without contact ids
1709 // the log engine looked each one up in the contacts DB and set the flag so we
1710 // need to unset it in the flags being excluded
1711 flags2 = static_cast<TLogFlags>(flags & ~KLogEventContactSearched);
1712 filter->SetFlags(flags2);
1715 TEST(view->SetFilterL(*filter, active->iStatus));
1716 CActiveScheduler::Start();
1717 TEST2(active->iStatus.Int(), KErrNone);
1718 TEST((~view->Event().Flags() & flags2) == flags2);
1720 while(view->NextL(active->iStatus))
1723 CActiveScheduler::Start();
1724 TEST2(active->iStatus.Int(), KErrNone);
1725 TEST((~view->Event().Flags() & flags2) == flags2);
1729 CleanupStack::PopAndDestroy(4); // filter, view, active, event
1733 @SYMTestCaseID SYSLIB-LOGENG-CT-0939
1734 @SYMTestCaseDesc Querying recent event view for flags test
1735 @SYMTestPriority High
1736 @SYMTestActions Change the log configuration.Clear the log for any recent list and add some events.Query for flags in the recent view list
1737 @SYMTestExpectedResults Test must not fail
1740 LOCAL_C void TestRecentViewForFlagsL(CLogClient& aClient)
1742 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0939 "));
1743 CLogEvent* event = CLogEvent::NewL();
1744 CleanupStack::PushL(event);
1746 CTestActive* active = new(ELeave)CTestActive();
1747 CleanupStack::PushL(active);
1751 // Change the log engine config
1753 aClient.GetConfig(config, active->iStatus);
1754 CActiveScheduler::Start();
1755 TEST2(active->iStatus.Int(), KErrNone);
1757 config.iMaxRecentLogSize = KLogFlagsMask + 1;
1759 // Change the log engine config
1761 aClient.ChangeConfig(config, active->iStatus);
1762 CActiveScheduler::Start();
1763 TEST2(active->iStatus.Int(), KErrNone);
1765 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
1766 CleanupStack::PushL(view);
1768 CLogFilter* filter = CLogFilter::NewL();
1769 CleanupStack::PushL(filter);
1771 // Make sure there are no entries in any recent lists
1773 aClient.ClearLog(KLogNullRecentList, active->iStatus);
1774 CActiveScheduler::Start();
1775 TEST2(active->iStatus.Int(), KErrNone);
1777 // Make sure there are no events
1778 TEST(!view->SetRecentListL(KLogNullRecentList, *filter, active->iStatus));
1782 aClient.GetString(buf, R_LOG_DIR_IN);
1785 event->SetEventType(KLogCallEventTypeUid);
1786 event->SetDirection(buf);
1788 TLogFlags flags = KLogFlagsMask + 1;
1791 event->ClearFlags(0xF);
1792 event->SetFlags(flags);
1793 event->SetContact(flags);
1797 aClient.AddEvent(*event, active->iStatus);
1798 CActiveScheduler::Start();
1799 TEST2(active->iStatus.Int(), KErrNone);
1802 flags = KLogFlagsMask + 1;
1805 filter->ClearFlags(0xF);
1806 filter->SetFlags(flags);
1809 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
1810 CActiveScheduler::Start();
1811 TEST2(active->iStatus.Int(), KErrNone);
1812 TEST((view->Event().Flags() & flags) == flags);
1814 while(view->NextL(active->iStatus))
1817 CActiveScheduler::Start();
1818 TEST2(active->iStatus.Int(), KErrNone);
1819 TEST((view->Event().Flags() & flags) == flags);
1823 // Now TEST we can query for the inverse
1824 filter->SetNullFields(ELogFlagsField);
1826 flags = KLogFlagsMask + 1;
1829 filter->ClearFlags(0xF);
1830 filter->SetFlags(flags);
1833 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
1834 CActiveScheduler::Start();
1835 TEST2(active->iStatus.Int(), KErrNone);
1836 TEST((~view->Event().Flags() & flags) == flags);
1838 while(view->NextL(active->iStatus))
1841 CActiveScheduler::Start();
1842 TEST2(active->iStatus.Int(), KErrNone);
1843 TEST((~view->Event().Flags() & flags) == flags);
1847 CleanupStack::PopAndDestroy(4); // filter, view, active, event
1851 @SYMTestCaseID SYSLIB-LOGENG-CT-0940
1852 @SYMTestCaseDesc Querying duplicate event view for flags test
1853 @SYMTestPriority High
1854 @SYMTestActions Change the log configuration.Clear the log for any recent list and add some events.Query for flags in the duplicate view list
1855 @SYMTestExpectedResults Test must not fail
1858 LOCAL_C void TestDuplicateViewForFlagsL(CLogClient& aClient)
1860 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0940 "));
1861 CLogEvent* event = CLogEvent::NewL();
1862 CleanupStack::PushL(event);
1864 CTestActive* active = new(ELeave)CTestActive();
1865 CleanupStack::PushL(active);
1867 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
1868 CleanupStack::PushL(view);
1870 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
1871 CleanupStack::PushL(duplicate);
1873 CLogFilter* filter = CLogFilter::NewL();
1874 CleanupStack::PushL(filter);
1876 // Make sure there are no entries in any recent lists
1878 aClient.ClearLog(KLogNullRecentList, active->iStatus);
1879 CActiveScheduler::Start();
1880 TEST2(active->iStatus.Int(), KErrNone);
1882 // Make sure there are now events
1883 TEST(!view->SetRecentListL(KLogNullRecentList, *filter, active->iStatus));
1887 aClient.GetString(buf, R_LOG_DIR_IN);
1890 event->SetEventType(KLogCallEventTypeUid);
1891 event->SetDirection(buf);
1892 event->SetDurationType(KLogDurationNone);
1893 event->SetContact(KTestContact1);
1894 event->SetStatus(KTestStatus1);
1896 TLogFlags flags = KLogFlagsMask + 1;
1899 event->ClearFlags(0xF);
1900 event->SetFlags(flags);
1904 aClient.AddEvent(*event, active->iStatus);
1905 CActiveScheduler::Start();
1906 TEST2(active->iStatus.Int(), KErrNone);
1909 // Add an extra event which will be the most recent
1911 aClient.AddEvent(*event, active->iStatus);
1912 CActiveScheduler::Start();
1913 TEST2(active->iStatus.Int(), KErrNone);
1916 TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
1917 CActiveScheduler::Start();
1918 TEST2(active->iStatus.Int(), KErrNone);
1919 TEST2(view->CountL(), 1);
1921 flags = KLogFlagsMask + 1;
1924 filter->ClearFlags(0xF);
1925 filter->SetFlags(flags);
1928 TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus));
1929 CActiveScheduler::Start();
1930 TEST2(active->iStatus.Int(), KErrNone);
1931 TEST((duplicate->Event().Flags() & flags) == flags);
1933 while(duplicate->NextL(active->iStatus))
1936 CActiveScheduler::Start();
1937 TEST2(active->iStatus.Int(), KErrNone);
1938 TEST((duplicate->Event().Flags() & flags) == flags);
1942 // Now TEST we can query for the inverse
1943 filter->SetNullFields(ELogFlagsField);
1945 flags = KLogFlagsMask + 1;
1948 filter->ClearFlags(0xF);
1949 filter->SetFlags(flags);
1952 TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus));
1953 CActiveScheduler::Start();
1954 TEST2(active->iStatus.Int(), KErrNone);
1955 TEST((~duplicate->Event().Flags() & flags) == flags);
1957 while(duplicate->NextL(active->iStatus))
1960 CActiveScheduler::Start();
1961 TEST2(active->iStatus.Int(), KErrNone);
1962 TEST((~duplicate->Event().Flags() & flags) == flags);
1966 CleanupStack::PopAndDestroy(5); // filter, duplicate, view, active, event
1970 @SYMTestCaseID SYSLIB-LOGENG-CT-0941
1971 @SYMTestCaseDesc Tests for removing recent events.Tests for CLogClient::ClearLog() function
1972 @SYMTestPriority High
1973 @SYMTestActions Clear log for any recent entries.Add events and create the view.Test for removing the recent events from the view
1974 @SYMTestExpectedResults Test must not fail
1977 LOCAL_C void TestRemovingRecentEventsL(CLogClient& aClient)
1979 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0941 "));
1980 CLogEvent* event = CLogEvent::NewL();
1981 CleanupStack::PushL(event);
1983 CTestActive* active = new(ELeave)CTestActive();
1984 CleanupStack::PushL(active);
1986 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
1987 CleanupStack::PushL(view);
1989 // Make sure there are no entries in any recent lists
1991 aClient.ClearLog(KLogNullRecentList, active->iStatus);
1992 CActiveScheduler::Start();
1993 TEST2(active->iStatus.Int(), KErrNone);
1995 // Make sure there are no events
1996 TEST(!view->SetRecentListL(KLogNullRecentList, active->iStatus));
2000 aClient.GetString(buf, R_LOG_DIR_IN);
2003 event->SetEventType(KLogCallEventTypeUid);
2004 event->SetDirection(buf);
2011 aClient.AddEvent(*event, active->iStatus);
2012 CActiveScheduler::Start();
2013 TEST2(active->iStatus.Int(), KErrNone);
2018 TEST(view->SetRecentListL(KLogNullRecentList, active->iStatus));
2019 CActiveScheduler::Start();
2020 TEST2(active->iStatus.Int(), KErrNone);
2022 TLogId id = view->Event().Id();
2023 while(view->NextL(active->iStatus))
2026 CActiveScheduler::Start();
2027 TEST2(active->iStatus.Int(), KErrNone);
2029 // Try removing the previous event
2031 id = view->Event().Id();
2034 // Try removing the current event
2036 TEST(!view->SetRecentListL(KLogNullRecentList, active->iStatus));
2038 CleanupStack::PopAndDestroy(3); // view, active, event
2042 @SYMTestCaseID SYSLIB-LOGENG-CT-0942
2043 @SYMTestCaseDesc Removing duplicate events from the duplicate view
2044 Tests for CLogViewRecent::DuplicatesL() function
2045 @SYMTestPriority High
2046 @SYMTestActions Clear log for any recent entries.Add events and create the view and duplicate view.
2047 @SYMTestExpectedResults Test must not fail
2050 LOCAL_C void TestRemovingDuplicateEventsL(CLogClient& aClient)
2052 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0942 "));
2053 CLogEvent* event = CLogEvent::NewL();
2054 CleanupStack::PushL(event);
2056 CTestActive* active = new(ELeave)CTestActive();
2057 CleanupStack::PushL(active);
2059 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
2060 CleanupStack::PushL(view);
2062 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
2063 CleanupStack::PushL(duplicate);
2065 // Make sure there are no entries in any recent lists
2067 aClient.ClearLog(KLogNullRecentList, active->iStatus);
2068 CActiveScheduler::Start();
2069 TEST2(active->iStatus.Int(), KErrNone);
2071 // Make sure there are no events
2072 TEST(!view->SetRecentListL(KLogNullRecentList, active->iStatus));
2076 aClient.GetString(buf, R_LOG_DIR_IN);
2079 event->SetEventType(KLogCallEventTypeUid);
2080 event->SetDirection(buf);
2081 event->SetDurationType(KLogDurationNone);
2082 event->SetContact(KTestContact1);
2083 event->SetStatus(KTestStatus1);
2090 aClient.AddEvent(*event, active->iStatus);
2091 CActiveScheduler::Start();
2092 TEST2(active->iStatus.Int(), KErrNone);
2093 TheTest.Printf(_L("EVENT ID: %d\n"), event->Id());
2098 TEST(view->SetRecentListL(KLogNullRecentList, active->iStatus));
2099 CActiveScheduler::Start();
2100 TEST2(active->iStatus.Int(), KErrNone);
2102 // Create the duplicate view
2104 TEST(view->DuplicatesL(*duplicate, active->iStatus));
2105 CActiveScheduler::Start();
2106 TEST2(active->iStatus.Int(), KErrNone);
2107 TEST2(view->CountL(), 1);
2108 count = duplicate->CountL();
2111 TLogId id = duplicate->Event().Id();
2112 while(duplicate->NextL(active->iStatus))
2115 CActiveScheduler::Start();
2116 TEST2(active->iStatus.Int(), KErrNone);
2118 // Try removing the previous event
2119 duplicate->RemoveL(id);
2120 id = duplicate->Event().Id();
2123 // Try removing the current event
2124 duplicate->RemoveL(id);
2125 count = duplicate->CountL();
2128 TEST(!view->DuplicatesL(*duplicate, active->iStatus));
2130 CleanupStack::PopAndDestroy(4); // duplicate, view, active, event
2134 @SYMTestCaseID SYSLIB-LOGENG-CT-0943
2135 s@SYMTestCaseDesc Multiple log event views test
2136 @SYMTestPriority High
2137 @SYMTestActions Add events and set the filter with different fields.Check for log event views
2138 @SYMTestExpectedResults Test must not fail
2141 LOCAL_C void TestMultipleViews1L(CLogClient& aClient)
2143 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0943 "));
2144 CTestActive* active1 = new(ELeave)CTestActive;
2145 CleanupStack::PushL(active1);
2148 User::After(1000000);
2151 now.UniversalTime();
2152 now += (TTimeIntervalDays)+1;
2154 // Get rid of all the events in the log
2156 aClient.ClearLog(now, active1->iStatus);
2157 CActiveScheduler::Start();
2158 TEST2(active1->iStatus.Int(), KErrNone);
2160 CTestActive* active2 = new(ELeave)CTestActive;
2161 CleanupStack::PushL(active2);
2163 CLogEvent* event = CLogEvent::NewL();
2164 CleanupStack::PushL(event);
2166 event->SetEventType(KLogCallEventTypeUid);
2167 event->SetContact(KTestContact1);
2168 event->SetDirection(KTestDirection1);
2169 event->SetDurationType(KLogDurationNone);
2170 event->SetNumber(KTestNumber1);
2171 event->SetRemoteParty(KTestRemote1);
2172 event->SetStatus(KTestStatus1);
2176 aClient.AddEvent(*event, active1->iStatus);
2177 CActiveScheduler::Start();
2178 TEST2(active1->iStatus.Int(), KErrNone);
2180 event->SetEventType(KLogDataEventTypeUid);
2181 event->SetContact(KTestContact2);
2182 event->SetDirection(KTestDirection2);
2183 event->SetDurationType(KLogDurationValid);
2184 event->SetNumber(KTestNumber2);
2185 event->SetRemoteParty(KTestRemote2);
2186 event->SetStatus(KTestStatus2);
2190 aClient.AddEvent(*event, active1->iStatus);
2191 CActiveScheduler::Start();
2192 TEST2(active1->iStatus.Int(), KErrNone);
2194 event->SetEventType(KLogFaxEventTypeUid);
2195 event->SetContact(KTestContact3);
2196 event->SetDirection(KTestDirection3);
2197 event->SetDurationType(KLogDurationData);
2198 event->SetNumber(KTestNumber3);
2199 event->SetRemoteParty(KTestRemote3);
2200 event->SetStatus(KTestStatus3);
2204 aClient.AddEvent(*event, active1->iStatus);
2205 CActiveScheduler::Start();
2206 TEST2(active1->iStatus.Int(), KErrNone);
2208 CLogFilterList* list = new(ELeave)CLogFilterList;
2209 CleanupStack::PushL(list);
2211 CLogViewEvent* view1 = CLogViewEvent::NewL(aClient);
2212 CleanupStack::PushL(view1);
2214 CLogViewEvent* view2 = CLogViewEvent::NewL(aClient);
2215 CleanupStack::PushL(view2);
2217 CLogFilter* filter = CLogFilter::NewL();
2218 CleanupStack::PushL(filter);
2221 filter->SetContact(KTestContact1);
2223 list->AppendL(filter);
2224 CleanupStack::Pop(); // filter
2229 TEST(view1->SetFilterL(*list, active1->iStatus));
2230 TEST(view2->SetFilterL(*list, active2->iStatus));
2231 CActiveScheduler::Start();
2232 CActiveScheduler::Start();
2233 TEST2(view1->CountL(), 1);
2234 TEST2(view2->CountL(), 1);
2236 filter = CLogFilter::NewL();
2237 CleanupStack::PushL(filter);
2240 filter->SetContact(KTestContact2);
2242 list->AppendL(filter);
2243 CleanupStack::Pop(); // filter
2247 TEST(view1->SetFilterL(*list, active1->iStatus));
2248 CActiveScheduler::Start();
2249 TEST2(view1->CountL(), 2);
2251 filter = CLogFilter::NewL();
2252 CleanupStack::PushL(filter);
2255 filter->SetContact(KTestContact3);
2257 list->AppendL(filter);
2258 CleanupStack::Pop(); // filter
2263 TEST(view1->SetFilterL(*list, active1->iStatus));
2264 TEST(view2->SetFilterL(*list, active2->iStatus));
2265 CActiveScheduler::Start();
2266 CActiveScheduler::Start();
2267 TEST2(view1->CountL(), 3);
2268 TEST2(view2->CountL(), 3);
2270 list->ResetAndDestroy();
2272 /////////////////////////////////////////
2274 filter = CLogFilter::NewL();
2275 CleanupStack::PushL(filter);
2278 filter->SetContact(KTestContact1);
2279 filter->SetDirection(KTestDirection1);
2281 list->AppendL(filter);
2282 CleanupStack::Pop(); // filter
2287 TEST(view1->SetFilterL(*list, active1->iStatus));
2288 TEST(view2->SetFilterL(*list, active2->iStatus));
2289 CActiveScheduler::Start();
2290 CActiveScheduler::Start();
2291 TEST2(view1->CountL(), 1);
2292 TEST2(view2->CountL(), 1);
2294 filter = CLogFilter::NewL();
2295 CleanupStack::PushL(filter);
2298 filter->SetContact(KTestContact2);
2299 filter->SetDirection(KTestDirection2);
2301 list->AppendL(filter);
2302 CleanupStack::Pop(); // filter
2307 TEST(view1->SetFilterL(*list, active1->iStatus));
2308 TEST(view2->SetFilterL(*list, active2->iStatus));
2309 CActiveScheduler::Start();
2310 CActiveScheduler::Start();
2311 TEST2(view1->CountL(), 2);
2312 TEST2(view2->CountL(), 2);
2314 filter = CLogFilter::NewL();
2315 CleanupStack::PushL(filter);
2318 filter->SetContact(KTestContact3);
2319 filter->SetDirection(KTestDirection3);
2321 list->AppendL(filter);
2322 CleanupStack::Pop(); // filter
2327 TEST(view1->SetFilterL(*list, active1->iStatus));
2328 TEST(view2->SetFilterL(*list, active2->iStatus));
2329 CActiveScheduler::Start();
2330 CActiveScheduler::Start();
2331 TEST2(view1->CountL(), 3);
2332 TEST2(view2->CountL(), 3);
2334 list->ResetAndDestroy();
2336 /////////////////////////////////////////
2338 filter = CLogFilter::NewL();
2339 CleanupStack::PushL(filter);
2342 filter->SetContact(KTestContact1);
2343 filter->SetDirection(KTestDirection1);
2344 filter->SetDurationType(KLogDurationNone);
2346 list->AppendL(filter);
2347 CleanupStack::Pop(); // filter
2352 TEST(view1->SetFilterL(*list, active1->iStatus));
2353 TEST(view2->SetFilterL(*list, active2->iStatus));
2354 CActiveScheduler::Start();
2355 CActiveScheduler::Start();
2356 TEST2(view1->CountL(), 1);
2357 TEST2(view2->CountL(), 1);
2359 filter = CLogFilter::NewL();
2360 CleanupStack::PushL(filter);
2363 filter->SetContact(KTestContact2);
2364 filter->SetDirection(KTestDirection2);
2365 filter->SetDurationType(KLogDurationValid);
2367 list->AppendL(filter);
2368 CleanupStack::Pop(); // filter
2373 TEST(view1->SetFilterL(*list, active1->iStatus));
2374 TEST(view2->SetFilterL(*list, active2->iStatus));
2375 CActiveScheduler::Start();
2376 CActiveScheduler::Start();
2377 TEST2(view1->CountL(), 2);
2378 TEST2(view2->CountL(), 2);
2380 filter = CLogFilter::NewL();
2381 CleanupStack::PushL(filter);
2384 filter->SetContact(KTestContact3);
2385 filter->SetDirection(KTestDirection3);
2386 filter->SetDurationType(KLogDurationData);
2388 list->AppendL(filter);
2389 CleanupStack::Pop(); // filter
2394 TEST(view1->SetFilterL(*list, active1->iStatus));
2395 TEST(view2->SetFilterL(*list, active2->iStatus));
2396 CActiveScheduler::Start();
2397 CActiveScheduler::Start();
2398 TEST2(view1->CountL(), 3);
2399 TEST2(view2->CountL(), 3);
2401 list->ResetAndDestroy();
2403 /////////////////////////////////////////
2405 filter = CLogFilter::NewL();
2406 CleanupStack::PushL(filter);
2409 filter->SetContact(KTestContact1);
2410 filter->SetDirection(KTestDirection1);
2411 filter->SetDurationType(KLogDurationNone);
2412 filter->SetEventType(KLogCallEventTypeUid);
2414 list->AppendL(filter);
2415 CleanupStack::Pop(); // filter
2420 TEST(view1->SetFilterL(*list, active1->iStatus));
2421 TEST(view2->SetFilterL(*list, active2->iStatus));
2422 CActiveScheduler::Start();
2423 CActiveScheduler::Start();
2424 TEST2(view1->CountL(), 1);
2425 TEST2(view2->CountL(), 1);
2427 filter = CLogFilter::NewL();
2428 CleanupStack::PushL(filter);
2431 filter->SetContact(KTestContact2);
2432 filter->SetDirection(KTestDirection2);
2433 filter->SetDurationType(KLogDurationValid);
2434 filter->SetEventType(KLogDataEventTypeUid);
2436 list->AppendL(filter);
2437 CleanupStack::Pop(); // filter
2442 TEST(view1->SetFilterL(*list, active1->iStatus));
2443 TEST(view2->SetFilterL(*list, active2->iStatus));
2444 CActiveScheduler::Start();
2445 CActiveScheduler::Start();
2446 TEST2(view1->CountL(), 2);
2447 TEST2(view2->CountL(), 2);
2449 filter = CLogFilter::NewL();
2450 CleanupStack::PushL(filter);
2453 filter->SetContact(KTestContact3);
2454 filter->SetDirection(KTestDirection3);
2455 filter->SetDurationType(KLogDurationData);
2456 filter->SetEventType(KLogFaxEventTypeUid);
2458 list->AppendL(filter);
2459 CleanupStack::Pop(); // filter
2464 TEST(view1->SetFilterL(*list, active1->iStatus));
2465 TEST(view2->SetFilterL(*list, active2->iStatus));
2466 CActiveScheduler::Start();
2467 CActiveScheduler::Start();
2468 TEST2(view1->CountL(), 3);
2469 TEST2(view2->CountL(), 3);
2471 list->ResetAndDestroy();
2473 /////////////////////////////////////////
2475 filter = CLogFilter::NewL();
2476 CleanupStack::PushL(filter);
2479 filter->SetContact(KTestContact1);
2480 filter->SetDirection(KTestDirection1);
2481 filter->SetDurationType(KLogDurationNone);
2482 filter->SetEventType(KLogCallEventTypeUid);
2483 filter->SetNumber(KTestNumber1);
2485 list->AppendL(filter);
2486 CleanupStack::Pop(); // filter
2491 TEST(view1->SetFilterL(*list, active1->iStatus));
2492 TEST(view2->SetFilterL(*list, active2->iStatus));
2493 CActiveScheduler::Start();
2494 CActiveScheduler::Start();
2495 TEST2(view1->CountL(), 1);
2496 TEST2(view2->CountL(), 1);
2498 filter = CLogFilter::NewL();
2499 CleanupStack::PushL(filter);
2502 filter->SetContact(KTestContact2);
2503 filter->SetDirection(KTestDirection2);
2504 filter->SetDurationType(KLogDurationValid);
2505 filter->SetEventType(KLogDataEventTypeUid);
2506 filter->SetNumber(KTestNumber2);
2508 list->AppendL(filter);
2509 CleanupStack::Pop(); // filter
2514 TEST(view1->SetFilterL(*list, active1->iStatus));
2515 TEST(view2->SetFilterL(*list, active2->iStatus));
2516 CActiveScheduler::Start();
2517 CActiveScheduler::Start();
2518 TEST2(view1->CountL(), 2);
2519 TEST2(view2->CountL(), 2);
2521 filter = CLogFilter::NewL();
2522 CleanupStack::PushL(filter);
2525 filter->SetContact(KTestContact3);
2526 filter->SetDirection(KTestDirection3);
2527 filter->SetDurationType(KLogDurationData);
2528 filter->SetEventType(KLogFaxEventTypeUid);
2529 filter->SetNumber(KTestNumber3);
2531 list->AppendL(filter);
2532 CleanupStack::Pop(); // filter
2537 TEST(view1->SetFilterL(*list, active1->iStatus));
2538 TEST(view2->SetFilterL(*list, active2->iStatus));
2539 CActiveScheduler::Start();
2540 CActiveScheduler::Start();
2541 TEST2(view1->CountL(), 3);
2542 TEST2(view2->CountL(), 3);
2544 list->ResetAndDestroy();
2546 /////////////////////////////////////////
2548 filter = CLogFilter::NewL();
2549 CleanupStack::PushL(filter);
2552 filter->SetContact(KTestContact1);
2553 filter->SetDirection(KTestDirection1);
2554 filter->SetDurationType(KLogDurationNone);
2555 filter->SetEventType(KLogCallEventTypeUid);
2556 filter->SetNumber(KTestNumber1);
2557 filter->SetRemoteParty(KTestRemote1);
2559 list->AppendL(filter);
2560 CleanupStack::Pop(); // filter
2565 TEST(view1->SetFilterL(*list, active1->iStatus));
2566 TEST(view2->SetFilterL(*list, active2->iStatus));
2567 CActiveScheduler::Start();
2568 CActiveScheduler::Start();
2569 TEST2(view1->CountL(), 1);
2570 TEST2(view2->CountL(), 1);
2572 filter = CLogFilter::NewL();
2573 CleanupStack::PushL(filter);
2576 filter->SetContact(KTestContact2);
2577 filter->SetDirection(KTestDirection2);
2578 filter->SetDurationType(KLogDurationValid);
2579 filter->SetEventType(KLogDataEventTypeUid);
2580 filter->SetNumber(KTestNumber2);
2581 filter->SetRemoteParty(KTestRemote2);
2583 list->AppendL(filter);
2584 CleanupStack::Pop(); // filter
2589 TEST(view1->SetFilterL(*list, active1->iStatus));
2590 TEST(view2->SetFilterL(*list, active2->iStatus));
2591 CActiveScheduler::Start();
2592 CActiveScheduler::Start();
2593 TEST2(view1->CountL(), 2);
2594 TEST2(view2->CountL(), 2);
2596 filter = CLogFilter::NewL();
2597 CleanupStack::PushL(filter);
2600 filter->SetContact(KTestContact3);
2601 filter->SetDirection(KTestDirection3);
2602 filter->SetDurationType(KLogDurationData);
2603 filter->SetEventType(KLogFaxEventTypeUid);
2604 filter->SetNumber(KTestNumber3);
2605 filter->SetRemoteParty(KTestRemote3);
2607 list->AppendL(filter);
2608 CleanupStack::Pop(); // filter
2613 TEST(view1->SetFilterL(*list, active1->iStatus));
2614 TEST(view2->SetFilterL(*list, active2->iStatus));
2615 CActiveScheduler::Start();
2616 CActiveScheduler::Start();
2617 TEST2(view1->CountL(), 3);
2618 TEST2(view2->CountL(), 3);
2620 list->ResetAndDestroy();
2622 /////////////////////////////////////////
2624 filter = CLogFilter::NewL();
2625 CleanupStack::PushL(filter);
2628 filter->SetContact(KTestContact1);
2629 filter->SetDirection(KTestDirection1);
2630 filter->SetDurationType(KLogDurationNone);
2631 filter->SetEventType(KLogCallEventTypeUid);
2632 filter->SetNumber(KTestNumber1);
2633 filter->SetRemoteParty(KTestRemote1);
2634 filter->SetStatus(KTestStatus1);
2636 list->AppendL(filter);
2637 CleanupStack::Pop(); // filter
2642 TEST(view1->SetFilterL(*list, active1->iStatus));
2643 TEST(view2->SetFilterL(*list, active2->iStatus));
2644 CActiveScheduler::Start();
2645 CActiveScheduler::Start();
2646 TEST2(view1->CountL(), 1);
2647 TEST2(view2->CountL(), 1);
2649 filter = CLogFilter::NewL();
2650 CleanupStack::PushL(filter);
2653 filter->SetContact(KTestContact2);
2654 filter->SetDirection(KTestDirection2);
2655 filter->SetDurationType(KLogDurationValid);
2656 filter->SetEventType(KLogDataEventTypeUid);
2657 filter->SetNumber(KTestNumber2);
2658 filter->SetRemoteParty(KTestRemote2);
2659 filter->SetStatus(KTestStatus2);
2661 list->AppendL(filter);
2662 CleanupStack::Pop(); // filter
2667 TEST(view1->SetFilterL(*list, active1->iStatus));
2668 TEST(view2->SetFilterL(*list, active2->iStatus));
2669 CActiveScheduler::Start();
2670 CActiveScheduler::Start();
2671 TEST2(view1->CountL(), 2);
2672 TEST2(view2->CountL(), 2);
2674 filter = CLogFilter::NewL();
2675 CleanupStack::PushL(filter);
2678 filter->SetContact(KTestContact3);
2679 filter->SetDirection(KTestDirection3);
2680 filter->SetDurationType(KLogDurationData);
2681 filter->SetEventType(KLogFaxEventTypeUid);
2682 filter->SetNumber(KTestNumber3);
2683 filter->SetRemoteParty(KTestRemote3);
2684 filter->SetStatus(KTestStatus3);
2686 list->AppendL(filter);
2687 CleanupStack::Pop(); // filter
2692 TEST(view1->SetFilterL(*list, active1->iStatus));
2693 TEST(view2->SetFilterL(*list, active2->iStatus));
2694 CActiveScheduler::Start();
2695 CActiveScheduler::Start();
2696 TEST2(view1->CountL(), 3);
2697 TEST2(view2->CountL(), 3);
2699 list->ResetAndDestroy();
2701 CleanupStack::PopAndDestroy(6); // list, view1, view2, event, active1, active2
2705 @SYMTestCaseID SYSLIB-LOGENG-CT-0944
2706 @SYMTestCaseDesc Multiple log event views test
2707 @SYMTestPriority High
2708 @SYMTestActions Add events and set the filter with different fields.
2709 Check for log event views and the test for the count of events
2710 @SYMTestExpectedResults Test must not fail
2713 LOCAL_C void TestMultipleViews2L(CLogClient& aClient)
2715 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0944 "));
2716 CTestActive* active1 = new(ELeave)CTestActive;
2717 CleanupStack::PushL(active1);
2720 User::After(1000000);
2723 now.UniversalTime();
2724 now += (TTimeIntervalDays)+1;
2726 // Get rid of all the events in the log
2728 aClient.ClearLog(now, active1->iStatus);
2729 CActiveScheduler::Start();
2730 TEST2(active1->iStatus.Int(), KErrNone);
2732 CTestActive* active2 = new(ELeave)CTestActive;
2733 CleanupStack::PushL(active2);
2735 CLogEvent* event = CLogEvent::NewL();
2736 CleanupStack::PushL(event);
2738 event->SetEventType(KLogCallEventTypeUid);
2739 event->SetContact(KTestContact1);
2740 event->SetDirection(KTestDirection1);
2741 event->SetDurationType(KLogDurationNone);
2742 event->SetNumber(KTestNumber1);
2743 event->SetRemoteParty(KTestRemote1);
2744 event->SetStatus(KTestStatus1);
2748 aClient.AddEvent(*event, active1->iStatus);
2749 CActiveScheduler::Start();
2750 TEST2(active1->iStatus.Int(), KErrNone);
2752 event->SetEventType(KLogDataEventTypeUid);
2753 event->SetContact(KTestContact2);
2754 event->SetDirection(KTestDirection2);
2755 event->SetDurationType(KLogDurationValid);
2756 event->SetNumber(KTestNumber2);
2757 event->SetRemoteParty(KTestRemote2);
2758 event->SetStatus(KTestStatus2);
2762 aClient.AddEvent(*event, active1->iStatus);
2763 CActiveScheduler::Start();
2764 TEST2(active1->iStatus.Int(), KErrNone);
2766 event->SetEventType(KLogFaxEventTypeUid);
2767 event->SetContact(KTestContact3);
2768 event->SetDirection(KTestDirection3);
2769 event->SetDurationType(KLogDurationData);
2770 event->SetNumber(KTestNumber3);
2771 event->SetRemoteParty(KTestRemote3);
2772 event->SetStatus(KTestStatus3);
2776 aClient.AddEvent(*event, active1->iStatus);
2777 CActiveScheduler::Start();
2778 TEST2(active1->iStatus.Int(), KErrNone);
2780 CLogFilterList* list = new(ELeave)CLogFilterList;
2781 CleanupStack::PushL(list);
2783 CLogViewEvent* view1 = CLogViewEvent::NewL(aClient);
2784 CleanupStack::PushL(view1);
2786 CLogClient* client2 = CLogClient::NewL(theFs);
2787 CleanupStack::PushL(client2);
2789 CLogViewEvent* view2 = CLogViewEvent::NewL(*client2);
2790 CleanupStack::PushL(view2);
2792 CLogFilter* filter = CLogFilter::NewL();
2793 CleanupStack::PushL(filter);
2796 filter->SetContact(KTestContact1);
2798 list->AppendL(filter);
2799 CleanupStack::Pop(); // filter
2804 TEST(view1->SetFilterL(*list, active1->iStatus));
2805 TEST(view2->SetFilterL(*list, active2->iStatus));
2806 CActiveScheduler::Start();
2807 CActiveScheduler::Start();
2808 TEST2(view1->CountL(), 1);
2809 TEST2(view2->CountL(), 1);
2811 filter = CLogFilter::NewL();
2812 CleanupStack::PushL(filter);
2815 filter->SetContact(KTestContact2);
2817 list->AppendL(filter);
2818 CleanupStack::Pop(); // filter
2822 TEST(view1->SetFilterL(*list, active1->iStatus));
2823 CActiveScheduler::Start();
2824 TEST2(view1->CountL(), 2);
2826 filter = CLogFilter::NewL();
2827 CleanupStack::PushL(filter);
2830 filter->SetContact(KTestContact3);
2832 list->AppendL(filter);
2833 CleanupStack::Pop(); // filter
2838 TEST(view1->SetFilterL(*list, active1->iStatus));
2839 TEST(view2->SetFilterL(*list, active2->iStatus));
2840 CActiveScheduler::Start();
2841 CActiveScheduler::Start();
2842 TEST2(view1->CountL(), 3);
2843 TEST2(view2->CountL(), 3);
2845 list->ResetAndDestroy();
2847 /////////////////////////////////////////
2849 filter = CLogFilter::NewL();
2850 CleanupStack::PushL(filter);
2853 filter->SetContact(KTestContact1);
2854 filter->SetDirection(KTestDirection1);
2856 list->AppendL(filter);
2857 CleanupStack::Pop(); // filter
2862 TEST(view1->SetFilterL(*list, active1->iStatus));
2863 TEST(view2->SetFilterL(*list, active2->iStatus));
2864 CActiveScheduler::Start();
2865 CActiveScheduler::Start();
2866 TEST2(view1->CountL(), 1);
2867 TEST2(view2->CountL(), 1);
2869 filter = CLogFilter::NewL();
2870 CleanupStack::PushL(filter);
2873 filter->SetContact(KTestContact2);
2874 filter->SetDirection(KTestDirection2);
2876 list->AppendL(filter);
2877 CleanupStack::Pop(); // filter
2882 TEST(view1->SetFilterL(*list, active1->iStatus));
2883 TEST(view2->SetFilterL(*list, active2->iStatus));
2884 CActiveScheduler::Start();
2885 CActiveScheduler::Start();
2886 TEST2(view1->CountL(), 2);
2887 TEST2(view2->CountL(), 2);
2889 filter = CLogFilter::NewL();
2890 CleanupStack::PushL(filter);
2893 filter->SetContact(KTestContact3);
2894 filter->SetDirection(KTestDirection3);
2896 list->AppendL(filter);
2897 CleanupStack::Pop(); // filter
2902 TEST(view1->SetFilterL(*list, active1->iStatus));
2903 TEST(view2->SetFilterL(*list, active2->iStatus));
2904 CActiveScheduler::Start();
2905 CActiveScheduler::Start();
2906 TEST2(view1->CountL(), 3);
2907 TEST2(view2->CountL(), 3);
2909 list->ResetAndDestroy();
2911 /////////////////////////////////////////
2913 filter = CLogFilter::NewL();
2914 CleanupStack::PushL(filter);
2917 filter->SetContact(KTestContact1);
2918 filter->SetDirection(KTestDirection1);
2919 filter->SetDurationType(KLogDurationNone);
2921 list->AppendL(filter);
2922 CleanupStack::Pop(); // filter
2927 TEST(view1->SetFilterL(*list, active1->iStatus));
2928 TEST(view2->SetFilterL(*list, active2->iStatus));
2929 CActiveScheduler::Start();
2930 CActiveScheduler::Start();
2931 TEST2(view1->CountL(), 1);
2932 TEST2(view2->CountL(), 1);
2934 filter = CLogFilter::NewL();
2935 CleanupStack::PushL(filter);
2938 filter->SetContact(KTestContact2);
2939 filter->SetDirection(KTestDirection2);
2940 filter->SetDurationType(KLogDurationValid);
2942 list->AppendL(filter);
2943 CleanupStack::Pop(); // filter
2948 TEST(view1->SetFilterL(*list, active1->iStatus));
2949 TEST(view2->SetFilterL(*list, active2->iStatus));
2950 CActiveScheduler::Start();
2951 CActiveScheduler::Start();
2952 TEST2(view1->CountL(), 2);
2953 TEST2(view2->CountL(), 2);
2955 filter = CLogFilter::NewL();
2956 CleanupStack::PushL(filter);
2959 filter->SetContact(KTestContact3);
2960 filter->SetDirection(KTestDirection3);
2961 filter->SetDurationType(KLogDurationData);
2963 list->AppendL(filter);
2964 CleanupStack::Pop(); // filter
2969 TEST(view1->SetFilterL(*list, active1->iStatus));
2970 TEST(view2->SetFilterL(*list, active2->iStatus));
2971 CActiveScheduler::Start();
2972 CActiveScheduler::Start();
2973 TEST2(view1->CountL(), 3);
2974 TEST2(view2->CountL(), 3);
2976 list->ResetAndDestroy();
2978 /////////////////////////////////////////
2980 filter = CLogFilter::NewL();
2981 CleanupStack::PushL(filter);
2984 filter->SetContact(KTestContact1);
2985 filter->SetDirection(KTestDirection1);
2986 filter->SetDurationType(KLogDurationNone);
2987 filter->SetEventType(KLogCallEventTypeUid);
2989 list->AppendL(filter);
2990 CleanupStack::Pop(); // filter
2995 TEST(view1->SetFilterL(*list, active1->iStatus));
2996 TEST(view2->SetFilterL(*list, active2->iStatus));
2997 CActiveScheduler::Start();
2998 CActiveScheduler::Start();
2999 TEST2(view1->CountL(), 1);
3000 TEST2(view2->CountL(), 1);
3002 filter = CLogFilter::NewL();
3003 CleanupStack::PushL(filter);
3006 filter->SetContact(KTestContact2);
3007 filter->SetDirection(KTestDirection2);
3008 filter->SetDurationType(KLogDurationValid);
3009 filter->SetEventType(KLogDataEventTypeUid);
3011 list->AppendL(filter);
3012 CleanupStack::Pop(); // filter
3017 TEST(view1->SetFilterL(*list, active1->iStatus));
3018 TEST(view2->SetFilterL(*list, active2->iStatus));
3019 CActiveScheduler::Start();
3020 CActiveScheduler::Start();
3021 TEST2(view1->CountL(), 2);
3022 TEST2(view2->CountL(), 2);
3024 filter = CLogFilter::NewL();
3025 CleanupStack::PushL(filter);
3028 filter->SetContact(KTestContact3);
3029 filter->SetDirection(KTestDirection3);
3030 filter->SetDurationType(KLogDurationData);
3031 filter->SetEventType(KLogFaxEventTypeUid);
3033 list->AppendL(filter);
3034 CleanupStack::Pop(); // filter
3039 TEST(view1->SetFilterL(*list, active1->iStatus));
3040 TEST(view2->SetFilterL(*list, active2->iStatus));
3041 CActiveScheduler::Start();
3042 CActiveScheduler::Start();
3043 TEST2(view1->CountL(), 3);
3044 TEST2(view2->CountL(), 3);
3046 list->ResetAndDestroy();
3048 /////////////////////////////////////////
3050 filter = CLogFilter::NewL();
3051 CleanupStack::PushL(filter);
3054 filter->SetContact(KTestContact1);
3055 filter->SetDirection(KTestDirection1);
3056 filter->SetDurationType(KLogDurationNone);
3057 filter->SetEventType(KLogCallEventTypeUid);
3058 filter->SetNumber(KTestNumber1);
3060 list->AppendL(filter);
3061 CleanupStack::Pop(); // filter
3066 TEST(view1->SetFilterL(*list, active1->iStatus));
3067 TEST(view2->SetFilterL(*list, active2->iStatus));
3068 CActiveScheduler::Start();
3069 CActiveScheduler::Start();
3070 TEST2(view1->CountL(), 1);
3071 TEST2(view2->CountL(), 1);
3073 filter = CLogFilter::NewL();
3074 CleanupStack::PushL(filter);
3077 filter->SetContact(KTestContact2);
3078 filter->SetDirection(KTestDirection2);
3079 filter->SetDurationType(KLogDurationValid);
3080 filter->SetEventType(KLogDataEventTypeUid);
3081 filter->SetNumber(KTestNumber2);
3083 list->AppendL(filter);
3084 CleanupStack::Pop(); // filter
3089 TEST(view1->SetFilterL(*list, active1->iStatus));
3090 TEST(view2->SetFilterL(*list, active2->iStatus));
3091 CActiveScheduler::Start();
3092 CActiveScheduler::Start();
3093 TEST2(view1->CountL(), 2);
3094 TEST2(view2->CountL(), 2);
3096 filter = CLogFilter::NewL();
3097 CleanupStack::PushL(filter);
3100 filter->SetContact(KTestContact3);
3101 filter->SetDirection(KTestDirection3);
3102 filter->SetDurationType(KLogDurationData);
3103 filter->SetEventType(KLogFaxEventTypeUid);
3104 filter->SetNumber(KTestNumber3);
3106 list->AppendL(filter);
3107 CleanupStack::Pop(); // filter
3112 TEST(view1->SetFilterL(*list, active1->iStatus));
3113 TEST(view2->SetFilterL(*list, active2->iStatus));
3114 CActiveScheduler::Start();
3115 CActiveScheduler::Start();
3116 TEST2(view1->CountL(), 3);
3117 TEST2(view2->CountL(), 3);
3119 list->ResetAndDestroy();
3121 /////////////////////////////////////////
3123 filter = CLogFilter::NewL();
3124 CleanupStack::PushL(filter);
3127 filter->SetContact(KTestContact1);
3128 filter->SetDirection(KTestDirection1);
3129 filter->SetDurationType(KLogDurationNone);
3130 filter->SetEventType(KLogCallEventTypeUid);
3131 filter->SetNumber(KTestNumber1);
3132 filter->SetRemoteParty(KTestRemote1);
3134 list->AppendL(filter);
3135 CleanupStack::Pop(); // filter
3140 TEST(view1->SetFilterL(*list, active1->iStatus));
3141 TEST(view2->SetFilterL(*list, active2->iStatus));
3142 CActiveScheduler::Start();
3143 CActiveScheduler::Start();
3144 TEST2(view1->CountL(), 1);
3145 TEST2(view2->CountL(), 1);
3147 filter = CLogFilter::NewL();
3148 CleanupStack::PushL(filter);
3151 filter->SetContact(KTestContact2);
3152 filter->SetDirection(KTestDirection2);
3153 filter->SetDurationType(KLogDurationValid);
3154 filter->SetEventType(KLogDataEventTypeUid);
3155 filter->SetNumber(KTestNumber2);
3156 filter->SetRemoteParty(KTestRemote2);
3158 list->AppendL(filter);
3159 CleanupStack::Pop(); // filter
3164 TEST(view1->SetFilterL(*list, active1->iStatus));
3165 TEST(view2->SetFilterL(*list, active2->iStatus));
3166 CActiveScheduler::Start();
3167 CActiveScheduler::Start();
3168 TEST2(view1->CountL(), 2);
3169 TEST2(view2->CountL(), 2);
3171 filter = CLogFilter::NewL();
3172 CleanupStack::PushL(filter);
3175 filter->SetContact(KTestContact3);
3176 filter->SetDirection(KTestDirection3);
3177 filter->SetDurationType(KLogDurationData);
3178 filter->SetEventType(KLogFaxEventTypeUid);
3179 filter->SetNumber(KTestNumber3);
3180 filter->SetRemoteParty(KTestRemote3);
3182 list->AppendL(filter);
3183 CleanupStack::Pop(); // filter
3188 TEST(view1->SetFilterL(*list, active1->iStatus));
3189 TEST(view2->SetFilterL(*list, active2->iStatus));
3190 CActiveScheduler::Start();
3191 CActiveScheduler::Start();
3192 TEST2(view1->CountL(), 3);
3193 TEST2(view2->CountL(), 3);
3195 list->ResetAndDestroy();
3197 /////////////////////////////////////////
3199 filter = CLogFilter::NewL();
3200 CleanupStack::PushL(filter);
3203 filter->SetContact(KTestContact1);
3204 filter->SetDirection(KTestDirection1);
3205 filter->SetDurationType(KLogDurationNone);
3206 filter->SetEventType(KLogCallEventTypeUid);
3207 filter->SetNumber(KTestNumber1);
3208 filter->SetRemoteParty(KTestRemote1);
3209 filter->SetStatus(KTestStatus1);
3211 list->AppendL(filter);
3212 CleanupStack::Pop(); // filter
3217 TEST(view1->SetFilterL(*list, active1->iStatus));
3218 TEST(view2->SetFilterL(*list, active2->iStatus));
3219 CActiveScheduler::Start();
3220 CActiveScheduler::Start();
3221 TEST2(view1->CountL(), 1);
3222 TEST2(view2->CountL(), 1);
3224 filter = CLogFilter::NewL();
3225 CleanupStack::PushL(filter);
3228 filter->SetContact(KTestContact2);
3229 filter->SetDirection(KTestDirection2);
3230 filter->SetDurationType(KLogDurationValid);
3231 filter->SetEventType(KLogDataEventTypeUid);
3232 filter->SetNumber(KTestNumber2);
3233 filter->SetRemoteParty(KTestRemote2);
3234 filter->SetStatus(KTestStatus2);
3236 list->AppendL(filter);
3237 CleanupStack::Pop(); // filter
3242 TEST(view1->SetFilterL(*list, active1->iStatus));
3243 TEST(view2->SetFilterL(*list, active2->iStatus));
3244 CActiveScheduler::Start();
3245 CActiveScheduler::Start();
3246 TEST2(view1->CountL(), 2);
3247 TEST2(view2->CountL(), 2);
3249 filter = CLogFilter::NewL();
3250 CleanupStack::PushL(filter);
3253 filter->SetContact(KTestContact3);
3254 filter->SetDirection(KTestDirection3);
3255 filter->SetDurationType(KLogDurationData);
3256 filter->SetEventType(KLogFaxEventTypeUid);
3257 filter->SetNumber(KTestNumber3);
3258 filter->SetRemoteParty(KTestRemote3);
3259 filter->SetStatus(KTestStatus3);
3261 list->AppendL(filter);
3262 CleanupStack::Pop(); // filter
3267 TEST(view1->SetFilterL(*list, active1->iStatus));
3268 TEST(view2->SetFilterL(*list, active2->iStatus));
3269 CActiveScheduler::Start();
3270 CActiveScheduler::Start();
3271 TEST2(view1->CountL(), 3);
3272 TEST2(view2->CountL(), 3);
3274 list->ResetAndDestroy();
3276 CleanupStack::PopAndDestroy(7); // list, view1, view2, client2, event, active1, active2
3280 @SYMTestCaseID SYSLIB-LOGENG-CT-0945
3281 @SYMTestCaseDesc Tests for notification on changes done to the view
3282 Tests for CLogViewChangeObserver::iStatus
3283 @SYMTestPriority High
3284 @SYMTestActions Tests for setting a filter on the view.Check for receiving notifications on adding events to the view
3285 @SYMTestExpectedResults Test must not fail
3288 LOCAL_C void TestViewChangeEventsL(CLogClient& aClient)
3290 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0945 "));
3291 TestUtils::DeleteDatabaseL();
3293 CLogEvent* event = CLogEvent::NewL();
3294 CleanupStack::PushL(event);
3295 event->SetEventType(KLogCallEventTypeUid);
3297 CTestActive* active = new(ELeave) CTestActive();
3298 CleanupStack::PushL(active);
3300 CLogViewChangeObserver* changeObs = CLogViewChangeObserver::NewLC();
3302 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs);
3303 CleanupStack::PushL(view);
3305 CLogFilter* filter = CLogFilter::NewL();
3306 CleanupStack::PushL(filter);
3307 TEST(!view->SetFilterL(*filter, active->iStatus));
3309 // Add some events and check we receive change notifications
3314 for(count = 0; count < KTestEventNum; count++)
3316 aClient.AddEvent(*event, changeObs->iStatus);
3317 CLogChangeDefinition* changes = changeObs->WaitForChangesLC(CLogViewChangeObserver::EStopOnBoth);
3318 TEST2(changeObs->iStatus.Int(), KErrNone);
3319 TEST(event->Id() == (TLogId) count);
3323 TEST2(changes->Count(), 1);
3324 TEST2(changes->At(0, logId, viewIndex), ELogChangeTypeEventAdded);
3325 TEST(logId == (TLogId) count);
3326 TEST2(viewIndex, 0);
3327 CleanupStack::PopAndDestroy(changes);
3330 CleanupStack::PopAndDestroy(5, event); // filter, view, changeObs, active, event
3334 @SYMTestCaseID SYSLIB-LOGENG-CT-0946
3335 @SYMTestCaseDesc Tests for events in the recent view list
3336 @SYMTestPriority High
3337 @SYMTestActions Tests for events in the recent view list after setting the filters for incoming,outgoing and missed calls
3338 @SYMTestExpectedResults Test must not fail
3341 LOCAL_C void TestAltEventsInRecentListL(CLogClient& aClient)
3343 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0946 "));
3344 CLogEvent* event = CLogEvent::NewL();
3345 CleanupStack::PushL(event);
3347 CTestActive* active = new(ELeave)CTestActive();
3348 CleanupStack::PushL(active);
3350 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
3351 CleanupStack::PushL(view);
3353 // Clear recent lists
3355 aClient.ClearLog(KLogNullRecentList, active->iStatus);
3356 CActiveScheduler::Start();
3357 TEST2(active->iStatus.Int(), KErrNone);
3360 event->SetEventType(KLogCallEventTypeUid);
3362 // Add Incoming events
3363 aClient.GetString(buf, R_LOG_DIR_IN);
3364 event->SetDirection(buf);
3365 event->SetContact(1);
3367 aClient.AddEvent(*event, active->iStatus);
3368 CActiveScheduler::Start();
3369 TEST2(active->iStatus.Int(), KErrNone);
3370 aClient.GetString(buf, R_LOG_DIR_IN_ALT);
3371 event->SetDirection(buf);
3372 event->SetContact(2);
3374 aClient.AddEvent(*event, active->iStatus);
3375 CActiveScheduler::Start();
3376 TEST2(active->iStatus.Int(), KErrNone);
3377 // Verify both events in recent list
3379 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
3380 CActiveScheduler::Start();
3381 TEST2(active->iStatus.Int(), KErrNone);
3382 TEST2(view->CountL(), 2);
3384 // Add Outgoing events
3385 aClient.GetString(buf, R_LOG_DIR_OUT);
3386 event->SetDirection(buf);
3387 event->SetContact(3);
3389 aClient.AddEvent(*event, active->iStatus);
3390 CActiveScheduler::Start();
3391 TEST2(active->iStatus.Int(), KErrNone);
3392 aClient.GetString(buf, R_LOG_DIR_OUT_ALT);
3393 event->SetDirection(buf);
3394 event->SetContact(4);
3396 aClient.AddEvent(*event, active->iStatus);
3397 CActiveScheduler::Start();
3398 TEST2(active->iStatus.Int(), KErrNone);
3399 // Verify both events in recent list
3401 TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus));
3402 CActiveScheduler::Start();
3403 TEST2(active->iStatus.Int(), KErrNone);
3404 TEST2(view->CountL(), 2);
3406 // Add Missed events
3407 aClient.GetString(buf, R_LOG_DIR_MISSED);
3408 event->SetDirection(buf);
3409 event->SetContact(5);
3411 aClient.AddEvent(*event, active->iStatus);
3412 CActiveScheduler::Start();
3413 TEST2(active->iStatus.Int(), KErrNone);
3414 aClient.GetString(buf, R_LOG_DIR_MISSED_ALT);
3415 event->SetDirection(buf);
3416 event->SetContact(6);
3418 aClient.AddEvent(*event, active->iStatus);
3419 CActiveScheduler::Start();
3420 TEST2(active->iStatus.Int(), KErrNone);
3421 // Verify both events in recent list
3423 TEST(view->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
3424 CActiveScheduler::Start();
3425 TEST2(active->iStatus.Int(), KErrNone);
3426 TEST2(view->CountL(), 2);
3428 CleanupStack::PopAndDestroy(3); // view, active, event,
3432 @SYMTestCaseID SYSLIB-LOGENG-CT-0947
3433 @SYMTestCaseDesc Tests for view with filter by time
3434 @SYMTestPriority High
3435 @SYMTestActions Tests for view with filters set by different time
3436 @SYMTestExpectedResults Test must not fail
3439 LOCAL_C void TestFilterByTimeL(CLogClient& aClient)
3441 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0947 "));
3442 CLogEvent* event = CLogEvent::NewL();
3443 CleanupStack::PushL(event);
3445 CTestActive* active = new(ELeave)CTestActive();
3446 CleanupStack::PushL(active);
3448 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
3449 CleanupStack::PushL(view);
3451 // Clear recent lists
3453 aClient.ClearLog(KLogNullRecentList, active->iStatus);
3454 CActiveScheduler::Start();
3455 TEST2(active->iStatus.Int(), KErrNone);
3457 event->SetEventType(KLogCallEventTypeUid);
3459 aClient.GetString(buf, R_LOG_DIR_IN);
3460 event->SetDirection(buf);
3462 // add first event (events following are added on successive days)
3463 event->SetContact(1); // ensures events are not duplicates
3465 aClient.AddEvent(*event, active->iStatus);
3466 CActiveScheduler::Start();
3467 TEST2(active->iStatus.Int(), KErrNone);
3470 systemTime.UniversalTime();
3472 // set filter startDate
3473 TTime startDate = systemTime + (TTimeIntervalHours)+1;
3476 systemTime += (TTimeIntervalDays)+1;
3477 event->SetContact(2);
3479 aClient.AddEvent(*event, active->iStatus);
3480 CActiveScheduler::Start();
3481 TEST2(active->iStatus.Int(), KErrNone);
3483 event->SetTime(systemTime);
3485 aClient.ChangeEvent(*event, active->iStatus);
3486 CActiveScheduler::Start();
3487 TEST2(active->iStatus.Int(), KErrNone);
3490 systemTime += (TTimeIntervalDays)+1;
3491 event->SetContact(3);
3493 aClient.AddEvent(*event, active->iStatus);
3494 CActiveScheduler::Start();
3495 TEST2(active->iStatus.Int(), KErrNone);
3497 event->SetTime(systemTime);
3499 aClient.ChangeEvent(*event, active->iStatus);
3500 CActiveScheduler::Start();
3501 TEST2(active->iStatus.Int(), KErrNone);
3503 // set filter endDate
3504 TTime endDate = systemTime + (TTimeIntervalHours)+1;
3507 systemTime += (TTimeIntervalDays)+1;
3508 event->SetContact(4);
3510 aClient.AddEvent(*event, active->iStatus);
3511 CActiveScheduler::Start();
3512 TEST2(active->iStatus.Int(), KErrNone);
3514 event->SetTime(systemTime);
3516 aClient.ChangeEvent(*event, active->iStatus);
3517 CActiveScheduler::Start();
3518 TEST2(active->iStatus.Int(), KErrNone);
3520 CLogFilter* filter = CLogFilter::NewL();
3521 CleanupStack::PushL(filter);
3523 // check using both start and end
3524 filter->SetStartTime(startDate);
3525 filter->SetEndTime(endDate);
3527 TEST(view->SetRecentListL(KLogNullRecentList, *filter, active->iStatus));
3528 CActiveScheduler::Start();
3529 TEST2(active->iStatus.Int(), KErrNone);
3530 TEST2(view->CountL(), 2);
3533 filter->SetStartTime(TTime(0)); // reset
3534 filter->SetEndTime(endDate);
3536 TEST(view->SetRecentListL(KLogNullRecentList, *filter, active->iStatus));
3537 CActiveScheduler::Start();
3538 TEST2(active->iStatus.Int(), KErrNone);
3539 TEST2(view->CountL(), 3);
3541 // only start filter
3542 filter->SetStartTime(startDate);
3543 filter->SetEndTime(TTime(0));
3545 TEST(view->SetRecentListL(KLogNullRecentList, *filter, active->iStatus));
3546 CActiveScheduler::Start();
3547 TEST2(active->iStatus.Int(), KErrNone);
3548 TEST2(view->CountL(), 3);
3551 filter->SetStartTime(TTime(0));
3552 filter->SetEndTime(TTime(0));
3554 TEST(view->SetRecentListL(KLogNullRecentList, *filter, active->iStatus));
3555 CActiveScheduler::Start();
3556 TEST2(active->iStatus.Int(), KErrNone);
3557 TEST2(view->CountL(), 4);
3559 CleanupStack::PopAndDestroy(4); // view, active, event, filter
3563 @SYMTestCaseID SYSLIB-LOGENG-CT-0948
3564 @SYMTestCaseDesc Tests for log view change observer
3565 @SYMTestPriority High
3566 @SYMTestActions Check that a view doesn't get change events for duplicates
3567 @SYMTestExpectedResults Test must not fail
3570 LOCAL_C void TestHiddenChangeEvents1L(CLogClient& aClient)
3572 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0948 "));
3575 TLogDatabaseChangeType type;
3577 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
3578 changeObs1->StartCollectingChanges();
3581 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
3582 CleanupStack::PushL(view);
3584 CLogFilter* filter = CLogFilter::NewL();
3585 CleanupStack::PushL(filter);
3587 CLogEvent* event = CLogEvent::NewL();
3588 CleanupStack::PushL(event);
3590 CTestActive* active = new(ELeave)CTestActive();
3591 CleanupStack::PushL(active);
3594 now.UniversalTime();
3595 now += (TTimeIntervalDays)+1;
3597 // Get rid of all the events in the log
3599 aClient.ClearLog(now, active->iStatus);
3600 CActiveScheduler::Start();
3601 TEST2(active->iStatus.Int(), KErrNone);
3603 // Incoming call event
3604 event->SetEventType(KLogCallEventTypeUid);
3605 TBuf<KLogMaxDirectionLength> buf;
3606 aClient.GetString(buf, R_LOG_DIR_IN);
3607 event->SetDirection(buf);
3611 aClient.AddEvent(*event, active->iStatus);
3612 CActiveScheduler::Start();
3613 TEST2(active->iStatus.Int(), KErrNone);
3615 // Setup normal event view
3617 TEST(view->SetFilterL(*filter, active->iStatus));
3618 CActiveScheduler::Start();
3619 TEST2(active->iStatus.Int(), KErrNone);
3621 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
3622 changeObs2->StartCollectingChanges();
3624 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
3625 CleanupStack::PushL(recent);
3627 // Check recent view
3629 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
3630 CActiveScheduler::Start();
3631 TEST2(active->iStatus.Int(), KErrNone);
3632 TEST2(recent->CountL(), 1);
3636 aClient.AddEvent(*event, active->iStatus);
3637 CActiveScheduler::Start();
3638 TEST2(active->iStatus.Int(), KErrNone);
3640 // Check change events
3641 CTestTimer* timer = CTestTimer::NewL();
3642 timer->After(100000);
3643 CActiveScheduler::Start();
3646 TEST2(changeObs2->Changes().Count(), 2);
3647 type = changeObs2->Changes().At(0, logId, viewIndex);
3648 TEST2(type, ELogChangeTypeEventAdded);
3649 type = changeObs2->Changes().At(1, logId, viewIndex);
3650 TEST2(type, ELogChangeTypeEventDeleted);
3652 // Check recent view
3654 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
3655 CActiveScheduler::Start();
3656 TEST2(active->iStatus.Int(), KErrNone);
3657 TEST2(recent->CountL(), 1);
3659 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
3660 CleanupStack::PushL(duplicate);
3662 // Check duplicate count
3664 TEST(recent->DuplicatesL(*duplicate, active->iStatus));
3665 CActiveScheduler::Start();
3666 TEST2(active->iStatus.Int(), KErrNone);
3667 TEST2(duplicate->CountL(), 1);
3669 // Check change events
3670 User::After(100000);
3671 TEST2(changeObs1->Changes().Count(), 1);
3672 type = changeObs1->Changes().At(0, logId, viewIndex);
3673 TEST2(type, ELogChangeTypeEventAdded);
3675 CleanupStack::PopAndDestroy(8); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate
3679 @SYMTestCaseID SYSLIB-LOGENG-CT-0949
3680 @SYMTestCaseDesc Tests for log view change observer
3681 @SYMTestPriority High
3682 @SYMTestActions Check that a view doesn't get change events when recent list purged
3683 @SYMTestExpectedResults Test must not fail
3686 LOCAL_C void TestHiddenChangeEvents2L(CLogClient& aClient)
3688 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0949 "));
3691 TLogDatabaseChangeType type;
3693 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
3694 changeObs1->StartCollectingChanges();
3696 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
3697 CleanupStack::PushL(view);
3699 CLogFilter* filter = CLogFilter::NewL();
3700 CleanupStack::PushL(filter);
3702 CLogEvent* event = CLogEvent::NewL();
3703 CleanupStack::PushL(event);
3705 CTestActive* active = new(ELeave)CTestActive();
3706 CleanupStack::PushL(active);
3709 now.UniversalTime();
3710 now += (TTimeIntervalDays)+1;
3712 // Get rid of all the events in the log
3714 aClient.ClearLog(now, active->iStatus);
3715 CActiveScheduler::Start();
3716 TEST2(active->iStatus.Int(), KErrNone);
3721 aClient.GetConfig(config, active->iStatus);
3722 CActiveScheduler::Start();
3723 TEST2(active->iStatus.Int(), KErrNone);
3725 // Incoming call event
3726 event->SetEventType(KLogCallEventTypeUid);
3727 TBuf<KLogMaxDirectionLength> buf;
3728 aClient.GetString(buf, R_LOG_DIR_IN);
3729 event->SetDirection(buf);
3731 // Add max allowed events
3732 TInt count = config.iMaxRecentLogSize;
3735 event->SetContact(count+1);
3737 aClient.AddEvent(*event, active->iStatus);
3738 CActiveScheduler::Start();
3739 TEST2(active->iStatus.Int(), KErrNone);
3742 // Setup normal event view
3744 TEST(view->SetFilterL(*filter, active->iStatus));
3745 CActiveScheduler::Start();
3746 TEST2(active->iStatus.Int(), KErrNone);
3748 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
3749 changeObs2->StartCollectingChanges();
3751 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
3752 CleanupStack::PushL(recent);
3754 // Check recent view
3756 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
3757 CActiveScheduler::Start();
3758 TEST2(active->iStatus.Int(), KErrNone);
3759 TEST2(recent->CountL(), config.iMaxRecentLogSize);
3761 // Add a new event, will cause one to be purged from recent view
3762 event->SetContact(1234);
3764 aClient.AddEvent(*event, active->iStatus);
3765 CActiveScheduler::Start();
3766 TEST2(active->iStatus.Int(), KErrNone);
3768 // Check change events
3769 CTestTimer *timer = CTestTimer::NewL();
3770 timer->After(100000);
3771 CActiveScheduler::Start();
3774 TEST2(changeObs2->Changes().Count(), 2);
3775 type = changeObs2->Changes().At(0, logId, viewIndex);
3776 TEST2(type, ELogChangeTypeEventAdded);
3777 type = changeObs2->Changes().At(1, logId, viewIndex);
3778 TEST2(type, ELogChangeTypeEventDeleted);
3780 // Check recent view
3782 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
3783 CActiveScheduler::Start();
3784 TEST2(active->iStatus.Int(), KErrNone);
3785 TEST2(recent->CountL(), config.iMaxRecentLogSize);
3787 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
3788 CleanupStack::PushL(duplicate);
3790 // Check duplicate count
3791 TEST(!recent->DuplicatesL(*duplicate, active->iStatus));
3793 // Check change events
3794 User::After(100000);
3795 TEST2(changeObs1->Changes().Count(), 1);
3796 type = changeObs1->Changes().At(0, logId, viewIndex);
3797 TEST2(type, ELogChangeTypeEventAdded);
3799 CleanupStack::PopAndDestroy(8); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate
3802 @SYMTestCaseID SYSLIB-LOGENG-CT-0950
3803 @SYMTestCaseDesc Tests for log view change observer
3804 @SYMTestPriority High
3805 @SYMTestActions Check that a view doesn't get change events when recent list purged after changing config
3806 @SYMTestExpectedResults Test must not fail
3809 LOCAL_C void TestHiddenChangeEvents3L(CLogClient& aClient)
3811 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0950 "));
3814 TLogDatabaseChangeType type;
3816 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
3817 changeObs1->StartCollectingChanges();
3819 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
3820 CleanupStack::PushL(view);
3822 CLogFilter* filter = CLogFilter::NewL();
3823 CleanupStack::PushL(filter);
3825 CLogEvent* event = CLogEvent::NewL();
3826 CleanupStack::PushL(event);
3828 CTestActive* active = new(ELeave)CTestActive();
3829 CleanupStack::PushL(active);
3832 now.UniversalTime();
3833 now += (TTimeIntervalDays)+1;
3835 // Get rid of all the events in the log
3837 aClient.ClearLog(now, active->iStatus);
3838 CActiveScheduler::Start();
3839 TEST2(active->iStatus.Int(), KErrNone);
3841 // Get and set config
3844 aClient.GetConfig(config, active->iStatus);
3845 CActiveScheduler::Start();
3846 TEST2(active->iStatus.Int(), KErrNone);
3847 config.iMaxRecentLogSize = 2;
3849 aClient.ChangeConfig(config, active->iStatus);
3850 CActiveScheduler::Start();
3851 TEST2(active->iStatus.Int(), KErrNone);
3853 // Incoming call event
3854 event->SetEventType(KLogCallEventTypeUid);
3855 TBuf<KLogMaxDirectionLength> buf;
3856 aClient.GetString(buf, R_LOG_DIR_IN);
3857 event->SetDirection(buf);
3859 // Add max allowed events
3860 TInt count = config.iMaxRecentLogSize;
3863 event->SetContact(count+1);
3865 aClient.AddEvent(*event, active->iStatus);
3866 CActiveScheduler::Start();
3867 TEST2(active->iStatus.Int(), KErrNone);
3870 // Setup normal event view
3872 TEST(view->SetFilterL(*filter, active->iStatus));
3873 CActiveScheduler::Start();
3874 TEST2(active->iStatus.Int(), KErrNone);
3876 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
3877 changeObs2->StartCollectingChanges();
3879 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
3880 CleanupStack::PushL(recent);
3882 // Check recent view
3884 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
3885 CActiveScheduler::Start();
3886 TEST2(active->iStatus.Int(), KErrNone);
3887 TEST2(recent->CountL(), config.iMaxRecentLogSize);
3889 // Change config, will cause one event to be purged from recent view
3890 config.iMaxRecentLogSize = 1;
3892 aClient.ChangeConfig(config, active->iStatus);
3893 CActiveScheduler::Start();
3894 TEST2(active->iStatus.Int(), KErrNone);
3896 // Check change events
3897 User::After(100000);
3898 TEST2(changeObs2->Changes().Count(), 1);
3899 type = changeObs2->Changes().At(0, logId, viewIndex);
3900 TEST2(type, ELogChangeTypeEventDeleted);
3902 // Check recent view
3904 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
3905 CActiveScheduler::Start();
3906 TEST2(active->iStatus.Int(), KErrNone);
3907 TEST2(recent->CountL(), config.iMaxRecentLogSize);
3909 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
3910 CleanupStack::PushL(duplicate);
3912 // Check duplicate count
3913 TEST(!recent->DuplicatesL(*duplicate, active->iStatus));
3915 // Check change events
3916 User::After(100000);
3917 TEST(!changeObs1->HaveChanges());
3919 CleanupStack::PopAndDestroy(8); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate
3923 @SYMTestCaseID SYSLIB-LOGENG-CT-0951
3924 @SYMTestCaseDesc Test for log view change observer
3925 @SYMTestPriority High
3926 @SYMTestActions Check that when deleting an event causing recent lists to be updated,views don't get unnecessary change events
3927 @SYMTestExpectedResults Test must not fail
3930 LOCAL_C void TestHiddenChangeEvents4L(CLogClient& aClient)
3932 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0951 "));
3935 TLogDatabaseChangeType type;
3937 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
3938 changeObs1->StartCollectingChanges();
3940 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
3941 CleanupStack::PushL(view);
3943 CLogFilter* filter = CLogFilter::NewL();
3944 CleanupStack::PushL(filter);
3945 filter->SetFlags(1); // Need to hide an event from the view
3947 CLogEvent* event = CLogEvent::NewL();
3948 CleanupStack::PushL(event);
3950 CTestActive* active = new(ELeave)CTestActive();
3951 CleanupStack::PushL(active);
3954 now.UniversalTime();
3955 now += (TTimeIntervalDays)+1;
3957 // Get rid of all the events in the log
3959 aClient.ClearLog(now, active->iStatus);
3960 CActiveScheduler::Start();
3961 TEST2(active->iStatus.Int(), KErrNone);
3963 // Incoming call event
3964 event->SetEventType(KLogCallEventTypeUid);
3965 TBuf<KLogMaxDirectionLength> buf;
3966 aClient.GetString(buf, R_LOG_DIR_IN);
3967 event->SetDirection(buf);
3973 aClient.AddEvent(*event, active->iStatus);
3974 CActiveScheduler::Start();
3975 TEST2(active->iStatus.Int(), KErrNone);
3979 aClient.AddEvent(*event, active->iStatus);
3980 CActiveScheduler::Start();
3981 TEST2(active->iStatus.Int(), KErrNone);
3983 event->ClearFlags(0xF);
3987 aClient.AddEvent(*event, active->iStatus);
3988 CActiveScheduler::Start();
3989 TEST2(active->iStatus.Int(), KErrNone);
3991 // Setup normal event view
3993 TEST(view->SetFilterL(*filter, active->iStatus));
3994 CActiveScheduler::Start();
3995 TEST2(active->iStatus.Int(), KErrNone);
3996 TEST2(view->CountL(), 2);
3998 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
3999 changeObs2->StartCollectingChanges();
4001 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
4002 CleanupStack::PushL(recent);
4004 // Check recent view
4006 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4007 CActiveScheduler::Start();
4008 TEST2(active->iStatus.Int(), KErrNone);
4009 TEST2(recent->CountL(), 1);
4011 changeObs1->StartCollectingChanges();
4012 changeObs2->StartCollectingChanges();
4014 // Delete the event in recent list
4016 aClient.DeleteEvent(event->Id(), active->iStatus);
4017 CActiveScheduler::Start();
4018 TEST2(active->iStatus.Int(), KErrNone);
4020 // Check change events
4021 User::After(1000000);
4022 TEST2(changeObs2->Changes().Count(), 2);
4023 type = changeObs2->Changes().At(0, logId, viewIndex);
4024 TEST2(type, ELogChangeTypeEventAdded);
4025 type = changeObs2->Changes().At(1, logId, viewIndex);
4026 TEST2(type, ELogChangeTypeEventDeleted);
4028 TEST(!changeObs1->HaveChanges());
4030 CleanupStack::PopAndDestroy(7); // changeObs1, changeObs2, view, filter, event, active, recent
4034 @SYMTestCaseID SYSLIB-LOGENG-CT-0952
4035 @SYMTestCaseDesc Tests for log view change observer
4036 @SYMTestPriority High
4037 @SYMTestActions Check that a view doesn't get change events when recent list cleared
4038 @SYMTestExpectedResults Test must not fail
4041 LOCAL_C void TestHiddenChangeEvents5L(CLogClient& aClient)
4043 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0952 "));
4046 TLogDatabaseChangeType type;
4048 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
4049 changeObs1->StartCollectingChanges();
4051 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
4052 CleanupStack::PushL(view);
4054 CLogFilter* filter = CLogFilter::NewL();
4055 CleanupStack::PushL(filter);
4057 CLogEvent* event = CLogEvent::NewL();
4058 CleanupStack::PushL(event);
4060 CTestActive* active = new(ELeave)CTestActive();
4061 CleanupStack::PushL(active);
4064 now.UniversalTime();
4065 now += (TTimeIntervalDays)+1;
4067 // Get rid of all the events in the log
4069 aClient.ClearLog(now, active->iStatus);
4070 CActiveScheduler::Start();
4071 TEST2(active->iStatus.Int(), KErrNone);
4076 aClient.GetConfig(config, active->iStatus);
4077 CActiveScheduler::Start();
4078 TEST2(active->iStatus.Int(), KErrNone);
4080 // Incoming call event
4081 event->SetEventType(KLogCallEventTypeUid);
4082 TBuf<KLogMaxDirectionLength> buf;
4083 aClient.GetString(buf, R_LOG_DIR_IN);
4084 event->SetDirection(buf);
4086 // Add max allowed events
4087 TInt count = config.iMaxRecentLogSize;
4090 event->SetContact(count+1);
4092 aClient.AddEvent(*event, active->iStatus);
4093 CActiveScheduler::Start();
4094 TEST2(active->iStatus.Int(), KErrNone);
4097 // Setup normal event view
4099 TEST(view->SetFilterL(*filter, active->iStatus));
4100 CActiveScheduler::Start();
4101 TEST2(active->iStatus.Int(), KErrNone);
4103 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
4104 changeObs2->StartCollectingChanges();
4106 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
4107 CleanupStack::PushL(recent);
4109 // Check recent view
4111 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4112 CActiveScheduler::Start();
4113 TEST2(active->iStatus.Int(), KErrNone);
4114 TEST2(recent->CountL(), config.iMaxRecentLogSize);
4116 // Clear recent view
4118 aClient.ClearLog(KLogRecentIncomingCalls, active->iStatus);
4119 CActiveScheduler::Start();
4120 TEST2(active->iStatus.Int(), KErrNone);
4122 // Check change events
4123 User::After(100000);
4125 count = config.iMaxRecentLogSize;
4126 TEST2(changeObs2->Changes().Count(), count);
4129 type = changeObs2->Changes().At(count, logId, viewIndex);
4130 TEST2(type, ELogChangeTypeEventDeleted);
4133 // Check recent view
4134 TEST(!recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4136 // Check change events
4137 User::After(100000);
4138 TEST(!changeObs1->HaveChanges());
4140 CleanupStack::PopAndDestroy(7); // changeObs1, changeObs2, view, filter, event, active, recent
4144 @SYMTestCaseID SYSLIB-LOGENG-CT-0953
4145 @SYMTestCaseDesc Tests for log view change observer
4146 @SYMTestPriority High
4147 @SYMTestActions Check that a view doesn't get change events when removing events from a recent or duplicate view
4148 @SYMTestExpectedResults Test must not fail
4151 LOCAL_C void TestHiddenChangeEvents6L(CLogClient& aClient)
4153 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0953 "));
4154 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
4155 changeObs1->StartCollectingChanges();
4157 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
4158 CleanupStack::PushL(view);
4160 CLogFilter* filter = CLogFilter::NewL();
4161 CleanupStack::PushL(filter);
4163 CLogEvent* event = CLogEvent::NewL();
4164 CleanupStack::PushL(event);
4166 CTestActive* active = new(ELeave)CTestActive();
4167 CleanupStack::PushL(active);
4170 now.UniversalTime();
4171 now += (TTimeIntervalDays)+1;
4173 // Get rid of all the events in the log
4175 aClient.ClearLog(now, active->iStatus);
4176 CActiveScheduler::Start();
4177 TEST2(active->iStatus.Int(), KErrNone);
4179 // Incoming call event
4180 event->SetEventType(KLogCallEventTypeUid);
4181 TBuf<KLogMaxDirectionLength> buf;
4182 aClient.GetString(buf, R_LOG_DIR_IN);
4183 event->SetDirection(buf);
4187 aClient.AddEvent(*event, active->iStatus);
4188 CActiveScheduler::Start();
4189 TEST2(active->iStatus.Int(), KErrNone);
4193 aClient.AddEvent(*event, active->iStatus);
4194 CActiveScheduler::Start();
4195 TEST2(active->iStatus.Int(), KErrNone);
4197 // Setup normal event view
4199 TEST(view->SetFilterL(*filter, active->iStatus));
4200 CActiveScheduler::Start();
4201 TEST2(active->iStatus.Int(), KErrNone);
4202 TEST2(view->CountL(), 2);
4204 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
4205 changeObs2->StartCollectingChanges();
4207 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
4208 CleanupStack::PushL(recent);
4210 // Check recent view
4212 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4213 CActiveScheduler::Start();
4214 TEST2(active->iStatus.Int(), KErrNone);
4215 TEST2(recent->CountL(), 1);
4217 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
4218 CleanupStack::PushL(duplicate);
4220 // Check duplicate count
4222 TEST(recent->DuplicatesL(*duplicate, active->iStatus));
4223 CActiveScheduler::Start();
4224 TEST2(active->iStatus.Int(), KErrNone);
4225 TEST2(recent->CountL(), 1);
4228 duplicate->RemoveL(duplicate->Event().Id());
4230 CTestTimer* timer = CTestTimer::NewL();
4231 CleanupStack::PushL(timer);
4232 timer->After(100000);
4233 CActiveScheduler::Start();
4235 // Check change events
4236 TEST(!changeObs1->HaveChanges());
4237 TEST(!changeObs2->HaveChanges());
4240 recent->RemoveL(recent->Event().Id());
4242 // Check change events
4243 timer->After(100000);
4244 CActiveScheduler::Start();
4246 TEST(!changeObs1->HaveChanges());
4247 TEST(!changeObs2->HaveChanges()); // No event because we should know we called Remove on ourselves
4249 CleanupStack::PopAndDestroy(9); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate, timer
4253 @SYMTestCaseID SYSLIB-LOGENG-CT-0954
4254 @SYMTestCaseDesc Tests for log view change observer
4255 @SYMTestPriority High
4256 @SYMTestActions Check that a view doesn't get change events when clearing duplicates
4257 @SYMTestExpectedResults Test must not fail
4260 LOCAL_C void TestHiddenChangeEvents7L(CLogClient& aClient)
4262 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0954 "));
4263 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
4264 changeObs1->StartCollectingChanges();
4266 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
4267 CleanupStack::PushL(view);
4269 CLogFilter* filter = CLogFilter::NewL();
4270 CleanupStack::PushL(filter);
4272 CLogEvent* event = CLogEvent::NewL();
4273 CleanupStack::PushL(event);
4275 CTestActive* active = new(ELeave)CTestActive();
4276 CleanupStack::PushL(active);
4279 now.UniversalTime();
4280 now += (TTimeIntervalDays)+1;
4282 // Get rid of all the events in the log
4284 aClient.ClearLog(now, active->iStatus);
4285 CActiveScheduler::Start();
4286 TEST2(active->iStatus.Int(), KErrNone);
4288 // Incoming call event
4289 event->SetEventType(KLogCallEventTypeUid);
4290 TBuf<KLogMaxDirectionLength> buf;
4291 aClient.GetString(buf, R_LOG_DIR_IN);
4292 event->SetDirection(buf);
4296 aClient.AddEvent(*event, active->iStatus);
4297 CActiveScheduler::Start();
4298 TEST2(active->iStatus.Int(), KErrNone);
4302 aClient.AddEvent(*event, active->iStatus);
4303 CActiveScheduler::Start();
4304 TEST2(active->iStatus.Int(), KErrNone);
4306 // Setup normal event view
4308 TEST(view->SetFilterL(*filter, active->iStatus));
4309 CActiveScheduler::Start();
4310 TEST2(active->iStatus.Int(), KErrNone);
4311 TEST2(view->CountL(), 2);
4313 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
4314 changeObs2->StartCollectingChanges();
4316 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
4317 CleanupStack::PushL(recent);
4319 // Check recent view
4321 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4322 CActiveScheduler::Start();
4323 TEST2(active->iStatus.Int(), KErrNone);
4324 TEST2(recent->CountL(), 1);
4326 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
4327 CleanupStack::PushL(duplicate);
4329 // Check duplicate count
4331 TEST(recent->DuplicatesL(*duplicate, active->iStatus));
4332 CActiveScheduler::Start();
4333 TEST2(active->iStatus.Int(), KErrNone);
4334 TEST2(recent->CountL(), 1);
4337 recent->ClearDuplicatesL();
4339 CTestTimer* timer = CTestTimer::NewL();
4340 CleanupStack::PushL(timer);
4341 timer->After(100000);
4342 CActiveScheduler::Start();
4344 // Check change events
4345 TEST(!changeObs1->HaveChanges());
4346 TEST(!changeObs2->HaveChanges());
4348 CleanupStack::PopAndDestroy(9); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate, timer
4352 @SYMTestCaseID SYSLIB-LOGENG-CT-1363
4353 @SYMTestCaseDesc Tests for log view change observer
4354 Making a call from recent call list causes total freeze if log
4356 @SYMTestPriority High
4357 @SYMTestActions Test that editing a recent event does not cause a panic if
4358 part of the log has been cleared
4359 @SYMTestExpectedResults Test must not fail
4362 LOCAL_C void DEF066296L(CLogClient& aClient)
4364 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1363 "));
4365 TBuf<KLogMaxDirectionLength> buf;
4367 CLogEvent* event = CLogEvent::NewL();
4368 CleanupStack::PushL(event);
4370 CTestActive* active = new(ELeave)CTestActive();
4371 CleanupStack::PushL(active);
4373 // To reproduce this defect, we need a view to be updated
4374 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
4375 CleanupStack::PushL(view);
4377 // Set up the event and log a call from number 444
4378 event->SetEventType(KLogCallEventTypeUid);
4379 aClient.GetString(buf, R_LOG_DIR_IN);
4380 event->SetDirection(buf);
4381 event->SetNumber(_L("444"));
4383 aClient.AddEvent(*event, active->iStatus);
4384 CActiveScheduler::Start();
4385 TEST2(active->iStatus.Int(), KErrNone);
4387 // Set up the view to display the recent call list
4389 TEST(view->SetRecentListL(-1, active->iStatus));
4390 CActiveScheduler::Start();
4391 TEST2(active->iStatus.Int(), KErrNone);
4393 // Get and print current UTC time
4395 now.UniversalTime();
4396 TBuf<0x80> testString;
4397 now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E")));
4398 TheTest.Printf(_L("Current UTC time - %S\n"), &testString);
4400 // Move the UTC time forward by one day
4401 now += TTimeIntervalDays(1);
4402 User::SetUTCTime(now);
4404 now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E")));
4405 TheTest.Printf(_L("Changed UTC time to - %S\n"), &testString);
4407 // Set up the event and log a call from number 555
4408 event->SetNumber(_L("555"));
4410 aClient.AddEvent(*event, active->iStatus);
4411 CActiveScheduler::Start();
4412 TEST2(active->iStatus.Int(), KErrNone);
4414 // Set up the event and log a call from number 611
4415 event->SetNumber(_L("611"));
4417 aClient.AddEvent(*event, active->iStatus);
4418 CActiveScheduler::Start();
4419 TEST2(active->iStatus.Int(), KErrNone);
4421 //remember this Id - we will try to change this log event later
4422 TInt logId = event->Id();
4424 // Set up the event and log a call from number 777
4425 event->SetNumber(_L("777"));
4427 aClient.AddEvent(*event, active->iStatus);
4428 CActiveScheduler::Start();
4429 TEST2(active->iStatus.Int(), KErrNone);
4431 // Delete all events occurring before today
4432 // this should remove only the first call to number 444
4433 TDateTime midnight = now.DateTime();
4434 midnight.SetHour(0);
4435 midnight.SetMinute(0);
4436 midnight.SetSecond(0);
4437 midnight.SetMicroSecond(0);
4440 aClient.ClearLog(midnight, active->iStatus);
4441 CActiveScheduler::Start();
4442 TEST2(active->iStatus.Int(), KErrNone);
4444 // Attempt to change an entry from the recent list - that for the call to number 611
4445 // without this defect fix, the call to ChangeEvent() will panic with EBadArrayPosition
4446 event->SetNumber(_L("555"));
4447 event->SetId(logId);
4449 aClient.ChangeEvent(*event, active->iStatus);
4450 CActiveScheduler::Start();
4451 TEST2(active->iStatus.Int(), KErrNone);
4453 // Restore and print UTC time
4454 now.UniversalTime();
4455 now -= TTimeIntervalDays(1);
4456 User::SetUTCTime(now);
4458 now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E")));
4459 TheTest.Printf(_L("Restored UTC time to - %S\n"), &testString);
4461 CleanupStack::PopAndDestroy(3, event); //event, active, view
4465 @SYMTestCaseID SYSLIB-LOGENG-CT-1807
4466 @SYMTestCaseDesc Tests that DEF087459 works between 00:00 and 01:00am hometime
4467 @SYMTestPriority Medium
4468 @SYMTestActions Change the home time to 00:30 and run DEF066296 test
4469 @SYMTestExpectedResults Test must not fail
4472 LOCAL_C void DEF087459L(CLogClient& aClient)
4474 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1807 "));
4476 TInt err = tz.Connect();
4477 TEST2(err, KErrNone);
4478 CleanupClosePushL(tz);
4481 // Get and print current home time and save it
4485 TBuf<0x80> testString;
4486 now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E")));
4487 TheTest.Printf(_L("Current home time - %S\n"), &testString);
4489 // Problem occurred between midnight and 01:00am hometime, so change home time to
4491 TDateTime midnight = now.DateTime();
4492 midnight.SetHour(0);
4493 midnight.SetMinute(30);
4494 midnight.SetSecond(0);
4495 midnight.SetMicroSecond(0);
4497 TTime newTime=midnight;
4499 err = tz.SetHomeTime(midnight);
4500 TEST2(err, KErrNone);
4502 // Get and print new home time
4504 now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E")));
4505 TheTest.Printf(_L("Changed home time to - %S\n"), &testString);
4506 TheTest.Printf(_L("Re-running DEF066296 test\n"));
4508 DEF066296L(aClient);
4510 // Restore and print hometime
4511 err = tz.SetHomeTime(saveNow);
4512 TEST2(err, KErrNone);
4514 now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E")));
4515 TheTest.Printf(_L("Restored home time to - %S\n"), &testString);
4517 CleanupStack::PopAndDestroy(); //tz
4521 @SYMTestCaseID SYSLIB-LOGENG-CT-0955
4522 @SYMTestCaseDesc Tests that events can be changed to move them between recent lists
4523 @SYMTestPriority High
4524 @SYMTestActions Add the events to the view.Move most recent event to another recent list
4525 @SYMTestExpectedResults Test must not fail
4528 LOCAL_C void TestChangeEventRecentView1L(CLogClient& aClient)
4530 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0955 "));
4531 CTestActive* active = new(ELeave)CTestActive();
4532 CleanupStack::PushL(active);
4534 CLogEvent* event = CLogEvent::NewL();
4535 CleanupStack::PushL(event);
4537 CLogViewRecent* recent1 = CLogViewRecent::NewL(aClient);
4538 CleanupStack::PushL(recent1);
4540 CLogViewDuplicate* duplicate1 = CLogViewDuplicate::NewL(aClient);
4541 CleanupStack::PushL(duplicate1);
4543 CLogViewRecent* recent2 = CLogViewRecent::NewL(aClient);
4544 CleanupStack::PushL(recent2);
4546 CLogViewDuplicate* duplicate2 = CLogViewDuplicate::NewL(aClient);
4547 CleanupStack::PushL(duplicate2);
4549 // Make sure there are no entries in any recent lists
4551 aClient.ClearLog(KLogNullRecentList, active->iStatus);
4552 CActiveScheduler::Start();
4553 TEST2(active->iStatus.Int(), KErrNone);
4555 // Incoming call event
4556 TBuf<KLogMaxDirectionLength> incoming;
4557 aClient.GetString(incoming, R_LOG_DIR_IN);
4559 // Missed call event
4560 TBuf<KLogMaxDirectionLength> missed;
4561 aClient.GetString(missed, R_LOG_DIR_MISSED);
4563 event->SetEventType(KLogCallEventTypeUid);
4564 event->SetDirection(missed);
4565 event->SetContact(1);
4569 aClient.AddEvent(*event, active->iStatus);
4570 CActiveScheduler::Start();
4571 TEST2(active->iStatus.Int(), KErrNone);
4572 TLogId id1 = event->Id();
4574 User::After(1000000);
4577 aClient.AddEvent(*event, active->iStatus);
4578 CActiveScheduler::Start();
4579 TEST2(active->iStatus.Int(), KErrNone);
4580 TLogId id2 = event->Id();
4582 User::After(1000000);
4585 aClient.AddEvent(*event, active->iStatus);
4586 CActiveScheduler::Start();
4587 TEST2(active->iStatus.Int(), KErrNone);
4588 TLogId id3 = event->Id();
4590 User::After(1000000);
4594 aClient.AddEvent(*event, active->iStatus);
4595 CActiveScheduler::Start();
4596 TEST2(active->iStatus.Int(), KErrNone);
4597 TLogId id4 = event->Id();
4599 // Check there's a recent event in the list
4601 TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
4602 CActiveScheduler::Start();
4603 TEST2(active->iStatus.Int(), KErrNone);
4604 TEST2(recent1->CountL(), 1);
4605 TEST2(recent1->Event().Id(), id4);
4607 // Check it has duplicates
4609 TEST(recent1->DuplicatesL(*duplicate1, active->iStatus));
4610 CActiveScheduler::Start();
4611 TEST2(active->iStatus.Int(), KErrNone);
4612 TEST2(duplicate1->CountL(), 3);
4613 TEST2(duplicate1->Event().Id(), id3);
4617 TEST(duplicate1->NextL(active->iStatus));
4618 CActiveScheduler::Start();
4619 TEST2(active->iStatus.Int(), KErrNone);
4620 TEST2(duplicate1->Event().Id(), id2);
4624 TEST(duplicate1->NextL(active->iStatus));
4625 CActiveScheduler::Start();
4626 TEST2(active->iStatus.Int(), KErrNone);
4627 TEST2(duplicate1->Event().Id(), id1);
4629 // Other recent list should be empty
4630 TEST(!recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4632 // Now move most recent event to another recent list
4633 event->SetDirection(incoming);
4635 aClient.ChangeEvent(*event, active->iStatus);
4636 CActiveScheduler::Start();
4637 TEST2(active->iStatus.Int(), KErrNone);
4639 // Most recent duplicate should now be the latest
4641 TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
4642 CActiveScheduler::Start();
4643 TEST2(active->iStatus.Int(), KErrNone);
4644 TEST2(recent1->CountL(), 1);
4645 TEST2(recent1->Event().Id(), id3);
4646 event->CopyL(recent1->Event()); // for later
4648 // There should still be some duplicates
4650 TEST(recent1->DuplicatesL(*duplicate1, active->iStatus));
4651 CActiveScheduler::Start();
4652 TEST2(active->iStatus.Int(), KErrNone);
4653 TEST2(duplicate1->CountL(), 2);
4654 TEST2(duplicate1->Event().Id(), id2);
4658 TEST(duplicate1->NextL(active->iStatus));
4659 CActiveScheduler::Start();
4660 TEST2(active->iStatus.Int(), KErrNone);
4661 TEST2(duplicate1->Event().Id(), id1);
4663 // Now the event should have moved to another recent list
4665 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4666 CActiveScheduler::Start();
4667 TEST2(active->iStatus.Int(), KErrNone);
4668 TEST2(recent2->CountL(), 1);
4669 TEST2(recent2->Event().Id(), id4);
4671 // No duplicates yet
4672 TEST(!recent2->DuplicatesL(*duplicate2, active->iStatus));
4674 // Now move most recent event to another recent list
4675 event->SetDirection(incoming);
4677 aClient.ChangeEvent(*event, active->iStatus);
4678 CActiveScheduler::Start();
4679 TEST2(active->iStatus.Int(), KErrNone);
4681 // Most recent duplicate should now be the latest
4683 TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
4684 CActiveScheduler::Start();
4685 TEST2(active->iStatus.Int(), KErrNone);
4686 TEST2(recent1->CountL(), 1);
4687 TEST2(recent1->Event().Id(), id2);
4688 event->CopyL(recent1->Event()); // for later
4690 // There should still be some duplicates
4692 TEST(recent1->DuplicatesL(*duplicate1, active->iStatus));
4693 CActiveScheduler::Start();
4694 TEST2(active->iStatus.Int(), KErrNone);
4695 TEST2(duplicate1->CountL(), 1);
4696 TEST2(duplicate1->Event().Id(), id1);
4698 // Now the event should have moved to another recent list
4700 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4701 CActiveScheduler::Start();
4702 TEST2(active->iStatus.Int(), KErrNone);
4703 TEST2(recent2->CountL(), 1);
4704 TEST2(recent2->Event().Id(), id4);
4706 // There should still be some duplicates
4708 TEST(recent2->DuplicatesL(*duplicate2, active->iStatus));
4709 CActiveScheduler::Start();
4710 TEST2(active->iStatus.Int(), KErrNone);
4711 TEST2(duplicate2->CountL(), 1);
4712 TEST2(duplicate2->Event().Id(), id3);
4714 // Now move most recent event to another recent list
4715 event->SetDirection(incoming);
4717 aClient.ChangeEvent(*event, active->iStatus);
4718 CActiveScheduler::Start();
4719 TEST2(active->iStatus.Int(), KErrNone);
4721 // Most recent duplicate should now be the latest
4723 TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
4724 CActiveScheduler::Start();
4725 TEST2(active->iStatus.Int(), KErrNone);
4726 TEST2(recent1->CountL(), 1);
4727 TEST2(recent1->Event().Id(), id1);
4728 event->CopyL(recent1->Event()); // for later
4730 // Should be no more duplicates
4731 TEST(!recent1->DuplicatesL(*duplicate1, active->iStatus));
4733 // Now the event should have moved to another recent list
4735 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4736 CActiveScheduler::Start();
4737 TEST2(active->iStatus.Int(), KErrNone);
4738 TEST2(recent2->CountL(), 1);
4739 TEST2(recent2->Event().Id(), id4);
4741 // There should still be some duplicates
4743 TEST(recent2->DuplicatesL(*duplicate2, active->iStatus));
4744 CActiveScheduler::Start();
4745 TEST2(active->iStatus.Int(), KErrNone);
4746 TEST2(duplicate2->CountL(), 2);
4747 TEST2(duplicate2->Event().Id(), id3);
4751 TEST(duplicate2->NextL(active->iStatus));
4752 CActiveScheduler::Start();
4753 TEST2(active->iStatus.Int(), KErrNone);
4754 TEST2(duplicate2->Event().Id(), id2);
4756 // Now move most recent event to another recent list
4757 event->SetDirection(incoming);
4759 aClient.ChangeEvent(*event, active->iStatus);
4760 CActiveScheduler::Start();
4761 TEST2(active->iStatus.Int(), KErrNone);
4763 // No more recent events
4764 TEST(!recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
4766 // Now the event should have moved to another recent list
4768 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4769 CActiveScheduler::Start();
4770 TEST2(active->iStatus.Int(), KErrNone);
4771 TEST2(recent2->CountL(), 1);
4772 TEST2(recent2->Event().Id(), id4);
4774 // There should still be some duplicates
4776 TEST(recent2->DuplicatesL(*duplicate2, active->iStatus));
4777 CActiveScheduler::Start();
4778 TEST2(active->iStatus.Int(), KErrNone);
4779 TEST2(duplicate2->CountL(), 3);
4780 TEST2(duplicate2->Event().Id(), id3);
4784 TEST(duplicate2->NextL(active->iStatus));
4785 CActiveScheduler::Start();
4786 TEST2(active->iStatus.Int(), KErrNone);
4787 TEST2(duplicate2->Event().Id(), id2);
4791 TEST(duplicate2->NextL(active->iStatus));
4792 CActiveScheduler::Start();
4793 TEST2(active->iStatus.Int(), KErrNone);
4794 TEST2(duplicate2->Event().Id(), id1);
4796 CleanupStack::PopAndDestroy(6); // active, event, recent1, duplicate1, recent2, duplicate2
4800 Test that events can be changed to move them between recent lists
4801 The same as TestChangeEventRecentView1L, but the events are transferred in reverse order
4803 @SYMTestCaseID SYSLIB-LOGENG-CT-0956
4804 @SYMTestCaseDesc Tests that events can be changed to move them between recent lists
4805 @SYMTestPriority High
4806 @SYMTestActions Add the events to the view.Move most recent event to another recent list in reverse order
4807 @SYMTestExpectedResults Test must not fail
4810 LOCAL_C void TestChangeEventRecentView2L(CLogClient& aClient)
4812 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0956 "));
4813 CTestActive* active = new(ELeave)CTestActive();
4814 CleanupStack::PushL(active);
4816 CLogEvent* event = CLogEvent::NewL();
4817 CleanupStack::PushL(event);
4819 CLogViewRecent* recent1 = CLogViewRecent::NewL(aClient);
4820 CleanupStack::PushL(recent1);
4822 CLogViewDuplicate* duplicate1 = CLogViewDuplicate::NewL(aClient);
4823 CleanupStack::PushL(duplicate1);
4825 CLogViewRecent* recent2 = CLogViewRecent::NewL(aClient);
4826 CleanupStack::PushL(recent2);
4828 CLogViewDuplicate* duplicate2 = CLogViewDuplicate::NewL(aClient);
4829 CleanupStack::PushL(duplicate2);
4831 // Make sure there are no entries in any recent lists
4833 aClient.ClearLog(KLogNullRecentList, active->iStatus);
4834 CActiveScheduler::Start();
4835 TEST2(active->iStatus.Int(), KErrNone);
4837 // Incoming call event
4838 TBuf<KLogMaxDirectionLength> incoming;
4839 aClient.GetString(incoming, R_LOG_DIR_IN);
4841 // Missed call event
4842 TBuf<KLogMaxDirectionLength> missed;
4843 aClient.GetString(missed, R_LOG_DIR_MISSED);
4845 event->SetEventType(KLogCallEventTypeUid);
4846 event->SetDirection(missed);
4847 event->SetContact(1);
4851 aClient.AddEvent(*event, active->iStatus);
4852 CActiveScheduler::Start();
4853 TEST2(active->iStatus.Int(), KErrNone);
4854 TLogId id1 = event->Id();
4856 User::After(1000000);
4859 aClient.AddEvent(*event, active->iStatus);
4860 CActiveScheduler::Start();
4861 TEST2(active->iStatus.Int(), KErrNone);
4862 TLogId id2 = event->Id();
4864 User::After(1000000);
4867 aClient.AddEvent(*event, active->iStatus);
4868 CActiveScheduler::Start();
4869 TEST2(active->iStatus.Int(), KErrNone);
4870 TLogId id3 = event->Id();
4872 User::After(1000000);
4876 aClient.AddEvent(*event, active->iStatus);
4877 CActiveScheduler::Start();
4878 TEST2(active->iStatus.Int(), KErrNone);
4879 TLogId id4 = event->Id();
4881 // Check there's a recent event in the list
4883 TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
4884 CActiveScheduler::Start();
4885 TEST2(active->iStatus.Int(), KErrNone);
4886 TEST2(recent1->CountL(), 1);
4887 TEST2(recent1->Event().Id(), id4);
4889 // Check it has duplicates
4891 TEST(recent1->DuplicatesL(*duplicate1, active->iStatus));
4892 CActiveScheduler::Start();
4893 TEST2(active->iStatus.Int(), KErrNone);
4894 TEST2(duplicate1->CountL(), 3);
4895 TEST2(duplicate1->Event().Id(), id3);
4899 TEST(duplicate1->NextL(active->iStatus));
4900 CActiveScheduler::Start();
4901 TEST2(active->iStatus.Int(), KErrNone);
4902 TEST2(duplicate1->Event().Id(), id2);
4906 TEST(duplicate1->NextL(active->iStatus));
4907 CActiveScheduler::Start();
4908 TEST2(active->iStatus.Int(), KErrNone);
4909 TEST2(duplicate1->Event().Id(), id1);
4910 event->CopyL(duplicate1->Event()); // for later
4912 // Other recent list should be empty
4913 TEST(!recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4915 // Now move latest recent event to another recent list
4916 event->SetDirection(incoming);
4918 aClient.ChangeEvent(*event, active->iStatus);
4919 CActiveScheduler::Start();
4920 TEST2(active->iStatus.Int(), KErrNone);
4922 // Most recent duplicate should still be the latest
4924 TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
4925 CActiveScheduler::Start();
4926 TEST2(active->iStatus.Int(), KErrNone);
4927 TEST2(recent1->CountL(), 1);
4928 TEST2(recent1->Event().Id(), id4);
4930 // There should still be some duplicates
4932 TEST(recent1->DuplicatesL(*duplicate1, active->iStatus));
4933 CActiveScheduler::Start();
4934 TEST2(active->iStatus.Int(), KErrNone);
4935 TEST2(duplicate1->CountL(), 2);
4936 TEST2(duplicate1->Event().Id(), id3);
4940 TEST(duplicate1->NextL(active->iStatus));
4941 CActiveScheduler::Start();
4942 TEST2(active->iStatus.Int(), KErrNone);
4943 TEST2(duplicate1->Event().Id(), id2);
4944 event->CopyL(duplicate1->Event()); // for later
4946 // Now the event should have moved to another recent list
4948 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4949 CActiveScheduler::Start();
4950 TEST2(active->iStatus.Int(), KErrNone);
4951 TEST2(recent2->CountL(), 1);
4952 TEST2(recent2->Event().Id(), id1);
4954 // No duplicates yet
4955 TEST(!recent2->DuplicatesL(*duplicate2, active->iStatus));
4957 // Now move most recent event to another recent list
4958 event->SetDirection(incoming);
4960 aClient.ChangeEvent(*event, active->iStatus);
4961 CActiveScheduler::Start();
4962 TEST2(active->iStatus.Int(), KErrNone);
4964 // Most recent duplicate should still be the latest
4966 TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
4967 CActiveScheduler::Start();
4968 TEST2(active->iStatus.Int(), KErrNone);
4969 TEST2(recent1->CountL(), 1);
4970 TEST2(recent1->Event().Id(), id4);
4972 // There should still be some duplicates
4974 TEST(recent1->DuplicatesL(*duplicate1, active->iStatus));
4975 CActiveScheduler::Start();
4976 TEST2(active->iStatus.Int(), KErrNone);
4977 TEST2(duplicate1->CountL(), 1);
4978 TEST2(duplicate1->Event().Id(), id3);
4979 event->CopyL(duplicate1->Event()); // for later
4981 // Now the event should have moved to another recent list
4983 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
4984 CActiveScheduler::Start();
4985 TEST2(active->iStatus.Int(), KErrNone);
4986 TEST2(recent2->CountL(), 1);
4987 TEST2(recent2->Event().Id(), id2);
4989 // There should still be some duplicates
4991 TEST(recent2->DuplicatesL(*duplicate2, active->iStatus));
4992 CActiveScheduler::Start();
4993 TEST2(active->iStatus.Int(), KErrNone);
4994 TEST2(duplicate2->CountL(), 1);
4995 TEST2(duplicate2->Event().Id(), id1);
4997 // Now move most recent event to another recent list
4998 event->SetDirection(incoming);
5000 aClient.ChangeEvent(*event, active->iStatus);
5001 CActiveScheduler::Start();
5002 TEST2(active->iStatus.Int(), KErrNone);
5004 // Most recent duplicate should still be the latest
5006 TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
5007 CActiveScheduler::Start();
5008 TEST2(active->iStatus.Int(), KErrNone);
5009 TEST2(recent1->CountL(), 1);
5010 TEST2(recent1->Event().Id(), id4);
5011 event->CopyL(recent1->Event()); // for later
5013 // Should be no more duplicates
5014 TEST(!recent1->DuplicatesL(*duplicate1, active->iStatus));
5016 // Now the event should have moved to another recent list
5018 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5019 CActiveScheduler::Start();
5020 TEST2(active->iStatus.Int(), KErrNone);
5021 TEST2(recent2->CountL(), 1);
5022 TEST2(recent2->Event().Id(), id3);
5024 // There should still be some duplicates
5026 TEST(recent2->DuplicatesL(*duplicate2, active->iStatus));
5027 CActiveScheduler::Start();
5028 TEST2(active->iStatus.Int(), KErrNone);
5029 TEST2(duplicate2->CountL(), 2);
5030 TEST2(duplicate2->Event().Id(), id2);
5034 TEST(duplicate2->NextL(active->iStatus));
5035 CActiveScheduler::Start();
5036 TEST2(active->iStatus.Int(), KErrNone);
5037 TEST2(duplicate2->Event().Id(), id1);
5039 // Now move most recent event to another recent list
5040 event->SetDirection(incoming);
5042 aClient.ChangeEvent(*event, active->iStatus);
5043 CActiveScheduler::Start();
5044 TEST2(active->iStatus.Int(), KErrNone);
5046 // No more recent events
5047 TEST(!recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
5049 // Now the event should have moved to another recent list
5051 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5052 CActiveScheduler::Start();
5053 TEST2(active->iStatus.Int(), KErrNone);
5054 TEST2(recent2->CountL(), 1);
5055 TEST2(recent2->Event().Id(), id4);
5057 // There should still be some duplicates
5059 TEST(recent2->DuplicatesL(*duplicate2, active->iStatus));
5060 CActiveScheduler::Start();
5061 TEST2(active->iStatus.Int(), KErrNone);
5062 TEST2(duplicate2->CountL(), 3);
5063 TEST2(duplicate2->Event().Id(), id3);
5067 TEST(duplicate2->NextL(active->iStatus));
5068 CActiveScheduler::Start();
5069 TEST2(active->iStatus.Int(), KErrNone);
5070 TEST2(duplicate2->Event().Id(), id2);
5074 TEST(duplicate2->NextL(active->iStatus));
5075 CActiveScheduler::Start();
5076 TEST2(active->iStatus.Int(), KErrNone);
5077 TEST2(duplicate2->Event().Id(), id1);
5079 CleanupStack::PopAndDestroy(6); // active, event, recent1, duplicate1, recent2, duplicate2
5083 @SYMTestCaseID SYSLIB-LOGENG-CT-0957
5084 @SYMTestCaseDesc Tests that change in log view after moving an event
5085 @SYMTestPriority High
5086 @SYMTestActions Check recent views are purged if necessary after moving an event
5087 @SYMTestExpectedResults Test must not fail
5090 LOCAL_C void TestChangeEventRecentViewAndPurgeL(CLogClient& aClient)
5092 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0957 "));
5093 CTestActive* active = new(ELeave)CTestActive();
5094 CleanupStack::PushL(active);
5096 CLogEvent* event = CLogEvent::NewL();
5097 CleanupStack::PushL(event);
5099 CLogViewRecent* recent1 = CLogViewRecent::NewL(aClient);
5100 CleanupStack::PushL(recent1);
5102 CLogViewRecent* recent2 = CLogViewRecent::NewL(aClient);
5103 CleanupStack::PushL(recent2);
5105 // Make sure there are no entries in any recent lists
5107 aClient.ClearLog(KLogNullRecentList, active->iStatus);
5108 CActiveScheduler::Start();
5109 TEST2(active->iStatus.Int(), KErrNone);
5114 aClient.GetConfig(config, active->iStatus);
5115 CActiveScheduler::Start();
5116 TEST2(active->iStatus.Int(), KErrNone);
5118 // Set the max recent list size to something small
5119 config.iMaxRecentLogSize = 3;
5121 aClient.ChangeConfig(config, active->iStatus);
5122 CActiveScheduler::Start();
5123 TEST2(active->iStatus.Int(), KErrNone);
5125 // Incoming call event
5126 TBuf<KLogMaxDirectionLength> incoming;
5127 aClient.GetString(incoming, R_LOG_DIR_IN);
5129 // Missed call event
5130 TBuf<KLogMaxDirectionLength> missed;
5131 aClient.GetString(missed, R_LOG_DIR_MISSED);
5133 event->SetEventType(KLogCallEventTypeUid);
5134 event->SetDirection(missed);
5137 event->SetContact(1);
5139 aClient.AddEvent(*event, active->iStatus);
5140 CActiveScheduler::Start();
5141 TEST2(active->iStatus.Int(), KErrNone);
5142 TLogId id1 = event->Id();
5144 User::After(1000000);
5145 event->SetDirection(incoming);
5148 event->SetContact(2);
5150 aClient.AddEvent(*event, active->iStatus);
5151 CActiveScheduler::Start();
5152 TEST2(active->iStatus.Int(), KErrNone);
5153 TLogId id2 = event->Id();
5155 User::After(1000000);
5158 event->SetContact(3);
5160 aClient.AddEvent(*event, active->iStatus);
5161 CActiveScheduler::Start();
5162 TEST2(active->iStatus.Int(), KErrNone);
5163 TLogId id3 = event->Id();
5165 User::After(1000000);
5168 event->SetContact(4);
5170 aClient.AddEvent(*event, active->iStatus);
5171 CActiveScheduler::Start();
5172 TEST2(active->iStatus.Int(), KErrNone);
5173 TLogId id4 = event->Id();
5177 TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
5178 CActiveScheduler::Start();
5179 TEST2(active->iStatus.Int(), KErrNone);
5180 TEST2(recent1->CountL(), 1);
5183 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5184 CActiveScheduler::Start();
5185 TEST2(active->iStatus.Int(), KErrNone);
5186 TEST2(recent2->CountL(), 3);
5191 aClient.GetEvent(*event, active->iStatus);
5192 CActiveScheduler::Start();
5193 TEST2(active->iStatus.Int(), KErrNone);
5195 // Now move the oldest event to another recent list - it should be purged
5196 event->SetDirection(incoming);
5198 aClient.ChangeEvent(*event, active->iStatus);
5199 CActiveScheduler::Start();
5200 TEST2(active->iStatus.Int(), KErrNone);
5202 // Missed call list now empty
5203 TEST(!recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
5205 // Incoming view should be unchanged
5207 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5208 CActiveScheduler::Start();
5209 TEST2(active->iStatus.Int(), KErrNone);
5210 TEST2(recent2->CountL(), 3);
5211 TEST2(recent2->Event().Id(), id4);
5215 TEST(recent2->NextL(active->iStatus));
5216 CActiveScheduler::Start();
5217 TEST2(active->iStatus.Int(), KErrNone);
5218 TEST2(recent2->Event().Id(), id3);
5222 TEST(recent2->NextL(active->iStatus));
5223 CActiveScheduler::Start();
5224 TEST2(active->iStatus.Int(), KErrNone);
5225 TEST2(recent2->Event().Id(), id2);
5228 now.UniversalTime();
5230 // This should have no effect
5231 event->SetTime(now);
5233 aClient.ChangeEvent(*event, active->iStatus);
5234 CActiveScheduler::Start();
5235 TEST2(active->iStatus.Int(), KErrNone);
5237 // Incoming view should be unchanged
5239 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5240 CActiveScheduler::Start();
5241 TEST2(active->iStatus.Int(), KErrNone);
5242 TEST2(recent2->CountL(), 3);
5243 TEST2(recent2->Event().Id(), id4);
5247 TEST(recent2->NextL(active->iStatus));
5248 CActiveScheduler::Start();
5249 TEST2(active->iStatus.Int(), KErrNone);
5250 TEST2(recent2->Event().Id(), id3);
5254 TEST(recent2->NextL(active->iStatus));
5255 CActiveScheduler::Start();
5256 TEST2(active->iStatus.Int(), KErrNone);
5257 TEST2(recent2->Event().Id(), id2);
5259 // Now add a new event to missed view (the latest)
5260 User::After(1000000);
5261 event->SetDirection(missed);
5263 aClient.AddEvent(*event, active->iStatus);
5264 CActiveScheduler::Start();
5265 TEST2(active->iStatus.Int(), KErrNone);
5267 User::After(1000000);
5268 now.UniversalTime();
5270 // This should have no effect
5271 event->SetTime(now);
5273 aClient.ChangeEvent(*event, active->iStatus);
5274 CActiveScheduler::Start();
5275 TEST2(active->iStatus.Int(), KErrNone);
5279 TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
5280 CActiveScheduler::Start();
5281 TEST2(active->iStatus.Int(), KErrNone);
5282 TEST2(recent1->CountL(), 1);
5285 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5286 CActiveScheduler::Start();
5287 TEST2(active->iStatus.Int(), KErrNone);
5288 TEST2(recent2->CountL(), 3);
5290 // Now move the latest event to another recent list - oldest should be purged
5291 event->SetDirection(incoming);
5293 aClient.ChangeEvent(*event, active->iStatus);
5294 CActiveScheduler::Start();
5295 TEST2(active->iStatus.Int(), KErrNone);
5297 TEST(!recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
5300 TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5301 CActiveScheduler::Start();
5302 TEST2(active->iStatus.Int(), KErrNone);
5303 TEST2(recent2->CountL(), 3);
5304 TEST2(recent2->Event().Id(), event->Id());
5308 TEST(recent2->NextL(active->iStatus));
5309 CActiveScheduler::Start();
5310 TEST2(active->iStatus.Int(), KErrNone);
5311 TEST2(recent2->Event().Id(), id4);
5315 TEST(recent2->NextL(active->iStatus));
5316 CActiveScheduler::Start();
5317 TEST2(active->iStatus.Int(), KErrNone);
5318 TEST2(recent2->Event().Id(), id3);
5320 CleanupStack::PopAndDestroy(4); // active, event, recent1, recent2
5324 @SYMTestCaseID SYSLIB-LOGENG-CT-0958
5325 @SYMTestCaseDesc Tests for the log view,on changing an event
5326 @SYMTestPriority High
5327 @SYMTestActions Check an event can be removed from recent lists by changing it
5328 @SYMTestExpectedResults Test must not fail
5331 LOCAL_C void TestChangeEventRecentViewRemoveL(CLogClient& aClient)
5333 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0958 "));
5334 CTestActive* active = new(ELeave)CTestActive();
5335 CleanupStack::PushL(active);
5337 CLogEvent* event = CLogEvent::NewL();
5338 CleanupStack::PushL(event);
5340 CLogViewRecent* recent = CLogViewRecent::NewL(aClient);
5341 CleanupStack::PushL(recent);
5343 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
5344 CleanupStack::PushL(duplicate);
5346 // Missed call event
5347 TBuf<KLogMaxDirectionLength> missed;
5348 aClient.GetString(missed, R_LOG_DIR_MISSED);
5350 event->SetEventType(KLogCallEventTypeUid);
5351 event->SetDirection(missed);
5354 event->SetContact(1);
5356 aClient.AddEvent(*event, active->iStatus);
5357 CActiveScheduler::Start();
5358 TEST2(active->iStatus.Int(), KErrNone);
5359 TLogId id1 = event->Id();
5361 User::After(1000000);
5363 // Add some duplicates
5365 aClient.AddEvent(*event, active->iStatus);
5366 CActiveScheduler::Start();
5367 TEST2(active->iStatus.Int(), KErrNone);
5368 TLogId id2 = event->Id();
5370 User::After(1000000);
5373 aClient.AddEvent(*event, active->iStatus);
5374 CActiveScheduler::Start();
5375 TEST2(active->iStatus.Int(), KErrNone);
5376 TLogId id3 = event->Id();
5378 User::After(1000000);
5381 aClient.AddEvent(*event, active->iStatus);
5382 CActiveScheduler::Start();
5383 TEST2(active->iStatus.Int(), KErrNone);
5384 TLogId id4 = event->Id();
5388 TEST(recent->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
5389 CActiveScheduler::Start();
5390 TEST2(active->iStatus.Int(), KErrNone);
5391 TEST2(recent->CountL(), 1);
5392 TEST2(recent->Event().Id(), id4);
5395 TEST(recent->DuplicatesL(*duplicate, active->iStatus));
5396 CActiveScheduler::Start();
5397 TEST2(active->iStatus.Int(), KErrNone);
5398 TEST2(duplicate->CountL(), 3);
5399 TEST2(duplicate->Event().Id(), id3);
5403 TEST(duplicate->NextL(active->iStatus));
5404 CActiveScheduler::Start();
5405 TEST2(active->iStatus.Int(), KErrNone);
5406 TEST2(duplicate->Event().Id(), id2);
5410 TEST(duplicate->NextL(active->iStatus));
5411 CActiveScheduler::Start();
5412 TEST2(active->iStatus.Int(), KErrNone);
5413 TEST2(duplicate->Event().Id(), id1);
5415 // Fetched call event
5416 TBuf<KLogMaxDirectionLength> fetched;
5417 aClient.GetString(missed, R_LOG_DIR_FETCHED);
5419 // Now change the event to remove it from recent lists
5420 event->SetDirection(fetched);
5422 aClient.ChangeEvent(*event, active->iStatus);
5423 CActiveScheduler::Start();
5424 TEST2(active->iStatus.Int(), KErrNone);
5428 TEST(recent->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
5429 CActiveScheduler::Start();
5430 TEST2(active->iStatus.Int(), KErrNone);
5431 TEST2(recent->CountL(), 1);
5432 TEST2(recent->Event().Id(), id3);
5435 TEST(recent->DuplicatesL(*duplicate, active->iStatus));
5436 CActiveScheduler::Start();
5437 TEST2(active->iStatus.Int(), KErrNone);
5438 TEST2(duplicate->CountL(), 2);
5439 TEST2(duplicate->Event().Id(), id2);
5440 event->CopyL(duplicate->Event()); // For later
5444 TEST(duplicate->NextL(active->iStatus));
5445 CActiveScheduler::Start();
5446 TEST2(active->iStatus.Int(), KErrNone);
5447 TEST2(duplicate->Event().Id(), id1);
5449 // Now change the event to remove it from recent lists
5450 event->SetDirection(fetched);
5452 aClient.ChangeEvent(*event, active->iStatus);
5453 CActiveScheduler::Start();
5454 TEST2(active->iStatus.Int(), KErrNone);
5458 TEST(recent->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
5459 CActiveScheduler::Start();
5460 TEST2(active->iStatus.Int(), KErrNone);
5461 TEST2(recent->CountL(), 1);
5462 TEST2(recent->Event().Id(), id3);
5465 TEST(recent->DuplicatesL(*duplicate, active->iStatus));
5466 CActiveScheduler::Start();
5467 TEST2(active->iStatus.Int(), KErrNone);
5468 TEST2(duplicate->CountL(), 1);
5469 TEST2(duplicate->Event().Id(), id1);
5470 event->CopyL(duplicate->Event()); // For later
5472 // Now change the event to remove it from recent lists
5473 event->SetDirection(fetched);
5475 aClient.ChangeEvent(*event, active->iStatus);
5476 CActiveScheduler::Start();
5477 TEST2(active->iStatus.Int(), KErrNone);
5481 TEST(recent->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
5482 CActiveScheduler::Start();
5483 TEST2(active->iStatus.Int(), KErrNone);
5484 TEST2(recent->CountL(), 1);
5485 TEST2(recent->Event().Id(), id3);
5486 event->CopyL(recent->Event()); // For later
5488 // No more duplicates
5489 TEST(!recent->DuplicatesL(*duplicate, active->iStatus));
5491 // Now change the event to remove it from recent lists
5492 event->SetDirection(fetched);
5494 aClient.ChangeEvent(*event, active->iStatus);
5495 CActiveScheduler::Start();
5496 TEST2(active->iStatus.Int(), KErrNone);
5498 TEST(!recent->SetRecentListL(KLogRecentMissedCalls, active->iStatus));
5500 CleanupStack::PopAndDestroy(4); // active, event, recent, duplicate
5503 CBaBackupSessionWrapper* theBackup = NULL;
5505 LOCAL_C TBool IsLogOpenL()
5507 return TestUtils::IsDatabaseOpenL();
5510 LOCAL_C void TestLogOpenL()
5515 LOCAL_C void TestLogClosedL()
5517 TEST(!IsLogOpenL());
5520 LOCAL_C void StartBackupL()
5522 User::InfoPrint(_L("Backup"));
5524 TDriveUnit driveUnit(EDriveC);
5525 TDriveName name = driveUnit.Name();
5528 LEAVE_IF_ERROR(parse.Set(KLogDatabaseName, &name, NULL));
5532 theBackup = CBaBackupSessionWrapper::NewL();
5534 theBackup->CloseFileL(parse.FullName(), MBackupObserver::EReleaseLockNoAccess);
5535 User::After(1000000);
5538 LOCAL_C void EndBackupL()
5542 User::After(1000000);
5545 LOCAL_C void DelayL(TInt aDelay)
5547 CTestTimer* timer = CTestTimer::NewL();
5548 timer->After(aDelay);
5549 CActiveScheduler::Start();
5554 @SYMTestCaseID SYSLIB-LOGENG-CT-0959
5555 @SYMTestCaseDesc Tests for log view change observer
5556 Test change stuff with backup
5557 @SYMTestPriority High
5558 @SYMTestActions Check that a view doesn't get change events when clearing duplicates even after backup
5559 @SYMTestExpectedResults Test must not fail
5562 LOCAL_C void TestHiddenChangeEvents1aL(CLogClient& aClient)
5564 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0959 "));
5567 TLogDatabaseChangeType type;
5569 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
5570 changeObs1->StartCollectingChanges();
5573 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
5574 CleanupStack::PushL(view);
5576 CLogFilter* filter = CLogFilter::NewL();
5577 CleanupStack::PushL(filter);
5579 CLogEvent* event = CLogEvent::NewL();
5580 CleanupStack::PushL(event);
5582 CTestActive* active = new(ELeave)CTestActive();
5583 CleanupStack::PushL(active);
5586 now.UniversalTime();
5587 now += (TTimeIntervalDays)+1;
5589 // Get rid of all the events in the log
5591 aClient.ClearLog(now, active->iStatus);
5592 CActiveScheduler::Start();
5593 TEST2(active->iStatus.Int(), KErrNone);
5595 // Incoming call event
5596 event->SetEventType(KLogCallEventTypeUid);
5597 TBuf<KLogMaxDirectionLength> buf;
5598 aClient.GetString(buf, R_LOG_DIR_IN);
5599 event->SetDirection(buf);
5603 aClient.AddEvent(*event, active->iStatus);
5604 CActiveScheduler::Start();
5605 TEST2(active->iStatus.Int(), KErrNone);
5607 // Setup normal event view
5609 TEST(view->SetFilterL(*filter, active->iStatus));
5610 CActiveScheduler::Start();
5611 TEST2(active->iStatus.Int(), KErrNone);
5613 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
5614 changeObs2->StartCollectingChanges();
5616 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
5617 CleanupStack::PushL(recent);
5619 // Check recent view
5621 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5622 CActiveScheduler::Start();
5623 TEST2(active->iStatus.Int(), KErrNone);
5624 TEST2(recent->CountL(), 1);
5628 aClient.AddEvent(*event, active->iStatus);
5629 CActiveScheduler::Start();
5630 TEST2(active->iStatus.Int(), KErrNone);
5632 // Check that changes work after a backup
5640 TEST2(changeObs2->Changes().Count(), 2);
5641 type = changeObs2->Changes().At(0, logId, viewIndex);
5642 TEST2(type, ELogChangeTypeEventAdded);
5643 type = changeObs2->Changes().At(1, logId, viewIndex);
5644 TEST2(type, ELogChangeTypeEventDeleted);
5646 // Check recent view
5648 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5649 CActiveScheduler::Start();
5650 TEST2(active->iStatus.Int(), KErrNone);
5651 TEST2(recent->CountL(), 1);
5653 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
5654 CleanupStack::PushL(duplicate);
5656 // Check duplicate count
5658 TEST(recent->DuplicatesL(*duplicate, active->iStatus));
5659 CActiveScheduler::Start();
5660 TEST2(active->iStatus.Int(), KErrNone);
5661 TEST2(duplicate->CountL(), 1);
5663 // Check that changes work after a backup
5670 // Check change events
5671 User::After(100000);
5672 TEST2(changeObs1->Changes().Count(), 1);
5673 type = changeObs1->Changes().At(0, logId, viewIndex);
5674 TEST2(type, ELogChangeTypeEventAdded);
5676 CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate
5680 Check that a view doesn't get change events when recent list purged
5682 @SYMTestCaseID SYSLIB-LOGENG-CT-0960
5683 @SYMTestCaseDesc Tests for log view change observer
5684 @SYMTestPriority High
5685 @SYMTestActions Check that a view doesn't get change events when recent list purged,even after backup
5686 @SYMTestExpectedResults Test must not fail
5689 LOCAL_C void TestHiddenChangeEvents2aL(CLogClient& aClient)
5691 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0960 "));
5694 TLogDatabaseChangeType type;
5696 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
5697 changeObs1->StartCollectingChanges();
5699 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
5700 CleanupStack::PushL(view);
5702 CLogFilter* filter = CLogFilter::NewL();
5703 CleanupStack::PushL(filter);
5705 CLogEvent* event = CLogEvent::NewL();
5706 CleanupStack::PushL(event);
5708 CTestActive* active = new(ELeave)CTestActive();
5709 CleanupStack::PushL(active);
5712 now.UniversalTime();
5713 now += (TTimeIntervalDays)+1;
5715 // Get rid of all the events in the log
5717 aClient.ClearLog(now, active->iStatus);
5718 CActiveScheduler::Start();
5719 TEST2(active->iStatus.Int(), KErrNone);
5724 aClient.GetConfig(config, active->iStatus);
5725 CActiveScheduler::Start();
5726 TEST2(active->iStatus.Int(), KErrNone);
5728 // Incoming call event
5729 event->SetEventType(KLogCallEventTypeUid);
5730 TBuf<KLogMaxDirectionLength> buf;
5731 aClient.GetString(buf, R_LOG_DIR_IN);
5732 event->SetDirection(buf);
5734 // Add max allowed events
5735 TInt count = config.iMaxRecentLogSize;
5738 event->SetContact(count+1);
5740 aClient.AddEvent(*event, active->iStatus);
5741 CActiveScheduler::Start();
5742 TEST2(active->iStatus.Int(), KErrNone);
5745 // Setup normal event view
5747 TEST(view->SetFilterL(*filter, active->iStatus));
5748 CActiveScheduler::Start();
5749 TEST2(active->iStatus.Int(), KErrNone);
5751 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
5752 changeObs2->StartCollectingChanges();
5754 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
5755 CleanupStack::PushL(recent);
5757 // Check recent view
5759 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5760 CActiveScheduler::Start();
5761 TEST2(active->iStatus.Int(), KErrNone);
5762 TEST2(recent->CountL(), config.iMaxRecentLogSize);
5764 // Add a new event, will cause one to be purged from recent view
5765 event->SetContact(1234);
5767 aClient.AddEvent(*event, active->iStatus);
5768 CActiveScheduler::Start();
5769 TEST2(active->iStatus.Int(), KErrNone);
5771 // Check that changes work after a backup
5779 TEST2(changeObs2->Changes().Count(), 2);
5780 type = changeObs2->Changes().At(0, logId, viewIndex);
5781 TEST2(type, ELogChangeTypeEventAdded);
5782 type = changeObs2->Changes().At(1, logId, viewIndex);
5783 TEST2(type, ELogChangeTypeEventDeleted);
5785 // Check recent view
5787 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5788 CActiveScheduler::Start();
5789 TEST2(active->iStatus.Int(), KErrNone);
5790 TEST2(recent->CountL(), config.iMaxRecentLogSize);
5792 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
5793 CleanupStack::PushL(duplicate);
5795 // Check duplicate count
5796 TEST(!recent->DuplicatesL(*duplicate, active->iStatus));
5798 // Check that changes work after a backup
5805 // Check change events
5806 User::After(100000);
5807 TEST2(changeObs1->Changes().Count(), 1);
5808 type = changeObs1->Changes().At(0, logId, viewIndex);
5809 TEST2(type, ELogChangeTypeEventAdded);
5811 CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate
5815 Check that a view doesn't get change events when recent list purged after changing config
5817 @SYMTestCaseID SYSLIB-LOGENG-CT-0961
5818 @SYMTestCaseDesc Tests for log view change observer
5819 @SYMTestPriority High
5820 @SYMTestActions Check that a view doesn't get change events when recent list purged after changing config,even after backup
5821 @SYMTestExpectedResults Test must not fail
5824 LOCAL_C void TestHiddenChangeEvents3aL(CLogClient& aClient)
5826 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0961 "));
5829 TLogDatabaseChangeType type;
5831 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
5832 changeObs1->StartCollectingChanges();
5834 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
5835 CleanupStack::PushL(view);
5837 CLogFilter* filter = CLogFilter::NewL();
5838 CleanupStack::PushL(filter);
5840 CLogEvent* event = CLogEvent::NewL();
5841 CleanupStack::PushL(event);
5843 CTestActive* active = new(ELeave)CTestActive();
5844 CleanupStack::PushL(active);
5847 now.UniversalTime();
5848 now += (TTimeIntervalDays)+1;
5850 // Get rid of all the events in the log
5852 aClient.ClearLog(now, active->iStatus);
5853 CActiveScheduler::Start();
5854 TEST2(active->iStatus.Int(), KErrNone);
5856 // Get and set config
5859 aClient.GetConfig(config, active->iStatus);
5860 CActiveScheduler::Start();
5861 TEST2(active->iStatus.Int(), KErrNone);
5862 config.iMaxRecentLogSize = 2;
5864 aClient.ChangeConfig(config, active->iStatus);
5865 CActiveScheduler::Start();
5866 TEST2(active->iStatus.Int(), KErrNone);
5868 // Incoming call event
5869 event->SetEventType(KLogCallEventTypeUid);
5870 TBuf<KLogMaxDirectionLength> buf;
5871 aClient.GetString(buf, R_LOG_DIR_IN);
5872 event->SetDirection(buf);
5874 // Add max allowed events
5875 TInt count = config.iMaxRecentLogSize;
5878 event->SetContact(count+1);
5880 aClient.AddEvent(*event, active->iStatus);
5881 CActiveScheduler::Start();
5882 TEST2(active->iStatus.Int(), KErrNone);
5885 // Setup normal event view
5887 TEST(view->SetFilterL(*filter, active->iStatus));
5888 CActiveScheduler::Start();
5889 TEST2(active->iStatus.Int(), KErrNone);
5891 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
5892 changeObs2->StartCollectingChanges();
5894 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
5895 CleanupStack::PushL(recent);
5897 // Check recent view
5899 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5900 CActiveScheduler::Start();
5901 TEST2(active->iStatus.Int(), KErrNone);
5902 TEST2(recent->CountL(), config.iMaxRecentLogSize);
5904 // Change config, will cause one event to be purged from recent view
5905 config.iMaxRecentLogSize = 1;
5907 aClient.ChangeConfig(config, active->iStatus);
5908 CActiveScheduler::Start();
5909 TEST2(active->iStatus.Int(), KErrNone);
5911 // Check that changes work after a backup
5919 // Check change events
5920 User::After(100000);
5921 TEST2(changeObs2->Changes().Count(), 1);
5922 type = changeObs2->Changes().At(0, logId, viewIndex);
5923 TEST2(type, ELogChangeTypeEventDeleted);
5925 // Check recent view
5927 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
5928 CActiveScheduler::Start();
5929 TEST2(active->iStatus.Int(), KErrNone);
5930 TEST2(recent->CountL(), config.iMaxRecentLogSize);
5932 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
5933 CleanupStack::PushL(duplicate);
5935 // Check duplicate count
5936 TEST(!recent->DuplicatesL(*duplicate, active->iStatus));
5938 // Check that changes work after a backup
5945 // Check change events
5946 User::After(100000);
5947 TEST(!changeObs1->HaveChanges());
5949 CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate
5953 Check that when deleting an event causing recent lists to be updated, views don't get unnecessary change events
5955 @SYMTestCaseID SYSLIB-LOGENG-CT-0962
5956 @SYMTestCaseDesc Tests for log view change observer
5957 @SYMTestPriority High
5958 @SYMTestActions Check that when deleting an event causing recent lists to be updated,views don't get unnecessary change events.
5959 Check the test work even after backup operations
5960 @SYMTestExpectedResults Test must not fail
5963 LOCAL_C void TestHiddenChangeEvents4aL(CLogClient& aClient)
5965 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0962 "));
5968 TLogDatabaseChangeType type;
5970 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
5971 changeObs1->StartCollectingChanges();
5973 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
5974 CleanupStack::PushL(view);
5976 CLogFilter* filter = CLogFilter::NewL();
5977 CleanupStack::PushL(filter);
5978 filter->SetFlags(1); // Need to hide an event from the view
5980 CLogEvent* event = CLogEvent::NewL();
5981 CleanupStack::PushL(event);
5983 CTestActive* active = new(ELeave)CTestActive();
5984 CleanupStack::PushL(active);
5987 now.UniversalTime();
5988 now += (TTimeIntervalDays)+1;
5990 // Get rid of all the events in the log
5992 aClient.ClearLog(now, active->iStatus);
5993 CActiveScheduler::Start();
5994 TEST2(active->iStatus.Int(), KErrNone);
5996 // Incoming call event
5997 event->SetEventType(KLogCallEventTypeUid);
5998 TBuf<KLogMaxDirectionLength> buf;
5999 aClient.GetString(buf, R_LOG_DIR_IN);
6000 event->SetDirection(buf);
6006 aClient.AddEvent(*event, active->iStatus);
6007 CActiveScheduler::Start();
6008 TEST2(active->iStatus.Int(), KErrNone);
6012 aClient.AddEvent(*event, active->iStatus);
6013 CActiveScheduler::Start();
6014 TEST2(active->iStatus.Int(), KErrNone);
6016 event->ClearFlags(0xF);
6020 aClient.AddEvent(*event, active->iStatus);
6021 CActiveScheduler::Start();
6022 TEST2(active->iStatus.Int(), KErrNone);
6024 // Setup normal event view
6026 TEST(view->SetFilterL(*filter, active->iStatus));
6027 CActiveScheduler::Start();
6028 TEST2(active->iStatus.Int(), KErrNone);
6029 TEST2(view->CountL(), 2);
6031 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
6032 changeObs2->StartCollectingChanges();
6034 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
6035 CleanupStack::PushL(recent);
6037 // Check recent view
6039 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
6040 CActiveScheduler::Start();
6041 TEST2(active->iStatus.Int(), KErrNone);
6042 TEST2(recent->CountL(), 1);
6044 changeObs1->StartCollectingChanges();
6045 changeObs2->StartCollectingChanges();
6047 // Delete the event in recent list
6049 aClient.DeleteEvent(event->Id(), active->iStatus);
6050 CActiveScheduler::Start();
6051 TEST2(active->iStatus.Int(), KErrNone);
6053 // Check that changes work after a backup
6060 // Check change events
6061 TEST2(changeObs2->Changes().Count(), 2);
6062 type = changeObs2->Changes().At(0, logId, viewIndex);
6063 TEST2(type, ELogChangeTypeEventAdded);
6064 type = changeObs2->Changes().At(1, logId, viewIndex);
6065 TEST2(type, ELogChangeTypeEventDeleted);
6067 TEST(!changeObs1->HaveChanges());
6069 CleanupStack::PopAndDestroy(7, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent
6073 @SYMTestCaseID SYSLIB-LOGENG-CT-0963
6074 @SYMTestCaseDesc Tests for log view change observer
6075 @SYMTestPriority High
6076 @SYMTestActions Check that a view doesn't get change events when recent list cleared
6077 Check the test work even after backup operations
6078 @SYMTestExpectedResults Test must not fail
6081 LOCAL_C void TestHiddenChangeEvents5aL(CLogClient& aClient)
6083 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0963 "));
6086 TLogDatabaseChangeType type;
6088 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
6089 changeObs1->StartCollectingChanges();
6091 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
6092 CleanupStack::PushL(view);
6094 CLogFilter* filter = CLogFilter::NewL();
6095 CleanupStack::PushL(filter);
6097 CLogEvent* event = CLogEvent::NewL();
6098 CleanupStack::PushL(event);
6100 CTestActive* active = new(ELeave)CTestActive();
6101 CleanupStack::PushL(active);
6104 now.UniversalTime();
6105 now += (TTimeIntervalDays)+1;
6107 // Get rid of all the events in the log
6109 aClient.ClearLog(now, active->iStatus);
6110 CActiveScheduler::Start();
6111 TEST2(active->iStatus.Int(), KErrNone);
6116 aClient.GetConfig(config, active->iStatus);
6117 CActiveScheduler::Start();
6118 TEST2(active->iStatus.Int(), KErrNone);
6120 // Incoming call event
6121 event->SetEventType(KLogCallEventTypeUid);
6122 TBuf<KLogMaxDirectionLength> buf;
6123 aClient.GetString(buf, R_LOG_DIR_IN);
6124 event->SetDirection(buf);
6126 // Add max allowed events
6127 TInt count = config.iMaxRecentLogSize;
6130 event->SetContact(count+1);
6132 aClient.AddEvent(*event, active->iStatus);
6133 CActiveScheduler::Start();
6134 TEST2(active->iStatus.Int(), KErrNone);
6137 // Setup normal event view
6139 TEST(view->SetFilterL(*filter, active->iStatus));
6140 CActiveScheduler::Start();
6141 TEST2(active->iStatus.Int(), KErrNone);
6143 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
6144 changeObs2->StartCollectingChanges();
6146 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
6147 CleanupStack::PushL(recent);
6149 // Check recent view
6151 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
6152 CActiveScheduler::Start();
6153 TEST2(active->iStatus.Int(), KErrNone);
6154 TEST2(recent->CountL(), config.iMaxRecentLogSize);
6156 // Clear recent view
6158 aClient.ClearLog(KLogRecentIncomingCalls, active->iStatus);
6159 CActiveScheduler::Start();
6160 TEST2(active->iStatus.Int(), KErrNone);
6162 // Check that changes work after a backup
6169 count = config.iMaxRecentLogSize;
6170 TEST2(changeObs2->Changes().Count(), count);
6173 type = changeObs2->Changes().At(count, logId, viewIndex);
6174 TEST2(type, ELogChangeTypeEventDeleted);
6177 // Check recent view
6178 TEST(!recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
6180 // Check that changes work after a backup
6187 // Check change events
6188 User::After(100000);
6189 TEST(!changeObs1->HaveChanges());
6191 CleanupStack::PopAndDestroy(7, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent
6195 @SYMTestCaseID SYSLIB-LOGENG-CT-0964
6196 @SYMTestCaseDesc Tests for log view change observer
6197 @SYMTestPriority High
6198 @SYMTestActions Check that a view doesn't get change events when removing events from a recent or duplicate view
6199 Check the test work even after backup operations
6200 @SYMTestExpectedResults Test must not fail
6203 LOCAL_C void TestHiddenChangeEvents6aL(CLogClient& aClient)
6205 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0964 "));
6206 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
6207 changeObs1->StartCollectingChanges();
6209 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
6210 CleanupStack::PushL(view);
6212 CLogFilter* filter = CLogFilter::NewL();
6213 CleanupStack::PushL(filter);
6215 CLogEvent* event = CLogEvent::NewL();
6216 CleanupStack::PushL(event);
6218 CTestActive* active = new(ELeave)CTestActive();
6219 CleanupStack::PushL(active);
6222 now.UniversalTime();
6223 now += (TTimeIntervalDays)+1;
6225 // Get rid of all the events in the log
6227 aClient.ClearLog(now, active->iStatus);
6228 CActiveScheduler::Start();
6229 TEST2(active->iStatus.Int(), KErrNone);
6231 // Incoming call event
6232 event->SetEventType(KLogCallEventTypeUid);
6233 TBuf<KLogMaxDirectionLength> buf;
6234 aClient.GetString(buf, R_LOG_DIR_IN);
6235 event->SetDirection(buf);
6239 aClient.AddEvent(*event, active->iStatus);
6240 CActiveScheduler::Start();
6241 TEST2(active->iStatus.Int(), KErrNone);
6245 aClient.AddEvent(*event, active->iStatus);
6246 CActiveScheduler::Start();
6247 TEST2(active->iStatus.Int(), KErrNone);
6249 // Setup normal event view
6251 TEST(view->SetFilterL(*filter, active->iStatus));
6252 CActiveScheduler::Start();
6253 TEST2(active->iStatus.Int(), KErrNone);
6254 TEST(view->CountL() == 2);
6256 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
6257 changeObs2->StartCollectingChanges();
6259 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
6260 CleanupStack::PushL(recent);
6262 // Check recent view
6264 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
6265 CActiveScheduler::Start();
6266 TEST2(active->iStatus.Int(), KErrNone);
6267 TEST2(recent->CountL(), 1);
6269 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
6270 CleanupStack::PushL(duplicate);
6272 // Check duplicate count
6274 TEST(recent->DuplicatesL(*duplicate, active->iStatus));
6275 CActiveScheduler::Start();
6276 TEST2(active->iStatus.Int(), KErrNone);
6277 TEST2(recent->CountL(), 1);
6280 duplicate->RemoveL(duplicate->Event().Id());
6282 // Check that changes work after a backup
6289 // Check change events
6290 TEST(!changeObs1->HaveChanges());
6291 TEST(!changeObs2->HaveChanges());
6294 recent->RemoveL(recent->Event().Id());
6296 // Check that changes work after a backup
6303 TEST(!changeObs1->HaveChanges());
6304 TEST(!changeObs2->HaveChanges()); // No event because we should know we called Remove on ourselves
6306 CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate
6310 @SYMTestCaseID SYSLIB-LOGENG-CT-0965
6311 @SYMTestCaseDesc Tests for log view change observer
6312 @SYMTestPriority High
6313 @SYMTestActions Check that a view doesn't get change events when clearing duplicates
6314 Check the test work even after backup operations
6315 @SYMTestExpectedResults Test must not fail
6318 LOCAL_C void TestHiddenChangeEvents7aL(CLogClient& aClient)
6320 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0965 "));
6321 CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC();
6322 changeObs1->StartCollectingChanges();
6324 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1);
6325 CleanupStack::PushL(view);
6327 CLogFilter* filter = CLogFilter::NewL();
6328 CleanupStack::PushL(filter);
6330 CLogEvent* event = CLogEvent::NewL();
6331 CleanupStack::PushL(event);
6333 CTestActive* active = new(ELeave)CTestActive();
6334 CleanupStack::PushL(active);
6337 now.UniversalTime();
6338 now += (TTimeIntervalDays)+1;
6340 // Get rid of all the events in the log
6342 aClient.ClearLog(now, active->iStatus);
6343 CActiveScheduler::Start();
6344 TEST2(active->iStatus.Int(), KErrNone);
6346 // Incoming call event
6347 event->SetEventType(KLogCallEventTypeUid);
6348 TBuf<KLogMaxDirectionLength> buf;
6349 aClient.GetString(buf, R_LOG_DIR_IN);
6350 event->SetDirection(buf);
6354 aClient.AddEvent(*event, active->iStatus);
6355 CActiveScheduler::Start();
6356 TEST2(active->iStatus.Int(), KErrNone);
6360 aClient.AddEvent(*event, active->iStatus);
6361 CActiveScheduler::Start();
6362 TEST2(active->iStatus.Int(), KErrNone);
6364 // Setup normal event view
6366 TEST(view->SetFilterL(*filter, active->iStatus));
6367 CActiveScheduler::Start();
6368 TEST2(active->iStatus.Int(), KErrNone);
6369 TEST2(view->CountL(), 2);
6371 CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC();
6372 changeObs2->StartCollectingChanges();
6374 CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2);
6375 CleanupStack::PushL(recent);
6377 // Check recent view
6379 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
6380 CActiveScheduler::Start();
6381 TEST2(active->iStatus.Int(), KErrNone);
6382 TEST2(recent->CountL(), 1);
6384 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
6385 CleanupStack::PushL(duplicate);
6387 // Check duplicate count
6389 TEST(recent->DuplicatesL(*duplicate, active->iStatus));
6390 CActiveScheduler::Start();
6391 TEST2(active->iStatus.Int(), KErrNone);
6392 TEST2(recent->CountL(), 1);
6395 recent->ClearDuplicatesL();
6397 // Check that changes work after a backup
6404 // Check change events
6405 TEST(!changeObs1->HaveChanges());
6406 TEST(!changeObs2->HaveChanges());
6408 CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate
6412 @SYMTestCaseID SYSLIB-LOGENG-CT-3511
6413 @SYMTestCaseDesc Tests an error condition for adding an event.
6414 @SYMTestPriority High
6415 @SYMTestActions A leave will be caused in an observer when a specific event is added. This test
6416 ensures by successful test completion that there are no panics in this
6418 @SYMTestExpectedResults Test must not fail
6421 LOCAL_C void DEF108741L(CLogClient& aClient)
6423 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3511 "));
6425 TestUtils::DeleteDatabaseL();
6427 // Create a new event
6428 CLogEvent* event = CLogEvent::NewL();
6429 CleanupStack::PushL(event);
6430 event->SetEventType(KLogCallEventTypeUid);
6432 CTestActive* active = new(ELeave) CTestActive();
6433 CleanupStack::PushL(active);
6435 // Create a change observer. This observer will cause errors in order to verify that
6436 // the system handles them properly.
6437 CLogViewChangeObserverErrorTest* changeObs = CLogViewChangeObserverErrorTest::NewLC();
6439 // Create a view for the event log
6440 CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs);
6441 CleanupStack::PushL(view);
6443 // Create a filter to specify what events appear in the view
6444 CLogFilter* filter = CLogFilter::NewL();
6445 CleanupStack::PushL(filter);
6446 TEST(!view->SetFilterL(*filter, active->iStatus));
6452 // This code adds 3 events with ids 0,1 and 2.
6453 // The observer add event handler :
6454 // CLogViewChangeObserverErrorTest::HandleLogViewChangeEventAddedL
6455 // has been written so that it will leave if an event with log id 1 is added.
6456 // The test completion proves that the leave is dealt with gracefully without
6458 for(count = 0; count < KTestErrorEventNum; count++)
6460 // Add an event to the log database
6461 aClient.AddEvent(*event, changeObs->iStatus);
6462 CLogChangeDefinition* changes = changeObs->WaitForChangesLC(CLogViewChangeObserver::EStopOnBoth);
6464 // Check the results/notifications are as expected
6465 TEST2(changeObs->iStatus.Int(), KErrNone);
6466 TEST(event->Id() == (TLogId) count);
6468 TEST2(changes->Count(), 1);
6469 TEST2(changes->At(0, logId, viewIndex), ELogChangeTypeEventAdded);
6470 TEST(logId == (TLogId) count);
6471 TEST2(viewIndex, 0);
6472 CleanupStack::PopAndDestroy(changes);
6475 CleanupStack::PopAndDestroy(5, event); // filter, view, changeObs, active, event
6479 @SYMTestCaseID SYSLIB-LOGENG-CT-3716
6480 @SYMTestCaseDesc Tests for the defect INC108225
6481 @SYMTestPriority High
6482 @SYMTestActions Tests for the count of out call list & the duplicates for CS & PS calls
6483 The fields to be considered while finding duplicates records are set in the resource file named LOGWRAP.RSS
6484 i.e. duplicate = ELogRemotePartyField|ELogContactField|ELogNumberField;
6485 Considering this duplicate value, the where clause in the query is made to find duplicate records.
6486 @SYMTestExpectedResults Test must not fail
6489 LOCAL_C void TestNumberFieldINC108225L(CLogClient& aClient)
6491 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3716 "));
6492 CLogEvent* event = CLogEvent::NewL();
6493 CleanupStack::PushL(event);
6495 CLogEvent* event1 = CLogEvent::NewL();
6496 CleanupStack::PushL(event1);
6498 CTestActive* active = new(ELeave)CTestActive();
6499 CleanupStack::PushL(active);
6501 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
6502 CleanupStack::PushL(view);
6504 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
6505 CleanupStack::PushL(duplicate);
6507 // Make sure there are no entries in any recent lists
6509 aClient.ClearLog(KLogRecentOutgoingCalls, active->iStatus);
6510 CActiveScheduler::Start();
6511 TEST2(active->iStatus.Int(), KErrNone);
6514 aClient.GetString(buf1, R_LOG_DIR_OUT);
6516 event->SetEventType(KLogCallEventTypeUid);
6517 event->SetDirection(buf1);
6518 event->SetDurationType(KLogDurationNone);
6519 event->SetContact(KTestContact1);
6520 event->SetRemoteParty(KTestRemote1);
6521 event->SetNumber(KTestNumber1);
6523 // Add event 1st CS Call with contact as KTestContact & number as KTestNumber1
6525 aClient.AddEvent(*event, active->iStatus);
6526 CActiveScheduler::Start();
6527 TEST2(active->iStatus.Int(), KErrNone);
6530 TBool res = view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus);
6531 CActiveScheduler::Start();
6532 TEST2(active->iStatus.Int(), KErrNone);
6533 TEST2(view->CountL(), 1);
6535 // Set new event with the same contact details (i.e. KTestContact) and
6536 //...event type as KLogCallEventTypeUid & no number field
6537 event1->SetEventType(KLogCallEventTypeUid);
6538 event1->SetDirection(buf1);
6539 event1->SetDurationType(KLogDurationNone);
6540 event1->SetContact(KTestContact1);
6541 event1->SetRemoteParty(KTestRemote1);
6543 // Add event 1st PS Call with contact as KTestContact1 & Number as Null
6545 aClient.AddEvent(*event1, active->iStatus);
6546 CActiveScheduler::Start();
6547 TEST2(active->iStatus.Int(), KErrNone);
6550 TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus));
6551 CActiveScheduler::Start();
6552 TEST2(active->iStatus.Int(), KErrNone);
6553 TEST2(view->CountL(), 2);
6555 // Add event 2nd CS Call
6557 aClient.AddEvent(*event, active->iStatus);
6558 CActiveScheduler::Start();
6559 TEST2(active->iStatus.Int(), KErrNone);
6562 TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus));
6563 CActiveScheduler::Start();
6564 TEST2(active->iStatus.Int(), KErrNone);
6565 TEST2(view->CountL(), 2);
6567 // Check duplicate count for the last call made i.e. CS call
6569 TEST(view->DuplicatesL(*duplicate, active->iStatus));
6570 CActiveScheduler::Start();
6571 TEST2(duplicate->CountL(), 1);
6573 // Add event 2nd PS Call
6575 aClient.AddEvent(*event1, active->iStatus);
6576 CActiveScheduler::Start();
6577 TEST2(active->iStatus.Int(), KErrNone);
6580 TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus));
6581 CActiveScheduler::Start();
6582 TEST2(active->iStatus.Int(), KErrNone);
6583 TEST2(view->CountL(), 2);
6585 // Check duplicate count for the last call made i.e. PS call
6587 TEST(view->DuplicatesL(*duplicate, active->iStatus));
6588 CActiveScheduler::Start();
6589 TEST2(duplicate->CountL(), 1);
6591 // Add event 3rd CS Call
6593 aClient.AddEvent(*event, active->iStatus);
6594 CActiveScheduler::Start();
6595 TEST2(active->iStatus.Int(), KErrNone);
6598 TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus));
6599 CActiveScheduler::Start();
6600 TEST2(active->iStatus.Int(), KErrNone);
6601 TEST2(view->CountL(), 2);
6603 // Check duplicate count for the last call made i.e. CS call
6605 TEST(view->DuplicatesL(*duplicate, active->iStatus));
6606 CActiveScheduler::Start();
6607 TEST2(duplicate->CountL(), 2);
6609 // Add event 3rd PS Call
6611 aClient.AddEvent(*event1, active->iStatus);
6612 CActiveScheduler::Start();
6613 TEST2(active->iStatus.Int(), KErrNone);
6616 TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus));
6617 CActiveScheduler::Start();
6618 TEST2(active->iStatus.Int(), KErrNone);
6619 TEST2(view->CountL(), 2);
6621 // Check duplicate count for the last call made i.e. PS call
6623 TEST(view->DuplicatesL(*duplicate, active->iStatus));
6624 CActiveScheduler::Start();
6625 TEST2(duplicate->CountL(), 2);
6627 CleanupStack::PopAndDestroy(5);
6631 @SYMTestCaseID SYSLIB-LOGENG-CT-3755
6632 @SYMTestCaseDesc Tests for the changes made in defect INC108225 for other fields
6633 @SYMTestPriority High
6634 @SYMTestActions Tests for the count of out call list & the duplicates for CS calls referring other fields
6635 The fields to be considered while finding duplicates records are set in the resource file named LOGWRAP.RSS
6636 i.e. duplicate = ELogRemotePartyField|ELogContactField|ELogNumberField;
6637 Considering this duplicate value, the where clause in the query is made to find duplicate records.
6638 @SYMTestExpectedResults Test must not fail
6641 LOCAL_C void TestOtherFieldsINC108225L(CLogClient& aClient)
6643 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3755 "));
6644 CLogEvent* event = CLogEvent::NewL();
6645 CleanupStack::PushL(event);
6647 CTestActive* active = new(ELeave)CTestActive();
6648 CleanupStack::PushL(active);
6650 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
6651 CleanupStack::PushL(view);
6653 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
6654 CleanupStack::PushL(duplicate);
6656 // Make sure there are no entries in any recent lists
6658 aClient.ClearLog(KLogRecentOutgoingCalls, active->iStatus);
6659 CActiveScheduler::Start();
6660 TEST2(active->iStatus.Int(), KErrNone);
6663 aClient.GetString(buf1, R_LOG_DIR_OUT);
6665 event->SetEventType(KLogCallEventTypeUid);
6666 event->SetDirection(buf1);
6667 event->SetContact(KTestContact1);
6668 event->SetRemoteParty(KTestRemote1);
6669 event->SetNumber(KTestNumber1);
6670 event->SetDurationType(KLogDurationNone);
6672 // Add event 1st CS Call with contact as KTestContact & number as KTestNumber1 &
6673 //.. durationtype as KLogDurationNone
6675 aClient.AddEvent(*event, active->iStatus);
6676 CActiveScheduler::Start();
6677 TEST2(active->iStatus.Int(), KErrNone);
6680 TBool res = view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus);
6681 CActiveScheduler::Start();
6682 TEST2(active->iStatus.Int(), KErrNone);
6683 TEST2(view->CountL(), 1);
6685 // Add event 2nd CS Call with duration type as KLogDurationValid
6686 event->SetDurationType(KLogDurationValid);
6689 aClient.AddEvent(*event, active->iStatus);
6690 CActiveScheduler::Start();
6691 TEST2(active->iStatus.Int(), KErrNone);
6694 TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus));
6695 CActiveScheduler::Start();
6696 TEST2(active->iStatus.Int(), KErrNone);
6697 TEST2(view->CountL(), 1);
6699 // Check duplicate count for the last call made
6701 TEST(view->DuplicatesL(*duplicate, active->iStatus));
6702 CActiveScheduler::Start();
6703 TEST2(duplicate->CountL(), 1);
6705 // Add event 3rd CS Call with Flag as KLogNullFlags
6706 event->SetFlags(KLogNullFlags);
6709 aClient.AddEvent(*event, active->iStatus);
6710 CActiveScheduler::Start();
6711 TEST2(active->iStatus.Int(), KErrNone);
6714 TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus));
6715 CActiveScheduler::Start();
6716 TEST2(active->iStatus.Int(), KErrNone);
6717 TEST2(view->CountL(), 1);
6719 // Check duplicate count for the last call made
6721 TEST(view->DuplicatesL(*duplicate, active->iStatus));
6722 CActiveScheduler::Start();
6723 TEST2(duplicate->CountL(), 2);
6725 // Add event 4th CS Call with Flag as KLogFlagsMask
6726 event->SetFlags(KLogFlagsMask);
6729 aClient.AddEvent(*event, active->iStatus);
6730 CActiveScheduler::Start();
6731 TEST2(active->iStatus.Int(), KErrNone);
6734 TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus));
6735 CActiveScheduler::Start();
6736 TEST2(active->iStatus.Int(), KErrNone);
6737 TEST2(view->CountL(), 1);
6739 // Check duplicate count for the last call made
6741 TEST(view->DuplicatesL(*duplicate, active->iStatus));
6742 CActiveScheduler::Start();
6743 TEST2(duplicate->CountL(), 3);
6745 // Add event 5th CS Call with Status as KNullDesC
6746 event->SetStatus(KNullDesC);
6749 aClient.AddEvent(*event, active->iStatus);
6750 CActiveScheduler::Start();
6751 TEST2(active->iStatus.Int(), KErrNone);
6754 TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus));
6755 CActiveScheduler::Start();
6756 TEST2(active->iStatus.Int(), KErrNone);
6757 TEST2(view->CountL(), 1);
6759 // Check duplicate count for the last call made
6761 TEST(view->DuplicatesL(*duplicate, active->iStatus));
6762 CActiveScheduler::Start();
6763 TEST2(duplicate->CountL(), 4);
6765 // Add event 6th CS Call with Status as KTestStatus1
6766 event->SetStatus(KTestStatus1);
6769 aClient.AddEvent(*event, active->iStatus);
6770 CActiveScheduler::Start();
6771 TEST2(active->iStatus.Int(), KErrNone);
6774 TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus));
6775 CActiveScheduler::Start();
6776 TEST2(active->iStatus.Int(), KErrNone);
6777 TEST2(view->CountL(), 1);
6779 // Check duplicate count for the last call made
6781 TEST(view->DuplicatesL(*duplicate, active->iStatus));
6782 CActiveScheduler::Start();
6783 TEST2(duplicate->CountL(), 5);
6785 CleanupStack::PopAndDestroy(4);
6789 @SYMTestCaseID PDS-LOGENG-CT-4050
6790 @SYMTestCaseDesc Tests for the changes made in defect DEF144552
6791 @SYMTestPriority High
6792 @SYMTestActions Tests for the sucessful completion of the following operation -
6793 1)Applying a filter where the event's start time matches the end time.
6794 2)Clearing the log where the clear log time is 1 microsecs after the
6795 timestamp of the event.
6796 @SYMTestExpectedResults Test must not fail
6799 LOCAL_C void DEF144552L(CLogClient& aClient)
6801 TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-CT-4050 "));
6802 TestUtils::DeleteDatabaseL(EFalse);
6804 CTestActive* active = new(ELeave)CTestActive();
6805 CleanupStack::PushL(active);
6807 //Setup the database by adding a event and changing the timestamp for the event
6809 CLogEvent* event = CLogEvent::NewL();
6810 CleanupStack::PushL(event);
6811 event->SetEventType(KLogCallEventTypeUid);
6812 event->SetContact(KTestContact1);
6813 event->SetNumber(KTestNumber2);
6814 event->SetDuration(0);
6816 aClient.AddEvent(*event, active->iStatus);
6817 CActiveScheduler::Start();
6818 TEST2(active->iStatus.Int(), KErrNone);
6822 now.UniversalTime();
6823 event->SetTime(now);
6825 aClient.ChangeEvent(*event, active->iStatus);
6826 CActiveScheduler::Start();
6827 TEST2(active->iStatus.Int(), KErrNone);
6829 //Test 1: Setup and apply a filter where the start time matches the end time
6830 //If the defect is fixed then the view will contain the event previously added,
6831 //Otherwise the time parameters will be truncated and the event will not be found
6833 //Setup filter so that the start and the end time matches
6834 CLogFilter* filter = CLogFilter::NewL();
6835 CleanupStack::PushL(filter);
6836 filter->SetStartTime(now);
6837 filter->SetEndTime(now);
6839 //Apply the filter and check that 1 event is in the view
6840 CLogViewEvent* view = CLogViewEvent::NewL(aClient);
6841 CleanupStack::PushL(view);
6843 TEST(view->SetFilterL(*filter, active->iStatus));
6844 CActiveScheduler::Start();
6845 TEST2(active->iStatus.Int(), KErrNone);
6846 TEST2(view->CountL(), 1);
6848 //Retrieve and check the event
6850 TEST(view->FirstL(active->iStatus));
6851 CActiveScheduler::Start();
6852 TEST2(active->iStatus.Int(), KErrNone);
6853 const CLogEvent& currentEvent(view->Event());
6854 TEST2(currentEvent.EventType().iUid, KLogCallEventTypeUid.iUid);
6855 TEST2(currentEvent.Duration(), 0);
6856 TEST2(currentEvent.Time().Int64(), now.Int64());
6858 // Test 2: Clearing a log where the time specified in ClearLog() is just
6859 // after the timestamp of the event by 1 microsecond. If the defect is fixed
6860 // then the event will be deleted. However if the defect is not fixed then the
6861 // time specified in ClearLog() will be truncated and the event will not be
6866 TTimeIntervalMicroSeconds microsecond(1);
6868 aClient.ClearLog(now, active->iStatus);
6869 CActiveScheduler::Start();
6870 TEST2(active->iStatus.Int(), KErrNone);
6872 //Check that the event has been deleted in the view
6873 CleanupStack::PopAndDestroy(2);
6874 view = CLogViewEvent::NewL(aClient);
6875 CleanupStack::PushL(view);
6876 filter = CLogFilter::NewL();
6877 CleanupStack::PushL(filter);
6879 TEST(!view->SetFilterL(*filter, active->iStatus));
6881 CleanupStack::PopAndDestroy(4, active);
6886 TestUtils::Initialize(_L("t_logview2"));
6887 TestUtils::DeleteDatabaseL();
6889 CLogClient* client = CLogClient::NewL(theFs);
6890 CleanupStack::PushL(client);
6892 CLogChangeNotifier* notifier = CLogChangeNotifier::NewL();
6893 CleanupStack::PushL(notifier);
6895 TheTest.Start(_L("Event View With Filter List"));
6896 TestEventViewWithFilterListL(*client);
6897 theLog.Write(_L8("Test 1 OK\n"));
6899 TheTest.Next(_L("View change observer"));
6900 TestViewChangeEventsL(*client);
6901 theLog.Write(_L8("Test 2 OK\n"));
6903 TheTest.Next(_L("Recent View With Filter"));
6904 TestRecentViewWithFilterL(*client);
6905 theLog.Write(_L8("Test 3 OK\n"));
6907 TheTest.Next(_L("Recent View With Filter List"));
6908 TestRecentViewWithFilterListL(*client);
6909 theLog.Write(_L8("Test 4 OK\n"));
6911 TheTest.Next(_L("Duplicate View With Filter"));
6912 TestDuplicateViewWithFilterL(*client);
6913 theLog.Write(_L8("Test 5 OK\n"));
6915 TheTest.Next(_L("Duplicate View With Filter List"));
6916 TestDuplicateViewWithFilterListL(*client);
6917 theLog.Write(_L8("Test 6 OK\n"));
6919 TheTest.Next(_L("Querying Event View For Null Fields"));
6920 TestEventViewForNullFieldsL(*client);
6921 theLog.Write(_L8("Test 7 OK\n"));
6923 TheTest.Next(_L("Querying Recent View For Null Fields"));
6924 TestRecentViewForNullFieldsL(*client);
6925 theLog.Write(_L8("Test 8 OK\n"));
6927 TheTest.Next(_L("Querying Duplicate View For Null Fields"));
6928 TestDuplicateViewForNullFieldsL(*client);
6929 theLog.Write(_L8("Test 9 OK\n"));
6931 TheTest.Next(_L("Querying Event View For Flags"));
6932 TestEventViewForFlagsL(*client);
6933 theLog.Write(_L8("Test 10 OK\n"));
6935 TheTest.Next(_L("Querying Recent View For Flags"));
6936 TestRecentViewForFlagsL(*client);
6937 theLog.Write(_L8("Test 11 OK\n"));
6939 TheTest.Next(_L("Querying Duplicate View For Flags"));
6940 TestDuplicateViewForFlagsL(*client);
6941 theLog.Write(_L8("Test 12 OK\n"));
6943 TheTest.Next(_L("Removing Recent Events"));
6944 TestRemovingRecentEventsL(*client);
6945 theLog.Write(_L8("Test 13 OK\n"));
6947 TheTest.Next(_L("Removing Duplicate Events"));
6948 TestRemovingDuplicateEventsL(*client);
6949 theLog.Write(_L8("Test 14 OK\n"));
6951 TheTest.Next(_L("Multiple Views"));
6952 TestMultipleViews1L(*client);
6953 TestMultipleViews2L(*client);
6954 theLog.Write(_L8("Test 15 OK\n"));
6956 TheTest.Next(_L("Test _ALT Events In Recent List"));
6957 TestAltEventsInRecentListL(*client);
6958 theLog.Write(_L8("Test 16 OK\n"));
6960 TheTest.Next(_L("Test filtering Events by time"));
6961 // This TEST sets system's 'Home Time'
6962 TestFilterByTimeL(*client);
6963 theLog.Write(_L8("Test 17 OK\n"));
6965 TheTest.Next(_L("Test hidden change events"));
6966 TestUtils::DeleteDatabaseL();
6967 TestHiddenChangeEvents1L(*client);
6968 TestHiddenChangeEvents1aL(*client);
6969 TestHiddenChangeEvents2L(*client);
6970 TestHiddenChangeEvents2aL(*client);
6971 TestHiddenChangeEvents3L(*client);
6972 TestHiddenChangeEvents3aL(*client);
6973 TestHiddenChangeEvents4L(*client);
6974 TestHiddenChangeEvents4aL(*client);
6975 TestHiddenChangeEvents5L(*client);
6976 TestHiddenChangeEvents5aL(*client);
6977 TestHiddenChangeEvents6L(*client);
6978 TestHiddenChangeEvents6aL(*client);
6979 TestHiddenChangeEvents7L(*client);
6980 TestHiddenChangeEvents7aL(*client);
6981 theLog.Write(_L8("Test 18 OK\n"));
6983 TheTest.Next(_L("Changing events and recent views"));
6984 TestChangeEventRecentView1L(*client);
6985 TestChangeEventRecentView2L(*client);
6986 TestChangeEventRecentViewAndPurgeL(*client);
6987 TestChangeEventRecentViewRemoveL(*client);
6988 theLog.Write(_L8("Test 19 OK\n"));
6990 TheTest.Next(_L("Test for DEF066296"));
6991 DEF066296L(*client);
6992 TheTest.Next(_L("Test for DEF087459"));
6993 DEF087459L(*client);
6994 theLog.Write(_L8("Test 20 OK\n"));
6996 TheTest.Next(_L("Event View With Filter List containing StartTime and EndTime"));
6997 TestEventViewWithTimestampsInFilterListL(*client);
6998 theLog.Write(_L8("Test 21 OK\n"));
7000 TheTest.Next(_L("Test for DEF108741 - View change observer, error condition"));
7001 DEF108741L(*client);
7002 theLog.Write(_L8("Test 22 OK\n"));
7004 TheTest.Next(_L("Test Defect INC108225: Call history check for the CS & PS(VOIP) calls "));
7005 TestNumberFieldINC108225L(*client);
7006 TestOtherFieldsINC108225L(*client);
7007 theLog.Write(_L8("Test 23 OK\n"));
7009 TheTest.Next(_L("Test Defect DEF144552: CLogFilter doesn't work when Starttime is the same as EndTime"));
7010 DEF144552L(*client);
7011 theLog.Write(_L8("Test 24 OK\n"));
7013 CleanupStack::PopAndDestroy(2); // client, notifier