loggingservices/eventlogger/test/src/t_logviewfail3.cpp
changeset 0 08ec8eefde2f
child 9 667e88a979d7
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <s32file.h>
       
    17 #include "TEST.H"
       
    18 #include <logview.h>
       
    19 
       
    20 #undef test  //there is a "test" macro which hides "RTest test" declaration.
       
    21 
       
    22 RTest test(_L("Log View Heap (Server) Failure Test Harness"));
       
    23 
       
    24 const TLogContactItemId KTestContact = 0x123;
       
    25 _LIT(KTestStatus, "Test Status Text");
       
    26 
       
    27 /**
       
    28 @SYMTestCaseID          SYSLIB-LOGENG-CT-0978
       
    29 @SYMTestCaseDesc	    Tests for CLogViewEvent::NewL() function
       
    30 @SYMTestPriority 	    High
       
    31 @SYMTestActions  	    Add an event to the client,Create a new CLogViewEvent on heap,if no error check if the view works
       
    32                         Check for log server failure error
       
    33 @SYMTestExpectedResults Test must not fail
       
    34 @SYMREQ                 REQ0000
       
    35 */
       
    36 LOCAL_C void TestEventViewConstructWithLogServFailL(CLogClient& aClient)
       
    37 	{
       
    38 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0978 "));
       
    39 	CTestActive* active = new(ELeave)CTestActive;
       
    40 	CleanupStack::PushL(active);
       
    41 
       
    42 	CLogEvent* event = CLogEvent::NewL();
       
    43 	CleanupStack::PushL(event);
       
    44 	event->SetEventType(KLogCallEventTypeUid);
       
    45 
       
    46 	// Add an event
       
    47 	aClient.AddEvent(*event, active->iStatus);
       
    48 	active->StartL();
       
    49 	CActiveScheduler::Start();
       
    50 	TEST2(active->iStatus.Int(), KErrNone);
       
    51 
       
    52 	CLogViewEvent* view = NULL;
       
    53 
       
    54 	TInt failCount = 0;
       
    55 	TBool finished = EFalse;
       
    56 	TInt error;
       
    57 
       
    58 	while(!finished)
       
    59 		{
       
    60 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
    61 
       
    62 		TRAP(error, view = CLogViewEvent::NewL(aClient));
       
    63 
       
    64 		__LOGSERV_UHEAP_RESET;
       
    65 		
       
    66 		if (!error)
       
    67 			{
       
    68 			finished = ETrue;
       
    69 			CleanupStack::PushL(view);
       
    70 		
       
    71 			// Check the view works
       
    72 			CLogFilter* filter = CLogFilter::NewL();
       
    73 			CleanupStack::PushL(filter);
       
    74 			
       
    75 			TEST(view->SetFilterL(*filter, active->iStatus));
       
    76 			active->StartL();
       
    77 			CActiveScheduler::Start();
       
    78 			TEST2(active->iStatus.Int(), KErrNone);
       
    79 			TEST(view->CountL() >= 1);
       
    80 			TEST(TestUtils::EventsEqual(*event, view->Event()));
       
    81 
       
    82 			CleanupStack::PopAndDestroy(2); // filter, view
       
    83 			}
       
    84 		else
       
    85 			{
       
    86 			TEST2(error, KErrNoMemory);
       
    87 			}
       
    88 		}
       
    89 
       
    90 	CleanupStack::PopAndDestroy(2); // event, active
       
    91 	}
       
    92 
       
    93 /**
       
    94 @SYMTestCaseID          SYSLIB-LOGENG-CT-0979
       
    95 @SYMTestCaseDesc	    Tests for CLogViewRecent::NewL(),SetRecentListL() functions
       
    96 @SYMTestPriority 	    High
       
    97 @SYMTestActions  	    Create a new view object,if no errors and test of initialising of the view for the specified recent event list. 
       
    98                         Check for log server failure error
       
    99 @SYMTestExpectedResults Test must not fail
       
   100 @SYMREQ                 REQ0000
       
   101 */
       
   102 LOCAL_C void TestRecentViewConstructWithLogServFailL(CLogClient& aClient)
       
   103 	{
       
   104 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0979 "));
       
   105 	CTestActive* active = new(ELeave)CTestActive;
       
   106 	CleanupStack::PushL(active);
       
   107 
       
   108 	CLogEvent* event = CLogEvent::NewL();
       
   109 	CleanupStack::PushL(event);
       
   110 
       
   111 	// Incoming
       
   112 	TLogString buf;
       
   113 	aClient.GetString(buf, R_LOG_DIR_IN);
       
   114 
       
   115 	event->SetEventType(KLogCallEventTypeUid);
       
   116 	event->SetDirection(buf);
       
   117 
       
   118 	// Add an event
       
   119 	aClient.AddEvent(*event, active->iStatus);
       
   120 	active->StartL();
       
   121 	CActiveScheduler::Start();
       
   122 	TEST2(active->iStatus.Int(), KErrNone);
       
   123 
       
   124 	CLogViewRecent* view = NULL;
       
   125 
       
   126 	TInt failCount = 0;
       
   127 	TBool finished = EFalse;
       
   128 	TInt error;
       
   129 
       
   130 	while(!finished)
       
   131 		{
       
   132 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   133 
       
   134 		TRAP(error, view = CLogViewRecent::NewL(aClient));
       
   135 
       
   136 		__LOGSERV_UHEAP_RESET;
       
   137 		
       
   138 		if (!error)
       
   139 			{
       
   140 			finished = ETrue;
       
   141 			CleanupStack::PushL(view);
       
   142 					
       
   143 			TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
       
   144 			active->StartL();
       
   145 			CActiveScheduler::Start();
       
   146 			TEST2(active->iStatus.Int(), KErrNone);
       
   147 			TEST(view->CountL() >= 1);
       
   148 			TEST(TestUtils::EventsEqual(*event, view->Event()));
       
   149 
       
   150 			CleanupStack::PopAndDestroy(); // view
       
   151 			}
       
   152 		else
       
   153 			{
       
   154 			TEST2(error, KErrNoMemory);
       
   155 			}
       
   156 		}
       
   157 
       
   158 	CleanupStack::PopAndDestroy(2); // event, active
       
   159 	}
       
   160 
       
   161 /**
       
   162 @SYMTestCaseID          SYSLIB-LOGENG-CT-0980
       
   163 @SYMTestCaseDesc	    Tests for CLogViewDuplicate::NewL() functions
       
   164 @SYMTestPriority 	    High
       
   165 @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
       
   166                         Check for log server failure error
       
   167 @SYMTestExpectedResults Test must not fail
       
   168 @SYMREQ                 REQ0000
       
   169 */
       
   170 LOCAL_C void TestDuplicateViewConstructWithLogServFailL(CLogClient& aClient)
       
   171 	{
       
   172 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0980 "));
       
   173 	CTestActive* active = new(ELeave)CTestActive;
       
   174 	CleanupStack::PushL(active);
       
   175 
       
   176 	CLogEvent* event = CLogEvent::NewL();
       
   177 	CleanupStack::PushL(event);
       
   178 
       
   179 	// Incoming
       
   180 	TLogString buf;
       
   181 	aClient.GetString(buf, R_LOG_DIR_IN);
       
   182 
       
   183 	event->SetEventType(KLogCallEventTypeUid);
       
   184 	event->SetDirection(buf);
       
   185 	event->SetContact(KTestContact);
       
   186 
       
   187 	// Add events
       
   188 	aClient.AddEvent(*event, active->iStatus);
       
   189 	active->StartL();
       
   190 	CActiveScheduler::Start();
       
   191 	TEST2(active->iStatus.Int(), KErrNone);
       
   192 
       
   193 	aClient.AddEvent(*event, active->iStatus);
       
   194 	active->StartL();
       
   195 	CActiveScheduler::Start();
       
   196 	TEST2(active->iStatus.Int(), KErrNone);
       
   197 
       
   198 	CLogViewDuplicate* view = NULL;
       
   199 
       
   200 	TInt failCount = 0;
       
   201 	TBool finished = EFalse;
       
   202 	TInt error;
       
   203 
       
   204 	while(!finished)
       
   205 		{
       
   206 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   207 
       
   208 		TRAP(error, view = CLogViewDuplicate::NewL(aClient));
       
   209 
       
   210 		__LOGSERV_UHEAP_RESET;
       
   211 		
       
   212 		if (!error)
       
   213 			{
       
   214 			finished = ETrue;
       
   215 			CleanupStack::PushL(view);
       
   216 			
       
   217 			CLogViewRecent* recent = CLogViewRecent::NewL(aClient);
       
   218 			CleanupStack::PushL(recent);
       
   219 			TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
       
   220 			active->StartL();
       
   221 			CActiveScheduler::Start();
       
   222 			TEST2(active->iStatus.Int(), KErrNone);
       
   223 			TEST(recent->CountL() >= 1);
       
   224 
       
   225 			TEST(recent->DuplicatesL(*view, active->iStatus));
       
   226 			active->StartL();
       
   227 			CActiveScheduler::Start();
       
   228 			TEST2(active->iStatus.Int(), KErrNone);
       
   229 			TEST(view->CountL() >= 1);
       
   230 
       
   231 			CleanupStack::PopAndDestroy(2); // recent, view
       
   232 			}
       
   233 		else
       
   234 			{
       
   235 			TEST2(error, KErrNoMemory);
       
   236 			}
       
   237 		}
       
   238 
       
   239 	CleanupStack::PopAndDestroy(2); // event, active
       
   240 	}
       
   241 
       
   242 /**
       
   243 @SYMTestCaseID          SYSLIB-LOGENG-CT-0981
       
   244 @SYMTestCaseDesc	    Tests for CLogViewEvent::SetFilterL() function 
       
   245 @SYMTestPriority 	    High
       
   246 @SYMTestActions  	    Create a log filter and set the filter on logview.Check for equality of events on the view and events
       
   247 						added.Check for log server failure error
       
   248 @SYMTestExpectedResults Test must not fail
       
   249 @SYMREQ                 REQ0000
       
   250 */
       
   251 LOCAL_C void TestEventViewSetupWithLogServFailL(CLogClient& aClient)
       
   252 	{
       
   253 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0981 "));
       
   254 	CTestActive* active = new(ELeave)CTestActive;
       
   255 	CleanupStack::PushL(active);
       
   256 
       
   257 	CLogEvent* event = CLogEvent::NewL();
       
   258 	CleanupStack::PushL(event);
       
   259 	event->SetEventType(KLogCallEventTypeUid);
       
   260 	event->SetStatus(KTestStatus);
       
   261 
       
   262 	// Add an event
       
   263 	aClient.AddEvent(*event, active->iStatus);
       
   264 	active->StartL();
       
   265 	CActiveScheduler::Start();
       
   266 	TEST2(active->iStatus.Int(), KErrNone);
       
   267 
       
   268 	CLogViewEvent* view = CLogViewEvent::NewL(aClient);
       
   269 	CleanupStack::PushL(view);
       
   270 
       
   271 	CLogFilterList* list = new(ELeave)CLogFilterList;
       
   272 	CleanupStack::PushL(list);
       
   273 
       
   274 	CLogFilter* filter = CLogFilter::NewL();
       
   275 	CleanupStack::PushL(filter);
       
   276 	filter->SetStatus(KTestStatus);
       
   277 
       
   278 	TInt failCount = 0;
       
   279 	TBool finished = EFalse;
       
   280 	TInt error;
       
   281 
       
   282 	while(!finished)
       
   283 		{
       
   284 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   285 
       
   286 		TBool result = EFalse;
       
   287 		TRAP(error, result = view->SetFilterL(*filter, active->iStatus));
       
   288 		
       
   289 		if (!error)
       
   290 			{
       
   291 			TEST(result);
       
   292 
       
   293 			active->StartL();
       
   294 			CActiveScheduler::Start();
       
   295 
       
   296 			if (active->iStatus.Int() == KErrNone)
       
   297 				{
       
   298 				finished = ETrue;		
       
   299 				
       
   300 				TEST(view->CountL() >= 1);
       
   301 				TEST(TestUtils::EventsEqual(*event, view->Event()));
       
   302 				}
       
   303 			else
       
   304 				{
       
   305 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
   306 				}
       
   307 			}
       
   308 		else
       
   309 			{
       
   310 			TEST2(error, KErrNoMemory);
       
   311 			}
       
   312 
       
   313 		__LOGSERV_UHEAP_RESET;
       
   314 		}
       
   315 
       
   316 	list->AppendL(filter);
       
   317 	CleanupStack::Pop(); // filter
       
   318 	
       
   319 	filter = CLogFilter::NewL();
       
   320 	CleanupStack::PushL(filter);
       
   321 	filter->SetEventType(KLogCallEventTypeUid);
       
   322 	list->AppendL(filter);
       
   323 	CleanupStack::Pop(); // filter
       
   324 
       
   325 	failCount = 0;
       
   326 	finished = EFalse;
       
   327 
       
   328 	while(!finished)
       
   329 		{
       
   330 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   331 
       
   332 		TBool result = EFalse;
       
   333 		TRAP(error, result = view->SetFilterL(*list, active->iStatus));
       
   334 		
       
   335 		if (!error)
       
   336 			{
       
   337 			TEST(result);
       
   338 
       
   339 			active->StartL();
       
   340 			CActiveScheduler::Start();
       
   341 
       
   342 			if (active->iStatus.Int() == KErrNone)
       
   343 				{
       
   344 				finished = ETrue;		
       
   345 				
       
   346 				TEST(view->CountL() >= 1);
       
   347 				TEST(TestUtils::EventsEqual(*event, view->Event()));
       
   348 				}
       
   349 			else
       
   350 				{
       
   351 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
   352 				}
       
   353 			}
       
   354 		else
       
   355 			{
       
   356 			TEST2(error, KErrNoMemory);
       
   357 			}
       
   358 
       
   359 		__LOGSERV_UHEAP_RESET;
       
   360 		}
       
   361 
       
   362 	list->ResetAndDestroy();
       
   363 	CleanupStack::PopAndDestroy(4); // list, view, event, active
       
   364 	}
       
   365 
       
   366 /**
       
   367 @SYMTestCaseID          SYSLIB-LOGENG-CT-0982
       
   368 @SYMTestCaseDesc	    Tests for CLogViewRecent::SetRecentListL() function 
       
   369 @SYMTestPriority 	    High
       
   370 @SYMTestActions  	    Set recent view list first without a filter and later with log filter,Check for log server failure error
       
   371 @SYMTestExpectedResults Test must not fail
       
   372 @SYMREQ                 REQ0000
       
   373 */
       
   374 LOCAL_C void TestRecentViewSetupWithLogServFailL(CLogClient& aClient)
       
   375 	{
       
   376 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0982 "));
       
   377 	CTestActive* active = new(ELeave)CTestActive;
       
   378 	CleanupStack::PushL(active);
       
   379 
       
   380 	CLogEvent* event = CLogEvent::NewL();
       
   381 	CleanupStack::PushL(event);
       
   382 
       
   383 	// Incoming
       
   384 	TLogString buf;
       
   385 	aClient.GetString(buf, R_LOG_DIR_IN);
       
   386 
       
   387 	event->SetEventType(KLogCallEventTypeUid);
       
   388 	event->SetDirection(buf);
       
   389 	event->SetStatus(KTestStatus);
       
   390 
       
   391 	// Add an event
       
   392 	aClient.AddEvent(*event, active->iStatus);
       
   393 	active->StartL();
       
   394 	CActiveScheduler::Start();
       
   395 	TEST2(active->iStatus.Int(), KErrNone);
       
   396 
       
   397 	CLogViewRecent* view = CLogViewRecent::NewL(aClient);
       
   398 	CleanupStack::PushL(view);
       
   399 
       
   400 	TInt failCount = 0;
       
   401 	TBool finished = EFalse;
       
   402 	TInt error;
       
   403 
       
   404 	while(!finished)
       
   405 		{
       
   406 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   407 
       
   408 		TBool result = EFalse;
       
   409 		TRAP(error, result = view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
       
   410 		
       
   411 		if (!error)
       
   412 			{
       
   413 			TEST(result);
       
   414 
       
   415 			active->StartL();
       
   416 			CActiveScheduler::Start();
       
   417 
       
   418 			if (active->iStatus.Int() == KErrNone)
       
   419 				{
       
   420 				finished = ETrue;		
       
   421 				TEST(view->CountL() >= 1);
       
   422 				}
       
   423 			else
       
   424 				{
       
   425 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
   426 				}
       
   427 			}
       
   428 		else
       
   429 			{
       
   430 			TEST2(error, KErrNoMemory);
       
   431 			}
       
   432 
       
   433 		__LOGSERV_UHEAP_RESET;
       
   434 		}
       
   435 
       
   436 	CLogFilterList* list = new(ELeave)CLogFilterList;
       
   437 	CleanupStack::PushL(list);
       
   438 
       
   439 	CLogFilter* filter = CLogFilter::NewL();
       
   440 	CleanupStack::PushL(filter);
       
   441 	filter->SetStatus(KTestStatus);
       
   442 
       
   443 	failCount = 0;
       
   444 	finished = EFalse;
       
   445 
       
   446 	while(!finished)
       
   447 		{
       
   448 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   449 
       
   450 		TBool result = EFalse;
       
   451 		TRAP(error, result = view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus));
       
   452 		
       
   453 		if (!error)
       
   454 			{
       
   455 			TEST(result);
       
   456 
       
   457 			active->StartL();
       
   458 			CActiveScheduler::Start();
       
   459 
       
   460 			if (active->iStatus.Int() == KErrNone)
       
   461 				{
       
   462 				finished = ETrue;		
       
   463 				TEST(view->CountL() >= 1);
       
   464 				}
       
   465 			else
       
   466 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
   467 			}
       
   468 		else
       
   469 			TEST2(error, KErrNoMemory);
       
   470 
       
   471 		__LOGSERV_UHEAP_RESET;
       
   472 		}
       
   473 
       
   474 	list->AppendL(filter);
       
   475 	CleanupStack::Pop(); // filter
       
   476 
       
   477 	filter = CLogFilter::NewL();
       
   478 	CleanupStack::PushL(filter);
       
   479 	filter->SetEventType(KLogCallEventTypeUid);
       
   480 	list->AppendL(filter);
       
   481 	CleanupStack::Pop(); // filter
       
   482 
       
   483 	failCount = 0;
       
   484 	finished = EFalse;
       
   485 
       
   486 	while(!finished)
       
   487 		{
       
   488 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   489 
       
   490 		TBool result = EFalse;
       
   491 		TRAP(error, result = view->SetRecentListL(KLogRecentIncomingCalls, *list, active->iStatus));
       
   492 		
       
   493 		if (!error)
       
   494 			{
       
   495 			TEST(result);
       
   496 
       
   497 			active->StartL();
       
   498 			CActiveScheduler::Start();
       
   499 
       
   500 			if (active->iStatus.Int() == KErrNone)
       
   501 				{
       
   502 				finished = ETrue;		
       
   503 				TEST(view->CountL() >= 1);
       
   504 				}
       
   505 			else
       
   506 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
   507 			}
       
   508 		else
       
   509 			TEST2(error, KErrNoMemory);
       
   510 
       
   511 		__LOGSERV_UHEAP_RESET;
       
   512 		}
       
   513 
       
   514 	list->ResetAndDestroy();
       
   515 	CleanupStack::PopAndDestroy(4); // list, view, event, active
       
   516 	}
       
   517 
       
   518 /**
       
   519 @SYMTestCaseID          SYSLIB-LOGENG-CT-0983
       
   520 @SYMTestCaseDesc	    Tests for CLogViewRecent::DuplicatesL() function
       
   521 @SYMTestPriority 	    High
       
   522 @SYMTestActions  	    Set the specified duplicate event view with logview duplicates.
       
   523                         Check for log server failure error
       
   524 @SYMTestExpectedResults Test must not fail
       
   525 @SYMREQ                 REQ0000
       
   526 */
       
   527 LOCAL_C void TestDuplicateViewSetupWithLogServFailL(CLogClient& aClient)
       
   528 	{
       
   529 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0983 "));
       
   530 	CTestActive* active = new(ELeave)CTestActive;
       
   531 	CleanupStack::PushL(active);
       
   532 
       
   533 	CLogEvent* event = CLogEvent::NewL();
       
   534 	CleanupStack::PushL(event);
       
   535 
       
   536 	// Incoming
       
   537 	TLogString buf;
       
   538 	aClient.GetString(buf, R_LOG_DIR_IN);
       
   539 
       
   540 	event->SetEventType(KLogCallEventTypeUid);
       
   541 	event->SetDirection(buf);
       
   542 	event->SetContact(KTestContact);
       
   543 	event->SetStatus(KTestStatus);
       
   544 
       
   545 	// Add events
       
   546 	aClient.AddEvent(*event, active->iStatus);
       
   547 	active->StartL();
       
   548 	CActiveScheduler::Start();
       
   549 	TEST2(active->iStatus.Int(), KErrNone);
       
   550 
       
   551 	aClient.AddEvent(*event, active->iStatus);
       
   552 	active->StartL();
       
   553 	CActiveScheduler::Start();
       
   554 	TEST2(active->iStatus.Int(), KErrNone);
       
   555 
       
   556 	CLogViewRecent* view = CLogViewRecent::NewL(aClient);
       
   557 	CleanupStack::PushL(view);
       
   558 
       
   559 	TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
       
   560 	active->StartL();
       
   561 	CActiveScheduler::Start();
       
   562 	TEST2(active->iStatus.Int(), KErrNone);
       
   563 	
       
   564 	CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
       
   565 	CleanupStack::PushL(duplicate);
       
   566 
       
   567 	TInt failCount = 0;
       
   568 	TBool finished = EFalse;
       
   569 	TInt error;
       
   570 
       
   571 	while(!finished)
       
   572 		{
       
   573 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   574 
       
   575 		TBool result = EFalse;
       
   576 		TRAP(error, result = view->DuplicatesL(*duplicate, active->iStatus));
       
   577 		
       
   578 		if (!error)
       
   579 			{
       
   580 			TEST(result);
       
   581 
       
   582 			active->StartL();
       
   583 			CActiveScheduler::Start();
       
   584 
       
   585 			if (active->iStatus.Int() == KErrNone)
       
   586 				{
       
   587 				finished = ETrue;		
       
   588 				TEST(duplicate->CountL() >= 1);
       
   589 				}
       
   590 			else
       
   591 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
   592 			}
       
   593 		else
       
   594 			TEST2(error, KErrNoMemory);
       
   595 
       
   596 		__LOGSERV_UHEAP_RESET;
       
   597 		}
       
   598 
       
   599 	CLogFilterList* list = new(ELeave)CLogFilterList;
       
   600 	CleanupStack::PushL(list);
       
   601 
       
   602 	CLogFilter* filter = CLogFilter::NewL();
       
   603 	CleanupStack::PushL(filter);
       
   604 	filter->SetStatus(KTestStatus);
       
   605 
       
   606 	failCount = 0;
       
   607 	finished = EFalse;
       
   608 
       
   609 	while(!finished)
       
   610 		{
       
   611 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   612 
       
   613 		TBool result = EFalse;
       
   614 		TRAP(error, result = view->DuplicatesL(*duplicate, *filter, active->iStatus));
       
   615 		
       
   616 		if (!error)
       
   617 			{
       
   618 			TEST(result);
       
   619 
       
   620 			active->StartL();
       
   621 			CActiveScheduler::Start();
       
   622 
       
   623 			if (active->iStatus.Int() == KErrNone)
       
   624 				{
       
   625 				finished = ETrue;		
       
   626 				TEST(duplicate->CountL() >= 1);
       
   627 				}
       
   628 			else
       
   629 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
   630 			}
       
   631 		else
       
   632 			TEST2(error, KErrNoMemory);
       
   633 
       
   634 		__LOGSERV_UHEAP_RESET;
       
   635 		}
       
   636 
       
   637 	list->AppendL(filter);
       
   638 	CleanupStack::Pop(); // filter
       
   639 
       
   640 	filter = CLogFilter::NewL();
       
   641 	CleanupStack::PushL(filter);
       
   642 	filter->SetEventType(KLogCallEventTypeUid);
       
   643 	list->AppendL(filter);
       
   644 	CleanupStack::Pop(); // filter
       
   645 
       
   646 	failCount = 0;
       
   647 	finished = EFalse;
       
   648 
       
   649 	while(!finished)
       
   650 		{
       
   651 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   652 
       
   653 		TBool result = EFalse;
       
   654 		TRAP(error, result = view->DuplicatesL(*duplicate, *list, active->iStatus));
       
   655 		
       
   656 		if (!error)
       
   657 			{
       
   658 			TEST(result);
       
   659 
       
   660 			active->StartL();
       
   661 			CActiveScheduler::Start();
       
   662 
       
   663 			if (active->iStatus.Int() == KErrNone)
       
   664 				{
       
   665 				finished = ETrue;		
       
   666 				TEST(duplicate->CountL() >= 1);
       
   667 				}
       
   668 			else
       
   669 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
   670 			}
       
   671 		else
       
   672 			TEST2(error, KErrNoMemory);
       
   673 
       
   674 		__LOGSERV_UHEAP_RESET;
       
   675 		}
       
   676 
       
   677 	list->ResetAndDestroy();
       
   678 	CleanupStack::PopAndDestroy(5); // list, duplicate, view, event, active
       
   679 	}
       
   680 
       
   681 /**
       
   682 @SYMTestCaseID          SYSLIB-LOGENG-CT-0984
       
   683 @SYMTestCaseDesc	    Tests for CLogViewEvent::NextL(),LastL(),PreviousL(),FirstL() functions
       
   684 @SYMTestPriority 	    High
       
   685 @SYMTestActions  	    Tests for all the navigation functions in the view.Check for log server failure error 
       
   686 @SYMTestExpectedResults Test must not fail
       
   687 @SYMREQ                 REQ0000
       
   688 */
       
   689 LOCAL_C void TestNavigationWithLogServFailL(CLogClient& aClient)
       
   690 	{
       
   691 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0984 "));
       
   692 	CTestActive* active = new(ELeave)CTestActive;
       
   693 	CleanupStack::PushL(active);
       
   694 
       
   695 	CLogEvent* event = CLogEvent::NewL();
       
   696 	CleanupStack::PushL(event);
       
   697 	event->SetEventType(KLogCallEventTypeUid);
       
   698 
       
   699 	// Add an event
       
   700 	aClient.AddEvent(*event, active->iStatus);
       
   701 	active->StartL();
       
   702 	CActiveScheduler::Start();
       
   703 	TEST2(active->iStatus.Int(), KErrNone);
       
   704 
       
   705 	CLogViewEvent* view = CLogViewEvent::NewL(aClient);
       
   706 	CleanupStack::PushL(view);
       
   707 
       
   708 	CLogFilter* filter = CLogFilter::NewL();
       
   709 	CleanupStack::PushL(filter);
       
   710 
       
   711 	TInt failCount = 0;
       
   712 	TBool finished = EFalse;
       
   713 	TInt error;
       
   714 
       
   715 	while(!finished)
       
   716 		{
       
   717 		TEST(view->SetFilterL(*filter, active->iStatus));
       
   718 		active->StartL();
       
   719 		CActiveScheduler::Start();
       
   720 		TEST2(active->iStatus.Int(), KErrNone);
       
   721 		TEST(view->CountL() > 1);
       
   722 		event->CopyL(view->Event());
       
   723 
       
   724 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   725 
       
   726 		TBool result = EFalse;
       
   727 		TRAP(error, result = view->NextL(active->iStatus));
       
   728 		
       
   729 		if (!error)
       
   730 			{
       
   731 			TEST(result);
       
   732 
       
   733 			active->StartL();
       
   734 			CActiveScheduler::Start();
       
   735 
       
   736 			if (active->iStatus.Int() == KErrNone)
       
   737 				{
       
   738 				finished = ETrue;
       
   739 				TEST(!TestUtils::EventsEqual(*event, view->Event()));
       
   740 				}
       
   741 			else
       
   742 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
   743 			}
       
   744 		else
       
   745 			TEST2(error, KErrNoMemory);
       
   746 
       
   747 		__LOGSERV_UHEAP_RESET;
       
   748 		}
       
   749 
       
   750 	failCount = 0;
       
   751 	finished = EFalse;
       
   752 
       
   753 	while(!finished)
       
   754 		{
       
   755 		TEST(view->SetFilterL(*filter, active->iStatus));
       
   756 		active->StartL();
       
   757 		CActiveScheduler::Start();
       
   758 		TEST2(active->iStatus.Int(), KErrNone);
       
   759 		TEST(view->CountL() > 1);
       
   760 
       
   761 		TEST(view->LastL(active->iStatus));
       
   762 		active->StartL();
       
   763 		CActiveScheduler::Start();
       
   764 		TEST2(active->iStatus.Int(), KErrNone);
       
   765 
       
   766 		event->CopyL(view->Event());
       
   767 
       
   768 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   769 
       
   770 		TBool result = EFalse;
       
   771 		TRAP(error, result = view->PreviousL(active->iStatus));
       
   772 		
       
   773 		if (!error)
       
   774 			{
       
   775 			TEST(result);
       
   776 
       
   777 			active->StartL();
       
   778 			CActiveScheduler::Start();
       
   779 
       
   780 			if (active->iStatus.Int() == KErrNone)
       
   781 				{
       
   782 				finished = ETrue;
       
   783 				TEST(!TestUtils::EventsEqual(*event, view->Event()));
       
   784 				}
       
   785 			else
       
   786 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
   787 			}
       
   788 		else
       
   789 			TEST2(error, KErrNoMemory);
       
   790 
       
   791 		__LOGSERV_UHEAP_RESET;
       
   792 		}
       
   793 
       
   794 	failCount = 0;
       
   795 	finished = EFalse;
       
   796 
       
   797 	while(!finished)
       
   798 		{
       
   799 		TEST(view->SetFilterL(*filter, active->iStatus));
       
   800 		active->StartL();
       
   801 		CActiveScheduler::Start();
       
   802 		TEST2(active->iStatus.Int(), KErrNone);
       
   803 		TEST(view->CountL() > 1);
       
   804 
       
   805 		TEST(view->LastL(active->iStatus));
       
   806 		active->StartL();
       
   807 		CActiveScheduler::Start();
       
   808 		TEST2(active->iStatus.Int(), KErrNone);
       
   809 
       
   810 		event->CopyL(view->Event());
       
   811 
       
   812 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   813 
       
   814 		TBool result = EFalse;
       
   815 		TRAP(error, result = view->FirstL(active->iStatus));
       
   816 		
       
   817 		if (!error)
       
   818 			{
       
   819 			TEST(result);
       
   820 
       
   821 			active->StartL();
       
   822 			CActiveScheduler::Start();
       
   823 
       
   824 			if (active->iStatus.Int() == KErrNone)
       
   825 				{
       
   826 				finished = ETrue;
       
   827 				TEST(!TestUtils::EventsEqual(*event, view->Event()));
       
   828 				}
       
   829 			else
       
   830 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
   831 			}
       
   832 		else
       
   833 			TEST2(error, KErrNoMemory);
       
   834 
       
   835 		__LOGSERV_UHEAP_RESET;
       
   836 		}
       
   837 
       
   838 	failCount = 0;
       
   839 	finished = EFalse;
       
   840 
       
   841 	while(!finished)
       
   842 		{
       
   843 		TEST(view->SetFilterL(*filter, active->iStatus));
       
   844 		active->StartL();
       
   845 		CActiveScheduler::Start();
       
   846 		TEST2(active->iStatus.Int(), KErrNone);
       
   847 		TEST(view->CountL() > 1);
       
   848 
       
   849 		TEST(view->FirstL(active->iStatus));
       
   850 		active->StartL();
       
   851 		CActiveScheduler::Start();
       
   852 		TEST2(active->iStatus.Int(), KErrNone);
       
   853 
       
   854 		event->CopyL(view->Event());
       
   855 
       
   856 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   857 
       
   858 		TBool result = EFalse;
       
   859 		TRAP(error, result = view->LastL(active->iStatus));
       
   860 		
       
   861 		if (!error)
       
   862 			{
       
   863 			TEST(result);
       
   864 
       
   865 			active->StartL();
       
   866 			CActiveScheduler::Start();
       
   867 
       
   868 			if (active->iStatus.Int() == KErrNone)
       
   869 				{
       
   870 				finished = ETrue;
       
   871 				TEST(!TestUtils::EventsEqual(*event, view->Event()));
       
   872 				}
       
   873 			else
       
   874 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
   875 			}
       
   876 		else
       
   877 			TEST2(error, KErrNoMemory);
       
   878 
       
   879 		__LOGSERV_UHEAP_RESET;
       
   880 		}
       
   881 
       
   882 	CleanupStack::PopAndDestroy(4); // filter, view, event, active
       
   883 	}
       
   884 
       
   885 /**
       
   886 @SYMTestCaseID          SYSLIB-LOGENG-CT-0985
       
   887 @SYMTestCaseDesc	    Tests for CLogViewEvent::CountL() functions
       
   888 @SYMTestPriority 	    High
       
   889 @SYMTestActions  	    Test for getting the number of events in the view.Check for log server failure error 
       
   890 @SYMTestExpectedResults Test must not fail
       
   891 @SYMREQ                 REQ0000
       
   892 */
       
   893 LOCAL_C void TestViewCountWithLogServFailL(CLogClient& aClient)
       
   894 	{
       
   895 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0985 "));
       
   896 	CTestActive* active = new(ELeave)CTestActive;
       
   897 	CleanupStack::PushL(active);
       
   898 
       
   899 	CLogEvent* event = CLogEvent::NewL();
       
   900 	CleanupStack::PushL(event);
       
   901 	event->SetEventType(KLogCallEventTypeUid);
       
   902 
       
   903 	// Add an event
       
   904 	aClient.AddEvent(*event, active->iStatus);
       
   905 	active->StartL();
       
   906 	CActiveScheduler::Start();
       
   907 	TEST2(active->iStatus.Int(), KErrNone);
       
   908 
       
   909 	CLogViewEvent* view = CLogViewEvent::NewL(aClient);
       
   910 	CleanupStack::PushL(view);
       
   911 
       
   912 	CLogFilter* filter = CLogFilter::NewL();
       
   913 	CleanupStack::PushL(filter);
       
   914 
       
   915 	TEST(view->SetFilterL(*filter, active->iStatus));
       
   916 	active->StartL();
       
   917 	CActiveScheduler::Start();
       
   918 	TEST2(active->iStatus.Int(), KErrNone);
       
   919 
       
   920 	TInt failCount = 0;
       
   921 	TBool finished = EFalse;
       
   922 	TInt error;
       
   923 
       
   924 	while(!finished)
       
   925 		{
       
   926 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
   927 
       
   928 		TInt result = 0;
       
   929 		TRAP(error, result = view->CountL());
       
   930 		
       
   931 		if (!error)
       
   932 			{
       
   933 			finished = ETrue;
       
   934 			TEST(result > 0);
       
   935 			}
       
   936 		else
       
   937 			TEST2(error, KErrNoMemory);
       
   938 
       
   939 		__LOGSERV_UHEAP_RESET;
       
   940 		}
       
   941 
       
   942 	CleanupStack::PopAndDestroy(4); // filter, view, event, active
       
   943 	}
       
   944 
       
   945 /**
       
   946 @SYMTestCaseID          SYSLIB-LOGENG-CT-0986
       
   947 @SYMTestCaseDesc	    Tests for CLogViewRecent::RemoveL() function
       
   948 @SYMTestPriority 	    High
       
   949 @SYMTestActions  	    Test for removing the event with the specified unique event ID from the view
       
   950 						Check for log server failure error
       
   951 @SYMTestExpectedResults Test must not fail
       
   952 @SYMREQ                 REQ0000
       
   953 */
       
   954 LOCAL_C void TestRecentViewRemoveWithLogServFailL(CLogClient& aClient)
       
   955 	{
       
   956 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0986 "));
       
   957 	CTestActive* active = new(ELeave)CTestActive;
       
   958 	CleanupStack::PushL(active);
       
   959 
       
   960 	CLogEvent* event = CLogEvent::NewL();
       
   961 	CleanupStack::PushL(event);
       
   962 
       
   963 	// Incoming
       
   964 	TLogString buf;
       
   965 	aClient.GetString(buf, R_LOG_DIR_IN);
       
   966 
       
   967 	event->SetEventType(KLogCallEventTypeUid);
       
   968 	event->SetDirection(buf);
       
   969 	event->SetContact(1);
       
   970 
       
   971 	// Add events
       
   972 	aClient.AddEvent(*event, active->iStatus);
       
   973 	active->StartL();
       
   974 	CActiveScheduler::Start();
       
   975 	TEST2(active->iStatus.Int(), KErrNone);
       
   976 
       
   977 	event->SetContact(2);
       
   978 
       
   979 	aClient.AddEvent(*event, active->iStatus);
       
   980 	active->StartL();
       
   981 	CActiveScheduler::Start();
       
   982 	TEST2(active->iStatus.Int(), KErrNone);
       
   983 
       
   984 	event->SetContact(3);
       
   985 
       
   986 	aClient.AddEvent(*event, active->iStatus);
       
   987 	active->StartL();
       
   988 	CActiveScheduler::Start();
       
   989 	TEST2(active->iStatus.Int(), KErrNone);
       
   990 
       
   991 	CLogViewRecent* view = CLogViewRecent::NewL(aClient);
       
   992 	CleanupStack::PushL(view);
       
   993 
       
   994 	TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
       
   995 	active->StartL();
       
   996 	CActiveScheduler::Start();
       
   997 	TEST2(active->iStatus.Int(), KErrNone);
       
   998 
       
   999 	TInt count = view->CountL();
       
  1000 	TEST(count > 1);
       
  1001 
       
  1002 	TInt failCount = 0;
       
  1003 	TBool finished = EFalse;
       
  1004 	TInt error;
       
  1005 
       
  1006 	while(!finished)
       
  1007 		{
       
  1008 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
  1009 
       
  1010 		TRAP(error, view->RemoveL(view->Event().Id()));
       
  1011 
       
  1012 		__LOGSERV_UHEAP_RESET;
       
  1013 
       
  1014 		if (!error)
       
  1015 			{
       
  1016 			finished = ETrue;
       
  1017 
       
  1018 			TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
       
  1019 			active->StartL();
       
  1020 			CActiveScheduler::Start();
       
  1021 			TEST2(active->iStatus.Int(), KErrNone);
       
  1022 
       
  1023 			TEST(count == view->CountL() + 1);
       
  1024 			}
       
  1025 		else
       
  1026 			TEST2(error, KErrNoMemory);
       
  1027 		}
       
  1028 
       
  1029 	failCount = 0;
       
  1030 	finished = EFalse;
       
  1031 
       
  1032 	while(!finished)
       
  1033 		{
       
  1034 		TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
       
  1035 		active->StartL();
       
  1036 		CActiveScheduler::Start();
       
  1037 		TEST2(active->iStatus.Int(), KErrNone);
       
  1038 
       
  1039 		count = view->CountL();
       
  1040 		TEST(count > 1);
       
  1041 
       
  1042 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
  1043 
       
  1044 		TBool ret = EFalse;
       
  1045 		TRAP(error, ret = view->RemoveL(active->iStatus));
       
  1046 
       
  1047 		__LOGSERV_UHEAP_RESET;
       
  1048 
       
  1049 		if (!error)
       
  1050 			{
       
  1051 			TEST(ret);
       
  1052 
       
  1053 			active->StartL();
       
  1054 			CActiveScheduler::Start();
       
  1055 
       
  1056 			if (active->iStatus == KErrNone)
       
  1057 				{
       
  1058 				TEST(count == view->CountL() + 1);
       
  1059 				finished = ETrue;
       
  1060 				}
       
  1061 			else
       
  1062 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
  1063 			}
       
  1064 		else
       
  1065 			TEST2(error, KErrNoMemory);
       
  1066 		}
       
  1067 
       
  1068 	CleanupStack::PopAndDestroy(3); // view, event, active
       
  1069 	}
       
  1070 
       
  1071 /**
       
  1072 @SYMTestCaseID          SYSLIB-LOGENG-CT-0987
       
  1073 @SYMTestCaseDesc	    Tests for CLogViewDuplicate::RemoveL() function
       
  1074 @SYMTestPriority 	    High
       
  1075 @SYMTestActions  	    Test for removing the event with the specified unique event ID from the view.Check for memory error
       
  1076 @SYMTestExpectedResults Test must not fail
       
  1077 @SYMREQ                 REQ0000
       
  1078 */
       
  1079 LOCAL_C void TestDuplicateViewRemoveWithLogServFailL(CLogClient& aClient)
       
  1080 	{
       
  1081 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0987 "));
       
  1082 	CTestActive* active = new(ELeave)CTestActive;
       
  1083 	CleanupStack::PushL(active);
       
  1084 
       
  1085 	CLogEvent* event = CLogEvent::NewL();
       
  1086 	CleanupStack::PushL(event);
       
  1087 
       
  1088 	// Incoming
       
  1089 	TLogString buf;
       
  1090 	aClient.GetString(buf, R_LOG_DIR_IN);
       
  1091 
       
  1092 	event->SetEventType(KLogCallEventTypeUid);
       
  1093 	event->SetDirection(buf);
       
  1094 	event->SetContact(KTestContact);
       
  1095 
       
  1096 	// Add events
       
  1097 	aClient.AddEvent(*event, active->iStatus);
       
  1098 	active->StartL();
       
  1099 	CActiveScheduler::Start();
       
  1100 	TEST2(active->iStatus.Int(), KErrNone);
       
  1101 
       
  1102 	aClient.AddEvent(*event, active->iStatus);
       
  1103 	active->StartL();
       
  1104 	CActiveScheduler::Start();
       
  1105 	TEST2(active->iStatus.Int(), KErrNone);
       
  1106 
       
  1107 	aClient.AddEvent(*event, active->iStatus);
       
  1108 	active->StartL();
       
  1109 	CActiveScheduler::Start();
       
  1110 	TEST2(active->iStatus.Int(), KErrNone);
       
  1111 
       
  1112 	aClient.AddEvent(*event, active->iStatus);
       
  1113 	active->StartL();
       
  1114 	CActiveScheduler::Start();
       
  1115 	TEST2(active->iStatus.Int(), KErrNone);
       
  1116 
       
  1117 	CLogViewRecent* view = CLogViewRecent::NewL(aClient);
       
  1118 	CleanupStack::PushL(view);
       
  1119 
       
  1120 	TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus));
       
  1121 	active->StartL();
       
  1122 	CActiveScheduler::Start();
       
  1123 	TEST2(active->iStatus.Int(), KErrNone);
       
  1124 
       
  1125 	CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient);
       
  1126 	CleanupStack::PushL(duplicate);
       
  1127 
       
  1128 	TEST(view->DuplicatesL(*duplicate, active->iStatus));
       
  1129 	active->StartL();
       
  1130 	CActiveScheduler::Start();
       
  1131 	TEST2(active->iStatus.Int(), KErrNone);
       
  1132 	
       
  1133 	TInt count = duplicate->CountL();
       
  1134 	TEST(count > 0);
       
  1135 
       
  1136 	TInt failCount = 0;
       
  1137 	TBool finished = EFalse;
       
  1138 	TInt error;
       
  1139 
       
  1140 	while(!finished)
       
  1141 		{
       
  1142 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
  1143 
       
  1144 		TRAP(error, duplicate->RemoveL(duplicate->Event().Id()));
       
  1145 
       
  1146 		__LOGSERV_UHEAP_RESET;
       
  1147 
       
  1148 		if (!error)
       
  1149 			{
       
  1150 			finished = ETrue;
       
  1151 
       
  1152 			TEST(view->DuplicatesL(*duplicate, active->iStatus));
       
  1153 			active->StartL();
       
  1154 			CActiveScheduler::Start();
       
  1155 			TEST2(active->iStatus.Int(), KErrNone);
       
  1156 
       
  1157 			TEST(count == duplicate->CountL() + 1);
       
  1158 			}
       
  1159 		else
       
  1160 			TEST2(error, KErrNoMemory);
       
  1161 		}
       
  1162 
       
  1163 	failCount = 0;
       
  1164 	finished = EFalse;
       
  1165 
       
  1166 	while(!finished)
       
  1167 		{
       
  1168 		TEST(view->DuplicatesL(*duplicate, active->iStatus));
       
  1169 		active->StartL();
       
  1170 		CActiveScheduler::Start();
       
  1171 		TEST2(active->iStatus.Int(), KErrNone);
       
  1172 
       
  1173 		count = duplicate->CountL();
       
  1174 
       
  1175 		__LOGSERV_UHEAP_FAILNEXT(failCount++);
       
  1176 
       
  1177 		TBool ret = EFalse;
       
  1178 		TRAP(error, ret = duplicate->RemoveL(active->iStatus));
       
  1179 
       
  1180 		__LOGSERV_UHEAP_RESET;
       
  1181 
       
  1182 		if (!error)
       
  1183 			{
       
  1184 			if (ret)
       
  1185 				{
       
  1186 				active->StartL();
       
  1187 				CActiveScheduler::Start();
       
  1188 				}
       
  1189 
       
  1190 			if (!ret || active->iStatus == KErrNone)
       
  1191 				{
       
  1192 				finished = ETrue;
       
  1193 				TEST(count == duplicate->CountL() + 1);
       
  1194 				}
       
  1195 			else
       
  1196 				TEST2(active->iStatus.Int(), KErrNoMemory);
       
  1197 			}
       
  1198 		else
       
  1199 			TEST2(error, KErrNoMemory);
       
  1200 		}
       
  1201 
       
  1202 	CleanupStack::PopAndDestroy(4); // duplicate, view, event, active
       
  1203 	}
       
  1204 
       
  1205 void doTestsL()
       
  1206 	{
       
  1207 	TestUtils::Initialize(_L("T_LOGVIEWFAIL3"));
       
  1208 	TestUtils::DeleteDatabaseL();
       
  1209 
       
  1210 	CLogClient* client = CLogClient::NewL(theFs);
       
  1211 	CleanupStack::PushL(client);
       
  1212 
       
  1213 	test.Start(_L("Heap Failure in Log Server"));
       
  1214 
       
  1215 	test.Next(_L("View Construction"));
       
  1216 	TestEventViewConstructWithLogServFailL(*client);
       
  1217 	TestRecentViewConstructWithLogServFailL(*client);
       
  1218 	TestDuplicateViewConstructWithLogServFailL(*client);
       
  1219 	theLog.Write(_L8("Test 1 OK\n"));
       
  1220 
       
  1221 	test.Next(_L("View Setup"));
       
  1222 	TestEventViewSetupWithLogServFailL(*client);
       
  1223 	TestRecentViewSetupWithLogServFailL(*client);
       
  1224 	TestDuplicateViewSetupWithLogServFailL(*client);
       
  1225 	theLog.Write(_L8("Test 2 OK\n"));
       
  1226 
       
  1227 	test.Next(_L("View Navigation"));
       
  1228 	TestNavigationWithLogServFailL(*client);
       
  1229 	theLog.Write(_L8("Test 3 OK\n"));
       
  1230 
       
  1231 	test.Next(_L("Other"));
       
  1232 	TestViewCountWithLogServFailL(*client);
       
  1233 	TestRecentViewRemoveWithLogServFailL(*client);
       
  1234 	TestDuplicateViewRemoveWithLogServFailL(*client);
       
  1235 	theLog.Write(_L8("Test 4 OK\n"));
       
  1236 
       
  1237 	CleanupStack::PopAndDestroy(); // client;
       
  1238 	}