loggingservices/eventlogger/test/src/t_logapi.cpp
branchRCL_3
changeset 9 667e88a979d7
parent 6 5ffdb8f2067f
child 15 fcc16690f446
equal deleted inserted replaced
8:fa9941cf3867 9:667e88a979d7
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    15 
    15 
    16 #include <s32file.h>
    16 #include <s32file.h>
    17 #include <e32math.h>
    17 #include <e32math.h>
    18 #include <logview.h>
    18 #include <logview.h>
    19 #include <s32mem.h> 
    19 #include <s32mem.h> 
    20 #include "TEST.H"
    20 #include "t_logutil2.h"
    21 
    21 
    22 #define UNUSED_VAR(a) a = a
    22 #define UNUSED_VAR(a) a = a
    23 
       
    24 #undef test  //there is a "test" macro which hides "RTest test" declaration.
       
    25 
    23 
    26 const TLogContactItemId KTestContact = 0x1234;
    24 const TLogContactItemId KTestContact = 0x1234;
    27 const TInt KTestEventNum = 10;
    25 const TInt KTestEventNum = 10;
    28 
    26 
    29 RTest test(_L("Log Client Basic API Test Harness"));
    27 RTest TheTest(_L("t_logapi"));
    30 
    28 
    31 const TUid KTestEventUid = {0x10005393};
    29 const TUid KTestEventUid = {0x10005393};
    32 _LIT(KTestEventDesc1, "Event Type Description");
    30 _LIT(KTestEventDesc1, "Event Type Description");
    33 _LIT(KTestEventDesc2, "Changed Event Description");
    31 _LIT(KTestEventDesc2, "Changed Event Description");
    34 _LIT(KTestRemoteParty1, "Remote Party");
    32 _LIT(KTestRemoteParty1, "Remote Party");
    58 const TLogAge KTestMaxEventAge = 0xFFFFFFF;
    56 const TLogAge KTestMaxEventAge = 0xFFFFFFF;
    59 
    57 
    60 TInt gTheId;
    58 TInt gTheId;
    61 
    59 
    62 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    60 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    63 ////////////////////  Thread panic macros   ////////////////////////////////////////////////////////////////////////
       
    64 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
       
    65 
       
    66 static void ThrCheck1(TInt aValue, TInt aLine)
       
    67 	{
       
    68 	if(!aValue)
       
    69 		{
       
    70 		RDebug::Print(_L("*** Line %d. Boolean expression evaluated to false!\r\n"), aLine);
       
    71 		User::Panic(_L("ThrChk1"), 1);
       
    72 		}
       
    73 	}
       
    74 
       
    75 static void ThrCheck2(TInt aValue, TInt aExpected, TInt aLine)
       
    76 	{
       
    77 	if(aValue != aExpected)
       
    78 		{
       
    79 		RDebug::Print(_L("*** Line %d. Expected error: %d, got: %d\r\n"), aLine, aExpected, aValue);
       
    80 		User::Panic(_L("ThrChk2"), 2);
       
    81 		}
       
    82 	}
       
    83 
       
    84 #define TTEST(arg) ThrCheck1((arg), __LINE__)
       
    85 #define TTEST2(aValue, aExpected) ThrCheck2(aValue, aExpected, __LINE__)
       
    86 
       
    87 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
       
    88 
    61 
    89 class TClientObserverTestReceiver : public MLogClientChangeObserver
    62 class TClientObserverTestReceiver : public MLogClientChangeObserver
    90 	{
    63 	{
    91 public:
    64 public:
    92 	TClientObserverTestReceiver(TBool& aFlag) : iCallCount(0), iFlag(aFlag) { }
    65 	TClientObserverTestReceiver(TBool& aFlag) : iCallCount(0), iFlag(aFlag) { }
   316 LOCAL_C void TestChangeEventTypeL(CLogClient& aClient)
   289 LOCAL_C void TestChangeEventTypeL(CLogClient& aClient)
   317 //
   290 //
   318 //
   291 //
   319 //
   292 //
   320 	{
   293 	{
   321 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0836 "));
   294 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0836 "));
   322 	LOGTEXT("TestChangeEventTypeL()");	
   295 	LOGTEXT("TestChangeEventTypeL()");	
   323 	CTestActive* active = new(ELeave)CTestActive();
   296 	CTestActive* active = new(ELeave)CTestActive();
   324 	CleanupStack::PushL(active);
   297 	CleanupStack::PushL(active);
   325 
   298 
   326 	CLogEventType* type = CLogEventType::NewL();
   299 	CLogEventType* type = CLogEventType::NewL();
   374 LOCAL_C void TestDeleteEventTypeL(CLogClient& aClient)
   347 LOCAL_C void TestDeleteEventTypeL(CLogClient& aClient)
   375 //
   348 //
   376 //
   349 //
   377 //
   350 //
   378 	{
   351 	{
   379     test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0837 "));
   352 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0837 "));
   380 	LOGTEXT("TestChangeEventTypeL()");	
   353 	LOGTEXT("TestChangeEventTypeL()");	
   381 	CTestActive* active = new(ELeave)CTestActive();
   354 	CTestActive* active = new(ELeave)CTestActive();
   382 	CleanupStack::PushL(active);
   355 	CleanupStack::PushL(active);
   383 
   356 
   384 	active->StartL();
   357 	active->StartL();
   419 LOCAL_C void TestAddEventL(CLogClient& aClient)
   392 LOCAL_C void TestAddEventL(CLogClient& aClient)
   420 //
   393 //
   421 //
   394 //
   422 //
   395 //
   423 	{
   396 	{
   424 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1329 "));	
   397 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1329 "));	
   425 	CLogEventType* type = CLogEventType::NewL();
   398 	CLogEventType* type = CLogEventType::NewL();
   426 	CleanupStack::PushL(type);
   399 	CleanupStack::PushL(type);
   427 
   400 
   428 	type->SetUid(KTestEventUid);
   401 	type->SetUid(KTestEventUid);
   429 	type->SetDescription(KTestEventDesc1);
   402 	type->SetDescription(KTestEventDesc1);
   489 @SYMTestExpectedResults Test must not fail
   462 @SYMTestExpectedResults Test must not fail
   490 @SYMREQ                 REQ0000
   463 @SYMREQ                 REQ0000
   491 */
   464 */
   492 LOCAL_C void TestClientFailL()
   465 LOCAL_C void TestClientFailL()
   493 	{
   466 	{
   494 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0838 "));	
   467 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0838 "));	
   495 	CLogEvent* event = CLogEvent::NewL();
   468 	CLogEvent* event = CLogEvent::NewL();
   496 	CleanupStack::PushL(event);
   469 	CleanupStack::PushL(event);
   497 
   470 
   498 	CTestActive* active = new(ELeave)CTestActive();
   471 	CTestActive* active = new(ELeave)CTestActive();
   499 	CleanupStack::PushL(active);
   472 	CleanupStack::PushL(active);
   527 LOCAL_C void TestGetEventL(CLogClient& aClient)
   500 LOCAL_C void TestGetEventL(CLogClient& aClient)
   528 //
   501 //
   529 //
   502 //
   530 //
   503 //
   531 	{
   504 	{
   532 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0839 "));
   505 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0839 "));
   533 	CTestActive* active = new(ELeave)CTestActive();
   506 	CTestActive* active = new(ELeave)CTestActive();
   534 	CleanupStack::PushL(active);
   507 	CleanupStack::PushL(active);
   535 
   508 
   536 	CLogEvent* event = CLogEvent::NewL();
   509 	CLogEvent* event = CLogEvent::NewL();
   537 	CleanupStack::PushL(event);
   510 	CleanupStack::PushL(event);
   617 LOCAL_C void TestChangeEventL(CLogClient& aClient)
   590 LOCAL_C void TestChangeEventL(CLogClient& aClient)
   618 //
   591 //
   619 //
   592 //
   620 //
   593 //
   621 	{
   594 	{
   622 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0840 "));
   595 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0840 "));
   623 	CTestActive* active = new(ELeave)CTestActive();
   596 	CTestActive* active = new(ELeave)CTestActive();
   624 	CleanupStack::PushL(active);
   597 	CleanupStack::PushL(active);
   625 
   598 
   626 	CLogEvent* event = CLogEvent::NewL();
   599 	CLogEvent* event = CLogEvent::NewL();
   627 	CleanupStack::PushL(event);
   600 	CleanupStack::PushL(event);
   697 LOCAL_C void TestDeleteEventL(CLogClient& aClient)
   670 LOCAL_C void TestDeleteEventL(CLogClient& aClient)
   698 //
   671 //
   699 //
   672 //
   700 //
   673 //
   701 	{
   674 	{
   702 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0841 "));
   675 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0841 "));
   703 	CTestActive* active = new(ELeave)CTestActive();
   676 	CTestActive* active = new(ELeave)CTestActive();
   704 	CleanupStack::PushL(active);
   677 	CleanupStack::PushL(active);
   705 
   678 
   706 	active->StartL();
   679 	active->StartL();
   707 	aClient.DeleteEvent(0, active->iStatus);
   680 	aClient.DeleteEvent(0, active->iStatus);
   744 LOCAL_C void TestGetConfigSettingsFromRepositoryFileL(CLogClient& aClient)
   717 LOCAL_C void TestGetConfigSettingsFromRepositoryFileL(CLogClient& aClient)
   745 	{
   718 	{
   746 	//Note: if this test starts failing, then go and check the CentralRepository private data cage 
   719 	//Note: if this test starts failing, then go and check the CentralRepository private data cage 
   747 	//(c:\\private\\10202be9 or z:\\private\\10202be9) if 101f401d.txt file is there.
   720 	//(c:\\private\\10202be9 or z:\\private\\10202be9) if 101f401d.txt file is there.
   748 	//If it is then delete it and try the test again.
   721 	//If it is then delete it and try the test again.
   749 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-UT-4015 "));
   722 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-UT-4015 "));
   750 	//Get the contact match count and contact name format.This should be from resource file.
   723 	//Get the contact match count and contact name format.This should be from resource file.
   751 	TInt16 contactMatchCount;
   724 	TInt16 contactMatchCount;
   752 	TInt16 contactNameFormat;
   725 	TInt16 contactNameFormat;
   753 	RFs fs;
   726 	RFs fs;
   754 	
   727 	
   860 	process.Resume();
   833 	process.Resume();
   861 	process.Close();	 
   834 	process.Close();	 
   862 	User::After(1000);
   835 	User::After(1000);
   863 	theLog.Write(_L8("Deleting the Log engine database... \n"));	
   836 	theLog.Write(_L8("Deleting the Log engine database... \n"));	
   864 	TestUtils::DeleteDatabaseL();
   837 	TestUtils::DeleteDatabaseL();
   865 	test.Next(_L("Delay of 2 min, the necessary time to central repository to unload its cache... "));	
   838 	TheTest.Next(_L("Delay of 2 min, the necessary time to central repository to unload its cache... "));	
   866 	User::After(125000000); // Delay to time to cenrep to unload its cache.
   839 	User::After(125000000); // Delay to time to cenrep to unload its cache.
   867 	}
   840 	}
   868 #endif
   841 #endif
   869 
   842 
   870 
   843 
   879 LOCAL_C void TestGetConfigL(CLogClient& aClient)
   852 LOCAL_C void TestGetConfigL(CLogClient& aClient)
   880 //
   853 //
   881 //
   854 //
   882 //
   855 //
   883 	{
   856 	{
   884 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0842 "));
   857 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0842 "));
   885 	CTestActive* active = new(ELeave)CTestActive();
   858 	CTestActive* active = new(ELeave)CTestActive();
   886 	CleanupStack::PushL(active);
   859 	CleanupStack::PushL(active);
   887 
   860 
   888 	TLogConfig config;
   861 	TLogConfig config;
   889 
   862 
   921 LOCAL_C void TestChangeConfigL(CLogClient& aClient)
   894 LOCAL_C void TestChangeConfigL(CLogClient& aClient)
   922 //
   895 //
   923 //
   896 //
   924 //
   897 //
   925 	{
   898 	{
   926 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0843 "));
   899 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0843 "));
   927 	CTestActive* active = new(ELeave)CTestActive();
   900 	CTestActive* active = new(ELeave)CTestActive();
   928 	CleanupStack::PushL(active);
   901 	CleanupStack::PushL(active);
   929 
   902 
   930 	TLogConfig config;
   903 	TLogConfig config;
   931 
   904 
   963 LOCAL_C void TestGetStringL(CLogClient& aClient)
   936 LOCAL_C void TestGetStringL(CLogClient& aClient)
   964 //
   937 //
   965 //
   938 //
   966 //
   939 //
   967 	{
   940 	{
   968 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0844 "));
   941 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0844 "));
   969 	TBuf<KLogMaxSharedStringLength> str;
   942 	TBuf<KLogMaxSharedStringLength> str;
   970 	
   943 	
   971 	TInt err = aClient.GetString(str, R_LOG_DIR_IN);
   944 	TInt err = aClient.GetString(str, R_LOG_DIR_IN);
   972 	TEST2(err, KErrNone);
   945 	TEST2(err, KErrNone);
   973 	TEST(str.Length() > 0);
   946 	TEST(str.Length() > 0);
  1062 @SYMTestExpectedResults Test must not fail
  1035 @SYMTestExpectedResults Test must not fail
  1063 @SYMREQ                 REQ0000
  1036 @SYMREQ                 REQ0000
  1064 */
  1037 */
  1065 LOCAL_C void TestClearEventLogL(CLogClient& aClient)
  1038 LOCAL_C void TestClearEventLogL(CLogClient& aClient)
  1066 	{
  1039 	{
  1067 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0845 "));
  1040 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0845 "));
  1068 	TTime now;
  1041 	TTime now;
  1069 	now.UniversalTime();
  1042 	now.UniversalTime();
  1070 	TDateTime d = now.DateTime();
  1043 	TDateTime d = now.DateTime();
  1071 	RDebug::Print(_L("TimeNow: Y=%d, M=%d, D=%d, H=%d, M=%d, S=%d\n"), d.Year(), d.Month() + 1, d.Day() + 1, d.Hour(), d.Minute(), d.Second());
  1044 	TheTest.Printf(_L("TimeNow: Y=%d, M=%d, D=%d, H=%d, M=%d, S=%d\n"), d.Year(), d.Month() + 1, d.Day() + 1, d.Hour(), d.Minute(), d.Second());
  1072 
  1045 
  1073 	TTime date1(now);
  1046 	TTime date1(now);
  1074 	date1 -= TTimeIntervalDays(1);
  1047 	date1 -= TTimeIntervalDays(1);
  1075 
  1048 
  1076 	TTime date2(date1);
  1049 	TTime date2(date1);
  1176 	TEST2(active->iStatus.Int(), KErrNone);
  1149 	TEST2(active->iStatus.Int(), KErrNone);
  1177 
  1150 
  1178 	//////////////////////////////////////////////////////////////////////////////	
  1151 	//////////////////////////////////////////////////////////////////////////////	
  1179 	//Clear all events before (current date - 1 day).
  1152 	//Clear all events before (current date - 1 day).
  1180 	//Then cancel the operation.
  1153 	//Then cancel the operation.
  1181 	RDebug::Print(_L("=.= ClearLog 1\n"));
  1154 	TheTest.Printf(_L("=.= ClearLog 1\n"));
  1182 	active->StartL();
  1155 	active->StartL();
  1183 	aClient.ClearLog(date1, active->iStatus);
  1156 	aClient.ClearLog(date1, active->iStatus);
  1184 	aClient.Cancel();
  1157 	aClient.Cancel();
  1185 	CActiveScheduler::Start();
  1158 	CActiveScheduler::Start();
  1186 	TEST2(active->iStatus.Int(), KErrCancel);
  1159 	TEST2(active->iStatus.Int(), KErrCancel);
  1187 
  1160 
  1188 	//////////////////////////////////////////////////////////////////////////////	
  1161 	//////////////////////////////////////////////////////////////////////////////	
  1189 	//Clear all events before (current date - 1 day).
  1162 	//Clear all events before (current date - 1 day).
  1190 	//event3 and event4 should be removed.
  1163 	//event3 and event4 should be removed.
  1191 	RDebug::Print(_L("=.= ClearLog 2\n"));
  1164 	TheTest.Printf(_L("=.= ClearLog 2\n"));
  1192 	active->StartL();
  1165 	active->StartL();
  1193 	aClient.ClearLog(date1, active->iStatus);
  1166 	aClient.ClearLog(date1, active->iStatus);
  1194 	CActiveScheduler::Start();
  1167 	CActiveScheduler::Start();
  1195 	TEST2(active->iStatus.Int(), KErrNone);
  1168 	TEST2(active->iStatus.Int(), KErrNone);
  1196 
  1169 
  1197 	//////////////////////////////////////////////////////////////////////////////	
  1170 	//////////////////////////////////////////////////////////////////////////////	
  1198 	//Get event1. It should be there - its time is (current date - 1 day + 10 seconds).
  1171 	//Get event1. It should be there - its time is (current date - 1 day + 10 seconds).
  1199 	RDebug::Print(_L("=.= GetEvent 1\n"));
  1172 	TheTest.Printf(_L("=.= GetEvent 1\n"));
  1200 	active->StartL();
  1173 	active->StartL();
  1201 	aClient.GetEvent(*event1, active->iStatus);
  1174 	aClient.GetEvent(*event1, active->iStatus);
  1202 	CActiveScheduler::Start();
  1175 	CActiveScheduler::Start();
  1203 	if(active->iStatus != KErrNone) 
  1176 	if(active->iStatus != KErrNone) 
  1204 		{
  1177 		{
  1205 		RDebug::Print(_L("=1= error code:%d\n"),active->iStatus.Int());
  1178 		TheTest.Printf(_L("=1= error code:%d\n"),active->iStatus.Int());
  1206 		}
  1179 		}
  1207 	TEST2(active->iStatus.Int(), KErrNone);
  1180 	TEST2(active->iStatus.Int(), KErrNone);
  1208 
  1181 
  1209 	//////////////////////////////////////////////////////////////////////////////	
  1182 	//////////////////////////////////////////////////////////////////////////////	
  1210 	//Get event2. It should be there - its time is (current date - 1 day + 10 seconds).
  1183 	//Get event2. It should be there - its time is (current date - 1 day + 10 seconds).
  1211 	RDebug::Print(_L("=.= GetEvent 2\n"));
  1184 	TheTest.Printf(_L("=.= GetEvent 2\n"));
  1212 	active->StartL();
  1185 	active->StartL();
  1213 	aClient.GetEvent(*event2, active->iStatus);
  1186 	aClient.GetEvent(*event2, active->iStatus);
  1214 	CActiveScheduler::Start();
  1187 	CActiveScheduler::Start();
  1215 	if(active->iStatus != KErrNone) 
  1188 	if(active->iStatus != KErrNone) 
  1216 		{
  1189 		{
  1217 		RDebug::Print(_L("=2= error code:%d\n"),active->iStatus.Int());
  1190 		TheTest.Printf(_L("=2= error code:%d\n"),active->iStatus.Int());
  1218 		}
  1191 		}
  1219 	TEST2(active->iStatus.Int(), KErrNone);
  1192 	TEST2(active->iStatus.Int(), KErrNone);
  1220 
  1193 
  1221 	//////////////////////////////////////////////////////////////////////////////	
  1194 	//////////////////////////////////////////////////////////////////////////////	
  1222 	//Get event3. It should not be there - its time is (current date - 2 days).
  1195 	//Get event3. It should not be there - its time is (current date - 2 days).
  1223 	RDebug::Print(_L("=.= GetEvent 3\n"));
  1196 	TheTest.Printf(_L("=.= GetEvent 3\n"));
  1224 	active->StartL();
  1197 	active->StartL();
  1225 	aClient.GetEvent(*event3, active->iStatus);
  1198 	aClient.GetEvent(*event3, active->iStatus);
  1226 	CActiveScheduler::Start();
  1199 	CActiveScheduler::Start();
  1227 	TEST2(active->iStatus.Int(), KErrNotFound);
  1200 	TEST2(active->iStatus.Int(), KErrNotFound);
  1228 
  1201 
  1229 	//////////////////////////////////////////////////////////////////////////////	
  1202 	//////////////////////////////////////////////////////////////////////////////	
  1230 	//Get event4. It should not be there - its time is (current date - 2 days).
  1203 	//Get event4. It should not be there - its time is (current date - 2 days).
  1231 	RDebug::Print(_L("=.= GetEvent 4\n"));
  1204 	TheTest.Printf(_L("=.= GetEvent 4\n"));
  1232 	active->StartL();
  1205 	active->StartL();
  1233 	aClient.GetEvent(*event4, active->iStatus);
  1206 	aClient.GetEvent(*event4, active->iStatus);
  1234 	CActiveScheduler::Start();
  1207 	CActiveScheduler::Start();
  1235 	TEST2(active->iStatus.Int(), KErrNotFound);
  1208 	TEST2(active->iStatus.Int(), KErrNotFound);
  1236 
  1209 
  1237 	//////////////////////////////////////////////////////////////////////////////	
  1210 	//////////////////////////////////////////////////////////////////////////////	
  1238 	//Clear all events happened before (current date).
  1211 	//Clear all events happened before (current date).
  1239 	//event1 and event2 should be removed.
  1212 	//event1 and event2 should be removed.
  1240 	RDebug::Print(_L("=#= ClearLog 1\n"));
  1213 	TheTest.Printf(_L("=#= ClearLog 1\n"));
  1241 	active->StartL();
  1214 	active->StartL();
  1242 	aClient.ClearLog(now, active->iStatus);
  1215 	aClient.ClearLog(now, active->iStatus);
  1243 	CActiveScheduler::Start();
  1216 	CActiveScheduler::Start();
  1244 	TEST2(active->iStatus.Int(), KErrNone);
  1217 	TEST2(active->iStatus.Int(), KErrNone);
  1245 
  1218 
  1246 	//////////////////////////////////////////////////////////////////////////////	
  1219 	//////////////////////////////////////////////////////////////////////////////	
  1247 	//Get event1. It should not be there - its time is (current date - 1 day + 10 seconds).
  1220 	//Get event1. It should not be there - its time is (current date - 1 day + 10 seconds).
  1248 	RDebug::Print(_L("=#= GetEvent 1\n"));
  1221 	TheTest.Printf(_L("=#= GetEvent 1\n"));
  1249 	active->StartL();
  1222 	active->StartL();
  1250 	aClient.GetEvent(*event1, active->iStatus);
  1223 	aClient.GetEvent(*event1, active->iStatus);
  1251 	CActiveScheduler::Start();
  1224 	CActiveScheduler::Start();
  1252 	TEST2(active->iStatus.Int(), KErrNotFound);
  1225 	TEST2(active->iStatus.Int(), KErrNotFound);
  1253 
  1226 
  1254 	//////////////////////////////////////////////////////////////////////////////	
  1227 	//////////////////////////////////////////////////////////////////////////////	
  1255 	//Get event2. It should not be there - its time is (current date - 1 day + 10 seconds).
  1228 	//Get event2. It should not be there - its time is (current date - 1 day + 10 seconds).
  1256 	RDebug::Print(_L("=#= GetEvent 2\n"));
  1229 	TheTest.Printf(_L("=#= GetEvent 2\n"));
  1257 	active->StartL();
  1230 	active->StartL();
  1258 	aClient.GetEvent(*event2, active->iStatus);
  1231 	aClient.GetEvent(*event2, active->iStatus);
  1259 	CActiveScheduler::Start();
  1232 	CActiveScheduler::Start();
  1260 	TEST2(active->iStatus.Int(), KErrNotFound);
  1233 	TEST2(active->iStatus.Int(), KErrNotFound);
  1261 
  1234 
  1456 	{
  1429 	{
  1457 	RThread thread;
  1430 	RThread thread;
  1458 	TRequestStatus status;
  1431 	TRequestStatus status;
  1459 
  1432 
  1460 	TName name;
  1433 	TName name;
  1461 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0846 "));
  1434 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0846 "));
  1462 	_LIT(KThreadName, "Test thread");
  1435 	_LIT(KThreadName, "Test thread");
  1463 	name.Format(KThreadName);
  1436 	name.Format(KThreadName);
  1464 
  1437 
  1465 	TInt err = thread.Create(name, DoDyingThreadStart, KDefaultStackSize, KMinTestHeapSize, KMaxTestHeapSize, NULL, EOwnerThread);
  1438 	TInt err = thread.Create(name, DoDyingThreadStart, KDefaultStackSize, KMinTestHeapSize, KMaxTestHeapSize, NULL, EOwnerThread);
  1466 	// Create the thread
  1439 	// Create the thread
  1485 @SYMTestExpectedResults Test must not fail
  1458 @SYMTestExpectedResults Test must not fail
  1486 @SYMREQ                 REQ0000
  1459 @SYMREQ                 REQ0000
  1487 */
  1460 */
  1488 LOCAL_C void TestMultipleClientAccessL()
  1461 LOCAL_C void TestMultipleClientAccessL()
  1489 	{
  1462 	{
  1490 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0847 "));
  1463 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0847 "));
  1491 	RThread threadArray[KTestThreadCount];
  1464 	RThread threadArray[KTestThreadCount];
  1492 	TRequestStatus statusArray[KTestThreadCount];
  1465 	TRequestStatus statusArray[KTestThreadCount];
  1493 
  1466 
  1494 	// Create the threads
  1467 	// Create the threads
  1495 	TInt count = KTestThreadCount;
  1468 	TInt count = KTestThreadCount;
  1507 
  1480 
  1508 	// Let the thread run
  1481 	// Let the thread run
  1509 	count = KTestThreadCount;
  1482 	count = KTestThreadCount;
  1510 	while(count--)
  1483 	while(count--)
  1511 		{
  1484 		{
  1512 		RDebug::Print(_L("   ** Resume thread %d\r\n"), count);
  1485 		TheTest.Printf(_L("   ** Resume thread %d\r\n"), count);
  1513 		threadArray[count].Resume();
  1486 		threadArray[count].Resume();
  1514 		}
  1487 		}
  1515 
  1488 
  1516 	RDebug::Print(_L("   ** Waiting threads to complete....\r\n"));
  1489 	TheTest.Printf(_L("   ** Waiting threads to complete....\r\n"));
  1517 	
  1490 	
  1518 	// Wait for all the threads to complete
  1491 	// Wait for all the threads to complete
  1519 	count = KTestThreadCount;
  1492 	count = KTestThreadCount;
  1520 	while(count--)
  1493 	while(count--)
  1521 		{
  1494 		{
  1522 		User::WaitForRequest(statusArray[count]);
  1495 		User::WaitForRequest(statusArray[count]);
  1523 		RDebug::Print(_L("   ** Thread %d completed\r\n"), count);
  1496 		TheTest.Printf(_L("   ** Thread %d completed\r\n"), count);
  1524 		TEST(threadArray[count].ExitType() != EExitPanic);
  1497 		TEST(threadArray[count].ExitType() != EExitPanic);
  1525 		threadArray[count].Close();
  1498 		threadArray[count].Close();
  1526 		}
  1499 		}
  1527 	}
  1500 	}
  1528 
  1501 
  1535 @SYMREQ                 REQ0000
  1508 @SYMREQ                 REQ0000
  1536 */
  1509 */
  1537 LOCAL_C void TestNoNotifierL()
  1510 LOCAL_C void TestNoNotifierL()
  1538 	{
  1511 	{
  1539 	TestUtils::DeleteDatabaseL();
  1512 	TestUtils::DeleteDatabaseL();
  1540 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0848 "));
  1513 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0848 "));
  1541 	RDebug::Print(_L("TestNoNotifierL - begin\n"));
  1514 	TheTest.Printf(_L("TestNoNotifierL - begin\n"));
  1542 
  1515 
  1543 	CLogClient* client = CLogClient::NewL(theFs);
  1516 	CLogClient* client = CLogClient::NewL(theFs);
  1544 	CleanupStack::PushL(client);
  1517 	CleanupStack::PushL(client);
  1545 
  1518 
  1546 	CTestActive* active = new(ELeave)CTestActive;
  1519 	CTestActive* active = new(ELeave)CTestActive;
  1547 	CleanupStack::PushL(active);
  1520 	CleanupStack::PushL(active);
  1548 	
  1521 	
  1549 	RDebug::Print(_L("TestAddEventTypeL\n"));
  1522 	TheTest.Printf(_L("TestAddEventTypeL\n"));
  1550 	TestAddEventTypeL(*client);
  1523 	TestAddEventTypeL(*client);
  1551 
  1524 
  1552 	RDebug::Print(_L("TestGetEventTypeL\n"));
  1525 	TheTest.Printf(_L("TestGetEventTypeL\n"));
  1553 	TestGetEventTypeL(*client);
  1526 	TestGetEventTypeL(*client);
  1554 
  1527 
  1555 	RDebug::Print(_L("TestChangeEventTypeL\n"));
  1528 	TheTest.Printf(_L("TestChangeEventTypeL\n"));
  1556 	TestChangeEventTypeL(*client);
  1529 	TestChangeEventTypeL(*client);
  1557 
  1530 
  1558 	RDebug::Print(_L("TestDeleteEventTypeL\n"));
  1531 	TheTest.Printf(_L("TestDeleteEventTypeL\n"));
  1559 	TestDeleteEventTypeL(*client);
  1532 	TestDeleteEventTypeL(*client);
  1560 
  1533 
  1561 	RDebug::Print(_L("TestAddEventL\n"));
  1534 	TheTest.Printf(_L("TestAddEventL\n"));
  1562 	TestAddEventL(*client);
  1535 	TestAddEventL(*client);
  1563 
  1536 
  1564 	RDebug::Print(_L("TestGetEventL\n"));
  1537 	TheTest.Printf(_L("TestGetEventL\n"));
  1565 	TestGetEventL(*client);
  1538 	TestGetEventL(*client);
  1566 
  1539 
  1567 	RDebug::Print(_L("TestChangeEventL\n"));
  1540 	TheTest.Printf(_L("TestChangeEventL\n"));
  1568 	TestChangeEventL(*client);
  1541 	TestChangeEventL(*client);
  1569 
  1542 
  1570 	RDebug::Print(_L("TestDeleteEventL\n"));
  1543 	TheTest.Printf(_L("TestDeleteEventL\n"));
  1571 	TestDeleteEventL(*client);
  1544 	TestDeleteEventL(*client);
  1572 
  1545 
  1573 	RDebug::Print(_L("TestGetConfigL\n"));
  1546 	TheTest.Printf(_L("TestGetConfigL\n"));
  1574 	TestGetConfigL(*client);
  1547 	TestGetConfigL(*client);
  1575 
  1548 
  1576 	RDebug::Print(_L("TestChangeConfigL\n"));
  1549 	TheTest.Printf(_L("TestChangeConfigL\n"));
  1577 	TestChangeConfigL(*client);
  1550 	TestChangeConfigL(*client);
  1578 
  1551 
  1579 	RDebug::Print(_L("TestGetStringL\n"));
  1552 	TheTest.Printf(_L("TestGetStringL\n"));
  1580 	TestGetStringL(*client);
  1553 	TestGetStringL(*client);
  1581 
  1554 
  1582 	RDebug::Print(_L("TestClearEventLogL\n"));
  1555 	TheTest.Printf(_L("TestClearEventLogL\n"));
  1583 	TestClearEventLogL(*client);
  1556 	TestClearEventLogL(*client);
  1584 
  1557 
  1585 	CleanupStack::PopAndDestroy(2); // active, client
  1558 	CleanupStack::PopAndDestroy(2); // active, client
  1586 	RDebug::Print(_L("TestNoNotifierL - end\n"));
  1559 	TheTest.Printf(_L("TestNoNotifierL - end\n"));
  1587 	}
  1560 	}
  1588 
  1561 
  1589 /**
  1562 /**
  1590 @SYMTestCaseID          PDS-LOGENG-CT-4016
  1563 @SYMTestCaseID          PDS-LOGENG-CT-4016
  1591 @SYMTestCaseDesc	    Tests for CLogChangeDefinition public APIs
  1564 @SYMTestCaseDesc	    Tests for CLogChangeDefinition public APIs
  1595 						need to return proper items from list.
  1568 						need to return proper items from list.
  1596 @SYMDEF                 DEF135499
  1569 @SYMDEF                 DEF135499
  1597 */
  1570 */
  1598 LOCAL_C void TestLogChangeDefinitionL(CLogClient& aClient)
  1571 LOCAL_C void TestLogChangeDefinitionL(CLogClient& aClient)
  1599 	{
  1572 	{
  1600 	test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-CT-4016"));
  1573 	TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-CT-4016"));
  1601 	TestUtils::DeleteDatabaseL();
  1574 	TestUtils::DeleteDatabaseL();
  1602 
  1575 
  1603 	CLogEvent* event = CLogEvent::NewL();
  1576 	CLogEvent* event = CLogEvent::NewL();
  1604 	CleanupStack::PushL(event);
  1577 	CleanupStack::PushL(event);
  1605 
  1578 
  1655 		}
  1628 		}
  1656 
  1629 
  1657 	const CLogChangeDefinition& changes = changeObs->Changes();
  1630 	const CLogChangeDefinition& changes = changeObs->Changes();
  1658 
  1631 
  1659 	changeCount = changes.Count();
  1632 	changeCount = changes.Count();
  1660 	RDebug::Print(_L("Change Count: %d\n"), changeCount);
  1633 	TheTest.Printf(_L("Change Count: %d\n"), changeCount);
  1661 	TEST2(changeCount, KTestEventNum);
  1634 	TEST2(changeCount, KTestEventNum);
  1662 	for(TInt i=0; i<changeCount; i++)
  1635 	for(TInt i=0; i<changeCount; i++)
  1663 		{
  1636 		{
  1664 		type = changes.At(i, logId, viewIndex);
  1637 		type = changes.At(i, logId, viewIndex);
  1665 		RDebug::Print(_L("Change Type: %d, logId: %d, viewIndex: %d\n"), type, logId, viewIndex);
  1638 		TheTest.Printf(_L("Change Type: %d, logId: %d, viewIndex: %d\n"), type, logId, viewIndex);
  1666 		TEST(changes.Find(logId)==i);
  1639 		TEST(changes.Find(logId)==i);
  1667 		TEST(changes.Find(logId, ELogChangeTypeEventAdded)>=0);
  1640 		TEST(changes.Find(logId, ELogChangeTypeEventAdded)>=0);
  1668 		TEST(changes.Find(TLogId(100000000), ELogChangeTypeEventAdded)==KErrNotFound);
  1641 		TEST(changes.Find(TLogId(100000000), ELogChangeTypeEventAdded)==KErrNotFound);
  1669 		TEST(changes.Find(logId, ELogChangeTypeLogCleared)==KErrNotFound);
  1642 		TEST(changes.Find(logId, ELogChangeTypeLogCleared)==KErrNotFound);
  1670 		TEST(changes.FindByViewIndex(viewIndex)>=0);
  1643 		TEST(changes.FindByViewIndex(viewIndex)>=0);
  1734 @SYMTestExpectedResults Test must not fail
  1707 @SYMTestExpectedResults Test must not fail
  1735 @SYMREQ                 REQ0000
  1708 @SYMREQ                 REQ0000
  1736 */
  1709 */
  1737 LOCAL_C void TestStartupL()
  1710 LOCAL_C void TestStartupL()
  1738 	{
  1711 	{
  1739 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0849 "));
  1712 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0849 "));
  1740 	RThread thread1;
  1713 	RThread thread1;
  1741 	RThread thread2;
  1714 	RThread thread2;
  1742 
  1715 
  1743 	// Create the threads
  1716 	// Create the threads
  1744 	LEAVE_IF_ERROR(thread1.Create(_L("Thread1"), LaunchThread, KDefaultStackSize, KMinHeapSize , KMinHeapSize , NULL));
  1717 	LEAVE_IF_ERROR(thread1.Create(_L("Thread1"), LaunchThread, KDefaultStackSize, KMinHeapSize , KMinHeapSize , NULL));
  1773 @SYMTestExpectedResults Test must not fail
  1746 @SYMTestExpectedResults Test must not fail
  1774 @SYMREQ                 REQ0000
  1747 @SYMREQ                 REQ0000
  1775 */
  1748 */
  1776 LOCAL_C void TestInvalidSchemaL()
  1749 LOCAL_C void TestInvalidSchemaL()
  1777 	{
  1750 	{
  1778 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0850 "));
  1751 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0850 "));
  1779 	TestUtils::TestInvalidSchemaL();
  1752 	TestUtils::TestInvalidSchemaL();
  1780 	}
  1753 	}
  1781 
  1754 
  1782 void doTestsL()
  1755 void doTestsL()
  1783 	{
  1756 	{
  1784 	TestUtils::Initialize(_L("T_LOGAPI"));
  1757 	TestUtils::Initialize(_L("t_logapi"));
  1785 	
  1758 	
  1786 	// This test should be first to ensure no clients kicking around
  1759 	// This test should be first to ensure no clients kicking around
  1787 	test.Next(_L("Invalid database scheme"));
  1760 	TheTest.Next(_L("Invalid database scheme"));
  1788 	TestInvalidSchemaL();
  1761 	TestInvalidSchemaL();
  1789 	theLog.Write(_L8("Test 0 OK\n"));
  1762 	theLog.Write(_L8("Test 0 OK\n"));
  1790 
  1763 
  1791 	test.Start(_L("Simultaneous Startup"));
  1764 	TheTest.Start(_L("Simultaneous Startup"));
  1792 	TestStartupL();
  1765 	TestStartupL();
  1793 	theLog.Write(_L8("Test 1 OK\n"));
  1766 	theLog.Write(_L8("Test 1 OK\n"));
  1794 
  1767 
  1795 	CLogChangeNotifier* notifier = CLogChangeNotifier::NewL();
  1768 	CLogChangeNotifier* notifier = CLogChangeNotifier::NewL();
  1796 	CleanupStack::PushL(notifier);
  1769 	CleanupStack::PushL(notifier);
  1797 
  1770 
  1798 	test.Next(_L("Dying thread test"));
  1771 	TheTest.Next(_L("Dying thread test"));
  1799 	TestThreadDieL();
  1772 	TestThreadDieL();
  1800 	theLog.Write(_L8("Test 2 OK\n"));
  1773 	theLog.Write(_L8("Test 2 OK\n"));
  1801 	
  1774 	
  1802 	TestUtils::DeleteDatabaseL();
  1775 	TestUtils::DeleteDatabaseL();
  1803 
  1776 
  1805 	CleanupStack::PushL(client);
  1778 	CleanupStack::PushL(client);
  1806 
  1779 
  1807 	CTestActive* active = new(ELeave) CTestActive(CActive::EPriorityIdle - 500);
  1780 	CTestActive* active = new(ELeave) CTestActive(CActive::EPriorityIdle - 500);
  1808 	CleanupStack::PushL(active);
  1781 	CleanupStack::PushL(active);
  1809 	
  1782 	
  1810 	test.Next(_L("Additional tests on CLogChangeDefinition."));
  1783 	TheTest.Next(_L("Additional tests on CLogChangeDefinition."));
  1811 	TestLogChangeDefinitionL(*client);
  1784 	TestLogChangeDefinitionL(*client);
  1812 	theLog.Write(_L8("Test 2.1 OK\n"));
  1785 	theLog.Write(_L8("Test 2.1 OK\n"));
  1813 	TestUtils::DeleteDatabaseL();
  1786 	TestUtils::DeleteDatabaseL();
  1814 	
  1787 	
  1815 	test.Next(_L("Client death"));
  1788 	TheTest.Next(_L("Client death"));
  1816 	TestClientFailL();
  1789 	TestClientFailL();
  1817 	theLog.Write(_L8("Test 3 OK\n"));
  1790 	theLog.Write(_L8("Test 3 OK\n"));
  1818 
  1791 
  1819 	test.Next(_L("Testing client API"));
  1792 	TheTest.Next(_L("Testing client API"));
  1820 	TestNoNotifierL();
  1793 	TestNoNotifierL();
  1821 	theLog.Write(_L8("Test 4 OK\n"));
  1794 	theLog.Write(_L8("Test 4 OK\n"));
  1822 
  1795 
  1823 	// Delay for testing change notification
  1796 	// Delay for testing change notification
  1824 	TInt delay = 5000000;	
  1797 	TInt delay = 5000000;	
  1826 
  1799 
  1827 
  1800 
  1828 	active->StartL();
  1801 	active->StartL();
  1829 	client->NotifyChange(delay, active->iStatus);
  1802 	client->NotifyChange(delay, active->iStatus);
  1830 
  1803 
  1831 	test.Next(_L("Delete Event Type"));
  1804 	TheTest.Next(_L("Delete Event Type"));
  1832 	TestDeleteEventTypeL(*client);
  1805 	TestDeleteEventTypeL(*client);
  1833 	theLog.Write(_L8("Test 5 OK\n"));
  1806 	theLog.Write(_L8("Test 5 OK\n"));
  1834 
  1807 
  1835 	CActiveScheduler::Start();
  1808 	CActiveScheduler::Start();
  1836 	TEST(active->iStatus.Int() >= 0);
  1809 	TEST(active->iStatus.Int() >= 0);
  1837 
  1810 
  1838 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0834 Add Event Type "));
  1811 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0834 Add Event Type "));
  1839 	TestAddEventTypeL(*client);
  1812 	TestAddEventTypeL(*client);
  1840 	theLog.Write(_L8("Test 6 OK\n"));
  1813 	theLog.Write(_L8("Test 6 OK\n"));
  1841 
  1814 
  1842 	// Must delete the database before testing
  1815 	// Must delete the database before testing
  1843 	// the notification API, since we just created the
  1816 	// the notification API, since we just created the
  1856 	TEST(active->iStatus.Int() >= 0);
  1829 	TEST(active->iStatus.Int() >= 0);
  1857 	active->StartL();
  1830 	active->StartL();
  1858 	client->NotifyChange(delay, active->iStatus);
  1831 	client->NotifyChange(delay, active->iStatus);
  1859 
  1832 
  1860 	// The following doesn't make any changes
  1833 	// The following doesn't make any changes
  1861 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0835 Get Event Type "));
  1834 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0835 Get Event Type "));
  1862 	TestGetEventTypeL(*client);
  1835 	TestGetEventTypeL(*client);
  1863 	theLog.Write(_L8("Test 7 OK\n"));
  1836 	theLog.Write(_L8("Test 7 OK\n"));
  1864 
  1837 
  1865 	test.Next(_L("Change Event Type"));
  1838 	TheTest.Next(_L("Change Event Type"));
  1866 	TestChangeEventTypeL(*client);
  1839 	TestChangeEventTypeL(*client);
  1867 	theLog.Write(_L8("Test 8 OK\n"));
  1840 	theLog.Write(_L8("Test 8 OK\n"));
  1868 
  1841 
  1869 	CActiveScheduler::Start();
  1842 	CActiveScheduler::Start();
  1870 	TEST(active->iStatus.Int() >= 0);
  1843 	TEST(active->iStatus.Int() >= 0);
  1871 	active->StartL();
  1844 	active->StartL();
  1872 	client->NotifyChange(delay, active->iStatus);
  1845 	client->NotifyChange(delay, active->iStatus);
  1873 
  1846 
  1874 	test.Next(_L("Delete Event Type"));
  1847 	TheTest.Next(_L("Delete Event Type"));
  1875 	TestDeleteEventTypeL(*client);
  1848 	TestDeleteEventTypeL(*client);
  1876 	theLog.Write(_L8("Test 9 OK\n"));
  1849 	theLog.Write(_L8("Test 9 OK\n"));
  1877 
  1850 
  1878 	CActiveScheduler::Start();
  1851 	CActiveScheduler::Start();
  1879 	TEST(active->iStatus.Int() >= 0);
  1852 	TEST(active->iStatus.Int() >= 0);
  1880 	active->StartL();
  1853 	active->StartL();
  1881 	client->NotifyChange(delay, active->iStatus);
  1854 	client->NotifyChange(delay, active->iStatus);
  1882 
  1855 
  1883 	test.Next(_L("Add Event"));
  1856 	TheTest.Next(_L("Add Event"));
  1884 	TestAddEventL(*client);
  1857 	TestAddEventL(*client);
  1885 	theLog.Write(_L8("Test 10 OK\n"));
  1858 	theLog.Write(_L8("Test 10 OK\n"));
  1886 
  1859 
  1887 	CActiveScheduler::Start();
  1860 	CActiveScheduler::Start();
  1888 	TEST(active->iStatus.Int() >= 0);
  1861 	TEST(active->iStatus.Int() >= 0);
  1889 	active->StartL();
  1862 	active->StartL();
  1890 	client->NotifyChange(delay, active->iStatus);
  1863 	client->NotifyChange(delay, active->iStatus);
  1891 
  1864 
  1892 	// The following doesn't make any changes
  1865 	// The following doesn't make any changes
  1893 	test.Next(_L("Get Event"));
  1866 	TheTest.Next(_L("Get Event"));
  1894 	TestGetEventL(*client);
  1867 	TestGetEventL(*client);
  1895 	theLog.Write(_L8("Test 11 OK\n"));
  1868 	theLog.Write(_L8("Test 11 OK\n"));
  1896 
  1869 
  1897 	test.Next(_L("Change Event"));
  1870 	TheTest.Next(_L("Change Event"));
  1898 	TestChangeEventL(*client);
  1871 	TestChangeEventL(*client);
  1899 	theLog.Write(_L8("Test 12 OK\n"));
  1872 	theLog.Write(_L8("Test 12 OK\n"));
  1900 
  1873 
  1901 	CActiveScheduler::Start();
  1874 	CActiveScheduler::Start();
  1902 	TEST(active->iStatus.Int() >= 0);
  1875 	TEST(active->iStatus.Int() >= 0);
  1903 	active->StartL();
  1876 	active->StartL();
  1904 	client->NotifyChange(delay, active->iStatus);
  1877 	client->NotifyChange(delay, active->iStatus);
  1905 
  1878 
  1906 	test.Next(_L("Delete Event"));
  1879 	TheTest.Next(_L("Delete Event"));
  1907 	TestDeleteEventL(*client);
  1880 	TestDeleteEventL(*client);
  1908 	theLog.Write(_L8("Test 13 OK\n"));
  1881 	theLog.Write(_L8("Test 13 OK\n"));
  1909 
  1882 
  1910 	CActiveScheduler::Start();
  1883 	CActiveScheduler::Start();
  1911 	TEST(active->iStatus.Int() >= 0);
  1884 	TEST(active->iStatus.Int() >= 0);
  1912 	active->StartL();
  1885 	active->StartL();
  1913 	client->NotifyChange(delay, active->iStatus);
  1886 	client->NotifyChange(delay, active->iStatus);
  1914 
  1887 
  1915 	// The following doesn't make any changes
  1888 	// The following doesn't make any changes
  1916 	test.Next(_L("Get Config"));
  1889 	TheTest.Next(_L("Get Config"));
  1917 	TestGetConfigL(*client);
  1890 	TestGetConfigL(*client);
  1918 	theLog.Write(_L8("Test 14 OK\n"));
  1891 	theLog.Write(_L8("Test 14 OK\n"));
  1919 
  1892 
  1920 	test.Next(_L("Change Config"));
  1893 	TheTest.Next(_L("Change Config"));
  1921 	TestChangeConfigL(*client);
  1894 	TestChangeConfigL(*client);
  1922 	theLog.Write(_L8("Test 15 OK\n"));
  1895 	theLog.Write(_L8("Test 15 OK\n"));
  1923 
  1896 
  1924 	CActiveScheduler::Start();
  1897 	CActiveScheduler::Start();
  1925 	TEST(active->iStatus.Int() >= 0);
  1898 	TEST(active->iStatus.Int() >= 0);
  1926 	active->StartL();
  1899 	active->StartL();
  1927 	client->NotifyChange(delay*3, active->iStatus);
  1900 	client->NotifyChange(delay*3, active->iStatus);
  1928 
  1901 
  1929 	// The following doesn't make any changes
  1902 	// The following doesn't make any changes
  1930 	test.Next(_L("Get String"));
  1903 	TheTest.Next(_L("Get String"));
  1931 	TestGetStringL(*client);
  1904 	TestGetStringL(*client);
  1932 	theLog.Write(_L8("Test 16 OK\n"));
  1905 	theLog.Write(_L8("Test 16 OK\n"));
  1933 
  1906 
  1934 	test.Next(_L("Clear Event Log"));
  1907 	TheTest.Next(_L("Clear Event Log"));
  1935 	TestClearEventLogL(*client);
  1908 	TestClearEventLogL(*client);
  1936 	theLog.Write(_L8("Test 17 OK\n"));
  1909 	theLog.Write(_L8("Test 17 OK\n"));
  1937 
  1910 
  1938 	CActiveScheduler::Start();
  1911 	CActiveScheduler::Start();
  1939 	TEST(active->iStatus.Int() >= 0);
  1912 	TEST(active->iStatus.Int() >= 0);
  1940 	active->StartL();
  1913 	active->StartL();
  1941 	client->NotifyChange(delay, active->iStatus);
  1914 	client->NotifyChange(delay, active->iStatus);
  1942 
  1915 
  1943 	test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0833 Test global change API "));
  1916 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0833 Test global change API "));
  1944 	TestClientObserverMechanismL(*client);
  1917 	TestClientObserverMechanismL(*client);
  1945 	theLog.Write(_L8("Test 18 OK\n"));
  1918 	theLog.Write(_L8("Test 18 OK\n"));
  1946 
  1919 
  1947 	test.Next(_L("Multiple client access"));
  1920 	TheTest.Next(_L("Multiple client access"));
  1948 	TestMultipleClientAccessL();
  1921 	TestMultipleClientAccessL();
  1949 	theLog.Write(_L8("Test 19 OK\n"));
  1922 	theLog.Write(_L8("Test 19 OK\n"));
  1950 	
  1923 	
  1951 	theLog.Write(_L8("Destroying: active\n"));
  1924 	theLog.Write(_L8("Destroying: active\n"));
  1952 	CleanupStack::PopAndDestroy(active);
  1925 	CleanupStack::PopAndDestroy(active);
  1964 	theLog.Write(_L8("Deleting the Log engine database... \n"));	
  1937 	theLog.Write(_L8("Deleting the Log engine database... \n"));	
  1965 	TestUtils::DeleteDatabaseL();
  1938 	TestUtils::DeleteDatabaseL();
  1966 	theLog.Write(_L8("Allocating a new CLogClient object... \n"));
  1939 	theLog.Write(_L8("Allocating a new CLogClient object... \n"));
  1967 	CLogClient* theClient = CLogClient::NewL(theFs);
  1940 	CLogClient* theClient = CLogClient::NewL(theFs);
  1968 	CleanupStack::PushL(theClient);	
  1941 	CleanupStack::PushL(theClient);	
  1969 	test.Next(_L("TestGetConfigSettingsFromRepositoryFileL () "));
  1942 	TheTest.Next(_L("TestGetConfigSettingsFromRepositoryFileL () "));
  1970 	TestGetConfigSettingsFromRepositoryFileL(*theClient);
  1943 	TestGetConfigSettingsFromRepositoryFileL(*theClient);
  1971 	theLog.Write(_L8("TestGetConfigSettingsFromRepositoryFileL () OK\n"));
  1944 	theLog.Write(_L8("TestGetConfigSettingsFromRepositoryFileL () OK\n"));
  1972 	theLog.Write(_L8("Destroying the CLogClient object... \n"));	
  1945 	theLog.Write(_L8("Destroying the CLogClient object... \n"));	
  1973 	CleanupStack::PopAndDestroy(theClient);
  1946 	CleanupStack::PopAndDestroy(theClient);
  1974 	theLog.Write(_L8("Destroyed ok\n"));
  1947 	theLog.Write(_L8("Destroyed ok\n"));