Update contrib.
1 // Copyright (c) 2002-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.
17 #include "t_logutil2.h"
20 RTest TheTest(_L("t_logviewfail3"));
22 const TLogContactItemId KTestContact = 0x123;
23 _LIT(KTestStatus, "Test Status Text");
26 @SYMTestCaseID SYSLIB-LOGENG-CT-0978
27 @SYMTestCaseDesc Tests for CLogViewEvent::NewL() function
29 @SYMTestActions Add an event to the client,Create a new CLogViewEvent on heap,if no error check if the view works
30 Check for log server failure error
31 @SYMTestExpectedResults Test must not fail
34 LOCAL_C void TestEventViewConstructWithLogServFailL(CLogClient& aClient)
36 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0978 "));
37 CTestActive* active = new(ELeave)CTestActive;
38 CleanupStack::PushL(active);
40 CLogEvent* event = CLogEvent::NewL();
41 CleanupStack::PushL(event);
42 event->SetEventType(KLogCallEventTypeUid);
45 aClient.AddEvent(*event, active->iStatus);
47 CActiveScheduler::Start();
48 TEST2(active->iStatus.Int(), KErrNone);
50 CLogViewEvent* view = NULL;
53 TBool finished = EFalse;
58 __LOGSERV_UHEAP_FAILNEXT(failCount++);
60 TRAP(error, view = CLogViewEvent::NewL(aClient));
62 __LOGSERV_UHEAP_RESET;
67 CleanupStack::PushL(view);
69 // Check the view works
70 CLogFilter* filter = CLogFilter::NewL();
71 CleanupStack::PushL(filter);
73 TEST(view->SetFilterL(*filter, active->iStatus));
75 CActiveScheduler::Start();
76 TEST2(active->iStatus.Int(), KErrNone);
77 TEST(view->CountL() >= 1);
78 TEST(TestUtils::EventsEqual(*event, view->Event()));
80 CleanupStack::PopAndDestroy(2); // filter, view
84 TEST2(error, KErrNoMemory);
88 CleanupStack::PopAndDestroy(2); // event, active
92 @SYMTestCaseID SYSLIB-LOGENG-CT-0979
93 @SYMTestCaseDesc Tests for CLogViewRecent::NewL(),SetRecentListL() functions
95 @SYMTestActions Create a new view object,if no errors and test of initialising of the view for the specified recent event list.
96 Check for log server failure error
97 @SYMTestExpectedResults Test must not fail
100 LOCAL_C void TestRecentViewConstructWithLogServFailL(CLogClient& aClient)
102 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0979 "));
103 CTestActive* active = new(ELeave)CTestActive;
104 CleanupStack::PushL(active);
106 CLogEvent* event = CLogEvent::NewL();
107 CleanupStack::PushL(event);
111 aClient.GetString(buf, R_LOG_DIR_IN);
113 event->SetEventType(KLogCallEventTypeUid);
114 event->SetDirection(buf);
117 aClient.AddEvent(*event, active->iStatus);
119 CActiveScheduler::Start();
120 TEST2(active->iStatus.Int(), KErrNone);
122 CLogViewRecent* view = NULL;
125 TBool finished = EFalse;
130 __LOGSERV_UHEAP_FAILNEXT(failCount++);
132 TRAP(error, view = CLogViewRecent::NewL(aClient));
134 __LOGSERV_UHEAP_RESET;
139 CleanupStack::PushL(view);
141 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
143 CActiveScheduler::Start();
144 TEST2(active->iStatus.Int(), KErrNone);
145 TEST(view->CountL() >= 1);
146 TEST(TestUtils::EventsEqual(*event, view->Event()));
148 CleanupStack::PopAndDestroy(); // view
152 TEST2(error, KErrNoMemory);
156 CleanupStack::PopAndDestroy(2); // event, active
160 @SYMTestCaseID SYSLIB-LOGENG-CT-0980
161 @SYMTestCaseDesc Tests for CLogViewDuplicate::NewL() functions
162 @SYMTestPriority High
163 @SYMTestActions Create a new logviewrecent object,set the recent log view,list out the duplicates of the current event in the recent event list view
164 Check for log server failure error
165 @SYMTestExpectedResults Test must not fail
168 LOCAL_C void TestDuplicateViewConstructWithLogServFailL(CLogClient& aClient)
170 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0980 "));
171 CTestActive* active = new(ELeave)CTestActive;
172 CleanupStack::PushL(active);
174 CLogEvent* event = CLogEvent::NewL();
175 CleanupStack::PushL(event);
179 aClient.GetString(buf, R_LOG_DIR_IN);
181 event->SetEventType(KLogCallEventTypeUid);
182 event->SetDirection(buf);
183 event->SetContact(KTestContact);
186 aClient.AddEvent(*event, active->iStatus);
188 CActiveScheduler::Start();
189 TEST2(active->iStatus.Int(), KErrNone);
191 aClient.AddEvent(*event, active->iStatus);
193 CActiveScheduler::Start();
194 TEST2(active->iStatus.Int(), KErrNone);
196 CLogViewDuplicate* view = NULL;
199 TBool finished = EFalse;
204 __LOGSERV_UHEAP_FAILNEXT(failCount++);
206 TRAP(error, view = CLogViewDuplicate::NewL(aClient));
208 __LOGSERV_UHEAP_RESET;
213 CleanupStack::PushL(view);
215 CLogViewRecent* recent = CLogViewRecent::NewL(aClient);
216 CleanupStack::PushL(recent);
217 TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
219 CActiveScheduler::Start();
220 TEST2(active->iStatus.Int(), KErrNone);
221 TEST(recent->CountL() >= 1);
223 TEST(recent->DuplicatesL(*view, active->iStatus));
225 CActiveScheduler::Start();
226 TEST2(active->iStatus.Int(), KErrNone);
227 TEST(view->CountL() >= 1);
229 CleanupStack::PopAndDestroy(2); // recent, view
233 TEST2(error, KErrNoMemory);
237 CleanupStack::PopAndDestroy(2); // event, active
241 @SYMTestCaseID SYSLIB-LOGENG-CT-0981
242 @SYMTestCaseDesc Tests for CLogViewEvent::SetFilterL() function
243 @SYMTestPriority High
244 @SYMTestActions Create a log filter and set the filter on logview.Check for equality of events on the view and events
245 added.Check for log server failure error
246 @SYMTestExpectedResults Test must not fail
249 LOCAL_C void TestEventViewSetupWithLogServFailL(CLogClient& aClient)
251 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0981 "));
252 CTestActive* active = new(ELeave)CTestActive;
253 CleanupStack::PushL(active);
255 CLogEvent* event = CLogEvent::NewL();
256 CleanupStack::PushL(event);
257 event->SetEventType(KLogCallEventTypeUid);
258 event->SetStatus(KTestStatus);
261 aClient.AddEvent(*event, active->iStatus);
263 CActiveScheduler::Start();
264 TEST2(active->iStatus.Int(), KErrNone);
266 CLogViewEvent* view = CLogViewEvent::NewL(aClient);
267 CleanupStack::PushL(view);
269 CLogFilterList* list = new(ELeave)CLogFilterList;
270 CleanupStack::PushL(list);
272 CLogFilter* filter = CLogFilter::NewL();
273 CleanupStack::PushL(filter);
274 filter->SetStatus(KTestStatus);
277 TBool finished = EFalse;
282 __LOGSERV_UHEAP_FAILNEXT(failCount++);
284 TBool result = EFalse;
285 TRAP(error, result = view->SetFilterL(*filter, active->iStatus));
292 CActiveScheduler::Start();
294 if (active->iStatus.Int() == KErrNone)
298 TEST(view->CountL() >= 1);
299 TEST(TestUtils::EventsEqual(*event, view->Event()));
303 TEST2(active->iStatus.Int(), KErrNoMemory);
308 TEST2(error, KErrNoMemory);
311 __LOGSERV_UHEAP_RESET;
314 list->AppendL(filter);
315 CleanupStack::Pop(); // filter
317 filter = CLogFilter::NewL();
318 CleanupStack::PushL(filter);
319 filter->SetEventType(KLogCallEventTypeUid);
320 list->AppendL(filter);
321 CleanupStack::Pop(); // filter
328 __LOGSERV_UHEAP_FAILNEXT(failCount++);
330 TBool result = EFalse;
331 TRAP(error, result = view->SetFilterL(*list, active->iStatus));
338 CActiveScheduler::Start();
340 if (active->iStatus.Int() == KErrNone)
344 TEST(view->CountL() >= 1);
345 TEST(TestUtils::EventsEqual(*event, view->Event()));
349 TEST2(active->iStatus.Int(), KErrNoMemory);
354 TEST2(error, KErrNoMemory);
357 __LOGSERV_UHEAP_RESET;
360 list->ResetAndDestroy();
361 CleanupStack::PopAndDestroy(4); // list, view, event, active
365 @SYMTestCaseID SYSLIB-LOGENG-CT-0982
366 @SYMTestCaseDesc Tests for CLogViewRecent::SetRecentListL() function
367 @SYMTestPriority High
368 @SYMTestActions Set recent view list first without a filter and later with log filter,Check for log server failure error
369 @SYMTestExpectedResults Test must not fail
372 LOCAL_C void TestRecentViewSetupWithLogServFailL(CLogClient& aClient)
374 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0982 "));
375 CTestActive* active = new(ELeave)CTestActive;
376 CleanupStack::PushL(active);
378 CLogEvent* event = CLogEvent::NewL();
379 CleanupStack::PushL(event);
383 aClient.GetString(buf, R_LOG_DIR_IN);
385 event->SetEventType(KLogCallEventTypeUid);
386 event->SetDirection(buf);
387 event->SetStatus(KTestStatus);
390 aClient.AddEvent(*event, active->iStatus);
392 CActiveScheduler::Start();
393 TEST2(active->iStatus.Int(), KErrNone);
395 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
396 CleanupStack::PushL(view);
399 TBool finished = EFalse;
404 __LOGSERV_UHEAP_FAILNEXT(failCount++);
406 TBool result = EFalse;
407 TRAP(error, result = view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
414 CActiveScheduler::Start();
416 if (active->iStatus.Int() == KErrNone)
419 TEST(view->CountL() >= 1);
423 TEST2(active->iStatus.Int(), KErrNoMemory);
428 TEST2(error, KErrNoMemory);
431 __LOGSERV_UHEAP_RESET;
434 CLogFilterList* list = new(ELeave)CLogFilterList;
435 CleanupStack::PushL(list);
437 CLogFilter* filter = CLogFilter::NewL();
438 CleanupStack::PushL(filter);
439 filter->SetStatus(KTestStatus);
446 __LOGSERV_UHEAP_FAILNEXT(failCount++);
448 TBool result = EFalse;
449 TRAP(error, result = view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
456 CActiveScheduler::Start();
458 if (active->iStatus.Int() == KErrNone)
461 TEST(view->CountL() >= 1);
464 TEST2(active->iStatus.Int(), KErrNoMemory);
467 TEST2(error, KErrNoMemory);
469 __LOGSERV_UHEAP_RESET;
472 list->AppendL(filter);
473 CleanupStack::Pop(); // filter
475 filter = CLogFilter::NewL();
476 CleanupStack::PushL(filter);
477 filter->SetEventType(KLogCallEventTypeUid);
478 list->AppendL(filter);
479 CleanupStack::Pop(); // filter
486 __LOGSERV_UHEAP_FAILNEXT(failCount++);
488 TBool result = EFalse;
489 TRAP(error, result = view->SetRecentListL(KLogRecentIncomingCalls, *list, active->iStatus));
496 CActiveScheduler::Start();
498 if (active->iStatus.Int() == KErrNone)
501 TEST(view->CountL() >= 1);
504 TEST2(active->iStatus.Int(), KErrNoMemory);
507 TEST2(error, KErrNoMemory);
509 __LOGSERV_UHEAP_RESET;
512 list->ResetAndDestroy();
513 CleanupStack::PopAndDestroy(4); // list, view, event, active
517 @SYMTestCaseID SYSLIB-LOGENG-CT-0983
518 @SYMTestCaseDesc Tests for CLogViewRecent::DuplicatesL() function
519 @SYMTestPriority High
520 @SYMTestActions Set the specified duplicate event view with logview duplicates.
521 Check for log server failure error
522 @SYMTestExpectedResults Test must not fail
525 LOCAL_C void TestDuplicateViewSetupWithLogServFailL(CLogClient& aClient)
527 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0983 "));
528 CTestActive* active = new(ELeave)CTestActive;
529 CleanupStack::PushL(active);
531 CLogEvent* event = CLogEvent::NewL();
532 CleanupStack::PushL(event);
536 aClient.GetString(buf, R_LOG_DIR_IN);
538 event->SetEventType(KLogCallEventTypeUid);
539 event->SetDirection(buf);
540 event->SetContact(KTestContact);
541 event->SetStatus(KTestStatus);
544 aClient.AddEvent(*event, active->iStatus);
546 CActiveScheduler::Start();
547 TEST2(active->iStatus.Int(), KErrNone);
549 aClient.AddEvent(*event, active->iStatus);
551 CActiveScheduler::Start();
552 TEST2(active->iStatus.Int(), KErrNone);
554 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
555 CleanupStack::PushL(view);
557 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
559 CActiveScheduler::Start();
560 TEST2(active->iStatus.Int(), KErrNone);
562 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
563 CleanupStack::PushL(duplicate);
566 TBool finished = EFalse;
571 __LOGSERV_UHEAP_FAILNEXT(failCount++);
573 TBool result = EFalse;
574 TRAP(error, result = view->DuplicatesL(*duplicate, active->iStatus));
581 CActiveScheduler::Start();
583 if (active->iStatus.Int() == KErrNone)
586 TEST(duplicate->CountL() >= 1);
589 TEST2(active->iStatus.Int(), KErrNoMemory);
592 TEST2(error, KErrNoMemory);
594 __LOGSERV_UHEAP_RESET;
597 CLogFilterList* list = new(ELeave)CLogFilterList;
598 CleanupStack::PushL(list);
600 CLogFilter* filter = CLogFilter::NewL();
601 CleanupStack::PushL(filter);
602 filter->SetStatus(KTestStatus);
609 __LOGSERV_UHEAP_FAILNEXT(failCount++);
611 TBool result = EFalse;
612 TRAP(error, result = view->DuplicatesL(*duplicate, *filter, active->iStatus));
619 CActiveScheduler::Start();
621 if (active->iStatus.Int() == KErrNone)
624 TEST(duplicate->CountL() >= 1);
627 TEST2(active->iStatus.Int(), KErrNoMemory);
630 TEST2(error, KErrNoMemory);
632 __LOGSERV_UHEAP_RESET;
635 list->AppendL(filter);
636 CleanupStack::Pop(); // filter
638 filter = CLogFilter::NewL();
639 CleanupStack::PushL(filter);
640 filter->SetEventType(KLogCallEventTypeUid);
641 list->AppendL(filter);
642 CleanupStack::Pop(); // filter
649 __LOGSERV_UHEAP_FAILNEXT(failCount++);
651 TBool result = EFalse;
652 TRAP(error, result = view->DuplicatesL(*duplicate, *list, active->iStatus));
659 CActiveScheduler::Start();
661 if (active->iStatus.Int() == KErrNone)
664 TEST(duplicate->CountL() >= 1);
667 TEST2(active->iStatus.Int(), KErrNoMemory);
670 TEST2(error, KErrNoMemory);
672 __LOGSERV_UHEAP_RESET;
675 list->ResetAndDestroy();
676 CleanupStack::PopAndDestroy(5); // list, duplicate, view, event, active
680 @SYMTestCaseID SYSLIB-LOGENG-CT-0984
681 @SYMTestCaseDesc Tests for CLogViewEvent::NextL(),LastL(),PreviousL(),FirstL() functions
682 @SYMTestPriority High
683 @SYMTestActions Tests for all the navigation functions in the view.Check for log server failure error
684 @SYMTestExpectedResults Test must not fail
687 LOCAL_C void TestNavigationWithLogServFailL(CLogClient& aClient)
689 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0984 "));
690 CTestActive* active = new(ELeave)CTestActive;
691 CleanupStack::PushL(active);
693 CLogEvent* event = CLogEvent::NewL();
694 CleanupStack::PushL(event);
695 event->SetEventType(KLogCallEventTypeUid);
698 aClient.AddEvent(*event, active->iStatus);
700 CActiveScheduler::Start();
701 TEST2(active->iStatus.Int(), KErrNone);
703 CLogViewEvent* view = CLogViewEvent::NewL(aClient);
704 CleanupStack::PushL(view);
706 CLogFilter* filter = CLogFilter::NewL();
707 CleanupStack::PushL(filter);
710 TBool finished = EFalse;
715 TEST(view->SetFilterL(*filter, active->iStatus));
717 CActiveScheduler::Start();
718 TEST2(active->iStatus.Int(), KErrNone);
719 TEST(view->CountL() > 1);
720 event->CopyL(view->Event());
722 __LOGSERV_UHEAP_FAILNEXT(failCount++);
724 TBool result = EFalse;
725 TRAP(error, result = view->NextL(active->iStatus));
732 CActiveScheduler::Start();
734 if (active->iStatus.Int() == KErrNone)
737 TEST(!TestUtils::EventsEqual(*event, view->Event()));
740 TEST2(active->iStatus.Int(), KErrNoMemory);
743 TEST2(error, KErrNoMemory);
745 __LOGSERV_UHEAP_RESET;
753 TEST(view->SetFilterL(*filter, active->iStatus));
755 CActiveScheduler::Start();
756 TEST2(active->iStatus.Int(), KErrNone);
757 TEST(view->CountL() > 1);
759 TEST(view->LastL(active->iStatus));
761 CActiveScheduler::Start();
762 TEST2(active->iStatus.Int(), KErrNone);
764 event->CopyL(view->Event());
766 __LOGSERV_UHEAP_FAILNEXT(failCount++);
768 TBool result = EFalse;
769 TRAP(error, result = view->PreviousL(active->iStatus));
776 CActiveScheduler::Start();
778 if (active->iStatus.Int() == KErrNone)
781 TEST(!TestUtils::EventsEqual(*event, view->Event()));
784 TEST2(active->iStatus.Int(), KErrNoMemory);
787 TEST2(error, KErrNoMemory);
789 __LOGSERV_UHEAP_RESET;
797 TEST(view->SetFilterL(*filter, active->iStatus));
799 CActiveScheduler::Start();
800 TEST2(active->iStatus.Int(), KErrNone);
801 TEST(view->CountL() > 1);
803 TEST(view->LastL(active->iStatus));
805 CActiveScheduler::Start();
806 TEST2(active->iStatus.Int(), KErrNone);
808 event->CopyL(view->Event());
810 __LOGSERV_UHEAP_FAILNEXT(failCount++);
812 TBool result = EFalse;
813 TRAP(error, result = view->FirstL(active->iStatus));
820 CActiveScheduler::Start();
822 if (active->iStatus.Int() == KErrNone)
825 TEST(!TestUtils::EventsEqual(*event, view->Event()));
828 TEST2(active->iStatus.Int(), KErrNoMemory);
831 TEST2(error, KErrNoMemory);
833 __LOGSERV_UHEAP_RESET;
841 TEST(view->SetFilterL(*filter, active->iStatus));
843 CActiveScheduler::Start();
844 TEST2(active->iStatus.Int(), KErrNone);
845 TEST(view->CountL() > 1);
847 TEST(view->FirstL(active->iStatus));
849 CActiveScheduler::Start();
850 TEST2(active->iStatus.Int(), KErrNone);
852 event->CopyL(view->Event());
854 __LOGSERV_UHEAP_FAILNEXT(failCount++);
856 TBool result = EFalse;
857 TRAP(error, result = view->LastL(active->iStatus));
864 CActiveScheduler::Start();
866 if (active->iStatus.Int() == KErrNone)
869 TEST(!TestUtils::EventsEqual(*event, view->Event()));
872 TEST2(active->iStatus.Int(), KErrNoMemory);
875 TEST2(error, KErrNoMemory);
877 __LOGSERV_UHEAP_RESET;
880 CleanupStack::PopAndDestroy(4); // filter, view, event, active
884 @SYMTestCaseID SYSLIB-LOGENG-CT-0985
885 @SYMTestCaseDesc Tests for CLogViewEvent::CountL() functions
886 @SYMTestPriority High
887 @SYMTestActions Test for getting the number of events in the view.Check for log server failure error
888 @SYMTestExpectedResults Test must not fail
891 LOCAL_C void TestViewCountWithLogServFailL(CLogClient& aClient)
893 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0985 "));
894 CTestActive* active = new(ELeave)CTestActive;
895 CleanupStack::PushL(active);
897 CLogEvent* event = CLogEvent::NewL();
898 CleanupStack::PushL(event);
899 event->SetEventType(KLogCallEventTypeUid);
902 aClient.AddEvent(*event, active->iStatus);
904 CActiveScheduler::Start();
905 TEST2(active->iStatus.Int(), KErrNone);
907 CLogViewEvent* view = CLogViewEvent::NewL(aClient);
908 CleanupStack::PushL(view);
910 CLogFilter* filter = CLogFilter::NewL();
911 CleanupStack::PushL(filter);
913 TEST(view->SetFilterL(*filter, active->iStatus));
915 CActiveScheduler::Start();
916 TEST2(active->iStatus.Int(), KErrNone);
919 TBool finished = EFalse;
924 __LOGSERV_UHEAP_FAILNEXT(failCount++);
927 TRAP(error, result = view->CountL());
935 TEST2(error, KErrNoMemory);
937 __LOGSERV_UHEAP_RESET;
940 CleanupStack::PopAndDestroy(4); // filter, view, event, active
944 @SYMTestCaseID SYSLIB-LOGENG-CT-0986
945 @SYMTestCaseDesc Tests for CLogViewRecent::RemoveL() function
946 @SYMTestPriority High
947 @SYMTestActions Test for removing the event with the specified unique event ID from the view
948 Check for log server failure error
949 @SYMTestExpectedResults Test must not fail
952 LOCAL_C void TestRecentViewRemoveWithLogServFailL(CLogClient& aClient)
954 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0986 "));
955 CTestActive* active = new(ELeave)CTestActive;
956 CleanupStack::PushL(active);
958 CLogEvent* event = CLogEvent::NewL();
959 CleanupStack::PushL(event);
963 aClient.GetString(buf, R_LOG_DIR_IN);
965 event->SetEventType(KLogCallEventTypeUid);
966 event->SetDirection(buf);
967 event->SetContact(1);
970 aClient.AddEvent(*event, active->iStatus);
972 CActiveScheduler::Start();
973 TEST2(active->iStatus.Int(), KErrNone);
975 event->SetContact(2);
977 aClient.AddEvent(*event, active->iStatus);
979 CActiveScheduler::Start();
980 TEST2(active->iStatus.Int(), KErrNone);
982 event->SetContact(3);
984 aClient.AddEvent(*event, active->iStatus);
986 CActiveScheduler::Start();
987 TEST2(active->iStatus.Int(), KErrNone);
989 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
990 CleanupStack::PushL(view);
992 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
994 CActiveScheduler::Start();
995 TEST2(active->iStatus.Int(), KErrNone);
997 TInt count = view->CountL();
1001 TBool finished = EFalse;
1006 __LOGSERV_UHEAP_FAILNEXT(failCount++);
1008 TRAP(error, view->RemoveL(view->Event().Id()));
1010 __LOGSERV_UHEAP_RESET;
1016 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
1018 CActiveScheduler::Start();
1019 TEST2(active->iStatus.Int(), KErrNone);
1021 TEST(count == view->CountL() + 1);
1024 TEST2(error, KErrNoMemory);
1032 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
1034 CActiveScheduler::Start();
1035 TEST2(active->iStatus.Int(), KErrNone);
1037 count = view->CountL();
1040 __LOGSERV_UHEAP_FAILNEXT(failCount++);
1043 TRAP(error, ret = view->RemoveL(active->iStatus));
1045 __LOGSERV_UHEAP_RESET;
1052 CActiveScheduler::Start();
1054 if (active->iStatus == KErrNone)
1056 TEST(count == view->CountL() + 1);
1060 TEST2(active->iStatus.Int(), KErrNoMemory);
1063 TEST2(error, KErrNoMemory);
1066 CleanupStack::PopAndDestroy(3); // view, event, active
1070 @SYMTestCaseID SYSLIB-LOGENG-CT-0987
1071 @SYMTestCaseDesc Tests for CLogViewDuplicate::RemoveL() function
1072 @SYMTestPriority High
1073 @SYMTestActions Test for removing the event with the specified unique event ID from the view.Check for memory error
1074 @SYMTestExpectedResults Test must not fail
1077 LOCAL_C void TestDuplicateViewRemoveWithLogServFailL(CLogClient& aClient)
1079 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0987 "));
1080 CTestActive* active = new(ELeave)CTestActive;
1081 CleanupStack::PushL(active);
1083 CLogEvent* event = CLogEvent::NewL();
1084 CleanupStack::PushL(event);
1088 aClient.GetString(buf, R_LOG_DIR_IN);
1090 event->SetEventType(KLogCallEventTypeUid);
1091 event->SetDirection(buf);
1092 event->SetContact(KTestContact);
1095 aClient.AddEvent(*event, active->iStatus);
1097 CActiveScheduler::Start();
1098 TEST2(active->iStatus.Int(), KErrNone);
1100 aClient.AddEvent(*event, active->iStatus);
1102 CActiveScheduler::Start();
1103 TEST2(active->iStatus.Int(), KErrNone);
1105 aClient.AddEvent(*event, active->iStatus);
1107 CActiveScheduler::Start();
1108 TEST2(active->iStatus.Int(), KErrNone);
1110 aClient.AddEvent(*event, active->iStatus);
1112 CActiveScheduler::Start();
1113 TEST2(active->iStatus.Int(), KErrNone);
1115 CLogViewRecent* view = CLogViewRecent::NewL(aClient);
1116 CleanupStack::PushL(view);
1118 TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
1120 CActiveScheduler::Start();
1121 TEST2(active->iStatus.Int(), KErrNone);
1123 CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
1124 CleanupStack::PushL(duplicate);
1126 TEST(view->DuplicatesL(*duplicate, active->iStatus));
1128 CActiveScheduler::Start();
1129 TEST2(active->iStatus.Int(), KErrNone);
1131 TInt count = duplicate->CountL();
1135 TBool finished = EFalse;
1140 __LOGSERV_UHEAP_FAILNEXT(failCount++);
1142 TRAP(error, duplicate->RemoveL(duplicate->Event().Id()));
1144 __LOGSERV_UHEAP_RESET;
1150 TEST(view->DuplicatesL(*duplicate, active->iStatus));
1152 CActiveScheduler::Start();
1153 TEST2(active->iStatus.Int(), KErrNone);
1155 TEST(count == duplicate->CountL() + 1);
1158 TEST2(error, KErrNoMemory);
1166 TEST(view->DuplicatesL(*duplicate, active->iStatus));
1168 CActiveScheduler::Start();
1169 TEST2(active->iStatus.Int(), KErrNone);
1171 count = duplicate->CountL();
1173 __LOGSERV_UHEAP_FAILNEXT(failCount++);
1176 TRAP(error, ret = duplicate->RemoveL(active->iStatus));
1178 __LOGSERV_UHEAP_RESET;
1185 CActiveScheduler::Start();
1188 if (!ret || active->iStatus == KErrNone)
1191 TEST(count == duplicate->CountL() + 1);
1194 TEST2(active->iStatus.Int(), KErrNoMemory);
1197 TEST2(error, KErrNoMemory);
1200 CleanupStack::PopAndDestroy(4); // duplicate, view, event, active
1205 TestUtils::Initialize(_L("t_logviewfail3"));
1206 TestUtils::DeleteDatabaseL();
1208 CLogClient* client = CLogClient::NewL(theFs);
1209 CleanupStack::PushL(client);
1211 TheTest.Start(_L("Heap Failure in Log Server"));
1213 TheTest.Next(_L("View Construction"));
1214 TestEventViewConstructWithLogServFailL(*client);
1215 TestRecentViewConstructWithLogServFailL(*client);
1216 TestDuplicateViewConstructWithLogServFailL(*client);
1217 theLog.Write(_L8("Test 1 OK\n"));
1219 TheTest.Next(_L("View Setup"));
1220 TestEventViewSetupWithLogServFailL(*client);
1221 TestRecentViewSetupWithLogServFailL(*client);
1222 TestDuplicateViewSetupWithLogServFailL(*client);
1223 theLog.Write(_L8("Test 2 OK\n"));
1225 TheTest.Next(_L("View Navigation"));
1226 TestNavigationWithLogServFailL(*client);
1227 theLog.Write(_L8("Test 3 OK\n"));
1229 TheTest.Next(_L("Other"));
1230 TestViewCountWithLogServFailL(*client);
1231 TestRecentViewRemoveWithLogServFailL(*client);
1232 TestDuplicateViewRemoveWithLogServFailL(*client);
1233 theLog.Write(_L8("Test 4 OK\n"));
1235 CleanupStack::PopAndDestroy(); // client;