os/persistentdata/traceservices/commsdebugutility/TE_commsdebugutility/src/step_030_xx.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2003-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 // See the test specification for details of what these test cases do.
    15 #include "teststepcomsdbg.h"
    16 #include "TestMessage.h"
    17 #include "step_030_xx.h"
    18 
    19 
    20 #include <comms-infras/commsdebugutility.h>
    21 
    22 
    23 
    24 /**
    25 * This is the Constructor
    26 */ 
    27 
    28 
    29 CFloggerTest030_Tag_Setup::CFloggerTest030_Tag_Setup()
    30 	{
    31 	// Store the name of this test case
    32 	SetTestStepName(_L("step_030_Tag_Setup"));
    33 	}
    34 
    35 
    36 /**
    37 * This is the Destructor
    38 */ 
    39 
    40 
    41 CFloggerTest030_Tag_Setup::~CFloggerTest030_Tag_Setup()
    42 	{
    43 	}
    44 
    45 
    46 /**
    47 * This function returns whether the test case has 
    48 * 					  passed or failed
    49 */
    50 
    51 
    52 TVerdict CFloggerTest030_Tag_Setup::doTestStepL( )
    53 	{
    54 	if ( executeStepL() == KErrNone  )
    55 		SetTestStepResult(EPass);
    56 
    57 	else
    58 		SetTestStepResult(EFail);
    59 
    60 	//INFO_PRINTF1(_L("leaving Step 030_Tag_Setup "));
    61 	User::After(KTimeForDisplay);
    62 
    63 	
    64 	return TestStepResult();
    65 	}
    66 
    67 
    68 TInt CFloggerTest030_Tag_Setup::executeStepL(TBool)
    69 	{
    70 	return KErrGeneral;
    71 	}
    72 
    73 TInt CFloggerTest030_Tag_Setup::executeStepL()
    74 	{
    75 	return constructFloggerIniL(KTagTestsIniFileSettings);
    76 	}
    77 
    78 
    79 
    80 
    81 
    82 /**
    83 * 030_TagSetLogTag01: Test that flogger handles empty tags
    84 */ 
    85 
    86 CFloggerTest030_TagSetLogTag01::CFloggerTest030_TagSetLogTag01()
    87 	{
    88 	// Store the name of this test case
    89 	SetTestStepName(_L("step_030_TagSetLogTag01"));
    90 	}
    91 
    92 
    93 
    94 
    95 CFloggerTest030_TagSetLogTag01::~CFloggerTest030_TagSetLogTag01()
    96 	{
    97 	}
    98 
    99 
   100 
   101 
   102 TVerdict CFloggerTest030_TagSetLogTag01::doTestStepL( )
   103 	{
   104 	if ( executeStepL() == KErrNone  )
   105 		SetTestStepResult(EPass);
   106 
   107 	else
   108 		SetTestStepResult(EFail);
   109 
   110 	User::After(KTimeForDisplay);
   111 
   112 	
   113 	return TestStepResult();
   114 	}
   115 
   116 TInt CFloggerTest030_TagSetLogTag01::executeStepL(TBool)
   117 	{
   118 	return KErrGeneral;
   119 	}
   120 
   121 
   122 TInt CFloggerTest030_TagSetLogTag01::executeStepL()
   123 	{
   124 	
   125 	TInt ret ;
   126 	RFileLogger theFlogger; 
   127 	ret = theFlogger.Connect();
   128 	
   129 	if ( ret == KErrNone)
   130 		{
   131 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
   132 		theFlogger.ClearLog();
   133 		theFlogger.SetLogTags(KNullDesC8, KNullDesC8);
   134 		theFlogger.Write(KTestMessage);
   135 		theFlogger.Close();
   136 		User::After(KTimeToLog);
   137 		TRAPD(r, ret = DoTestCheckWriteL());
   138 		if (r != KErrNone)
   139 			ret = r;
   140 		}
   141 
   142 	return ret;		
   143 
   144 	}
   145 
   146 
   147 
   148 
   149 TInt CFloggerTest030_TagSetLogTag01::DoTestCheckWriteL()
   150 	{
   151 	RFile theFile;
   152 	HBufC8 * hBuffer;
   153 	TInt listfilesize,returnCode;
   154 	RFs fileSystem; //For file operation create a file system
   155 	TUint numSuccessful = 0;
   156 
   157 	
   158 	User::LeaveIfError(fileSystem.Connect());
   159 	CleanupClosePushL(fileSystem);
   160 	
   161 	//Open the file in the read mode
   162 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
   163 
   164 	CleanupClosePushL(theFile);
   165 
   166 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
   167 	
   168 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
   169 	CleanupStack::PushL(hBuffer);
   170 
   171 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
   172 
   173 	// Read from position 0: start of file
   174 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
   175 	
   176 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
   177 											//from the file
   178 
   179 	if (returnCode == KErrNotFound)
   180 		{
   181 		numSuccessful++;
   182 		returnCode = ptrString.Find(KErrOOM);
   183 		if (returnCode > 0)
   184 			User::Leave(KErrNoMemory);
   185 		}
   186 
   187 	
   188 	CleanupStack::PopAndDestroy(hBuffer);
   189 	CleanupStack::PopAndDestroy();	//theFile
   190 	CleanupStack::PopAndDestroy();  //fileSystem
   191 	
   192 	if (numSuccessful == 1)
   193 		return KErrNone;
   194 	else 
   195 		return KErrNotFound;
   196 	}
   197 
   198 
   199 
   200 
   201 /**
   202 * 030_TagSetLogTag02: Test that flogger handles empty subsys tag
   203 */ 
   204 
   205 CFloggerTest030_TagSetLogTag02::CFloggerTest030_TagSetLogTag02()
   206 	{
   207 	// Store the name of this test case
   208 	SetTestStepName(_L("step_030_TagSetLogTag02"));
   209 	}
   210 
   211 
   212 
   213 
   214 CFloggerTest030_TagSetLogTag02::~CFloggerTest030_TagSetLogTag02()
   215 	{
   216 	}
   217 
   218 
   219 
   220 
   221 TVerdict CFloggerTest030_TagSetLogTag02::doTestStepL( )
   222 	{
   223 	if ( executeStepL() == KErrNone  )
   224 		SetTestStepResult(EPass);
   225 
   226 	else
   227 		SetTestStepResult(EFail);
   228 
   229 	User::After(KTimeForDisplay);
   230 
   231 	
   232 	return TestStepResult();
   233 	}
   234 
   235 
   236 TInt CFloggerTest030_TagSetLogTag02::executeStepL(TBool)
   237 	{
   238 	return KErrGeneral;
   239 	}
   240 
   241 TInt CFloggerTest030_TagSetLogTag02::executeStepL()
   242 	{
   243 	
   244 	TInt ret ;
   245 	RFileLogger theFlogger; 
   246 	ret = theFlogger.Connect();
   247 	
   248 	if ( ret == KErrNone)
   249 		{
   250 		//Create Log by passing the subsystem and component name as parameters
   251 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
   252 		theFlogger.ClearLog();
   253 		theFlogger.SetLogTags(KNullDesC8, KStdCompTag8);
   254 		theFlogger.Write(KTestMessage);
   255 		theFlogger.Close();
   256 		User::After(KTimeToLog);
   257 		TRAPD(r, ret = DoTestCheckWriteL());
   258 		if (r != KErrNone)
   259 			ret = r;
   260 		}
   261 
   262 	return ret;		
   263 
   264 	}
   265 
   266 
   267 
   268 
   269 TInt CFloggerTest030_TagSetLogTag02::DoTestCheckWriteL()
   270 	{
   271 	RFile theFile;
   272 	HBufC8 * hBuffer;
   273 	TInt listfilesize,returnCode;
   274 	RFs fileSystem; //For file operation create a file system
   275 	TUint numSuccessful = 0;
   276 
   277 	
   278 	User::LeaveIfError(fileSystem.Connect());
   279 	CleanupClosePushL(fileSystem);
   280 	
   281 	//Open the file in the read mode
   282 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
   283 
   284 	CleanupClosePushL(theFile);
   285 
   286 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
   287 	
   288 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
   289 	CleanupStack::PushL(hBuffer);
   290 
   291 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
   292 
   293 	// Read from position 0: start of file
   294 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
   295 	
   296 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
   297 											//from the file
   298 
   299 	if (returnCode == KErrNotFound)
   300 		{
   301 		numSuccessful++;
   302 		returnCode = ptrString.Find(KErrOOM);
   303 		if (returnCode > 0)
   304 			User::Leave(KErrNoMemory);
   305 		}
   306 
   307 	
   308 	CleanupStack::PopAndDestroy(hBuffer);
   309 	CleanupStack::PopAndDestroy();	//theFile
   310 	CleanupStack::PopAndDestroy();  //fileSystem
   311 	
   312 	if (numSuccessful == 1)
   313 		return KErrNone;
   314 	else 
   315 		return KErrNotFound;
   316 	}
   317 
   318 
   319 
   320 /**
   321 * 030_TagSetLogTag03: Test that flogger handles empty component tag
   322 */ 
   323 
   324 CFloggerTest030_TagSetLogTag03::CFloggerTest030_TagSetLogTag03()
   325 	{
   326 	// Store the name of this test case
   327 	SetTestStepName(_L("step_030_TagSetLogTag03"));
   328 	}
   329 
   330 
   331 
   332 
   333 CFloggerTest030_TagSetLogTag03::~CFloggerTest030_TagSetLogTag03()
   334 	{
   335 	}
   336 
   337 
   338 
   339 
   340 TVerdict CFloggerTest030_TagSetLogTag03::doTestStepL( )
   341 	{
   342 	if ( executeStepL() == KErrNone  )
   343 		SetTestStepResult(EPass);
   344 
   345 	else
   346 		SetTestStepResult(EFail);
   347 
   348 	User::After(KTimeForDisplay);
   349 
   350 	
   351 	return TestStepResult();
   352 	}
   353 
   354 TInt CFloggerTest030_TagSetLogTag03::executeStepL(TBool)
   355 	{
   356 	return KErrGeneral;
   357 	}
   358 
   359 
   360 TInt CFloggerTest030_TagSetLogTag03::executeStepL()
   361 	{
   362 	
   363 	TInt ret ;
   364 	RFileLogger theFlogger; 
   365 	ret = theFlogger.Connect();
   366 	
   367 	if ( ret == KErrNone)
   368 		{
   369 		//Create Log by passing the subsystem and component name as parameters
   370 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
   371 		theFlogger.ClearLog();
   372 		theFlogger.SetLogTags(KStdSubsysTag8, KNullDesC8);
   373 		theFlogger.Write(KTestMessage);
   374 		theFlogger.Close();
   375 		User::After(KTimeToLog);
   376 		TRAPD(r, ret = DoTestCheckWriteL());
   377 		if (r != KErrNone)
   378 			ret = r;
   379 		}
   380 
   381 	return ret;		
   382 
   383 	}
   384 
   385 
   386 
   387 
   388 TInt CFloggerTest030_TagSetLogTag03::DoTestCheckWriteL()
   389 	{
   390 	RFile theFile;
   391 	HBufC8 * hBuffer;
   392 	TInt listfilesize,returnCode;
   393 	RFs fileSystem; //For file operation create a file system
   394 	TUint numSuccessful = 0;
   395 
   396 	
   397 	User::LeaveIfError(fileSystem.Connect());
   398 	CleanupClosePushL(fileSystem);
   399 	
   400 	//Open the file in the read mode
   401 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
   402 
   403 	CleanupClosePushL(theFile);
   404 
   405 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
   406 	
   407 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
   408 	CleanupStack::PushL(hBuffer);
   409 
   410 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
   411 
   412 	// Read from position 0: start of file
   413 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
   414 	
   415 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
   416 											//from the file
   417 
   418 	if (returnCode == KErrNotFound)
   419 		{
   420 		numSuccessful++;
   421 		returnCode = ptrString.Find(KErrOOM);
   422 		if (returnCode > 0)
   423 			User::Leave(KErrNoMemory);
   424 		}
   425 
   426 	
   427 	CleanupStack::PopAndDestroy(hBuffer);
   428 	CleanupStack::PopAndDestroy();	//theFile
   429 	CleanupStack::PopAndDestroy();  //fileSystem
   430 	
   431 	if (numSuccessful == 1)
   432 		return KErrNone;
   433 	else 
   434 		return KErrNotFound;
   435 	}
   436 
   437 
   438 
   439 
   440 /**
   441 * 030_TagSetLogTag04: Test that flogger handles spaces in tags
   442 */ 
   443 
   444 CFloggerTest030_TagSetLogTag04::CFloggerTest030_TagSetLogTag04()
   445 	{
   446 	// Store the name of this test case
   447 	SetTestStepName(_L("step_030_TagSetLogTag04"));
   448 	}
   449 
   450 
   451 
   452 
   453 CFloggerTest030_TagSetLogTag04::~CFloggerTest030_TagSetLogTag04()
   454 	{
   455 	}
   456 
   457 
   458 
   459 
   460 TVerdict CFloggerTest030_TagSetLogTag04::doTestStepL( )
   461 	{
   462 	if ( executeStepL() == KErrNone  )
   463 		SetTestStepResult(EPass);
   464 
   465 	else
   466 		SetTestStepResult(EFail);
   467 
   468 	User::After(KTimeForDisplay);
   469 
   470 	
   471 	return TestStepResult();
   472 	}
   473 
   474 
   475 TInt CFloggerTest030_TagSetLogTag04::executeStepL(TBool)
   476 	{
   477 	return KErrGeneral;
   478 	}
   479 
   480 TInt CFloggerTest030_TagSetLogTag04::executeStepL()
   481 	{
   482 	
   483 	TInt ret ;
   484 	RFileLogger theFlogger; 
   485 	ret = theFlogger.Connect();
   486 	
   487 	if ( ret == KErrNone)
   488 		{
   489 		//Create Log by passing the subsystem and component name as parameters
   490 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
   491 		theFlogger.ClearLog();
   492 		theFlogger.SetLogTags(KStdSubsysTag8, KCompTagWithSpaceChars8);
   493 		theFlogger.Write(KTestMessage);
   494 		theFlogger.Close();
   495 		User::After(KTimeToLog);
   496 		TRAPD(r, ret = DoTestCheckWriteL());
   497 		if (r != KErrNone)
   498 			ret = r;
   499 		}
   500 
   501 	return ret;		
   502 
   503 	}
   504 
   505 
   506 
   507 
   508 TInt CFloggerTest030_TagSetLogTag04::DoTestCheckWriteL()
   509 	{
   510 	RFile theFile;
   511 	HBufC8 * hBuffer;
   512 	TInt listfilesize,returnCode;
   513 	RFs fileSystem; //For file operation create a file system
   514 	TUint numSuccessful = 0;
   515 
   516 	
   517 	User::LeaveIfError(fileSystem.Connect());
   518 	CleanupClosePushL(fileSystem);
   519 	
   520 	//Open the file in the read mode
   521 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
   522 
   523 	CleanupClosePushL(theFile);
   524 
   525 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
   526 	
   527 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
   528 	CleanupStack::PushL(hBuffer);
   529 
   530 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
   531 
   532 	// Read from position 0: start of file
   533 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
   534 	
   535 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
   536 											//from the file
   537 
   538 	if (returnCode == KErrNotFound)
   539 		{
   540 		numSuccessful++;
   541 		returnCode = ptrString.Find(KErrOOM);
   542 		if (returnCode > 0)
   543 			User::Leave(KErrNoMemory);
   544 		}
   545 
   546 	
   547 	CleanupStack::PopAndDestroy(hBuffer);
   548 	CleanupStack::PopAndDestroy();	//theFile
   549 	CleanupStack::PopAndDestroy();  //fileSystem
   550 	
   551 	if (numSuccessful == 1)
   552 		return KErrNone;
   553 	else 
   554 		return KErrNotFound;
   555 	}
   556 
   557 
   558 
   559 
   560 
   561 /**
   562 * 030_TagSetLogTag05: Test that flogger handles punctuation in tags
   563 */ 
   564 
   565 CFloggerTest030_TagSetLogTag05::CFloggerTest030_TagSetLogTag05()
   566 	{
   567 	// Store the name of this test case
   568 	SetTestStepName(_L("step_030_TagSetLogTag05"));
   569 	}
   570 
   571 
   572 
   573 
   574 CFloggerTest030_TagSetLogTag05::~CFloggerTest030_TagSetLogTag05()
   575 	{
   576 	}
   577 
   578 
   579 
   580 
   581 TVerdict CFloggerTest030_TagSetLogTag05::doTestStepL( )
   582 	{
   583 	if ( executeStepL() == KErrNone  )
   584 		SetTestStepResult(EPass);
   585 
   586 	else
   587 		SetTestStepResult(EFail);
   588 
   589 	User::After(KTimeForDisplay);
   590 
   591 	
   592 	return TestStepResult();
   593 	}
   594 
   595 
   596 TInt CFloggerTest030_TagSetLogTag05::executeStepL(TBool)
   597 	{
   598 	return KErrGeneral;
   599 	}
   600 
   601 TInt CFloggerTest030_TagSetLogTag05::executeStepL()
   602 	{
   603 	
   604 	TInt ret ;
   605 	RFileLogger theFlogger; 
   606 	ret = theFlogger.Connect();
   607 	
   608 	if ( ret == KErrNone)
   609 		{
   610 		//Create Log by passing the subsystem and component name as parameters
   611 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
   612 		theFlogger.ClearLog();
   613 		theFlogger.SetLogTags(KSubsysTagWithPunctuationChars8, KCompTagWithPunctuationChars8);
   614 		theFlogger.Write(KTestMessage);
   615 		theFlogger.Close();
   616 		User::After(KTimeToLog);
   617 		TRAPD(r, ret = DoTestCheckWriteL());
   618 		if (r != KErrNone)
   619 			ret = r;
   620 		}
   621 
   622 	return ret;		
   623 
   624 	}
   625 
   626 
   627 
   628 
   629 TInt CFloggerTest030_TagSetLogTag05::DoTestCheckWriteL()
   630 	{
   631 	RFile theFile;
   632 	HBufC8 * hBuffer;
   633 	TInt listfilesize,returnCode;
   634 	RFs fileSystem; //For file operation create a file system
   635 	TUint numSuccessful = 0;
   636 
   637 	
   638 	User::LeaveIfError(fileSystem.Connect());
   639 	CleanupClosePushL(fileSystem);
   640 	
   641 	//Open the file in the read mode
   642 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
   643 
   644 	CleanupClosePushL(theFile);
   645 
   646 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
   647 	
   648 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
   649 	CleanupStack::PushL(hBuffer);
   650 
   651 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
   652 
   653 	// Read from position 0: start of file
   654 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
   655 	
   656 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
   657 											//from the file
   658 
   659 	if (returnCode == KErrNotFound)
   660 		{
   661 		numSuccessful++;
   662 		returnCode = ptrString.Find(KErrOOM);
   663 		if (returnCode > 0)
   664 			User::Leave(KErrNoMemory);
   665 		}
   666 
   667 	
   668 	CleanupStack::PopAndDestroy(hBuffer);
   669 	CleanupStack::PopAndDestroy();	//theFile
   670 	CleanupStack::PopAndDestroy();  //fileSystem
   671 	
   672 	if (numSuccessful == 1)
   673 		return KErrNone;
   674 	else 
   675 		return KErrNotFound;
   676 	}
   677 
   678 
   679 /**
   680 * 030_TagSetLogTag06: Test that flogger handles long tags
   681 */ 
   682 
   683 CFloggerTest030_TagSetLogTag06::CFloggerTest030_TagSetLogTag06()
   684 	{
   685 	// Store the name of this test case
   686 	SetTestStepName(_L("step_030_TagSetLogTag06"));
   687 	}
   688 
   689 
   690 
   691 
   692 CFloggerTest030_TagSetLogTag06::~CFloggerTest030_TagSetLogTag06()
   693 	{
   694 	}
   695 
   696 
   697 
   698 
   699 TVerdict CFloggerTest030_TagSetLogTag06::doTestStepL( )
   700 	{
   701 	if ( executeStepL() == KErrNone  )
   702 		SetTestStepResult(EPass);
   703 
   704 	else
   705 		SetTestStepResult(EFail);
   706 
   707 	User::After(KTimeForDisplay);
   708 
   709 	
   710 	return TestStepResult();
   711 	}
   712 
   713 
   714 TInt CFloggerTest030_TagSetLogTag06::executeStepL(TBool)
   715 	{
   716 	return KErrGeneral;
   717 	}
   718 
   719 TInt CFloggerTest030_TagSetLogTag06::executeStepL()
   720 	{
   721 	
   722 	TInt ret ;
   723 	RFileLogger theFlogger; 
   724 	ret = theFlogger.Connect();
   725 	
   726 	if ( ret == KErrNone)
   727 		{
   728 		//Create Log by passing the subsystem and component name as parameters
   729 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
   730 		theFlogger.ClearLog();
   731 		theFlogger.SetLogTags(KSubsysTag16char8, KCompTag16char8);
   732 		theFlogger.Write(KTestMessage8);
   733 		theFlogger.Close();
   734 		User::After(KTimeToLog);
   735 		TRAPD(r, ret = DoTestCheckWriteL());
   736 		if (r != KErrNone)
   737 			ret = r;
   738 		}
   739 
   740 	return ret;		
   741 
   742 	}
   743 
   744 
   745 
   746 
   747 TInt CFloggerTest030_TagSetLogTag06::DoTestCheckWriteL()
   748 	{
   749 	RFile theFile;
   750 	HBufC8 * hBuffer;
   751 	TInt listfilesize,returnCode;
   752 	RFs fileSystem; //For file operation create a file system
   753 	TUint numSuccessful = 0;
   754 
   755 	
   756 	User::LeaveIfError(fileSystem.Connect());
   757 	CleanupClosePushL(fileSystem);
   758 	
   759 	//Open the file in the read mode
   760 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
   761 
   762 	CleanupClosePushL(theFile);
   763 
   764 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
   765 	
   766 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
   767 	CleanupStack::PushL(hBuffer);
   768 
   769 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
   770 
   771 	// Read from position 0: start of file
   772 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
   773 	
   774 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
   775 											//from the file
   776 	
   777 	if (returnCode > 0)
   778 		{
   779 		numSuccessful++;
   780 		}
   781 	else if (returnCode == KErrNotFound)
   782 		{
   783 		returnCode = ptrString.Find(KErrOOM);
   784 		if (returnCode > 0)
   785 			User::Leave(KErrNoMemory);
   786 		}
   787 
   788 	
   789 	CleanupStack::PopAndDestroy(hBuffer);
   790 	CleanupStack::PopAndDestroy();	//theFile
   791 	CleanupStack::PopAndDestroy();  //fileSystem
   792 	
   793 	if (numSuccessful == 1)
   794 		return KErrNone;
   795 	else 
   796 		return KErrNotFound;
   797 	}
   798 
   799 
   800 
   801 
   802 /**
   803 * 030_TagSetLogTag07: Test that flogger handles long tags
   804 */ 
   805 
   806 CFloggerTest030_TagSetLogTag07::CFloggerTest030_TagSetLogTag07()
   807 	{
   808 	// Store the name of this test case
   809 	SetTestStepName(_L("step_030_TagSetLogTag07"));
   810 	}
   811 
   812 
   813 
   814 
   815 CFloggerTest030_TagSetLogTag07::~CFloggerTest030_TagSetLogTag07()
   816 	{
   817 	}
   818 
   819 
   820 
   821 
   822 TVerdict CFloggerTest030_TagSetLogTag07::doTestStepL( )
   823 	{
   824 	if ( executeStepL() == KErrNone  )
   825 		SetTestStepResult(EPass);
   826 
   827 	else
   828 		SetTestStepResult(EFail);
   829 
   830 	User::After(KTimeForDisplay);
   831 
   832 	
   833 	return TestStepResult();
   834 	}
   835 
   836 
   837 TInt CFloggerTest030_TagSetLogTag07::executeStepL(TBool)
   838 	{
   839 	return KErrGeneral;
   840 	}
   841 
   842 TInt CFloggerTest030_TagSetLogTag07::executeStepL()
   843 	{
   844 	
   845 	TInt ret ;
   846 	RFileLogger theFlogger; 
   847 	ret = theFlogger.Connect();
   848 	
   849 	if ( ret == KErrNone)
   850 		{
   851 		//Create Log by passing the subsystem and component name as parameters
   852 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
   853 		theFlogger.ClearLog();
   854 		theFlogger.SetLogTags(KSubsysTag17char8, KCompTag17char8);
   855 		theFlogger.Write(KTestMessage8);
   856 		theFlogger.Close();
   857 		User::After(KTimeToLog);
   858 		TRAPD(r, ret = DoTestCheckWriteL());
   859 		if (r != KErrNone)
   860 			ret = r;
   861 		}
   862 
   863 	return ret;		
   864 
   865 	}
   866 
   867 
   868 
   869 
   870 TInt CFloggerTest030_TagSetLogTag07::DoTestCheckWriteL()
   871 	{
   872 	RFile theFile;
   873 	HBufC8 * hBuffer;
   874 	TInt listfilesize,returnCode;
   875 	RFs fileSystem; //For file operation create a file system
   876 	TUint numSuccessful = 0;
   877 
   878 	
   879 	User::LeaveIfError(fileSystem.Connect());
   880 	CleanupClosePushL(fileSystem);
   881 	
   882 	//Open the file in the read mode
   883 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
   884 
   885 	CleanupClosePushL(theFile);
   886 
   887 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
   888 	
   889 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
   890 	CleanupStack::PushL(hBuffer);
   891 
   892 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
   893 
   894 	// Read from position 0: start of file
   895 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
   896 	
   897 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
   898 											//from the file
   899 	
   900 	if (returnCode > 0)
   901 		{
   902 		numSuccessful++;
   903 		}
   904 	else if (returnCode == KErrNotFound)
   905 		{
   906 		returnCode = ptrString.Find(KErrOOM);
   907 		if (returnCode > 0)
   908 			User::Leave(KErrNoMemory);
   909 		}
   910 
   911 	// We expect to see the string "subsystem0123456" but not "subsystem01234567"
   912 	returnCode = ptrString.Find(KSubsysTag16char8); //find the test descriptor in the buffer read
   913 
   914 	if (returnCode > 0)
   915 		{
   916 		numSuccessful++;
   917 		}
   918 
   919 	returnCode = ptrString.Find(KSubsysTag17char8); //find the test descriptor in the buffer read
   920 	
   921 	if (returnCode == KErrNotFound)
   922 		{
   923 		numSuccessful++;
   924 		}
   925 	
   926 	CleanupStack::PopAndDestroy(hBuffer);
   927 	CleanupStack::PopAndDestroy();	//theFile
   928 	CleanupStack::PopAndDestroy();  //fileSystem
   929 	
   930 	if (numSuccessful == 3)
   931 		return KErrNone;
   932 	else 
   933 		return KErrNotFound;
   934 	}
   935 
   936 
   937 
   938 
   939 /**
   940 * 030_TagSetLogTag08: Test that flogger handles very long tags
   941 */ 
   942 
   943 CFloggerTest030_TagSetLogTag08::CFloggerTest030_TagSetLogTag08()
   944 	{
   945 	// Store the name of this test case
   946 	SetTestStepName(_L("step_030_TagSetLogTag08"));
   947 	}
   948 
   949 
   950 
   951 
   952 CFloggerTest030_TagSetLogTag08::~CFloggerTest030_TagSetLogTag08()
   953 	{
   954 	}
   955 
   956 
   957 
   958 
   959 TVerdict CFloggerTest030_TagSetLogTag08::doTestStepL( )
   960 	{
   961 	if ( executeStepL() == KErrNone  )
   962 		SetTestStepResult(EPass);
   963 
   964 	else
   965 		SetTestStepResult(EFail);
   966 
   967 	User::After(KTimeForDisplay);
   968 
   969 	
   970 	return TestStepResult();
   971 	}
   972 
   973 
   974 TInt CFloggerTest030_TagSetLogTag08::executeStepL(TBool)
   975 	{
   976 	return KErrGeneral;
   977 	}
   978 
   979 TInt CFloggerTest030_TagSetLogTag08::executeStepL()
   980 	{
   981 	
   982 	TInt ret ;
   983 	RFileLogger theFlogger; 
   984 	ret = theFlogger.Connect();
   985 	
   986 	if ( ret == KErrNone)
   987 		{
   988 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
   989 		theFlogger.ClearLog();
   990 		theFlogger.SetLogTags(KSubsysTag66char8, KCompTag66char8);
   991 		theFlogger.Write(KTestMessage);
   992 		theFlogger.Close();
   993 		User::After(KTimeToLog);
   994 		TRAPD(r, ret = DoTestCheckWriteL());
   995 		if (r != KErrNone)
   996 			ret = r;
   997 		}
   998 
   999 	return ret;		
  1000 
  1001 	}
  1002 
  1003 
  1004 
  1005 
  1006 TInt CFloggerTest030_TagSetLogTag08::DoTestCheckWriteL()
  1007 	{
  1008 	RFile theFile;
  1009 	HBufC8 * hBuffer;
  1010 	TInt listfilesize,returnCode;
  1011 	RFs fileSystem; //For file operation create a file system
  1012 	TUint numSuccessful = 0;
  1013 
  1014 	
  1015 	User::LeaveIfError(fileSystem.Connect());
  1016 	CleanupClosePushL(fileSystem);
  1017 	
  1018 	//Open the file in the read mode
  1019 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  1020 
  1021 	CleanupClosePushL(theFile);
  1022 
  1023 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  1024 	
  1025 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  1026 	CleanupStack::PushL(hBuffer);
  1027 
  1028 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  1029 
  1030 	// Read from position 0: start of file
  1031 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  1032 	
  1033 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  1034 											//from the file
  1035 	
  1036 	if (returnCode > 0)
  1037 		{
  1038 		numSuccessful++;
  1039 		}
  1040 	else if (returnCode == KErrNotFound)
  1041 		{
  1042 		returnCode = ptrString.Find(KErrOOM);
  1043 		if (returnCode > 0)
  1044 			User::Leave(KErrNoMemory);
  1045 		}
  1046 
  1047 	// We expect to see the string "subsystem0123456" but not "subsystem01234567"
  1048 	returnCode = ptrString.Find(KSubsysTag16char8); //find the test descriptor in the buffer read
  1049 
  1050 	if (returnCode > 0)
  1051 		{
  1052 		numSuccessful++;
  1053 		}
  1054 	
  1055 	CleanupStack::PopAndDestroy(hBuffer);
  1056 	CleanupStack::PopAndDestroy();	//theFile
  1057 	CleanupStack::PopAndDestroy();  //fileSystem
  1058 	
  1059 	if (numSuccessful == 2)
  1060 		return KErrNone;
  1061 	else 
  1062 		return KErrNotFound;
  1063 	}
  1064 
  1065 
  1066 
  1067 
  1068 /***************************************************************************************/
  1069 
  1070 /**
  1071 * 030_TagCreateLog01: Test that flogger handles empty tags
  1072 */ 
  1073 
  1074 CFloggerTest030_TagCreateLog01::CFloggerTest030_TagCreateLog01()
  1075 	{
  1076 	// Store the name of this test case
  1077 	SetTestStepName(_L("step_030_TagCreateLog01"));
  1078 	}
  1079 
  1080 
  1081 
  1082 
  1083 CFloggerTest030_TagCreateLog01::~CFloggerTest030_TagCreateLog01()
  1084 	{
  1085 	}
  1086 
  1087 
  1088 
  1089 
  1090 TVerdict CFloggerTest030_TagCreateLog01::doTestStepL( )
  1091 	{
  1092 	if ( executeStepL() == KErrNone  )
  1093 		SetTestStepResult(EPass);
  1094 
  1095 	else
  1096 		SetTestStepResult(EFail);
  1097 
  1098 	User::After(KTimeForDisplay);
  1099 
  1100 	
  1101 	return TestStepResult();
  1102 	}
  1103 
  1104 
  1105 TInt CFloggerTest030_TagCreateLog01::executeStepL(TBool)
  1106 	{
  1107 	return KErrGeneral;
  1108 	}
  1109 
  1110 TInt CFloggerTest030_TagCreateLog01::executeStepL()
  1111 	{
  1112 	
  1113 	TInt ret ;
  1114 	RFileLogger theFlogger; 
  1115 	ret = theFlogger.Connect();
  1116 	
  1117 	if ( ret == KErrNone)
  1118 		{
  1119 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  1120 		theFlogger.ClearLog();
  1121 		theFlogger.CreateLog(KNullDesC16, KNullDesC16, EFileLoggingModeOverwrite);
  1122 		theFlogger.Write(KTestMessage);
  1123 		theFlogger.Close();
  1124 		User::After(KTimeToLog);
  1125 		TRAPD(r, ret = DoTestCheckWriteL());
  1126 		if (r != KErrNone)
  1127 			ret = r;
  1128 		}
  1129 
  1130 	return ret;		
  1131 
  1132 	}
  1133 
  1134 
  1135 
  1136 
  1137 TInt CFloggerTest030_TagCreateLog01::DoTestCheckWriteL()
  1138 	{
  1139 	RFile theFile;
  1140 	HBufC8 * hBuffer;
  1141 	TInt listfilesize,returnCode;
  1142 	RFs fileSystem; //For file operation create a file system
  1143 	TUint numSuccessful = 0;
  1144 
  1145 	
  1146 	User::LeaveIfError(fileSystem.Connect());
  1147 	CleanupClosePushL(fileSystem);
  1148 	
  1149 	//Open the file in the read mode
  1150 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  1151 
  1152 	CleanupClosePushL(theFile);
  1153 
  1154 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  1155 	
  1156 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  1157 	CleanupStack::PushL(hBuffer);
  1158 
  1159 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  1160 
  1161 	// Read from position 0: start of file
  1162 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  1163 	
  1164 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  1165 											//from the file
  1166 
  1167 	if (returnCode == KErrNotFound)
  1168 		{
  1169 		numSuccessful++;
  1170 		returnCode = ptrString.Find(KErrOOM);
  1171 		if (returnCode > 0)
  1172 			User::Leave(KErrNoMemory);
  1173 		}
  1174 
  1175 	
  1176 	CleanupStack::PopAndDestroy(hBuffer);
  1177 	CleanupStack::PopAndDestroy();	//theFile
  1178 	CleanupStack::PopAndDestroy();  //fileSystem
  1179 	
  1180 	if (numSuccessful == 1)
  1181 		return KErrNone;
  1182 	else 
  1183 		return KErrNotFound;
  1184 	}
  1185 
  1186 
  1187 
  1188 
  1189 /**
  1190 * 030_TagCreateLog02: Test that flogger handles empty subsys tag
  1191 */ 
  1192 
  1193 CFloggerTest030_TagCreateLog02::CFloggerTest030_TagCreateLog02()
  1194 	{
  1195 	// Store the name of this test case
  1196 	SetTestStepName(_L("step_030_TagCreateLog02"));
  1197 	}
  1198 
  1199 
  1200 
  1201 
  1202 CFloggerTest030_TagCreateLog02::~CFloggerTest030_TagCreateLog02()
  1203 	{
  1204 	}
  1205 
  1206 
  1207 
  1208 
  1209 TVerdict CFloggerTest030_TagCreateLog02::doTestStepL( )
  1210 	{
  1211 	if ( executeStepL() == KErrNone  )
  1212 		SetTestStepResult(EPass);
  1213 
  1214 	else
  1215 		SetTestStepResult(EFail);
  1216 
  1217 	User::After(KTimeForDisplay);
  1218 
  1219 	
  1220 	return TestStepResult();
  1221 	}
  1222 
  1223 TInt CFloggerTest030_TagCreateLog02::executeStepL(TBool)
  1224 	{
  1225 	return KErrGeneral;
  1226 	}
  1227 
  1228 
  1229 TInt CFloggerTest030_TagCreateLog02::executeStepL()
  1230 	{
  1231 	
  1232 	TInt ret ;
  1233 	RFileLogger theFlogger; 
  1234 	ret = theFlogger.Connect();
  1235 	
  1236 	if ( ret == KErrNone)
  1237 		{
  1238 		//Create Log by passing the subsystem and component name as parameters
  1239 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  1240 		theFlogger.ClearLog();
  1241 		theFlogger.CreateLog(KNullDesC16, KStdCompTag16, EFileLoggingModeOverwrite);
  1242 		theFlogger.Write(KTestMessage);
  1243 		theFlogger.Close();
  1244 		User::After(KTimeToLog);
  1245 		TRAPD(r, ret = DoTestCheckWriteL());
  1246 		if (r != KErrNone)
  1247 			ret = r;
  1248 		}
  1249 
  1250 	return ret;		
  1251 
  1252 	}
  1253 
  1254 
  1255 
  1256 
  1257 TInt CFloggerTest030_TagCreateLog02::DoTestCheckWriteL()
  1258 	{
  1259 	RFile theFile;
  1260 	HBufC8 * hBuffer;
  1261 	TInt listfilesize,returnCode;
  1262 	RFs fileSystem; //For file operation create a file system
  1263 	TUint numSuccessful = 0;
  1264 
  1265 	
  1266 	User::LeaveIfError(fileSystem.Connect());
  1267 	CleanupClosePushL(fileSystem);
  1268 	
  1269 	//Open the file in the read mode
  1270 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  1271 
  1272 	CleanupClosePushL(theFile);
  1273 
  1274 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  1275 	
  1276 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  1277 	CleanupStack::PushL(hBuffer);
  1278 
  1279 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  1280 
  1281 	// Read from position 0: start of file
  1282 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  1283 	
  1284 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  1285 											//from the file
  1286 
  1287 	if (returnCode == KErrNotFound)
  1288 		{
  1289 		numSuccessful++;
  1290 		returnCode = ptrString.Find(KErrOOM);
  1291 		if (returnCode > 0)
  1292 			User::Leave(KErrNoMemory);
  1293 		}
  1294 
  1295 	
  1296 	CleanupStack::PopAndDestroy(hBuffer);
  1297 	CleanupStack::PopAndDestroy();	//theFile
  1298 	CleanupStack::PopAndDestroy();  //fileSystem
  1299 	
  1300 	if (numSuccessful == 1)
  1301 		return KErrNone;
  1302 	else 
  1303 		return KErrNotFound;
  1304 	}
  1305 
  1306 
  1307 
  1308 /**
  1309 * 030_TagCreateLog03: Test that flogger handles empty component tag
  1310 */ 
  1311 
  1312 CFloggerTest030_TagCreateLog03::CFloggerTest030_TagCreateLog03()
  1313 	{
  1314 	// Store the name of this test case
  1315 	SetTestStepName(_L("step_030_TagCreateLog03"));
  1316 	}
  1317 
  1318 
  1319 
  1320 
  1321 CFloggerTest030_TagCreateLog03::~CFloggerTest030_TagCreateLog03()
  1322 	{
  1323 	}
  1324 
  1325 
  1326 
  1327 
  1328 TVerdict CFloggerTest030_TagCreateLog03::doTestStepL( )
  1329 	{
  1330 	if ( executeStepL() == KErrNone  )
  1331 		SetTestStepResult(EPass);
  1332 
  1333 	else
  1334 		SetTestStepResult(EFail);
  1335 
  1336 	User::After(KTimeForDisplay);
  1337 
  1338 	
  1339 	return TestStepResult();
  1340 	}
  1341 
  1342 
  1343 TInt CFloggerTest030_TagCreateLog03::executeStepL(TBool)
  1344 	{
  1345 	return KErrGeneral;
  1346 	}
  1347 
  1348 TInt CFloggerTest030_TagCreateLog03::executeStepL()
  1349 	{
  1350 	
  1351 	TInt ret ;
  1352 	RFileLogger theFlogger; 
  1353 	ret = theFlogger.Connect();
  1354 	
  1355 	if ( ret == KErrNone)
  1356 		{
  1357 		//Create Log by passing the subsystem and component name as parameters
  1358 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  1359 		theFlogger.ClearLog();
  1360 		theFlogger.CreateLog(KStdSubsysTag16, KNullDesC16, EFileLoggingModeOverwrite);
  1361 		theFlogger.Write(KTestMessage);
  1362 		theFlogger.Close();
  1363 		User::After(KTimeToLog);
  1364 		TRAPD(r, ret = DoTestCheckWriteL());
  1365 		if (r != KErrNone)
  1366 			ret = r;
  1367 		}
  1368 
  1369 	return ret;		
  1370 
  1371 	}
  1372 
  1373 
  1374 
  1375 
  1376 TInt CFloggerTest030_TagCreateLog03::DoTestCheckWriteL()
  1377 	{
  1378 	RFile theFile;
  1379 	HBufC8 * hBuffer;
  1380 	TInt listfilesize,returnCode;
  1381 	RFs fileSystem; //For file operation create a file system
  1382 	TUint numSuccessful = 0;
  1383 
  1384 	
  1385 	User::LeaveIfError(fileSystem.Connect());
  1386 	CleanupClosePushL(fileSystem);
  1387 	
  1388 	//Open the file in the read mode
  1389 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  1390 
  1391 	CleanupClosePushL(theFile);
  1392 
  1393 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  1394 	
  1395 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  1396 	CleanupStack::PushL(hBuffer);
  1397 
  1398 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  1399 
  1400 	// Read from position 0: start of file
  1401 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  1402 	
  1403 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  1404 											//from the file
  1405 
  1406 	if (returnCode == KErrNotFound)
  1407 		{
  1408 		numSuccessful++;
  1409 		returnCode = ptrString.Find(KErrOOM);
  1410 		if (returnCode > 0)
  1411 			User::Leave(KErrNoMemory);
  1412 		}
  1413 
  1414 	
  1415 	CleanupStack::PopAndDestroy(hBuffer);
  1416 	CleanupStack::PopAndDestroy();	//theFile
  1417 	CleanupStack::PopAndDestroy();  //fileSystem
  1418 	
  1419 	if (numSuccessful == 1)
  1420 		return KErrNone;
  1421 	else 
  1422 		return KErrNotFound;
  1423 	}
  1424 
  1425 
  1426 
  1427 
  1428 /**
  1429 * 030_TagCreateLog04: Test that flogger handles spaces in tags
  1430 */ 
  1431 
  1432 CFloggerTest030_TagCreateLog04::CFloggerTest030_TagCreateLog04()
  1433 	{
  1434 	// Store the name of this test case
  1435 	SetTestStepName(_L("step_030_TagCreateLog04"));
  1436 	}
  1437 
  1438 
  1439 
  1440 
  1441 CFloggerTest030_TagCreateLog04::~CFloggerTest030_TagCreateLog04()
  1442 	{
  1443 	}
  1444 
  1445 
  1446 
  1447 
  1448 TVerdict CFloggerTest030_TagCreateLog04::doTestStepL( )
  1449 	{
  1450 	if ( executeStepL() == KErrNone  )
  1451 		SetTestStepResult(EPass);
  1452 
  1453 	else
  1454 		SetTestStepResult(EFail);
  1455 
  1456 	User::After(KTimeForDisplay);
  1457 
  1458 	
  1459 	return TestStepResult();
  1460 	}
  1461 
  1462 
  1463 TInt CFloggerTest030_TagCreateLog04::executeStepL(TBool)
  1464 	{
  1465 	return KErrGeneral;
  1466 	}
  1467 
  1468 TInt CFloggerTest030_TagCreateLog04::executeStepL()
  1469 	{
  1470 	
  1471 	TInt ret ;
  1472 	RFileLogger theFlogger; 
  1473 	ret = theFlogger.Connect();
  1474 	
  1475 	if ( ret == KErrNone)
  1476 		{
  1477 		//Create Log by passing the subsystem and component name as parameters
  1478 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  1479 		theFlogger.ClearLog();
  1480 		theFlogger.CreateLog(KStdSubsysTag16, KCompTagWithSpaceChars16, EFileLoggingModeOverwrite);
  1481 		theFlogger.Write(KTestMessage);
  1482 		theFlogger.Close();
  1483 		User::After(KTimeToLog);
  1484 		TRAPD(r, ret = DoTestCheckWriteL());
  1485 		if (r != KErrNone)
  1486 			ret = r;
  1487 		}
  1488 
  1489 	return ret;		
  1490 
  1491 	}
  1492 
  1493 
  1494 
  1495 
  1496 TInt CFloggerTest030_TagCreateLog04::DoTestCheckWriteL()
  1497 	{
  1498 	RFile theFile;
  1499 	HBufC8 * hBuffer;
  1500 	TInt listfilesize,returnCode;
  1501 	RFs fileSystem; //For file operation create a file system
  1502 	TUint numSuccessful = 0;
  1503 
  1504 	
  1505 	User::LeaveIfError(fileSystem.Connect());
  1506 	CleanupClosePushL(fileSystem);
  1507 	
  1508 	//Open the file in the read mode
  1509 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  1510 
  1511 	CleanupClosePushL(theFile);
  1512 
  1513 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  1514 	
  1515 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  1516 	CleanupStack::PushL(hBuffer);
  1517 
  1518 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  1519 
  1520 	// Read from position 0: start of file
  1521 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  1522 	
  1523 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  1524 											//from the file
  1525 
  1526 	if (returnCode == KErrNotFound)
  1527 		{
  1528 		numSuccessful++;
  1529 		returnCode = ptrString.Find(KErrOOM);
  1530 		if (returnCode > 0)
  1531 			User::Leave(KErrNoMemory);
  1532 		}
  1533 
  1534 	
  1535 	CleanupStack::PopAndDestroy(hBuffer);
  1536 	CleanupStack::PopAndDestroy();	//theFile
  1537 	CleanupStack::PopAndDestroy();  //fileSystem
  1538 	
  1539 	if (numSuccessful == 1)
  1540 		return KErrNone;
  1541 	else 
  1542 		return KErrNotFound;
  1543 	}
  1544 
  1545 
  1546 
  1547 
  1548 
  1549 /**
  1550 * 030_TagCreateLog05: Test that flogger handles punctuation in tags
  1551 */ 
  1552 
  1553 CFloggerTest030_TagCreateLog05::CFloggerTest030_TagCreateLog05()
  1554 	{
  1555 	// Store the name of this test case
  1556 	SetTestStepName(_L("step_030_TagCreateLog05"));
  1557 	}
  1558 
  1559 
  1560 
  1561 
  1562 CFloggerTest030_TagCreateLog05::~CFloggerTest030_TagCreateLog05()
  1563 	{
  1564 	}
  1565 
  1566 
  1567 
  1568 
  1569 TVerdict CFloggerTest030_TagCreateLog05::doTestStepL( )
  1570 	{
  1571 	if ( executeStepL() == KErrNone  )
  1572 		SetTestStepResult(EPass);
  1573 
  1574 	else
  1575 		SetTestStepResult(EFail);
  1576 
  1577 	User::After(KTimeForDisplay);
  1578 
  1579 	
  1580 	return TestStepResult();
  1581 	}
  1582 
  1583 
  1584 TInt CFloggerTest030_TagCreateLog05::executeStepL(TBool)
  1585 {
  1586 return KErrGeneral;
  1587 }
  1588 
  1589 TInt CFloggerTest030_TagCreateLog05::executeStepL()
  1590 	{
  1591 	
  1592 	TInt ret ;
  1593 	RFileLogger theFlogger; 
  1594 	ret = theFlogger.Connect();
  1595 	
  1596 	if ( ret == KErrNone)
  1597 		{
  1598 		//Create Log by passing the subsystem and component name as parameters
  1599 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  1600 		theFlogger.ClearLog();
  1601 		theFlogger.CreateLog(KSubsysTagWithPunctuationChars16, KCompTagWithPunctuationChars16, EFileLoggingModeOverwrite);
  1602 		theFlogger.Write(KTestMessage);
  1603 		theFlogger.Close();
  1604 		User::After(KTimeToLog);
  1605 		TRAPD(r, ret = DoTestCheckWriteL());
  1606 		if (r != KErrNone)
  1607 			ret = r;
  1608 		}
  1609 
  1610 	return ret;		
  1611 
  1612 	}
  1613 
  1614 
  1615 
  1616 
  1617 TInt CFloggerTest030_TagCreateLog05::DoTestCheckWriteL()
  1618 	{
  1619 	RFile theFile;
  1620 	HBufC8 * hBuffer;
  1621 	TInt listfilesize,returnCode;
  1622 	RFs fileSystem; //For file operation create a file system
  1623 	TUint numSuccessful = 0;
  1624 
  1625 	
  1626 	User::LeaveIfError(fileSystem.Connect());
  1627 	CleanupClosePushL(fileSystem);
  1628 	
  1629 	//Open the file in the read mode
  1630 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  1631 
  1632 	CleanupClosePushL(theFile);
  1633 
  1634 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  1635 	
  1636 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  1637 	CleanupStack::PushL(hBuffer);
  1638 
  1639 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  1640 
  1641 	// Read from position 0: start of file
  1642 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  1643 	
  1644 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  1645 											//from the file
  1646 
  1647 	if (returnCode == KErrNotFound)
  1648 		{
  1649 		numSuccessful++;
  1650 		returnCode = ptrString.Find(KErrOOM);
  1651 		if (returnCode > 0)
  1652 			User::Leave(KErrNoMemory);
  1653 		}
  1654 
  1655 	
  1656 	CleanupStack::PopAndDestroy(hBuffer);
  1657 	CleanupStack::PopAndDestroy();	//theFile
  1658 	CleanupStack::PopAndDestroy();  //fileSystem
  1659 	
  1660 	if (numSuccessful == 1)
  1661 		return KErrNone;
  1662 	else 
  1663 		return KErrNotFound;
  1664 	}
  1665 
  1666 
  1667 
  1668 /**
  1669 * 030_TagCreateLog06: Test that flogger handles length 16 tags
  1670 */ 
  1671 
  1672 CFloggerTest030_TagCreateLog06::CFloggerTest030_TagCreateLog06()
  1673 	{
  1674 	// Store the name of this test case
  1675 	SetTestStepName(_L("step_030_TagCreateLog06"));
  1676 	}
  1677 
  1678 
  1679 
  1680 
  1681 CFloggerTest030_TagCreateLog06::~CFloggerTest030_TagCreateLog06()
  1682 	{
  1683 	}
  1684 
  1685 
  1686 
  1687 
  1688 TVerdict CFloggerTest030_TagCreateLog06::doTestStepL( )
  1689 	{
  1690 	if ( executeStepL() == KErrNone  )
  1691 		SetTestStepResult(EPass);
  1692 
  1693 	else
  1694 		SetTestStepResult(EFail);
  1695 
  1696 	User::After(KTimeForDisplay);
  1697 
  1698 	
  1699 	return TestStepResult();
  1700 	}
  1701 
  1702 
  1703 TInt CFloggerTest030_TagCreateLog06::executeStepL(TBool)
  1704 	{
  1705 	return KErrGeneral;
  1706 	}	
  1707 
  1708 TInt CFloggerTest030_TagCreateLog06::executeStepL()
  1709 	{
  1710 	
  1711 	TInt ret ;
  1712 	RFileLogger theFlogger; 
  1713 	ret = theFlogger.Connect();
  1714 	
  1715 	if ( ret == KErrNone)
  1716 		{
  1717 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  1718 		theFlogger.ClearLog();
  1719 		theFlogger.CreateLog(KSubsysTag16char16, KCompTag16char16, EFileLoggingModeOverwrite); 
  1720 		theFlogger.Write(KTestMessage);
  1721 		theFlogger.Close();
  1722 		User::After(KTimeToLog);
  1723 		TRAPD(r, ret = DoTestCheckWriteL());
  1724 		if (r != KErrNone)
  1725 			ret = r;
  1726 		}
  1727 
  1728 	return ret;		
  1729 
  1730 	}
  1731 
  1732 
  1733 
  1734 
  1735 
  1736 TInt CFloggerTest030_TagCreateLog06::DoTestCheckWriteL()
  1737 	{
  1738 	RFile theFile;
  1739 	HBufC8 * hBuffer;
  1740 	TInt listfilesize,returnCode;
  1741 	RFs fileSystem; //For file operation create a file system
  1742 	TBuf8<256> testData; //To hold the test descriptor
  1743 
  1744 
  1745 	_LIT8(KOOMError, "#Logs may be lost out of memory!!");
  1746 	
  1747 	User::LeaveIfError(fileSystem.Connect());
  1748 	
  1749 	//Open the file in the read mode
  1750 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  1751 
  1752 	CleanupClosePushL(theFile);
  1753 
  1754 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  1755 	
  1756 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  1757 	CleanupStack::PushL(hBuffer);
  1758 
  1759 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  1760 
  1761 	// Read from position 0: start of file
  1762 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  1763 	
  1764 	testData.Copy(KTestMessage); //Copy the test descriptor
  1765 	returnCode = ptrString.Find(testData); //find the test descriptor in the buffer read
  1766 											//from the file
  1767 
  1768 	if (returnCode == KErrNotFound)
  1769 		{
  1770 		returnCode = ptrString.Find(KOOMError);
  1771 		if (returnCode > 0)
  1772 			User::Leave(KErrNoMemory);
  1773 		}
  1774 
  1775 	
  1776 	CleanupStack::PopAndDestroy(hBuffer);
  1777 	CleanupStack::PopAndDestroy();	//theFile
  1778 	if (returnCode > 0)
  1779 		return KErrNone;
  1780 	else 
  1781 		return KErrNotFound;
  1782 	}
  1783 
  1784 
  1785 
  1786 
  1787 
  1788 
  1789 
  1790 
  1791 /**
  1792 * 030_TagCreateLog07: Test that flogger handles length 17 tags by truncating
  1793 */ 
  1794 
  1795 CFloggerTest030_TagCreateLog07::CFloggerTest030_TagCreateLog07()
  1796 	{
  1797 	// Store the name of this test case
  1798 	SetTestStepName(_L("step_030_TagCreateLog07"));
  1799 	}
  1800 
  1801 
  1802 
  1803 
  1804 CFloggerTest030_TagCreateLog07::~CFloggerTest030_TagCreateLog07()
  1805 	{
  1806 	}
  1807 
  1808 
  1809 
  1810 
  1811 TVerdict CFloggerTest030_TagCreateLog07::doTestStepL( )
  1812 	{
  1813 	if ( executeStepL() == KErrNone  )
  1814 		SetTestStepResult(EPass);
  1815 
  1816 	else
  1817 		SetTestStepResult(EFail);
  1818 
  1819 	User::After(KTimeForDisplay);
  1820 
  1821 	
  1822 	return TestStepResult();
  1823 	}
  1824 
  1825 
  1826 TInt CFloggerTest030_TagCreateLog07::executeStepL(TBool)
  1827 	{
  1828 	return KErrGeneral;
  1829 	}
  1830 
  1831 TInt CFloggerTest030_TagCreateLog07::executeStepL()
  1832 	{
  1833 	
  1834 	TInt ret ;
  1835 	RFileLogger theFlogger; 
  1836 	ret = theFlogger.Connect();
  1837 	
  1838 	if ( ret == KErrNone)
  1839 		{
  1840 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  1841 		theFlogger.ClearLog();
  1842 		theFlogger.CreateLog(KSubsysTag17char16, KCompTag17char16, EFileLoggingModeOverwrite); 
  1843 		theFlogger.Write(KTestMessage);
  1844 		theFlogger.Close();
  1845 		User::After(KTimeToLog);
  1846 		TRAPD(r, ret = DoTestCheckWriteL());
  1847 		if (r != KErrNone)
  1848 			ret = r;
  1849 		}
  1850 
  1851 	return ret;		
  1852 
  1853 	}
  1854 
  1855 
  1856 
  1857 /**
  1858 * This function checks whether test data was written
  1859 * 						  in to the log file .				  
  1860 */
  1861 
  1862 
  1863 TInt CFloggerTest030_TagCreateLog07::DoTestCheckWriteL()
  1864 	{
  1865 	RFile theFile;
  1866 	HBufC8 * hBuffer;
  1867 	TInt listfilesize,returnCode;
  1868 	RFs fileSystem; //For file operation create a file system
  1869 	TBuf8<256> testData; //To hold the test descriptor
  1870 	TInt numSuccessful = 0;
  1871 
  1872 
  1873 	_LIT8(KOOMError, "#Logs may be lost out of memory!!");
  1874 	
  1875 	User::LeaveIfError(fileSystem.Connect());
  1876 	
  1877 	//Open the file in the read mode
  1878 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  1879 
  1880 	CleanupClosePushL(theFile);
  1881 
  1882 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  1883 	
  1884 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  1885 	CleanupStack::PushL(hBuffer);
  1886 
  1887 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  1888 
  1889 	// Read from position 0: start of file
  1890 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  1891 	
  1892 	testData.Copy(KTestMessage); //Copy the test descriptor
  1893 	returnCode = ptrString.Find(testData); //find the test descriptor in the buffer read
  1894 											//from the file
  1895 	if (returnCode > 0)
  1896 		{
  1897 		numSuccessful++;
  1898 		}
  1899 											
  1900 	// We expect to see the string "subsystem0123456" but not "subsystem01234567"
  1901 	testData.Copy(KSubsysTag16char16); //Copy the test descriptor
  1902 	returnCode = ptrString.Find(testData); //find the test descriptor in the buffer read
  1903 
  1904 	if (returnCode > 0)
  1905 		{
  1906 		numSuccessful++;
  1907 		}
  1908 
  1909 	testData.Copy(KSubsysTag17char16); //Copy the test descriptor
  1910 	returnCode = ptrString.Find(testData); //find the test descriptor in the buffer read
  1911 	
  1912 	if (returnCode == KErrNotFound)
  1913 		{
  1914 		numSuccessful++;
  1915 		}
  1916 	
  1917 	if (returnCode == KErrNotFound)
  1918 		{
  1919 		returnCode = ptrString.Find(KOOMError);
  1920 		if (returnCode > 0)
  1921 			User::Leave(KErrNoMemory);
  1922 		}
  1923 
  1924 
  1925 	
  1926 	CleanupStack::PopAndDestroy(hBuffer);
  1927 	CleanupStack::PopAndDestroy();	//theFile
  1928 	if (numSuccessful == 3)
  1929 		return KErrNone;
  1930 	else 
  1931 		return KErrNotFound;
  1932 	}
  1933 
  1934 
  1935 /**
  1936 * 030_TagCreateLog08: Test that flogger handles very long tags
  1937 */ 
  1938 
  1939 CFloggerTest030_TagCreateLog08::CFloggerTest030_TagCreateLog08()
  1940 	{
  1941 	// Store the name of this test case
  1942 	SetTestStepName(_L("step_030_TagCreateLog08"));
  1943 	}
  1944 
  1945 
  1946 
  1947 
  1948 CFloggerTest030_TagCreateLog08::~CFloggerTest030_TagCreateLog08()
  1949 	{
  1950 	}
  1951 
  1952 
  1953 
  1954 
  1955 TVerdict CFloggerTest030_TagCreateLog08::doTestStepL( )
  1956 	{
  1957 	if ( executeStepL() == KErrNone  )
  1958 		SetTestStepResult(EPass);
  1959 
  1960 	else
  1961 		SetTestStepResult(EFail);
  1962 
  1963 	User::After(KTimeForDisplay);
  1964 
  1965 	
  1966 	return TestStepResult();
  1967 	}
  1968 
  1969 
  1970 TInt CFloggerTest030_TagCreateLog08::executeStepL(TBool)
  1971 	{
  1972 	return KErrGeneral;
  1973 	}
  1974 
  1975 TInt CFloggerTest030_TagCreateLog08::executeStepL()
  1976 	{
  1977 	
  1978 	TInt ret ;
  1979 	RFileLogger theFlogger; 
  1980 	ret = theFlogger.Connect();
  1981 	
  1982 	if ( ret == KErrNone)
  1983 		{
  1984 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  1985 		theFlogger.ClearLog();
  1986 		theFlogger.CreateLog(KSubsysTag66char16, KCompTag66char16, EFileLoggingModeOverwrite);
  1987 		theFlogger.Write(KTestMessage);
  1988 		theFlogger.Close();
  1989 		User::After(KTimeToLog);
  1990 		TRAPD(r, ret = DoTestCheckWriteL());
  1991 		if (r != KErrNone)
  1992 			ret = r;
  1993 		}
  1994 
  1995 	return ret;		
  1996 
  1997 	}
  1998 
  1999 
  2000 
  2001 
  2002 TInt CFloggerTest030_TagCreateLog08::DoTestCheckWriteL()
  2003 	{
  2004 	RFile theFile;
  2005 	HBufC8 * hBuffer;
  2006 	TInt listfilesize,returnCode;
  2007 	RFs fileSystem; //For file operation create a file system
  2008 	TUint numSuccessful = 0;
  2009 
  2010 	
  2011 	User::LeaveIfError(fileSystem.Connect());
  2012 	CleanupClosePushL(fileSystem);
  2013 	
  2014 	//Open the file in the read mode
  2015 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  2016 
  2017 	CleanupClosePushL(theFile);
  2018 
  2019 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  2020 	
  2021 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  2022 	CleanupStack::PushL(hBuffer);
  2023 
  2024 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  2025 
  2026 	// Read from position 0: start of file
  2027 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  2028 	
  2029 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  2030 											//from the file
  2031 	
  2032 	if (returnCode > 0)
  2033 		{
  2034 		numSuccessful++;
  2035 		}
  2036 	else if (returnCode == KErrNotFound)
  2037 		{
  2038 		returnCode = ptrString.Find(KErrOOM);
  2039 		if (returnCode > 0)
  2040 			User::Leave(KErrNoMemory);
  2041 		}
  2042 
  2043 	// We expect to see the string "subsystem0123456" but not "subsystem01234567"
  2044 	returnCode = ptrString.Find(KSubsysTag16char8); //find the test descriptor in the buffer read
  2045 
  2046 	if (returnCode > 0)
  2047 		{
  2048 		numSuccessful++;
  2049 		}
  2050 	
  2051 	CleanupStack::PopAndDestroy(hBuffer);
  2052 	CleanupStack::PopAndDestroy();	//theFile
  2053 	CleanupStack::PopAndDestroy();  //fileSystem
  2054 	
  2055 	if (numSuccessful == 2)
  2056 		return KErrNone;
  2057 	else 
  2058 		return KErrNotFound;
  2059 	}
  2060 
  2061 
  2062 
  2063 
  2064 /***************************************************************************************/
  2065 
  2066 
  2067 /**
  2068 * 030_TagWrite01: Test that flogger handles empty tags
  2069 */ 
  2070 
  2071 CFloggerTest030_TagWrite01::CFloggerTest030_TagWrite01()
  2072 	{
  2073 	// Store the name of this test case
  2074 	SetTestStepName(_L("step_030_TagWrite01"));
  2075 	}
  2076 
  2077 
  2078 
  2079 
  2080 CFloggerTest030_TagWrite01::~CFloggerTest030_TagWrite01()
  2081 	{
  2082 	}
  2083 
  2084 
  2085 
  2086 
  2087 TVerdict CFloggerTest030_TagWrite01::doTestStepL( )
  2088 	{
  2089 	if ( executeStepL() == KErrNone  )
  2090 		SetTestStepResult(EPass);
  2091 
  2092 	else
  2093 		SetTestStepResult(EFail);
  2094 
  2095 	User::After(KTimeForDisplay);
  2096 
  2097 	
  2098 	return TestStepResult();
  2099 	}
  2100 
  2101 
  2102 TInt CFloggerTest030_TagWrite01::executeStepL(TBool)
  2103 	{
  2104 	return KErrGeneral;
  2105 	}
  2106 
  2107 TInt CFloggerTest030_TagWrite01::executeStepL()
  2108 	{
  2109 	
  2110 	TInt ret ;
  2111 	RFileLogger theFlogger; 
  2112 	ret = theFlogger.Connect();
  2113 	
  2114 	if ( ret == KErrNone)
  2115 		{
  2116 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  2117 		theFlogger.ClearLog();
  2118 		theFlogger.Close();
  2119 		RFileLogger::Write(KNullDesC8, KNullDesC8,KTestMessage);
  2120 		User::After(KTimeToLog);
  2121 		TRAPD(r, ret = DoTestCheckWriteL());
  2122 		if (r != KErrNone)
  2123 			ret = r;
  2124 		}
  2125 
  2126 	return ret;		
  2127 
  2128 	}
  2129 
  2130 
  2131 
  2132 
  2133 TInt CFloggerTest030_TagWrite01::DoTestCheckWriteL()
  2134 	{
  2135 	RFile theFile;
  2136 	HBufC8 * hBuffer;
  2137 	TInt listfilesize,returnCode;
  2138 	RFs fileSystem; //For file operation create a file system
  2139 	TUint numSuccessful = 0;
  2140 
  2141 	
  2142 	User::LeaveIfError(fileSystem.Connect());
  2143 	CleanupClosePushL(fileSystem);
  2144 	
  2145 	//Open the file in the read mode
  2146 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  2147 
  2148 	CleanupClosePushL(theFile);
  2149 
  2150 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  2151 	
  2152 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  2153 	CleanupStack::PushL(hBuffer);
  2154 
  2155 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  2156 
  2157 	// Read from position 0: start of file
  2158 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  2159 	
  2160 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  2161 											//from the file
  2162 
  2163 	if (returnCode == KErrNotFound)
  2164 		{
  2165 		numSuccessful++;
  2166 		returnCode = ptrString.Find(KErrOOM);
  2167 		if (returnCode > 0)
  2168 			User::Leave(KErrNoMemory);
  2169 		}
  2170 
  2171 	
  2172 	CleanupStack::PopAndDestroy(hBuffer);
  2173 	CleanupStack::PopAndDestroy();	//theFile
  2174 	CleanupStack::PopAndDestroy();  //fileSystem
  2175 	
  2176 	if (numSuccessful == 1)
  2177 		return KErrNone;
  2178 	else 
  2179 		return KErrNotFound;
  2180 	}
  2181 
  2182 
  2183 
  2184 
  2185 /**
  2186 * 030_TagWrite02: Test that flogger handles empty subsys tag
  2187 */ 
  2188 
  2189 CFloggerTest030_TagWrite02::CFloggerTest030_TagWrite02()
  2190 	{
  2191 	// Store the name of this test case
  2192 	SetTestStepName(_L("step_030_TagWrite02"));
  2193 	}
  2194 
  2195 
  2196 
  2197 
  2198 CFloggerTest030_TagWrite02::~CFloggerTest030_TagWrite02()
  2199 	{
  2200 	}
  2201 
  2202 
  2203 
  2204 
  2205 TVerdict CFloggerTest030_TagWrite02::doTestStepL( )
  2206 	{
  2207 	if ( executeStepL() == KErrNone  )
  2208 		SetTestStepResult(EPass);
  2209 
  2210 	else
  2211 		SetTestStepResult(EFail);
  2212 
  2213 	User::After(KTimeForDisplay);
  2214 
  2215 	
  2216 	return TestStepResult();
  2217 	}
  2218 
  2219 
  2220 TInt CFloggerTest030_TagWrite02::executeStepL(TBool)
  2221 	{
  2222 	return KErrGeneral;
  2223 	}
  2224 
  2225 TInt CFloggerTest030_TagWrite02::executeStepL()
  2226 	{
  2227 	
  2228 	TInt ret ;
  2229 	RFileLogger theFlogger; 
  2230 	ret = theFlogger.Connect();
  2231 	
  2232 	if ( ret == KErrNone)
  2233 		{
  2234 		//Create Log by passing the subsystem and component name as parameters
  2235 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  2236 		theFlogger.ClearLog();
  2237 		theFlogger.Close();
  2238 		RFileLogger::Write(KNullDesC8, KStdCompTag8,KTestMessage);
  2239 		User::After(KTimeToLog);
  2240 		TRAPD(r, ret = DoTestCheckWriteL());
  2241 		if (r != KErrNone)
  2242 			ret = r;
  2243 		}
  2244 
  2245 	return ret;		
  2246 
  2247 	}
  2248 
  2249 
  2250 
  2251 
  2252 TInt CFloggerTest030_TagWrite02::DoTestCheckWriteL()
  2253 	{
  2254 	RFile theFile;
  2255 	HBufC8 * hBuffer;
  2256 	TInt listfilesize,returnCode;
  2257 	RFs fileSystem; //For file operation create a file system
  2258 	TUint numSuccessful = 0;
  2259 
  2260 	
  2261 	User::LeaveIfError(fileSystem.Connect());
  2262 	CleanupClosePushL(fileSystem);
  2263 	
  2264 	//Open the file in the read mode
  2265 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  2266 
  2267 	CleanupClosePushL(theFile);
  2268 
  2269 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  2270 	
  2271 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  2272 	CleanupStack::PushL(hBuffer);
  2273 
  2274 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  2275 
  2276 	// Read from position 0: start of file
  2277 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  2278 	
  2279 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  2280 											//from the file
  2281 
  2282 	if (returnCode == KErrNotFound)
  2283 		{
  2284 		numSuccessful++;
  2285 		returnCode = ptrString.Find(KErrOOM);
  2286 		if (returnCode > 0)
  2287 			User::Leave(KErrNoMemory);
  2288 		}
  2289 
  2290 	
  2291 	CleanupStack::PopAndDestroy(hBuffer);
  2292 	CleanupStack::PopAndDestroy();	//theFile
  2293 	CleanupStack::PopAndDestroy();  //fileSystem
  2294 	
  2295 	if (numSuccessful == 1)
  2296 		return KErrNone;
  2297 	else 
  2298 		return KErrNotFound;
  2299 	}
  2300 
  2301 
  2302 
  2303 /**
  2304 * 030_TagWrite03: Test that flogger handles empty component tag
  2305 */ 
  2306 
  2307 CFloggerTest030_TagWrite03::CFloggerTest030_TagWrite03()
  2308 	{
  2309 	// Store the name of this test case
  2310 	SetTestStepName(_L("step_030_TagWrite03"));
  2311 	}
  2312 
  2313 
  2314 
  2315 
  2316 CFloggerTest030_TagWrite03::~CFloggerTest030_TagWrite03()
  2317 	{
  2318 	}
  2319 
  2320 
  2321 
  2322 
  2323 TVerdict CFloggerTest030_TagWrite03::doTestStepL( )
  2324 	{
  2325 	if ( executeStepL() == KErrNone  )
  2326 		SetTestStepResult(EPass);
  2327 
  2328 	else
  2329 		SetTestStepResult(EFail);
  2330 
  2331 	User::After(KTimeForDisplay);
  2332 
  2333 	
  2334 	return TestStepResult();
  2335 	}
  2336 
  2337 
  2338 TInt CFloggerTest030_TagWrite03::executeStepL(TBool)
  2339 	{
  2340 	return KErrGeneral;
  2341 	}
  2342 
  2343 TInt CFloggerTest030_TagWrite03::executeStepL()
  2344 	{
  2345 	
  2346 	TInt ret ;
  2347 	RFileLogger theFlogger; 
  2348 	ret = theFlogger.Connect();
  2349 	
  2350 	if ( ret == KErrNone)
  2351 		{
  2352 		//Create Log by passing the subsystem and component name as parameters
  2353 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  2354 		theFlogger.ClearLog();
  2355 		theFlogger.Close();
  2356 		RFileLogger::Write(KStdSubsysTag8, KNullDesC8,KTestMessage);
  2357 		User::After(KTimeToLog);
  2358 		TRAPD(r, ret = DoTestCheckWriteL());
  2359 		if (r != KErrNone)
  2360 			ret = r;
  2361 		}
  2362 
  2363 	return ret;		
  2364 
  2365 	}
  2366 
  2367 
  2368 
  2369 
  2370 TInt CFloggerTest030_TagWrite03::DoTestCheckWriteL()
  2371 	{
  2372 	RFile theFile;
  2373 	HBufC8 * hBuffer;
  2374 	TInt listfilesize,returnCode;
  2375 	RFs fileSystem; //For file operation create a file system
  2376 	TUint numSuccessful = 0;
  2377 
  2378 	
  2379 	User::LeaveIfError(fileSystem.Connect());
  2380 	CleanupClosePushL(fileSystem);
  2381 	
  2382 	//Open the file in the read mode
  2383 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  2384 
  2385 	CleanupClosePushL(theFile);
  2386 
  2387 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  2388 	
  2389 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  2390 	CleanupStack::PushL(hBuffer);
  2391 
  2392 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  2393 
  2394 	// Read from position 0: start of file
  2395 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  2396 	
  2397 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  2398 											//from the file
  2399 
  2400 	if (returnCode == KErrNotFound)
  2401 		{
  2402 		numSuccessful++;
  2403 		returnCode = ptrString.Find(KErrOOM);
  2404 		if (returnCode > 0)
  2405 			User::Leave(KErrNoMemory);
  2406 		}
  2407 
  2408 	
  2409 	CleanupStack::PopAndDestroy(hBuffer);
  2410 	CleanupStack::PopAndDestroy();	//theFile
  2411 	CleanupStack::PopAndDestroy();  //fileSystem
  2412 	
  2413 	if (numSuccessful == 1)
  2414 		return KErrNone;
  2415 	else 
  2416 		return KErrNotFound;
  2417 	}
  2418 
  2419 
  2420 
  2421 
  2422 /**
  2423 * 030_TagWrite04: Test that flogger handles spaces in tags
  2424 */ 
  2425 
  2426 CFloggerTest030_TagWrite04::CFloggerTest030_TagWrite04()
  2427 	{
  2428 	// Store the name of this test case
  2429 	SetTestStepName(_L("step_030_TagWrite04"));
  2430 	}
  2431 
  2432 
  2433 
  2434 
  2435 CFloggerTest030_TagWrite04::~CFloggerTest030_TagWrite04()
  2436 	{
  2437 	}
  2438 
  2439 
  2440 
  2441 
  2442 TVerdict CFloggerTest030_TagWrite04::doTestStepL( )
  2443 	{
  2444 	if ( executeStepL() == KErrNone  )
  2445 		SetTestStepResult(EPass);
  2446 
  2447 	else
  2448 		SetTestStepResult(EFail);
  2449 
  2450 	User::After(KTimeForDisplay);
  2451 
  2452 	
  2453 	return TestStepResult();
  2454 	}
  2455 
  2456 
  2457 TInt CFloggerTest030_TagWrite04::executeStepL(TBool)
  2458 	{
  2459 	return KErrGeneral;
  2460 	}
  2461 
  2462 TInt CFloggerTest030_TagWrite04::executeStepL()
  2463 	{
  2464 	
  2465 	TInt ret ;
  2466 	RFileLogger theFlogger; 
  2467 	ret = theFlogger.Connect();
  2468 	
  2469 	if ( ret == KErrNone)
  2470 		{
  2471 		//Create Log by passing the subsystem and component name as parameters
  2472 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  2473 		theFlogger.ClearLog();
  2474 		theFlogger.Close();
  2475 		RFileLogger::Write(KStdSubsysTag8, KCompTagWithSpaceChars8,KTestMessage);
  2476 		User::After(KTimeToLog);
  2477 		TRAPD(r, ret = DoTestCheckWriteL());
  2478 		if (r != KErrNone)
  2479 			ret = r;
  2480 		}
  2481 
  2482 	return ret;		
  2483 
  2484 	}
  2485 
  2486 
  2487 
  2488 
  2489 TInt CFloggerTest030_TagWrite04::DoTestCheckWriteL()
  2490 	{
  2491 	RFile theFile;
  2492 	HBufC8 * hBuffer;
  2493 	TInt listfilesize,returnCode;
  2494 	RFs fileSystem; //For file operation create a file system
  2495 	TUint numSuccessful = 0;
  2496 
  2497 	
  2498 	User::LeaveIfError(fileSystem.Connect());
  2499 	CleanupClosePushL(fileSystem);
  2500 	
  2501 	//Open the file in the read mode
  2502 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  2503 
  2504 	CleanupClosePushL(theFile);
  2505 
  2506 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  2507 	
  2508 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  2509 	CleanupStack::PushL(hBuffer);
  2510 
  2511 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  2512 
  2513 	// Read from position 0: start of file
  2514 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  2515 	
  2516 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  2517 											//from the file
  2518 
  2519 	if (returnCode == KErrNotFound)
  2520 		{
  2521 		numSuccessful++;
  2522 		returnCode = ptrString.Find(KErrOOM);
  2523 		if (returnCode > 0)
  2524 			User::Leave(KErrNoMemory);
  2525 		}
  2526 
  2527 	
  2528 	CleanupStack::PopAndDestroy(hBuffer);
  2529 	CleanupStack::PopAndDestroy();	//theFile
  2530 	CleanupStack::PopAndDestroy();  //fileSystem
  2531 	
  2532 	if (numSuccessful == 1)
  2533 		return KErrNone;
  2534 	else 
  2535 		return KErrNotFound;
  2536 	}
  2537 
  2538 
  2539 
  2540 
  2541 
  2542 /**
  2543 * 030_TagWrite05: Test that flogger handles punctuation in tags
  2544 */ 
  2545 
  2546 CFloggerTest030_TagWrite05::CFloggerTest030_TagWrite05()
  2547 	{
  2548 	// Store the name of this test case
  2549 	SetTestStepName(_L("step_030_TagWrite05"));
  2550 	}
  2551 
  2552 
  2553 
  2554 
  2555 CFloggerTest030_TagWrite05::~CFloggerTest030_TagWrite05()
  2556 	{
  2557 	}
  2558 
  2559 
  2560 
  2561 
  2562 TVerdict CFloggerTest030_TagWrite05::doTestStepL( )
  2563 	{
  2564 	if ( executeStepL() == KErrNone  )
  2565 		SetTestStepResult(EPass);
  2566 
  2567 	else
  2568 		SetTestStepResult(EFail);
  2569 
  2570 	User::After(KTimeForDisplay);
  2571 
  2572 	
  2573 	return TestStepResult();
  2574 	}
  2575 
  2576 TInt CFloggerTest030_TagWrite05::executeStepL(TBool)
  2577 	{
  2578 	return KErrGeneral;
  2579 	}
  2580 
  2581 
  2582 TInt CFloggerTest030_TagWrite05::executeStepL()
  2583 	{
  2584 	
  2585 	TInt ret ;
  2586 	RFileLogger theFlogger; 
  2587 	ret = theFlogger.Connect();
  2588 	
  2589 	if ( ret == KErrNone)
  2590 		{
  2591 		//Create Log by passing the subsystem and component name as parameters
  2592 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  2593 		theFlogger.ClearLog();
  2594 		theFlogger.Close();
  2595 		RFileLogger::Write(KSubsysTagWithPunctuationChars8, KCompTagWithPunctuationChars8,KTestMessage);
  2596 		User::After(KTimeToLog);
  2597 		TRAPD(r, ret = DoTestCheckWriteL());
  2598 		if (r != KErrNone)
  2599 			ret = r;
  2600 		}
  2601 
  2602 	return ret;		
  2603 
  2604 	}
  2605 
  2606 
  2607 
  2608 
  2609 TInt CFloggerTest030_TagWrite05::DoTestCheckWriteL()
  2610 	{
  2611 	RFile theFile;
  2612 	HBufC8 * hBuffer;
  2613 	TInt listfilesize,returnCode;
  2614 	RFs fileSystem; //For file operation create a file system
  2615 	TUint numSuccessful = 0;
  2616 
  2617 	
  2618 	User::LeaveIfError(fileSystem.Connect());
  2619 	CleanupClosePushL(fileSystem);
  2620 	
  2621 	//Open the file in the read mode
  2622 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  2623 
  2624 	CleanupClosePushL(theFile);
  2625 
  2626 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  2627 	
  2628 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  2629 	CleanupStack::PushL(hBuffer);
  2630 
  2631 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  2632 
  2633 	// Read from position 0: start of file
  2634 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  2635 	
  2636 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  2637 											//from the file
  2638 
  2639 	if (returnCode == KErrNotFound)
  2640 		{
  2641 		numSuccessful++;
  2642 		returnCode = ptrString.Find(KErrOOM);
  2643 		if (returnCode > 0)
  2644 			User::Leave(KErrNoMemory);
  2645 		}
  2646 
  2647 	
  2648 	CleanupStack::PopAndDestroy(hBuffer);
  2649 	CleanupStack::PopAndDestroy();	//theFile
  2650 	CleanupStack::PopAndDestroy();  //fileSystem
  2651 	
  2652 	if (numSuccessful == 1)
  2653 		return KErrNone;
  2654 	else 
  2655 		return KErrNotFound;
  2656 	}
  2657 
  2658 
  2659 /**
  2660 * 030_TagWrite06: Test that flogger handles long tags
  2661 */ 
  2662 
  2663 CFloggerTest030_TagWrite06::CFloggerTest030_TagWrite06()
  2664 	{
  2665 	// Store the name of this test case
  2666 	SetTestStepName(_L("step_030_TagWrite06"));
  2667 	}
  2668 
  2669 
  2670 
  2671 
  2672 CFloggerTest030_TagWrite06::~CFloggerTest030_TagWrite06()
  2673 	{
  2674 	}
  2675 
  2676 
  2677 
  2678 
  2679 TVerdict CFloggerTest030_TagWrite06::doTestStepL( )
  2680 	{
  2681 	if ( executeStepL() == KErrNone  )
  2682 		SetTestStepResult(EPass);
  2683 
  2684 	else
  2685 		SetTestStepResult(EFail);
  2686 
  2687 	User::After(KTimeForDisplay);
  2688 
  2689 	
  2690 	return TestStepResult();
  2691 	}
  2692 
  2693 
  2694 TInt CFloggerTest030_TagWrite06::executeStepL(TBool)
  2695 	{
  2696 	return KErrGeneral;
  2697 	}
  2698 
  2699 TInt CFloggerTest030_TagWrite06::executeStepL()
  2700 	{
  2701 	
  2702 	TInt ret ;
  2703 	RFileLogger theFlogger; 
  2704 	ret = theFlogger.Connect();
  2705 	
  2706 	if ( ret == KErrNone)
  2707 		{
  2708 		//Create Log by passing the subsystem and component name as parameters
  2709 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  2710 		theFlogger.ClearLog();
  2711 		theFlogger.Close();
  2712 		RFileLogger::Write(KSubsysTag16char8, KCompTag16char8,KTestMessage8);
  2713 		User::After(KTimeToLog);
  2714 		TRAPD(r, ret = DoTestCheckWriteL());
  2715 		if (r != KErrNone)
  2716 			ret = r;
  2717 		}
  2718 
  2719 	return ret;		
  2720 
  2721 	}
  2722 
  2723 
  2724 
  2725 
  2726 TInt CFloggerTest030_TagWrite06::DoTestCheckWriteL()
  2727 	{
  2728 	RFile theFile;
  2729 	HBufC8 * hBuffer;
  2730 	TInt listfilesize,returnCode;
  2731 	RFs fileSystem; //For file operation create a file system
  2732 	TUint numSuccessful = 0;
  2733 
  2734 	
  2735 	User::LeaveIfError(fileSystem.Connect());
  2736 	CleanupClosePushL(fileSystem);
  2737 	
  2738 	//Open the file in the read mode
  2739 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  2740 
  2741 	CleanupClosePushL(theFile);
  2742 
  2743 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  2744 	
  2745 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  2746 	CleanupStack::PushL(hBuffer);
  2747 
  2748 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  2749 
  2750 	// Read from position 0: start of file
  2751 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  2752 	
  2753 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  2754 											//from the file
  2755 	
  2756 	if (returnCode > 0)
  2757 		{
  2758 		numSuccessful++;
  2759 		}
  2760 	else if (returnCode == KErrNotFound)
  2761 		{
  2762 		returnCode = ptrString.Find(KErrOOM);
  2763 		if (returnCode > 0)
  2764 			User::Leave(KErrNoMemory);
  2765 		}
  2766 
  2767 	
  2768 	CleanupStack::PopAndDestroy(hBuffer);
  2769 	CleanupStack::PopAndDestroy();	//theFile
  2770 	CleanupStack::PopAndDestroy();  //fileSystem
  2771 	
  2772 	if (numSuccessful == 1)
  2773 		return KErrNone;
  2774 	else 
  2775 		return KErrNotFound;
  2776 	}
  2777 
  2778 
  2779 
  2780 
  2781 /**
  2782 * 030_TagWrite07: Test that flogger handles long tags
  2783 */ 
  2784 
  2785 CFloggerTest030_TagWrite07::CFloggerTest030_TagWrite07()
  2786 	{
  2787 	// Store the name of this test case
  2788 	SetTestStepName(_L("step_030_TagWrite07"));
  2789 	}
  2790 
  2791 
  2792 
  2793 
  2794 CFloggerTest030_TagWrite07::~CFloggerTest030_TagWrite07()
  2795 	{
  2796 	}
  2797 
  2798 
  2799 
  2800 
  2801 TVerdict CFloggerTest030_TagWrite07::doTestStepL( )
  2802 	{
  2803 	if ( executeStepL() == KErrNone  )
  2804 		SetTestStepResult(EPass);
  2805 
  2806 	else
  2807 		SetTestStepResult(EFail);
  2808 
  2809 	User::After(KTimeForDisplay);
  2810 
  2811 	
  2812 	return TestStepResult();
  2813 	}
  2814 
  2815 
  2816 TInt CFloggerTest030_TagWrite07::executeStepL(TBool)
  2817 	{
  2818 	return KErrGeneral;
  2819 	}
  2820 
  2821 TInt CFloggerTest030_TagWrite07::executeStepL()
  2822 	{
  2823 	
  2824 	TInt ret ;
  2825 	RFileLogger theFlogger; 
  2826 	ret = theFlogger.Connect();
  2827 	
  2828 	if ( ret == KErrNone)
  2829 		{
  2830 		//Create Log by passing the subsystem and component name as parameters
  2831 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  2832 		theFlogger.ClearLog();
  2833 		theFlogger.Close();
  2834 		RFileLogger::Write(KSubsysTag17char8, KCompTag17char8,KTestMessage8);
  2835 		User::After(KTimeToLog);
  2836 		TRAPD(r, ret = DoTestCheckWriteL());
  2837 		if (r != KErrNone)
  2838 			ret = r;
  2839 		}
  2840 
  2841 	return ret;		
  2842 
  2843 	}
  2844 
  2845 
  2846 
  2847 
  2848 TInt CFloggerTest030_TagWrite07::DoTestCheckWriteL()
  2849 	{
  2850 	RFile theFile;
  2851 	HBufC8 * hBuffer;
  2852 	TInt listfilesize,returnCode;
  2853 	RFs fileSystem; //For file operation create a file system
  2854 	TUint numSuccessful = 0;
  2855 
  2856 	
  2857 	User::LeaveIfError(fileSystem.Connect());
  2858 	CleanupClosePushL(fileSystem);
  2859 	
  2860 	//Open the file in the read mode
  2861 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  2862 
  2863 	CleanupClosePushL(theFile);
  2864 
  2865 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  2866 	
  2867 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  2868 	CleanupStack::PushL(hBuffer);
  2869 
  2870 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  2871 
  2872 	// Read from position 0: start of file
  2873 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  2874 	
  2875 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  2876 											//from the file
  2877 	
  2878 	if (returnCode > 0)
  2879 		{
  2880 		numSuccessful++;
  2881 		}
  2882 	else if (returnCode == KErrNotFound)
  2883 		{
  2884 		returnCode = ptrString.Find(KErrOOM);
  2885 		if (returnCode > 0)
  2886 			User::Leave(KErrNoMemory);
  2887 		}
  2888 
  2889 	// We expect to see the string "subsystem0123456" but not "subsystem01234567"
  2890 	returnCode = ptrString.Find(KSubsysTag16char8); //find the test descriptor in the buffer read
  2891 
  2892 	if (returnCode > 0)
  2893 		{
  2894 		numSuccessful++;
  2895 		}
  2896 
  2897 	returnCode = ptrString.Find(KSubsysTag17char8); //find the test descriptor in the buffer read
  2898 	
  2899 	if (returnCode == KErrNotFound)
  2900 		{
  2901 		numSuccessful++;
  2902 		}
  2903 	
  2904 	CleanupStack::PopAndDestroy(hBuffer);
  2905 	CleanupStack::PopAndDestroy();	//theFile
  2906 	CleanupStack::PopAndDestroy();  //fileSystem
  2907 	
  2908 	if (numSuccessful == 3)
  2909 		return KErrNone;
  2910 	else 
  2911 		return KErrNotFound;
  2912 	}
  2913 
  2914 
  2915 
  2916 
  2917 /**
  2918 * 030_TagWrite08: Test that flogger handles very long tags
  2919 */ 
  2920 
  2921 CFloggerTest030_TagWrite08::CFloggerTest030_TagWrite08()
  2922 	{
  2923 	// Store the name of this test case
  2924 	SetTestStepName(_L("step_030_TagWrite08"));
  2925 	}
  2926 
  2927 
  2928 
  2929 
  2930 CFloggerTest030_TagWrite08::~CFloggerTest030_TagWrite08()
  2931 	{
  2932 	}
  2933 
  2934 
  2935 
  2936 
  2937 TVerdict CFloggerTest030_TagWrite08::doTestStepL( )
  2938 	{
  2939 	if ( executeStepL() == KErrNone  )
  2940 		SetTestStepResult(EPass);
  2941 
  2942 	else
  2943 		SetTestStepResult(EFail);
  2944 
  2945 	User::After(KTimeForDisplay);
  2946 
  2947 	
  2948 	return TestStepResult();
  2949 	}
  2950 
  2951 
  2952 TInt CFloggerTest030_TagWrite08::executeStepL(TBool)
  2953 	{
  2954 	return KErrGeneral;
  2955 	}
  2956 
  2957 TInt CFloggerTest030_TagWrite08::executeStepL()
  2958 	{
  2959 	
  2960 	TInt ret ;
  2961 	RFileLogger theFlogger; 
  2962 	ret = theFlogger.Connect();
  2963 	
  2964 	if ( ret == KErrNone)
  2965 		{
  2966 		theFlogger.SetLogTags(KStdSubsysTag8, KStdCompTag8);
  2967 		theFlogger.ClearLog();
  2968 		theFlogger.Close();
  2969 		RFileLogger::Write(KSubsysTag66char8, KCompTag66char8,KTestMessage);
  2970 		User::After(KTimeToLog);
  2971 		TRAPD(r, ret = DoTestCheckWriteL());
  2972 		if (r != KErrNone)
  2973 			ret = r;
  2974 		}
  2975 
  2976 	return ret;		
  2977 
  2978 	}
  2979 
  2980 
  2981 
  2982 
  2983 TInt CFloggerTest030_TagWrite08::DoTestCheckWriteL()
  2984 	{
  2985 	RFile theFile;
  2986 	HBufC8 * hBuffer;
  2987 	TInt listfilesize,returnCode;
  2988 	RFs fileSystem; //For file operation create a file system
  2989 	TUint numSuccessful = 0;
  2990 
  2991 	
  2992 	User::LeaveIfError(fileSystem.Connect());
  2993 	CleanupClosePushL(fileSystem);
  2994 	
  2995 	//Open the file in the read mode
  2996 	User::LeaveIfError(theFile.Open(fileSystem,KFloggerOutputFile,EFileRead)); 
  2997 
  2998 	CleanupClosePushL(theFile);
  2999 
  3000 	User::LeaveIfError(theFile.Size(listfilesize)); //Size of the file
  3001 	
  3002 	hBuffer = HBufC8::New(listfilesize); //Allocate the buffer
  3003 	CleanupStack::PushL(hBuffer);
  3004 
  3005 	TPtr8 ptrString = hBuffer->Des();  ; //To hold the buffer
  3006 
  3007 	// Read from position 0: start of file
  3008 	User::LeaveIfError(returnCode = theFile.Read(ptrString));
  3009 	
  3010 	returnCode = ptrString.Find(KTestMessage8); //find the test descriptor in the buffer read
  3011 											//from the file
  3012 	
  3013 	if (returnCode > 0)
  3014 		{
  3015 		numSuccessful++;
  3016 		}
  3017 	else if (returnCode == KErrNotFound)
  3018 		{
  3019 		returnCode = ptrString.Find(KErrOOM);
  3020 		if (returnCode > 0)
  3021 			User::Leave(KErrNoMemory);
  3022 		}
  3023 
  3024 	// We expect to see the string "subsystem0123456" but not "subsystem01234567"
  3025 	returnCode = ptrString.Find(KSubsysTag16char8); //find the test descriptor in the buffer read
  3026 
  3027 	if (returnCode > 0)
  3028 		{
  3029 		numSuccessful++;
  3030 		}
  3031 	
  3032 	CleanupStack::PopAndDestroy(hBuffer);
  3033 	CleanupStack::PopAndDestroy();	//theFile
  3034 	CleanupStack::PopAndDestroy();  //fileSystem
  3035 	
  3036 	if (numSuccessful == 2)
  3037 		return KErrNone;
  3038 	else 
  3039 		return KErrNotFound;
  3040 	}
  3041 
  3042