os/ossrv/genericservices/httputils/Test/IpuTestUtils/IpuTestHarness.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) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #include "IpuTestUtils.h"
    17 #include <e32consf.h>
    18 //
    19 //	Constants
    20 _LIT(KTestPanic, "IpuTestHarness");
    21 const TInt KFailedTestsGranularity = 10;
    22 const TInt KMaxLogEntrySize = 256;
    23 
    24 //
    25 //	CIpuTestHarness
    26 //
    27 CIpuTestHarness::CIpuTestHarness(const TDesC& aTitle)
    28 	: iTest(aTitle)
    29 //
    30 //	Default c'tor
    31 	{
    32     LogRTestToFile(iTest);
    33 	iTest.Title();
    34 	iCanStartTest = ETrue;
    35 	}
    36 
    37 CIpuTestHarness::~CIpuTestHarness()
    38 //
    39 //	D'tor
    40 	{
    41 	TTime endtime;
    42 	endtime.UniversalTime();
    43 
    44 	// Do resource handle leak test?
    45 	if (iDoResourceLeakTest)
    46 		ResourceLeakTest();
    47 
    48 	//	End of tests - see if failed or ok
    49 	if (iFailedTests->Count())
    50 		{
    51 		TestHarnessFailed();
    52 		}
    53 	else
    54 		{
    55 		TestHarnessComplete();
    56 		}
    57 
    58 	iFailedTests->ResetAndDestroy();
    59 	delete iFailedTests;
    60 
    61 	//	Log finish time
    62 	TDateTime t = endtime.DateTime();
    63 	LogIt(_L("Ended @ %d:%d:%d:%d"),t.Hour(),t.Minute(),t.Second(),t.MicroSecond());
    64 	TTime difftime(endtime.Int64() - iStartTime.Int64());
    65 	t = difftime.DateTime();
    66 	LogIt(_L("Execution time %d:%d:%d:%d"),t.Hour(),t.Minute(),t.Second(),t.MicroSecond());
    67 
    68 	//	Close logs and test harness
    69 	iFlogger.CloseLog();
    70 	
    71 	// iTest test harness performs UHEAP MARK/UNMARK check upon creation/destruction
    72 	//   therefore, it must be destroyed last since it is created first in 
    73 	//   CIpuTestHarness
    74 	iTest.Close();
    75 	}
    76 
    77 EXPORT_C CIpuTestHarness* CIpuTestHarness::NewLC(const TDesC& aTitle)
    78 //
    79 //	Static factory c'tor
    80 	{
    81 	CIpuTestHarness* self = new (ELeave) CIpuTestHarness(aTitle);
    82 	CleanupStack::PushL(self);
    83 	self->ConstructL(aTitle);
    84 	return self;
    85 	}
    86 
    87 EXPORT_C CIpuTestHarness* CIpuTestHarness::NewL(const TDesC& aTitle)
    88 //
    89 //	Static factiry c'tor
    90 	{
    91 	CIpuTestHarness* self = CIpuTestHarness::NewLC(aTitle);
    92 	CleanupStack::Pop();
    93 	return self;
    94 	}
    95 
    96 void CIpuTestHarness::ConstructL(const TDesC& aTitle)
    97 //
    98 //	Non-trivial c'tor
    99 	{
   100 	//	Create iFailedTests
   101 	iFailedTests = new (ELeave) CArrayPtrFlat<CTestInfo> (KFailedTestsGranularity);
   102 
   103 	//	Start up logging server connection
   104 	TBuf<64> temp(aTitle);
   105 	DefaultLogFileName(temp);
   106 	CreateFlogger(temp, EFalse, EFalse);
   107 
   108 	iStartTime.UniversalTime();
   109 	TDateTime t = iStartTime.DateTime();
   110 	LogIt(_L("Started @ %d:%d:%d:%d"),t.Hour(),t.Minute(),t.Second(),t.MicroSecond());
   111 
   112 	// Find number of open resource handles
   113 	TInt processHandleCount=0;
   114 	RThread().HandleCount(processHandleCount,iStartHandleCount);
   115 	}
   116 
   117 EXPORT_C void CIpuTestHarness::StartTestL(const TDesC& aName)
   118 //
   119 //	Logs start of test aName
   120 	{
   121 	if (iCanStartTest)
   122 		{
   123 		//  - increment test count
   124 		++iTestCount;
   125 		
   126 		if (iTestMode == ETestModeNormal) // don't add this info when we are doing memory leak testing otherwise it
   127 										  // would get leaked!
   128 			{
   129 
   130 			//	Add this test to failed test list - set errorcode to zero
   131 			CTestInfo* temp = CTestInfo::NewLC(aName, iTestCount, 0);
   132 			iFailedTests->AppendL(temp);
   133 			CleanupStack::Pop();	//	temp
   134 
   135 			//	Stop new test being started until this one has ended
   136 			iTest.Start(aName);
   137 			iCanStartTest = EFalse;
   138 			}
   139 
   140 		
   141 		TBuf<KMaxFileName + 4> buf;
   142 		buf.Format(KTestStartingWithDesc, iTestCount, &aName);
   143 		WriteComment(buf);
   144 
   145 		// Reset iStepNumber - start at 1
   146 		iStepNumber = 1;
   147 		}
   148 	else
   149 		{
   150 		//	Panic client - bad usage - not allowed to nest tests
   151 		Panic(EBadStartTest);
   152 		}
   153 	}
   154 
   155 EXPORT_C void CIpuTestHarness::NextStep(const TDesC& aStepName)
   156 //
   157 //	Logs the next step in a test - for informative use.
   158 	{
   159 	if (!iCanStartTest)
   160 		{
   161 		TBuf<KMaxFileName + 4> buf;
   162 		buf.Format(KNextTestStepWithDesc, iTestCount, iStepNumber, &aStepName);
   163 		WriteComment(buf);
   164 		iTest.Next(aStepName);
   165 		++iStepNumber;
   166 		}
   167 	else
   168 		{
   169 		//	Panic client - bad usage - test not started
   170 		Panic(EBadStartTest);
   171 		}
   172 	}
   173 
   174 EXPORT_C void CIpuTestHarness::EndTest(TInt aErrorCode)
   175 //
   176 //	Logs end of test
   177 	{
   178 	if (!iCanStartTest)
   179 		{
   180 		if (iTestMode == ETestModeNormal)
   181 			{
   182 			//	Get ptr to this test's entry in failed list - will be the last entry
   183 			TBuf<KMaxFileName + 4> buf;
   184 			TInt index = iFailedTests->Count();
   185 			CTestInfo* ptr = iFailedTests->At(--index);
   186 			if (aErrorCode)
   187 				{
   188 				//	Set the error code
   189 				ptr->SetErrorCode(aErrorCode);
   190 				buf.Format(KTestFailed, iTestCount, aErrorCode);
   191 				WriteComment(buf);
   192 				}
   193 			else
   194 				{
   195 				//	Remove entry from list of failed tests
   196 				delete ptr;
   197 				iFailedTests->Delete(index);
   198 				}
   199 			
   200 			}
   201 		//	Allow new test to start
   202 		iTest.End();
   203 		iCanStartTest = ETrue;
   204 		}
   205 	else
   206 		{
   207 		if (iTestMode == ETestModeNormal)
   208 			//	Panic client - bad usage - test not started
   209 			Panic(EBadEndTest);
   210 		// don't panic when we are memory leak testing as EndTestL will never get called to reset the test properly
   211 		}
   212 	}
   213 
   214 EXPORT_C void CIpuTestHarness::LogIt(TRefByValue<const TDesC> aFmt, ...)
   215 //
   216 //	Messages to the front end emulator and to the Inu log
   217 	{
   218 	VA_LIST list;
   219 	VA_START(list,aFmt);
   220 
   221 	TBuf<KMaxFileName + 4> buf;
   222 	buf.Append(KTestCommentPrepend);
   223 	buf.AppendFormatList(aFmt,list);
   224 	VA_END(list);
   225 
   226 	WriteComment(buf);
   227 	}
   228 
   229 EXPORT_C void CIpuTestHarness::operator()(TInt aResult,TInt aLineNum)
   230 //
   231 //	Overload operator ()
   232 	{
   233 	iTest(aResult, aLineNum);
   234 	}
   235 
   236 EXPORT_C void CIpuTestHarness::operator()(TInt aResult)
   237 //
   238 //	Overload operator ()
   239 	{
   240 	iTest(aResult);
   241 	}
   242 
   243 EXPORT_C void CIpuTestHarness::PressAnyKey()
   244 //
   245 //	Request a key press from user and wait - unless we are running a script
   246 	{
   247 	if (!iScriptRunning)
   248 		{
   249 		iTest.Printf(TRefByValue<const TDesC>_L("\nPress a key"));	
   250 		iTest.Getch();
   251 		}
   252 	}
   253 
   254 EXPORT_C void CIpuTestHarness::DumpData(HBufC8& aData, TBool logIt)
   255 //
   256 //	Do a formatted dump of binary data, optionally logging it
   257 	{
   258 	// Iterate the supplied block of data in blocks of 16 bytes
   259 	TInt pos = 0;
   260 	TBuf<KMaxLogEntrySize> logLine;
   261 	TBuf<KMaxLogEntrySize> anEntry;
   262 	while (pos < aData.Length())
   263 		{
   264 		anEntry.Format(TRefByValue<const TDesC>_L("%04x : "), pos);
   265 		logLine.Append(anEntry);
   266 
   267 		// Hex output
   268 		TInt offset = 0;
   269 		for (offset = 0; offset < 16; offset++)
   270 			{
   271 			if (pos + offset < aData.Length())
   272 				{
   273 				TInt nextByte = aData[pos + offset];
   274 				anEntry.Format(TRefByValue<const TDesC>_L("%02x "), nextByte);
   275 				logLine.Append(anEntry);
   276 				}
   277 			else
   278 				{
   279 				anEntry.Format(TRefByValue<const TDesC>_L("   "));
   280 				logLine.Append(anEntry);
   281 				}
   282 			}
   283 			anEntry.Format(TRefByValue<const TDesC>_L(": "));
   284 			logLine.Append(anEntry);
   285 
   286 		// Char output
   287 		for (offset = 0; offset < 16; offset++)
   288 			{
   289 			if (pos + offset < aData.Length())
   290 				{
   291 				TInt nextByte = aData[pos + offset];
   292 				if ((nextByte >= 32) && (nextByte <= 127))
   293 					{
   294 					anEntry.Format(TRefByValue<const TDesC>_L("%c"), nextByte);
   295 					logLine.Append(anEntry);
   296 					}
   297 				else
   298 					{
   299 					anEntry.Format(TRefByValue<const TDesC>_L("."));
   300 					logLine.Append(anEntry);
   301 					}
   302 				}
   303 			else
   304 				{
   305 				anEntry.Format(TRefByValue<const TDesC>_L(" "));
   306 				logLine.Append(anEntry);
   307 				}
   308 			}
   309 			if (logIt)
   310 				{
   311 				LogIt(TRefByValue<const TDesC>_L("%S"), &logLine);
   312 				}
   313 			else
   314 				{
   315 				iTest.Printf(TRefByValue<const TDesC>_L("%S\n"), &logLine);	
   316 				}
   317 			logLine.Zero();
   318 
   319 		// Advance to next 16 byte segment
   320 		pos += 16;
   321 		}
   322 	}
   323 
   324 EXPORT_C void CIpuTestHarness::GetAnEntry(const TDesC& ourPrompt, TDes& currentstring)
   325 //
   326 //	Get an input string from the user, displaying a supplied prompt and default string value
   327 	{
   328 	// If we're scripting, try reading from script first
   329 	TInt readScriptErr = KErrNotFound;
   330 	if (iScriptRunning)
   331 		{
   332 		readScriptErr = ReadLineFromScript(currentstring);
   333 		}
   334 	if (!readScriptErr)
   335 		return;
   336 
   337 	// Either not scripting, or hit end of script - continue with user input
   338 	TBuf16<KMaxUserEntrySize> ourLine;
   339 	TBuf<KMaxUserEntrySize> tempstring;				//tempstring is a unicode descriptor
   340 										//create a temporary buffer where the
   341 										//unicode strings are stored in order to 
   342 										//be displayed
   343 	ourLine.Zero ();
   344 	tempstring.Copy(currentstring);		//Copy current string to Unicode buffer
   345 	TKeyCode key = EKeyNull;						//current string buffer is 8 bits wide.
   346 										//Unicode string bufffer (tempstring) is 16 bits wide.
   347 	for (;;)
   348 		{
   349 		if (ourLine.Length () == 0)
   350 			{
   351 			iTest.Console()->SetPos (0, iTest.Console()->WhereY ());
   352 			iTest.Console()->Printf (_L ("%S"), &ourPrompt);
   353 			if (tempstring.Length () != 0)						//get tempstring's number of items
   354 				iTest.Console()->Printf (_L (" = %S"), &tempstring);	//if not zero print them to iTest.Console()
   355 			iTest.Console()->Printf (_L (" : "));
   356 			iTest.Console()->ClearToEndOfLine ();
   357 			}
   358 		key = iTest.Getch();
   359 		
   360 		  if (key == EKeyBackspace)
   361 				{
   362 					if (ourLine.Length() !=0)
   363 					{
   364 						ourLine.SetLength(ourLine.Length()-1);
   365 						iTest.Console()->Printf (_L ("%c"), key);
   366 						iTest.Console()->SetPos(iTest.Console()->WhereX(),iTest.Console()->WhereY());
   367 						iTest.Console()->ClearToEndOfLine();
   368 					}	// end if (ourLine.Length() !=0)
   369 				}	// end if (key == KeyBackSpace)
   370 		  
   371 		  		  
   372 		  if (key == EKeyDelete) 			
   373 				{
   374 					ourLine.Zero();
   375 					iTest.Console()->SetPos (0, iTest.Console()->WhereY ());
   376 					iTest.Console()->ClearToEndOfLine ();
   377 					tempstring.Copy(ourLine);
   378 					break;
   379 				}
   380 		  
   381 		  if (key == EKeyEnter)
   382 			break;
   383 		
   384 		  if (key < 32)
   385 			{
   386 			continue;
   387 			}
   388 		
   389 		ourLine.Append (key);
   390 		iTest.Console()->Printf (_L ("%c"), key);
   391 		iTest.Console()->SetPos(iTest.Console()->WhereX(),iTest.Console()->WhereY());
   392 		iTest.Console()->ClearToEndOfLine();
   393 		if (ourLine.Length () == ourLine.MaxLength ())
   394 			break;
   395 		}	// end of for statement
   396 
   397 	if ((key == EKeyEnter) && (ourLine.Length () == 0))
   398 		tempstring.Copy (currentstring);				//copy contents of 8 bit "ourLine" descriptor
   399 	
   400 	iTest.Console()->SetPos (0, iTest.Console()->WhereY ());		
   401 	iTest.Console()->ClearToEndOfLine ();
   402 	iTest.Console()->Printf (_L ("%S"), &ourPrompt);
   403 	
   404 	if ((key == EKeyEnter) && (ourLine.Length() !=0))
   405 		tempstring.Copy(ourLine);
   406 	if (tempstring.Length () != 0)						//if temstring length is not zero
   407 		{
   408 		iTest.Console()->Printf (_L (" = %S\n"), &tempstring);	//print the contents to iTest.Console()
   409 		LogIt(_L ("%S = %S\n"), &ourPrompt, &tempstring);
   410 		}
   411 
   412 	else
   413 		//iTest.Console()->Printf (_L (" is empty"));
   414 	iTest.Console()->Printf (_L ("\n"));
   415 	currentstring.Copy(tempstring);						//copy 16 bit tempstring descriptor back 
   416 	}
   417 
   418 
   419 EXPORT_C TInt CIpuTestHarness::GetSelection(const TDesC& ourPrompt, const TDesC& validChoices)
   420 //
   421 //	Present the user with a list of options, and get their selection
   422 	{
   423 	// If we're scripting, try reading from script first
   424 	TInt readScriptErr = KErrNotFound;
   425 	if (iScriptRunning)
   426 		{
   427 		TBuf<1> oneCharBuf;
   428 		readScriptErr = ReadLineFromScript(oneCharBuf);
   429 		if (!readScriptErr)
   430 			{
   431 			return validChoices.Locate((TChar)oneCharBuf[0]);
   432 			}
   433 		}
   434 
   435 	// Either not scripting, or hit end of script - continue with user input
   436 	TKeyCode key = EKeyNull;
   437 	iTest.Console()->SetPos (0, iTest.Console()->WhereY ());
   438 	iTest.Console()->Printf(_L("%S "), &ourPrompt);
   439 	iTest.Console()->Printf(_L("[%S] :"), &validChoices);
   440 	TInt retVal = KErrNotFound;
   441 	while (retVal == KErrNotFound)
   442 		{
   443 		key = iTest.Getch();
   444 
   445 		// Check that key is in the list of valid choices
   446 		retVal = validChoices.Locate((TChar)key);
   447 		}
   448 	iTest.Console()->Printf(_L("%c\n\n"), key);
   449 	return retVal;
   450 	}
   451 
   452 
   453 EXPORT_C void CIpuTestHarness::SetScript(RFile& scriptFile)
   454 //
   455 //	Sets the file to be used for a test script - ie. a file that contains commands used by
   456 //  GetEntry() and GetSelection()
   457 	{
   458 	iScriptFile = &scriptFile;
   459 	iScriptRunning = ETrue;
   460 	LogIt(_L("***SCRIPT STARTING***\n"));
   461 	}
   462 
   463 TInt CIpuTestHarness::ReadLineFromScript(TDes& aBuffer)
   464 //
   465 // Reads the next line from the script file, and sets the passed-in descriptor with its contents.
   466 // Returns KErrNone if reading succeeded; KErrNotFound if the EOF was reached. When EOF is reached,
   467 // the file is closed.
   468 	{
   469 	// *********************************
   470 	// Assume script is 8-bit text file
   471 	// *********************************
   472 	TBool isAComment = ETrue;
   473 	TInt err = KErrNone;
   474 	TBuf<512> line;
   475 	while (isAComment && !err)
   476 		{
   477 		TFileText text;
   478 		text.Set(*iScriptFile);
   479 		line.SetLength(0);
   480 		for(;;)
   481 			{
   482 			TBuf8<2> c;
   483 			err = iScriptFile->Read(c,1);
   484 			if (err && err != KErrEof)
   485 				{
   486 				iTest.Printf(_L("Error reading file: %d\n"), err);
   487 				break;
   488 				}
   489 			if (c.Length() == 0)
   490 				{
   491 				err = KErrEof;
   492 				break;
   493 				}
   494 			else
   495 				{
   496 				if (c[0] == '\n') // break out if it is CR
   497 					break;
   498 				else if (c[0] != (TUint8)(0x0d)) // otherwise append the char, _unless_ it is a LF
   499 					line.Append(c[0]);
   500 				}
   501 			}
   502 		if (err == KErrNone && line.Locate('/') != 0) // comment (only works if it's the first character)
   503 			{
   504 			isAComment = EFalse;
   505 			}
   506 		}
   507 
   508 	// The line read is not a comment, or have hit end of file
   509 	if (!err)
   510 		{
   511 		// copy to passed in descriptor, but do not allow an overflow
   512 		aBuffer.Copy(line.Left(aBuffer.MaxLength()));
   513 		LogIt(_L("***SCRIPT : read command '%S' ***\n"), &aBuffer);
   514 		}
   515 	else
   516 		{
   517 		iScriptFile->Close();
   518 		err = KErrNotFound;
   519 		iScriptRunning = EFalse;
   520 		LogIt(_L("***SCRIPT ENDED***\n"));
   521 		}
   522 	return err;
   523 	}
   524 
   525 void CIpuTestHarness::Panic(TInt aPanic)
   526 //
   527 //	Panic the client program.
   528 	{
   529 	User::Panic(KTestPanic,aPanic);
   530 	}
   531 
   532 void CIpuTestHarness::TestHarnessComplete()
   533 //
   534 //	Test harness completed without failures
   535 	{
   536 	_LIT(KTestCompleteFormat, "Total Tests %d, Failed Tests %d");
   537 	TBuf<50> text;
   538 	text.AppendFormat(KTestCompleteFormat, iTestCount, iFailedTests->Count()); 
   539 	WriteComment(text);
   540 	WriteComment(KTestHarnessCompleted);
   541 	}
   542 
   543 void CIpuTestHarness::TestHarnessFailed()
   544 //
   545 //	Test harness has a failure - log information
   546 	{
   547 	TBuf<KMaxFileName + 4> buf;
   548 	buf.Format(KTestHarnessFailed, iFailedTests->Count());
   549 	WriteComment(buf);
   550 	//	Log fialed tests' information
   551 	for (TInt ii=0; ii<iFailedTests->Count(); ++ii)
   552 		{
   553 		CTestInfo* failed = iFailedTests->At(ii);
   554 		TPtrC name = failed->Name();
   555 		LogIt(KTestFailInfo, failed->Number(), &name, failed->ErrorCode());
   556 		}
   557 	}
   558 
   559 void CIpuTestHarness::ResourceLeakTest()
   560 //
   561 // Creates a new test that fails if any there are any leaked resource handles
   562 	{
   563 	// Start new test
   564 	_LIT(KResourceTestName, "Resource Handle Leak Test");
   565 	TRAPD(testError, StartTestL(KResourceTestName));
   566 	if(testError==KErrNone)
   567 		{
   568 		//	Find number of opened handles
   569 		TInt processHandleCount=0;
   570 		TInt threadHandleCount=0;
   571 		RThread().HandleCount(processHandleCount,threadHandleCount);
   572 		TInt openHandleCount = iStartHandleCount-threadHandleCount;
   573 		TInt err = KErrNone;
   574 		if ( openHandleCount !=0 )
   575 			{
   576 			err = KErrGeneral;
   577 			LogIt(_L("Number leaked handles is %D"), openHandleCount);
   578 			}
   579 		EndTest(err);
   580 		}
   581 	else
   582 		{
   583 		_LIT(KTxtResourceTestRunError, "Unable to complete Resource Leak Test, error: %d");
   584 		LogIt(KTxtResourceTestRunError, testError);
   585 		EndTest(testError);
   586 		}
   587 	}
   588 
   589 //
   590 //	CTestInfo
   591 //
   592 CIpuTestHarness::CTestInfo::CTestInfo()
   593 //
   594 //	Default c'tor
   595 	{
   596 	}
   597 
   598 CIpuTestHarness::CTestInfo::~CTestInfo()
   599 //
   600 //	D'tor
   601 	{
   602 	delete iName;
   603 	}
   604 
   605 CIpuTestHarness::CTestInfo* CIpuTestHarness::CTestInfo::NewLC(const TDesC& aName, TInt aNumber, TInt aErrorCode)
   606 //
   607 //	Static factory c'tor
   608 	{
   609 	CTestInfo* self = new (ELeave) CTestInfo();
   610 	CleanupStack::PushL(self);
   611 	self->ConstructL(aName, aNumber, aErrorCode);
   612 	return self;
   613 	}
   614 
   615 CIpuTestHarness::CTestInfo* CIpuTestHarness::CTestInfo::NewL(const TDesC& aName, TInt aNumber, TInt aErrorCode)
   616 //
   617 //	Static factory c'tor
   618 	{
   619 	CTestInfo* self = NewLC(aName, aNumber, aErrorCode);
   620 	CleanupStack::Pop();	//	self
   621 	return self;
   622 	}
   623 
   624 void CIpuTestHarness::CTestInfo::ConstructL(const TDesC& aName, TInt aNumber, TInt aErrorCode)
   625 //
   626 //	Non-trivial c'tor
   627 	{
   628 	iName = aName.AllocLC();
   629 	CleanupStack::Pop();	//	iName
   630 
   631 	iNumber = aNumber;
   632 	iErrorCode = aErrorCode;
   633 	}
   634 
   635 void CIpuTestHarness::CTestInfo::SetNameL(const TDesC& aName)
   636 //
   637 //	Sets iName
   638 	{
   639 	HBufC* temp = aName.AllocLC();
   640 	CleanupStack::Pop();	//	temp
   641 	delete iName;
   642 	iName = temp;
   643 	}
   644 
   645 void CIpuTestHarness::CTestInfo::SetNumber(TInt aNumber)
   646 //
   647 //	Sets iNumber
   648 	{
   649 	iNumber = aNumber;
   650 	}
   651 
   652 void CIpuTestHarness::CTestInfo::SetErrorCode(TInt aErrorCode)
   653 //
   654 //	Sets iErrorCode
   655 	{
   656 	iErrorCode = aErrorCode;
   657 	}