loggingservices/eventlogger/test/src/t_logfile.cpp
branchRCL_3
changeset 23 26645d81f48d
parent 9 667e88a979d7
child 24 cc28652e0254
equal deleted inserted replaced
21:28839de615b4 23:26645d81f48d
   196 	TBool finished = EFalse;
   196 	TBool finished = EFalse;
   197 	TInt error;
   197 	TInt error;
   198 
   198 
   199 	while(!finished)
   199 	while(!finished)
   200 		{
   200 		{
   201         if(failCount == 4)
   201 		TheTest.Printf(_L("%d\r\n"), failCount);
       
   202 
       
   203         if(failCount > 8)
   202             {
   204             {
   203             TRAP(error, client = CLogClient::NewL(theFs));
   205             TRAP(error, client = CLogClient::NewL(theFs));
   204             TEST2(error, KErrNone);
   206             TEST2(error, KErrNone);
   205             TestBasicL(*client);
   207             TestBasicL(*client);
   206             finished = ETrue;
   208             finished = ETrue;
   207             continue;
   209             continue;
   208             }
   210             }
   209 
   211 		
   210 		__FILE_FAILNEXT(++failCount);
   212 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
   211 
   213 
   212 		TRAP(error, client = CLogClient::NewL(theFs));
   214 		TRAP(error, client = CLogClient::NewL(theFs));
   213 
   215 
   214 		__FILE_RESET;
   216 		__FILE_RESET;
   215 
   217 
   218 			finished = ETrue;
   220 			finished = ETrue;
   219 			TestBasicL(*client);
   221 			TestBasicL(*client);
   220 			}
   222 			}
   221 		else
   223 		else
   222 			{
   224 			{
   223 			TEST2(error, KErrGeneral);
   225 			TEST2(error, KErrNoMemory);
   224 			TestUtils::DeleteDatabaseL();
   226 			TestUtils::DeleteDatabaseL();
   225 			}
   227 			}
   226 		}
   228 		}
   227 
   229 
   228 	delete client;
   230 	delete client;
   229 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
   231 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
   230 	}
   232 	}
   231 
   233 
   232 /**
   234 /**
   233 @SYMTestCaseID          SYSLIB-LOGENG-CT-0912
   235 @SYMTestCaseID          SYSLIB-LOGENG-CT-0912
   234 @SYMTestCaseDesc	    Adding an event type test,
   236 @SYMTestCaseDesc	    Adding an event type test,
   256 	TInt error;
   258 	TInt error;
   257 
   259 
   258 	while(!finished)
   260 	while(!finished)
   259 		{
   261 		{
   260 		error = KErrNone;
   262 		error = KErrNone;
   261 
   263         if(failCount == 8)
   262         if(failCount == 4)
       
   263             {
   264             {
   264             aClient.AddEventType(*type, active->iStatus);
   265             aClient.AddEventType(*type, active->iStatus);
   265             active->StartL();
   266             active->StartL();
   266             CActiveScheduler::Start();
   267             CActiveScheduler::Start();
   267             TEST2(active->iStatus.Int(), KErrNone);
   268             TEST2(active->iStatus.Int(), KErrNone);
   268             finished = ETrue;
   269             finished = ETrue;
   269             continue;
   270             continue;
   270             }
   271             }
       
   272 
       
   273 		TheTest.Printf(_L("%d  \r"), failCount);
       
   274         
       
   275 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
   271 		
   276 		
   272 		__FILE_FAILNEXT(++failCount);
       
   273 
       
   274 		aClient.AddEventType(*type, active->iStatus);
   277 		aClient.AddEventType(*type, active->iStatus);
   275 	
   278 	
   276 		active->StartL();
   279 		active->StartL();
   277 		CActiveScheduler::Start();
   280 		CActiveScheduler::Start();
   278 		
   281 		
   281 		else
   284 		else
   282 			error = active->iStatus.Int();
   285 			error = active->iStatus.Int();
   283 
   286 
   284 		__FILE_RESET;
   287 		__FILE_RESET;
   285 
   288 
   286 		if (error == KErrGeneral)
   289 		if (error == KErrNoMemory)
   287 			{
   290 			{
   288 			active->StartL();
   291 			active->StartL();
   289 			aClient.GetEventType(*type, active->iStatus);
   292 			aClient.GetEventType(*type, active->iStatus);
   290 			CActiveScheduler::Start();
   293 			CActiveScheduler::Start();
   291 			TEST2(active->iStatus.Int(), KErrNotFound);
   294 			TEST2(active->iStatus.Int(), KErrNotFound);
   299 	aClient.AddEventType(*type, active->iStatus);
   302 	aClient.AddEventType(*type, active->iStatus);
   300 	CActiveScheduler::Start();
   303 	CActiveScheduler::Start();
   301 	TEST2(active->iStatus.Int(), KErrAlreadyExists);
   304 	TEST2(active->iStatus.Int(), KErrAlreadyExists);
   302 
   305 
   303 	CleanupStack::PopAndDestroy(2); // active, type
   306 	CleanupStack::PopAndDestroy(2); // active, type
   304 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
   307 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
   305 	}
   308 	}
   306 
   309 
   307 /**
   310 /**
   308 @SYMTestCaseID          SYSLIB-LOGENG-CT-0913
   311 @SYMTestCaseID          SYSLIB-LOGENG-CT-0913
   309 @SYMTestCaseDesc	    Getting an event type test.
   312 @SYMTestCaseDesc	    Getting an event type test.
   327 	TInt failCount = 0;
   330 	TInt failCount = 0;
   328 	TBool finished = EFalse;
   331 	TBool finished = EFalse;
   329 
   332 
   330 	while(!finished)
   333 	while(!finished)
   331 		{
   334 		{
   332 		__FILE_FAILNEXT(++failCount);
   335 		TheTest.Printf(_L("%d  \r"), failCount);
       
   336 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
   333 
   337 
   334 		aClient.GetEventType(*type, active->iStatus);
   338 		aClient.GetEventType(*type, active->iStatus);
   335 
   339 
   336 		active->StartL();
   340 		active->StartL();
   337 		CActiveScheduler::Start();
   341 		CActiveScheduler::Start();
   338 		
   342 		
   339 		if (active->iStatus == KErrNone)
   343 		if (active->iStatus == KErrNone)
   340 			finished = ETrue;
   344 			finished = ETrue;
   341 		else
   345 		else
   342 			{
   346 			{
   343 			TEST2(active->iStatus.Int(), KErrGeneral);
   347 			TEST2(active->iStatus.Int(), KErrNoMemory);
   344 			TEST(type->Description() == KNullDesC);
   348 			TEST(type->Description() == KNullDesC);
   345 			}
   349 			}
   346 
   350 
   347 		__FILE_RESET;
   351 		__FILE_RESET;
   348 		}
   352 		}
   350 	TEST(type->Uid() == KTestEventUid);
   354 	TEST(type->Uid() == KTestEventUid);
   351 	TEST(type->Description() == KTestEventDesc1);
   355 	TEST(type->Description() == KTestEventDesc1);
   352 	TEST(type->LoggingEnabled());
   356 	TEST(type->LoggingEnabled());
   353 
   357 
   354 	CleanupStack::PopAndDestroy(2); // active, type
   358 	CleanupStack::PopAndDestroy(2); // active, type
   355 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
   359 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
   356 	}
   360 	}
   357 
   361 
   358 /**
   362 /**
   359 @SYMTestCaseID          SYSLIB-LOGENG-CT-0914
   363 @SYMTestCaseID          SYSLIB-LOGENG-CT-0914
   360 @SYMTestCaseDesc	    Changing an event type test,
   364 @SYMTestCaseDesc	    Changing an event type test,
   384 		error = KErrNone;
   388 		error = KErrNone;
   385 
   389 
   386 		type->SetDescription(KTestEventDesc2);
   390 		type->SetDescription(KTestEventDesc2);
   387 		type->SetLoggingEnabled(EFalse);
   391 		type->SetLoggingEnabled(EFalse);
   388 
   392 
   389         if(failCount == 3)
   393         if(failCount == 8)
   390             {
   394             {
   391             aClient.ChangeEventType(*type, active->iStatus);
   395             aClient.ChangeEventType(*type, active->iStatus);
   392             active->StartL();
   396             active->StartL();
   393             CActiveScheduler::Start();
   397             CActiveScheduler::Start();
   394             TEST2(active->iStatus.Int(), KErrNone);
   398             TEST2(active->iStatus.Int(), KErrNone);
   395             finished = ETrue;
   399             finished = ETrue;
   396             continue;
   400             continue;
   397             }
   401             }
   398 		
   402 		
   399 		__FILE_FAILNEXT(++failCount);
   403 		TheTest.Printf(_L("%d  \r"), failCount);
       
   404 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
   400 
   405 
   401 		aClient.ChangeEventType(*type, active->iStatus);
   406 		aClient.ChangeEventType(*type, active->iStatus);
   402 
   407 
   403 		active->StartL();
   408 		active->StartL();
   404 		CActiveScheduler::Start();
   409 		CActiveScheduler::Start();
   408 		else
   413 		else
   409 			error = active->iStatus.Int();
   414 			error = active->iStatus.Int();
   410 
   415 
   411 		__FILE_RESET;
   416 		__FILE_RESET;
   412 
   417 
   413 		if (error == KErrGeneral)
   418 		if (error == KErrNoMemory)
   414 			{
   419 			{
   415 			active->StartL();
   420 			active->StartL();
   416 			aClient.GetEventType(*type, active->iStatus);
   421 			aClient.GetEventType(*type, active->iStatus);
   417 			CActiveScheduler::Start();
   422 			CActiveScheduler::Start();
   418 			TEST2(active->iStatus.Int(), KErrNone);
   423 			TEST2(active->iStatus.Int(), KErrNone);
   434 	TEST(type->Uid() == KTestEventUid);
   439 	TEST(type->Uid() == KTestEventUid);
   435 	TEST(type->Description() == KTestEventDesc2);
   440 	TEST(type->Description() == KTestEventDesc2);
   436 	TEST(type->LoggingEnabled() == EFalse);
   441 	TEST(type->LoggingEnabled() == EFalse);
   437 
   442 
   438 	CleanupStack::PopAndDestroy(2); // type, active
   443 	CleanupStack::PopAndDestroy(2); // type, active
   439 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
   444 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
   440 	}
   445 	}
   441 
   446 
   442 /**
   447 /**
   443 @SYMTestCaseID          SYSLIB-LOGENG-CT-0915
   448 @SYMTestCaseID          SYSLIB-LOGENG-CT-0915
   444 @SYMTestCaseDesc	    Deleting an event type test
   449 @SYMTestCaseDesc	    Deleting an event type test
   465 
   470 
   466 	while(!finished)
   471 	while(!finished)
   467 		{
   472 		{
   468 		error = KErrNone;
   473 		error = KErrNone;
   469 
   474 
   470         if(failCount == 3)
   475         if(failCount == 8)
   471             {
   476             {
   472             aClient.DeleteEventType(KTestEventUid, active->iStatus);
   477             aClient.DeleteEventType(KTestEventUid, active->iStatus);
   473             active->StartL();
   478             active->StartL();
   474             CActiveScheduler::Start();
   479             CActiveScheduler::Start();
   475             TEST2(active->iStatus.Int(), KErrNone);
   480             TEST2(active->iStatus.Int(), KErrNone);
   476             finished = ETrue;
   481             finished = ETrue;
   477             continue;
   482             continue;
   478             }
   483             }
   479 		
   484 		
   480 		__FILE_FAILNEXT(++failCount);
   485 		TheTest.Printf(_L("%d  \r"), failCount);
       
   486 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
   481 
   487 
   482 		aClient.DeleteEventType(KTestEventUid, active->iStatus);
   488 		aClient.DeleteEventType(KTestEventUid, active->iStatus);
   483 
   489 
   484 		active->StartL();
   490 		active->StartL();
   485 		CActiveScheduler::Start();
   491 		CActiveScheduler::Start();
   489 		else
   495 		else
   490 			error = active->iStatus.Int();
   496 			error = active->iStatus.Int();
   491 
   497 
   492 		__FILE_RESET;
   498 		__FILE_RESET;
   493 
   499 
   494 		if (error == KErrGeneral)
   500 		if (error == KErrNoMemory)
   495 			{
   501 			{
   496 			active->StartL();
   502 			active->StartL();
   497 			aClient.GetEventType(*type, active->iStatus);
   503 			aClient.GetEventType(*type, active->iStatus);
   498 			CActiveScheduler::Start();
   504 			CActiveScheduler::Start();
   499 			TEST2(active->iStatus.Int(), KErrNone);
   505 			TEST2(active->iStatus.Int(), KErrNone);
   506 	aClient.GetEventType(*type, active->iStatus);
   512 	aClient.GetEventType(*type, active->iStatus);
   507 	CActiveScheduler::Start();
   513 	CActiveScheduler::Start();
   508 	TEST2(active->iStatus.Int(), KErrNotFound);
   514 	TEST2(active->iStatus.Int(), KErrNotFound);
   509 
   515 
   510 	CleanupStack::PopAndDestroy(2); // type, active
   516 	CleanupStack::PopAndDestroy(2); // type, active
   511 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
   517 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
   512 	}
   518 	}
   513 
   519 
   514 /**
   520 /**
   515 @SYMTestCaseID          SYSLIB-LOGENG-CT-0916
   521 @SYMTestCaseID          SYSLIB-LOGENG-CT-0916
   516 @SYMTestCaseDesc	    Adding an event test,
   522 @SYMTestCaseDesc	    Adding an event test,
   566 
   572 
   567 	while(!finished)
   573 	while(!finished)
   568 		{
   574 		{
   569 		error = KErrNone;
   575 		error = KErrNone;
   570 
   576 
   571         if(failCount == 3)
   577         if(failCount == 8)
   572             {
   578             {
   573             aClient.AddEvent(*event, active->iStatus);
   579             aClient.AddEvent(*event, active->iStatus);
   574             active->StartL();
   580             active->StartL();
   575             CActiveScheduler::Start();
   581             CActiveScheduler::Start();
   576             TEST2(active->iStatus.Int(), KErrNone);
   582             TEST2(active->iStatus.Int(), KErrNone);
   577             finished = ETrue;
   583             finished = ETrue;
   578             continue;
   584             continue;
   579             }
   585             }
   580 
   586 
   581 		__FILE_FAILNEXT(++failCount);
   587 		TheTest.Printf(_L("%d  \r"), failCount);
       
   588 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
   582 		aClient.AddEvent(*event, active->iStatus);
   589 		aClient.AddEvent(*event, active->iStatus);
   583 
   590 
   584 		active->StartL();
   591 		active->StartL();
   585 		CActiveScheduler::Start();
   592 		CActiveScheduler::Start();
   586 
   593 
   589 		else
   596 		else
   590 			error = active->iStatus.Int();
   597 			error = active->iStatus.Int();
   591 
   598 
   592 		__FILE_RESET;
   599 		__FILE_RESET;
   593 
   600 
   594 		if (error == KErrGeneral)
   601 		if (error == KErrNoMemory)
   595 			{
   602 			{
   596 			TEST2(error, KErrGeneral);
       
   597 			event->SetId(0);
   603 			event->SetId(0);
   598 
   604 
   599 			active->StartL();
   605 			active->StartL();
   600 			aClient.GetEvent(*event, active->iStatus);
   606 			aClient.GetEvent(*event, active->iStatus);
   601 			CActiveScheduler::Start();
   607 			CActiveScheduler::Start();
   615 	aClient.GetEvent(*event, active->iStatus);
   621 	aClient.GetEvent(*event, active->iStatus);
   616 	CActiveScheduler::Start();
   622 	CActiveScheduler::Start();
   617 	TEST2(active->iStatus.Int(), KErrNone);
   623 	TEST2(active->iStatus.Int(), KErrNone);
   618 
   624 
   619 	CleanupStack::PopAndDestroy(3); // event, active, type
   625 	CleanupStack::PopAndDestroy(3); // event, active, type
   620 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
   626 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
   621 	}
   627 	}
   622 
   628 
   623 /**
   629 /**
   624 @SYMTestCaseID          SYSLIB-LOGENG-CT-0917
   630 @SYMTestCaseID          SYSLIB-LOGENG-CT-0917
   625 @SYMTestCaseDesc	    Get an events' information test
   631 @SYMTestCaseDesc	    Get an events' information test
   644 	TInt failCount = 0;
   650 	TInt failCount = 0;
   645 	TBool finished = EFalse;
   651 	TBool finished = EFalse;
   646 
   652 
   647 	while(!finished)
   653 	while(!finished)
   648 		{
   654 		{
   649 		__FILE_FAILNEXT(++failCount);
   655 		TheTest.Printf(_L("%d  \r"), failCount);
       
   656 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
   650 		aClient.GetEvent(*event, active->iStatus);
   657 		aClient.GetEvent(*event, active->iStatus);
   651 
   658 
   652 		active->StartL();
   659 		active->StartL();
   653 		CActiveScheduler::Start();
   660 		CActiveScheduler::Start();
   654 
   661 
   655 		if (active->iStatus == KErrNone)
   662 		if (active->iStatus == KErrNone)
   656 			finished = ETrue;
   663 			finished = ETrue;
   657 		else
   664 		else
   658 			TEST2(active->iStatus.Int(), KErrGeneral);
   665 			TEST2(active->iStatus.Int(), KErrNoMemory);
   659 
   666 
   660 		__FILE_RESET;
   667 		__FILE_RESET;
   661 		}
   668 		}
   662 
   669 
   663 	TEST(event->Id() == 0);
   670 	TEST(event->Id() == 0);
   674 	TEST(event->Contact() == KTestContact1);
   681 	TEST(event->Contact() == KTestContact1);
   675 	TEST(event->Link() == KTestLink1);
   682 	TEST(event->Link() == KTestLink1);
   676 	TEST(event->Data() == KTestData1);
   683 	TEST(event->Data() == KTestData1);
   677 
   684 
   678 	CleanupStack::PopAndDestroy(2); // event, active
   685 	CleanupStack::PopAndDestroy(2); // event, active
   679 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
   686 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
   680 	}
   687 	}
   681 
   688 
   682 /**
   689 /**
   683 @SYMTestCaseID          SYSLIB-LOGENG-CT-0918
   690 @SYMTestCaseID          SYSLIB-LOGENG-CT-0918
   684 @SYMTestCaseDesc	    Changing an event type test
   691 @SYMTestCaseDesc	    Changing an event type test
   720 		event->SetNumber(KTestNumber2);
   727 		event->SetNumber(KTestNumber2);
   721 		event->SetContact(KTestContact2);
   728 		event->SetContact(KTestContact2);
   722 		event->SetLink(KTestLink2);
   729 		event->SetLink(KTestLink2);
   723 		event->SetDataL(KTestData2);
   730 		event->SetDataL(KTestData2);
   724 
   731 
   725         if(failCount == 3)
   732         if(failCount == 14)
   726             {
   733             {
   727             aClient.ChangeEvent(*event, active->iStatus);
   734             aClient.ChangeEvent(*event, active->iStatus);
   728             active->StartL();
   735             active->StartL();
   729             CActiveScheduler::Start();
   736             CActiveScheduler::Start();
   730             TEST2(active->iStatus.Int(), KErrNone);
   737             TEST2(active->iStatus.Int(), KErrNone);
   731             finished = ETrue;
   738             finished = ETrue;
   732             continue;
   739             continue;
   733             }
   740             }
   734 		
   741 		
   735 		__FILE_FAILNEXT(++failCount);
   742 		TheTest.Printf(_L("%d  \r"), failCount);
       
   743 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
   736 
   744 
   737 		aClient.ChangeEvent(*event, active->iStatus);
   745 		aClient.ChangeEvent(*event, active->iStatus);
   738 
   746 
   739 		active->StartL();
   747 		active->StartL();
   740 		CActiveScheduler::Start();
   748 		CActiveScheduler::Start();
   743 		else
   751 		else
   744 			error = active->iStatus.Int();
   752 			error = active->iStatus.Int();
   745 
   753 
   746 		__FILE_RESET;
   754 		__FILE_RESET;
   747 
   755 
   748 		if (error == KErrGeneral)
   756 		if (error == KErrNoMemory)
   749 			{
   757 			{
   750 			active->StartL();
   758 			active->StartL();
   751 			aClient.GetEvent(*event, active->iStatus);
   759 			aClient.GetEvent(*event, active->iStatus);
   752 			CActiveScheduler::Start();
   760 			CActiveScheduler::Start();
   753 			if (active->iStatus != KErrNone) 
   761 			if (active->iStatus != KErrNone) 
   754 			    TheTest.Printf(_L("error code:%d failcount:%d\n"),active->iStatus.Int(),failCount);
   762 			    TheTest.Printf(_L("\nerror code:%d failcount:%d\n"),active->iStatus.Int(),failCount);
   755 			TEST2(active->iStatus.Int(), KErrNone);
   763 			TEST2(active->iStatus.Int(), KErrNone);
   756 
   764 
   757 			TEST(event->Id() == 0);
   765 			TEST(event->Id() == 0);
   758 			TEST(event->Time() > TTime(0));
   766 			TEST(event->Time() > TTime(0));
   759 			TEST(event->Description() == KTestEventDesc1);
   767 			TEST(event->Description() == KTestEventDesc1);
   792 	TEST(event->Contact() == KTestContact2);
   800 	TEST(event->Contact() == KTestContact2);
   793 	TEST(event->Link() == KTestLink2);
   801 	TEST(event->Link() == KTestLink2);
   794 	TEST(event->Data() == KTestData2);
   802 	TEST(event->Data() == KTestData2);
   795 
   803 
   796 	CleanupStack::PopAndDestroy(2); // event, active
   804 	CleanupStack::PopAndDestroy(2); // event, active
   797 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
   805 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
   798 	}
   806 	}
   799 
   807 
   800 /**
   808 /**
   801 @SYMTestCaseID          SYSLIB-LOGENG-CT-0919
   809 @SYMTestCaseID          SYSLIB-LOGENG-CT-0919
   802 @SYMTestCaseDesc	    Deleting an event test,
   810 @SYMTestCaseDesc	    Deleting an event test,
   824 
   832 
   825 	while(!finished)
   833 	while(!finished)
   826 		{
   834 		{
   827 		error = KErrNone;
   835 		error = KErrNone;
   828 
   836 
   829         if(failCount == 6)
   837         if(failCount == 10)
   830             {
   838             {
   831             aClient.DeleteEvent(0, active->iStatus);
   839             aClient.DeleteEvent(0, active->iStatus);
   832             active->StartL();
   840             active->StartL();
   833             CActiveScheduler::Start();
   841             CActiveScheduler::Start();
   834             TEST2(active->iStatus.Int(), KErrNone);
   842             TEST2(active->iStatus.Int(), KErrNone);
   835             finished = ETrue;
   843             finished = ETrue;
   836             continue;
   844             continue;
   837             }
   845             }
   838 		
   846 		
   839 		__FILE_FAILNEXT(++failCount);
   847 		TheTest.Printf(_L("%d  \r"), failCount);
       
   848 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
   840 
   849 
   841 		aClient.DeleteEvent(0, active->iStatus);
   850 		aClient.DeleteEvent(0, active->iStatus);
   842 
   851 
   843 		active->StartL();
   852 		active->StartL();
   844 		CActiveScheduler::Start();
   853 		CActiveScheduler::Start();
   848 		else
   857 		else
   849 			error = active->iStatus.Int();
   858 			error = active->iStatus.Int();
   850 
   859 
   851 		__FILE_RESET;
   860 		__FILE_RESET;
   852 
   861 
   853 		if (error == KErrGeneral)
   862 		if (error == KErrNoMemory)
   854 			{
   863 			{
   855 			active->StartL();
   864 			active->StartL();
   856 			aClient.GetEvent(*event, active->iStatus);
   865 			aClient.GetEvent(*event, active->iStatus);
   857 			CActiveScheduler::Start();
   866 			CActiveScheduler::Start();
   858 			TEST2(active->iStatus.Int(), KErrNone);
   867 			TEST2(active->iStatus.Int(), KErrNone);
   865 	aClient.GetEvent(*event, active->iStatus);
   874 	aClient.GetEvent(*event, active->iStatus);
   866 	CActiveScheduler::Start();
   875 	CActiveScheduler::Start();
   867 	TEST2(active->iStatus.Int(), KErrNotFound);
   876 	TEST2(active->iStatus.Int(), KErrNotFound);
   868 
   877 
   869 	CleanupStack::PopAndDestroy(2); // event, active
   878 	CleanupStack::PopAndDestroy(2); // event, active
   870 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
   879 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
   871 	}
   880 	}
   872 
   881 
   873 /**
   882 /**
   874 @SYMTestCaseID          SYSLIB-LOGENG-CT-0920
   883 @SYMTestCaseID          SYSLIB-LOGENG-CT-0920
   875 @SYMTestCaseDesc	    Getting the Log Engine configuration information test
   884 @SYMTestCaseDesc	    Getting the Log Engine configuration information test
   895 	TInt failCount = 0;
   904 	TInt failCount = 0;
   896 	TBool finished = EFalse;
   905 	TBool finished = EFalse;
   897 
   906 
   898 	while(!finished)
   907 	while(!finished)
   899 		{
   908 		{
   900 		__FILE_FAILNEXT(++failCount);
   909 		TheTest.Printf(_L("%d  \r"), failCount);
       
   910 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
   901 		aClient.GetConfig(config, active->iStatus);
   911 		aClient.GetConfig(config, active->iStatus);
   902 
   912 
   903 		active->StartL();
   913 		active->StartL();
   904 		CActiveScheduler::Start();
   914 		CActiveScheduler::Start();
   905 
   915 
   906 		if (active->iStatus == KErrNone)
   916 		if (active->iStatus == KErrNone)
   907 			finished = ETrue;
   917 			finished = ETrue;
   908 		else
   918 		else
   909 			TEST2(active->iStatus.Int(), KErrGeneral);
   919 			TEST2(active->iStatus.Int(), KErrNoMemory);
   910 
   920 
   911 		__FILE_RESET;
   921 		__FILE_RESET;
   912 		}
   922 		}
   913 
   923 
   914 	TEST(config.iMaxEventAge > 0);
   924 	TEST(config.iMaxEventAge > 0);
   915 	TEST(config.iMaxLogSize > 0);
   925 	TEST(config.iMaxLogSize > 0);
   916 	TEST(config.iMaxRecentLogSize > 0);
   926 	TEST(config.iMaxRecentLogSize > 0);
   917 
   927 
   918 	CleanupStack::PopAndDestroy(); // active
   928 	CleanupStack::PopAndDestroy(); // active
   919 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
   929 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
   920 	}
   930 	}
   921 
   931 
   922 /**
   932 /**
   923 @SYMTestCaseID          SYSLIB-LOGENG-CT-0921
   933 @SYMTestCaseID          SYSLIB-LOGENG-CT-0921
   924 @SYMTestCaseDesc	    Changing the configuration of Log Engine test,
   934 @SYMTestCaseDesc	    Changing the configuration of Log Engine test,
   954 
   964 
   955 		config.iMaxLogSize = KTestMaxLogSize;
   965 		config.iMaxLogSize = KTestMaxLogSize;
   956 		config.iMaxRecentLogSize = KTestMaxRecentLogSize;
   966 		config.iMaxRecentLogSize = KTestMaxRecentLogSize;
   957 		config.iMaxEventAge = KTestMaxEventAge;
   967 		config.iMaxEventAge = KTestMaxEventAge;
   958 
   968 
   959         if(failCount == 4)
   969         if(failCount == 11)
   960             {
   970             {
   961             aClient.ChangeConfig(config, active->iStatus);
   971             aClient.ChangeConfig(config, active->iStatus);
   962             active->StartL();
   972             active->StartL();
   963             CActiveScheduler::Start();
   973             CActiveScheduler::Start();
   964             TEST2(active->iStatus.Int(), KErrNone);
   974             TEST2(active->iStatus.Int(), KErrNone);
   965             finished = ETrue;
   975             finished = ETrue;
   966             continue;
   976             continue;
   967             }
   977             }
   968 		
   978 		
   969 		__FILE_FAILNEXT(++failCount);
   979 		TheTest.Printf(_L("%d  \r"), failCount);
       
   980 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
   970 
   981 
   971 		aClient.ChangeConfig(config, active->iStatus);
   982 		aClient.ChangeConfig(config, active->iStatus);
   972 
   983 
   973 		active->StartL();
   984 		active->StartL();
   974 		CActiveScheduler::Start();
   985 		CActiveScheduler::Start();
   978 		else
   989 		else
   979 			error = active->iStatus.Int();
   990 			error = active->iStatus.Int();
   980 		
   991 		
   981 		__FILE_RESET;
   992 		__FILE_RESET;
   982 
   993 
   983 		if (error == KErrGeneral)
   994 		if (error == KErrNoMemory)
   984 			{
   995 			{
   985 			active->StartL();
   996 			active->StartL();
   986 			aClient.GetConfig(config, active->iStatus);
   997 			aClient.GetConfig(config, active->iStatus);
   987 			CActiveScheduler::Start();
   998 			CActiveScheduler::Start();
   988 			TEST2(active->iStatus.Int(), KErrNone);
   999 			TEST2(active->iStatus.Int(), KErrNone);
   998 	TEST(config.iMaxLogSize == KTestMaxLogSize);
  1009 	TEST(config.iMaxLogSize == KTestMaxLogSize);
   999 	TEST(config.iMaxRecentLogSize == KTestMaxRecentLogSize);
  1010 	TEST(config.iMaxRecentLogSize == KTestMaxRecentLogSize);
  1000 	TEST(config.iMaxEventAge == KTestMaxEventAge);
  1011 	TEST(config.iMaxEventAge == KTestMaxEventAge);
  1001 
  1012 
  1002 	CleanupStack::PopAndDestroy(); // active
  1013 	CleanupStack::PopAndDestroy(); // active
  1003 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
  1014 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
  1004 	}
  1015 	}
  1005 
  1016 
  1006 /**
  1017 /**
  1007 @SYMTestCaseID          SYSLIB-LOGENG-CT-0922
  1018 @SYMTestCaseID          SYSLIB-LOGENG-CT-0922
  1008 @SYMTestCaseDesc	    Getting a standard string from the specified resource file test
  1019 @SYMTestCaseDesc	    Getting a standard string from the specified resource file test
  1022 	TBool finished = EFalse;
  1033 	TBool finished = EFalse;
  1023 	TInt error;
  1034 	TInt error;
  1024 
  1035 
  1025 	while(!finished)
  1036 	while(!finished)
  1026 		{
  1037 		{
  1027 		__FILE_FAILNEXT(++failCount);
  1038 		TheTest.Printf(_L("%d  \r"), failCount);
       
  1039 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
  1028 
  1040 
  1029 		error = aClient.GetString(str, R_LOG_DIR_IN);
  1041 		error = aClient.GetString(str, R_LOG_DIR_IN);
  1030 
  1042 
  1031 		__FILE_RESET;
  1043 		__FILE_RESET;
  1032 
  1044 
  1035 			finished = ETrue;
  1047 			finished = ETrue;
  1036 			TEST(str.Length() > 0);
  1048 			TEST(str.Length() > 0);
  1037 			}
  1049 			}
  1038 		else
  1050 		else
  1039 			{
  1051 			{
  1040 			TEST2(error, KErrGeneral);
  1052 			TEST2(error, KErrNoMemory);
  1041 			TEST(str.Length() == 0);
  1053 			TEST(str.Length() == 0);
  1042 			}
  1054 			}
  1043 		}
  1055 		}
  1044 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
  1056 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
  1045 	}
  1057 	}
  1046 
  1058 
  1047 /**
  1059 /**
  1048 @SYMTestCaseID          SYSLIB-LOGENG-CT-0923
  1060 @SYMTestCaseID          SYSLIB-LOGENG-CT-0923
  1049 @SYMTestCaseDesc	    Clearing the Log Event test.
  1061 @SYMTestCaseDesc	    Clearing the Log Event test.
  1142 	TInt failCount = 0;
  1154 	TInt failCount = 0;
  1143 	TBool finished = EFalse;
  1155 	TBool finished = EFalse;
  1144 
  1156 
  1145 	while(!finished)
  1157 	while(!finished)
  1146 		{
  1158 		{
  1147 		__FILE_FAILNEXT(++failCount);
  1159 		TheTest.Printf(_L("%d  \r"), failCount);
       
  1160 		__FILE_FAILNEXT(KErrNoMemory, failCount++);
  1148 
  1161 
  1149 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM	
  1162 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM	
  1150 		if(aUseSimId)
  1163 		if(aUseSimId)
  1151 			{
  1164 			{
  1152 			aClient.ClearLog(date1, KLogNullSimId, active->iStatus);
  1165 			aClient.ClearLog(date1, KLogNullSimId, active->iStatus);
  1163 		CActiveScheduler::Start();
  1176 		CActiveScheduler::Start();
  1164 
  1177 
  1165 		if (active->iStatus == KErrNone)
  1178 		if (active->iStatus == KErrNone)
  1166 			finished = ETrue;
  1179 			finished = ETrue;
  1167 		else
  1180 		else
  1168 			TEST2(active->iStatus.Int(), KErrGeneral);
  1181 			TEST2(active->iStatus.Int(), KErrNoMemory);
  1169 		}
  1182 		}
  1170 
  1183 
  1171 	active->StartL();
  1184 	active->StartL();
  1172 	aClient.GetEvent(*event1, active->iStatus);
  1185 	aClient.GetEvent(*event1, active->iStatus);
  1173 	CActiveScheduler::Start();
  1186 	CActiveScheduler::Start();
  1204 	aClient.GetEvent(*event2, active->iStatus);
  1217 	aClient.GetEvent(*event2, active->iStatus);
  1205 	CActiveScheduler::Start();
  1218 	CActiveScheduler::Start();
  1206 	TEST2(active->iStatus.Int(), KErrNotFound);
  1219 	TEST2(active->iStatus.Int(), KErrNotFound);
  1207 
  1220 
  1208 	CleanupStack::PopAndDestroy(5); // event4, event3, event2, event1, active
  1221 	CleanupStack::PopAndDestroy(5); // event4, event3, event2, event1, active
  1209 	TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount);
  1222 	TheTest.Printf(_L("\r\nThe test has succeeded at iteration %d\n"), failCount);
  1210 	}
  1223 	}
  1211 
  1224 
  1212 void doTestsL()
  1225 void doTestsL()
  1213 	{
  1226 	{
  1214 	TestUtils::Initialize(_L("t_logfile"));
  1227 	TestUtils::Initialize(_L("t_logfile"));
  1215 
  1228 
  1216     TheTest.Start(_L("Construction + create db"));
  1229     TheTest.Start(_L("Construction + create db"));
  1217 	TestUtils::DeleteDatabaseL();
  1230 	TestUtils::DeleteDatabaseL();
  1218 	TestConstructionL(); // Creates database
  1231 	TestConstructionL(); // Creates database
  1219     TheTest.Next(_L("Construction + open db"));
  1232 	TheTest.Next(_L("Construction + open db"));
  1220 	TestConstructionL(); // Opens existing database
  1233 	TestConstructionL(); // Opens existing database
  1221 	TestUtils::DeleteDatabaseL();
  1234 	TestUtils::DeleteDatabaseL();
  1222 	theLog.Write(_L8("Test 1 OK\n"));
  1235 	theLog.Write(_L8("Test 1 OK\n"));
  1223 
  1236 
  1224 	CLogClient* client = CLogClient::NewL(theFs);
  1237 	CLogClient* client = CLogClient::NewL(theFs);