kerneltest/e32test/rm_debug/crashmonitor/t_crashmonitor.cpp
changeset 296 94f2adf59133
parent 293 0659d0e1a03c
child 297 b2826f67641f
equal deleted inserted replaced
293:0659d0e1a03c 296:94f2adf59133
     1 // Copyright (c) 2008-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 the License "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 // Tests the functionality of the SCM Libraries
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "t_crashmonitor.h"
       
    19 
       
    20 #include <crashlogwalker.h>
       
    21 
       
    22 using namespace Debug;
       
    23 
       
    24 /**
       
    25  * Test suite version
       
    26  */
       
    27 const TVersion testVersion(1,1,0);
       
    28 
       
    29 
       
    30 /**
       
    31  * Constructor
       
    32  */
       
    33 CSCMLibraryClient::CSCMLibraryClient():
       
    34 	iNonCachedWriter(iBuffer, EFalse),
       
    35 	iCachedWriter(iBuffer, EFalse),
       
    36 	iWriter(NULL),
       
    37 	iReader(iBuffer)	
       
    38 	{
       
    39 	}
       
    40 
       
    41 /**
       
    42  * First phase constructor
       
    43  */
       
    44 CSCMLibraryClient* CSCMLibraryClient::NewL()
       
    45 	{
       
    46 	CSCMLibraryClient* self = new(ELeave) CSCMLibraryClient();
       
    47   	self->ConstructL();
       
    48 	return self;
       
    49 	}
       
    50 
       
    51 /**
       
    52  * Destructor
       
    53  */
       
    54 CSCMLibraryClient::~CSCMLibraryClient()
       
    55 	{
       
    56 	}
       
    57 
       
    58 /**
       
    59  * ConstructL
       
    60  */
       
    61 void CSCMLibraryClient::ConstructL()
       
    62 	{}
       
    63 
       
    64 
       
    65 
       
    66 /**
       
    67  * Prints usage of this test suite
       
    68  */
       
    69 void CSCMLibraryClient::PrintUsage()
       
    70 	{
       
    71 	test.Printf(_L("Invoke with arguments:\n"));
       
    72 	test.Printf(_L("-r: run specified tests in reverse order\n"));
       
    73 	test.Printf(_L("-h: display usage information\n"));
       
    74 	test.Printf(_L("-v: display version\n"));
       
    75 	test.Printf(_L("<number>: test number to run, can specify more than one from the following list:\n"));
       
    76 	test.Printf(_L("Press any key for list...\n"));
       
    77 	test.Getch();
       
    78 	// if there are too many of these they won't fit on the screen! Stick another Getch() in if there get too many
       
    79 	for(TInt i=0; i<KMaxTests; i++)
       
    80 		{
       
    81 		test.Printf(_L("%2d: %S\n"), i, &(iTestArray[i].iFunctionName));
       
    82 		}
       
    83 	test.Printf(_L("Press any key...\n"));
       
    84 	test.Getch();
       
    85 	}
       
    86 
       
    87 /**
       
    88  * Parses arguments from command line
       
    89  * @param aMode Argument mode
       
    90  * @param aTests Array of tests
       
    91  */
       
    92 void CSCMLibraryClient::ParseCommandLineL(TUint32& aMode, RArray<TInt>& aTests)
       
    93 	{
       
    94 	// get the length of the command line arguments
       
    95 	TInt argc = User::CommandLineLength();
       
    96 
       
    97 	// allocate a buffer for the command line arguments and extract the data to it
       
    98 	HBufC* commandLine = HBufC::NewLC(argc);
       
    99 	TPtr commandLineBuffer = commandLine->Des();
       
   100 	User::CommandLine(commandLineBuffer);
       
   101 
       
   102 	// reset mode
       
   103 	aMode = (TTestMode)0;
       
   104 
       
   105 	// create a lexer and read through the command line
       
   106 	TLex lex(*commandLine);
       
   107 	while (!lex.Eos())
       
   108 		{
       
   109 		// expecting the first character to be a '-'
       
   110 		if (lex.Get() == '-')
       
   111 			{
       
   112 			TChar arg = lex.Get();
       
   113 			switch (arg)
       
   114 				{
       
   115 				case 'v':
       
   116 					//print out the help
       
   117 					aMode |= EModeVersion;
       
   118 					break;
       
   119 				case 'h':
       
   120 					//print out the help
       
   121 					aMode |= EModeHelp;
       
   122 					break;
       
   123 				case 'r':
       
   124 					//store the fact that we want to run in reverse
       
   125 					aMode |= EModeReverse;
       
   126 					break;
       
   127 				default:
       
   128 					// unknown argument so leave
       
   129 					User::Leave(KErrArgument);
       
   130 				}
       
   131 			}
       
   132 		else
       
   133 			{
       
   134 			lex.UnGet();
       
   135 			TInt testNumber;
       
   136 			User::LeaveIfError(lex.Val(testNumber));
       
   137 			if( (testNumber<0) || (testNumber>=KMaxTests) )
       
   138 				{
       
   139 				User::Leave(KErrArgument);
       
   140 				}
       
   141 			aTests.AppendL(testNumber);
       
   142 			}
       
   143 		lex.SkipSpace();
       
   144 		}
       
   145 	// if no tests specified then run them all
       
   146 	if(aTests.Count() == 0)
       
   147 		{
       
   148 		aMode |= EModeAll;
       
   149 		}
       
   150 
       
   151 	// do clean up
       
   152 	CleanupStack::PopAndDestroy(commandLine);
       
   153 	}
       
   154 
       
   155 /**
       
   156  * This will run all tests in the suite
       
   157  */
       
   158 void CSCMLibraryClient::ClientAppL()
       
   159 	{	
       
   160 	
       
   161 	FillArray();
       
   162 	
       
   163 	test.Start(_L("ClientAppL"));
       
   164 
       
   165 	RArray<TInt> testsToRun;
       
   166 	TUint32 testMode = 0;
       
   167 	ParseCommandLineL(testMode, testsToRun);
       
   168 
       
   169 	//if help or version mode specified then just print out the relevant stuff and quit
       
   170 	if((testMode & EModeHelp) || (testMode & EModeVersion))
       
   171 		{
       
   172 		if(testMode & EModeHelp)
       
   173 			{
       
   174 			PrintUsage();
       
   175 			}
       
   176 		if(testMode & EModeVersion)
       
   177 			{
       
   178 			PrintVersion();
       
   179 			}
       
   180 		test.End();
       
   181 		return;
       
   182 		}
       
   183 
       
   184 	if(testMode & EModeAll)
       
   185 		{
       
   186 		for(TInt i=0; i<KMaxTests; i++)
       
   187 			{
       
   188 			testsToRun.AppendL(i);
       
   189 			}
       
   190 		}
       
   191 
       
   192 	// if EModeReverse specified then reverse the array elements
       
   193 	TInt numberOfTests = testsToRun.Count();
       
   194 	if(testMode & EModeReverse)
       
   195 		{
       
   196 		for(TInt i=0; i<(numberOfTests>>1); i++)
       
   197 			{
       
   198 			TInt temp = testsToRun[i];
       
   199 			testsToRun[i] = testsToRun[numberOfTests - (i+1)];
       
   200 			testsToRun[numberOfTests - (i+1)] = temp;
       
   201 			}
       
   202 		}
       
   203 
       
   204 	HelpStartTestTimer();
       
   205 
       
   206 	// first run al tests with non cached writer
       
   207 	iWriter = &iNonCachedWriter;
       
   208 	for(TInt i=0; i<numberOfTests; i++)
       
   209 		{
       
   210 		RunTest(testsToRun[i]);
       
   211 		}
       
   212 	
       
   213 	iWriter = &iCachedWriter;	
       
   214 	for(TInt i=0; i<numberOfTests; i++)
       
   215 		{
       
   216 		RunTest(testsToRun[i]);
       
   217 		}
       
   218 
       
   219 	
       
   220 	testsToRun.Close();
       
   221 
       
   222 	HelpStopTestTimer();
       
   223 
       
   224 	ReportPerformance();
       
   225 	
       
   226 	test.End();
       
   227 	}
       
   228 
       
   229 /**
       
   230  * This fills our array of test functions with function pointers to tests
       
   231  */
       
   232 void CSCMLibraryClient::FillArray() 
       
   233 	{
       
   234 	
       
   235 	//iTestArray[0] = new TFunctionData();
       
   236 	iTestArray[0].iFunctionPtr = &CSCMLibraryClient::TestCheckSum;
       
   237 	iTestArray[0].iFunctionName = _L("TestCheckSum");
       
   238 	
       
   239 	iTestArray[1].iFunctionPtr = &CSCMLibraryClient::TestLockDataSerialization;
       
   240 	iTestArray[1].iFunctionName = _L("TestLockDataSerialization");
       
   241 	
       
   242 	iTestArray[2].iFunctionPtr = &CSCMLibraryClient::TestOffsetsHeaderSerialization;
       
   243 	iTestArray[2].iFunctionName = _L("TestOffsetsHeaderSerialization");
       
   244 	
       
   245 	iTestArray[3].iFunctionPtr = &CSCMLibraryClient::TestInfoHeaderSerialization;
       
   246 	iTestArray[3].iFunctionName = _L("TestInfoHeaderSerialization");
       
   247 	
       
   248 	iTestArray[4].iFunctionPtr = &CSCMLibraryClient::TestRawData;
       
   249 	iTestArray[4].iFunctionName = _L("TestRawData");
       
   250 
       
   251 	iTestArray[5].iFunctionPtr = &CSCMLibraryClient::TestProcessData;
       
   252 	iTestArray[5].iFunctionName = _L("TestProcessData");
       
   253 	
       
   254 	iTestArray[6].iFunctionPtr = &CSCMLibraryClient::TestThreadData;
       
   255 	iTestArray[6].iFunctionName = _L("TestThreadData");
       
   256 	
       
   257 	iTestArray[7].iFunctionPtr = &CSCMLibraryClient::TestThreadStack;
       
   258 	iTestArray[7].iFunctionName = _L("TestThreadStack");
       
   259 		
       
   260 	iTestArray[8].iFunctionPtr = &CSCMLibraryClient::TestRegisterValue;
       
   261 	iTestArray[8].iFunctionName = _L("TestRegisterValue");
       
   262 		
       
   263 	iTestArray[9].iFunctionPtr = &CSCMLibraryClient::TestRegisterSet;
       
   264 	iTestArray[9].iFunctionName = _L("TestRegisterSet");
       
   265 
       
   266 	iTestArray[10].iFunctionPtr = &CSCMLibraryClient::TestMemoryDump;
       
   267 	iTestArray[10].iFunctionName = _L("TestMemoryDump");
       
   268 	
       
   269 	iTestArray[11].iFunctionPtr = &CSCMLibraryClient::TestCodeSegmentSet;
       
   270 	iTestArray[11].iFunctionName = _L("TestCodeSegmentSet");
       
   271 	
       
   272 	iTestArray[12].iFunctionPtr = &CSCMLibraryClient::TestCodeSegment;
       
   273 	iTestArray[12].iFunctionName = _L("TestCodeSegment");
       
   274 	
       
   275 	iTestArray[13].iFunctionPtr = &CSCMLibraryClient::TestTraceDump;
       
   276 	iTestArray[13].iFunctionName = _L("TestTraceDump");
       
   277 	
       
   278 	iTestArray[14].iFunctionPtr = &CSCMLibraryClient::TestVariantSpecificData;
       
   279 	iTestArray[14].iFunctionName = _L("TestVariantSpecificData");
       
   280 	
       
   281 	iTestArray[15].iFunctionPtr = &CSCMLibraryClient::TestRomHeaderData;
       
   282 	iTestArray[15].iFunctionName = _L("TestRomHeaderData");
       
   283 	
       
   284 	iTestArray[16].iFunctionPtr = & CSCMLibraryClient::TestSCMLockData;
       
   285 	iTestArray[16].iFunctionName = _L("TestSCMLockData");
       
   286 
       
   287 	};
       
   288 
       
   289 /**
       
   290  * Entry point for crash monitor tests
       
   291  */
       
   292 GLDEF_C TInt E32Main()
       
   293 	{
       
   294 	TInt ret = KErrNone;
       
   295 	
       
   296 	CTrapCleanup* trap = CTrapCleanup::New();
       
   297 	if (!trap)
       
   298 		return KErrNoMemory;
       
   299 	
       
   300    	test.Title();
       
   301    	CSCMLibraryClient* tester = CSCMLibraryClient::NewL();
       
   302    	if (tester != NULL)
       
   303        {
       
   304         __UHEAP_MARK;
       
   305 	    TRAP(ret,tester->ClientAppL());
       
   306 	    __UHEAP_MARKEND;
       
   307 
       
   308 	   delete tester;
       
   309        }
       
   310        
       
   311 	delete trap;
       
   312 	return ret;
       
   313 	}
       
   314 
       
   315 /**
       
   316  * Runs a given test identified by argument
       
   317  * @param aTestNumber Test to run
       
   318  */
       
   319 void CSCMLibraryClient::RunTest(TInt aTestNumber)
       
   320 	{
       
   321 	if( (aTestNumber<0) || (aTestNumber>=KMaxTests) )
       
   322 		{
       
   323 		User::Panic(_L("Test number out of range"), aTestNumber);
       
   324 		}
       
   325 	__UHEAP_MARK;
       
   326 	
       
   327 	if(iTestArray[aTestNumber].iFunctionPtr)
       
   328 		{
       
   329 		test.Printf(_L("pre-run test %d"), aTestNumber);
       
   330 		(this->*(iTestArray[aTestNumber].iFunctionPtr))();
       
   331 		test.Printf(_L("post-run test %d"), aTestNumber);
       
   332 		}
       
   333 
       
   334 	__UHEAP_MARKEND;
       
   335 	}
       
   336 
       
   337 /**
       
   338  * Prints the version of this test suite
       
   339  */
       
   340 void CSCMLibraryClient::PrintVersion()
       
   341 	{
       
   342 	test.Printf(_L("\nt_crashmonitor_lib.exe\nVersion: %S\n"), &(testVersion.Name()));
       
   343 	test.Printf(_L("Press any key...\n"));
       
   344 	test.Getch();
       
   345 	}
       
   346 /**
       
   347  * Reports performance metrics from all the tests
       
   348  */
       
   349 void CSCMLibraryClient::ReportPerformance(void)
       
   350 	{
       
   351 	test.Printf(_L("\nPerformance\n"));
       
   352 	test.Printf(_L("========================\n"));
       
   353 
       
   354 	
       
   355 	// Runtime
       
   356 	TInt ticks = HelpGetTestTicks();
       
   357 #ifndef __WINS__
       
   358 	test (ticks != 0);  
       
   359 #endif
       
   360 	TInt nkTicksPerSecond = HelpTicksPerSecond();
       
   361 
       
   362 #ifndef __WINS__
       
   363 	test (nkTicksPerSecond != 0);
       
   364 #endif
       
   365 
       
   366 	test.Printf(_L("Total test runtime: %d seconds\n"),ticks/nkTicksPerSecond);
       
   367 
       
   368 	test.Printf(_L("\n"));
       
   369 	}
       
   370 
       
   371 /**
       
   372  * Returns the number of nanokernel ticks in one second
       
   373  * @return Number of nanokernel ticks. 0 if unsuccesful
       
   374  */
       
   375 TInt CSCMLibraryClient::HelpTicksPerSecond(void)
       
   376 	{
       
   377 	TInt nanokernel_tick_period;
       
   378 	HAL::Get(HAL::ENanoTickPeriod, nanokernel_tick_period);
       
   379 	
       
   380 	ASSERT(nanokernel_tick_period != 0);
       
   381 
       
   382 	static const TInt KOneMillion = 1000000;
       
   383 
       
   384 	return KOneMillion/nanokernel_tick_period;
       
   385 	}
       
   386 
       
   387 void CSCMLibraryClient::DoWrite(MByteStreamSerializable& aObjectToWrite, TInt aPosition)
       
   388 	{
       
   389 	if(iWriter == &iCachedWriter)
       
   390 		{
       
   391 		iCachedWriter.SetPosition(aPosition);
       
   392 		test(aObjectToWrite.Serialize(iCachedWriter) == KErrNone);
       
   393 		iCachedWriter.FlushCache();	
       
   394 		}
       
   395 	else if(iWriter == &iNonCachedWriter)
       
   396 		{
       
   397 		iNonCachedWriter.SetPosition(aPosition);		
       
   398 		test(aObjectToWrite.Serialize(iNonCachedWriter) == KErrNone);	
       
   399 		}
       
   400 	else
       
   401 		{
       
   402 		// no writer
       
   403 		test(EFalse);
       
   404 		}
       
   405 	}
       
   406 
       
   407 // BASE granted test id's 2364 to 2394
       
   408 
       
   409 //---------------------------------------------
       
   410 // !@SYMTestCaseID KBASE-T_SCMLIB-2364
       
   411 //! @SYMTestType
       
   412 //! @SYMPREQ PREQ1700
       
   413 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TScmChecksum structure 
       
   414 //! @SYMTestActions TScmChecksum serialized & then deserialized
       
   415 //! @SYMTestExpectedResults TScmChecksum structure serialized / deserialized ok
       
   416 //! @SYMTestPriority High
       
   417 //! @SYMTestStatus Implemented
       
   418 //---------------------------------------------
       
   419 void CSCMLibraryClient::TestCheckSum()
       
   420 	{
       
   421 	test.Next(_L("TestCheckSum\n"));
       
   422 	
       
   423 	TScmChecksum chksm1;
       
   424 	chksm1.Reset();
       
   425 	
       
   426 	TInt blocksize1 = 123;
       
   427 	TInt blocksize2 = 166;
       
   428 	
       
   429 	TScmChecksum chksm2;
       
   430 	chksm2.Reset();
       
   431 		
       
   432 	test(ChecksumHelper(chksm1, blocksize1, iBuffer, KBufLen));
       
   433 	test(ChecksumHelper(chksm2, blocksize2, iBuffer, KBufLen));
       
   434 		
       
   435 	test(chksm1  == chksm2);
       
   436 
       
   437 	}
       
   438 
       
   439 TBool CSCMLibraryClient::ChecksumHelper(TScmChecksum& aChecksum, TUint aBlocksize, TUint8* aBuffer, TUint aBufferLen) 
       
   440 	{
       
   441 	if( aBlocksize == 0 || aBufferLen == 0 )
       
   442 		{
       
   443 		return EFalse;
       
   444 		}
       
   445 	
       
   446 	TInt remaining = aBufferLen;
       
   447 	TInt pos = 0;
       
   448 		
       
   449 	while(remaining > aBlocksize)
       
   450 		{		
       
   451 		aChecksum.ChecksumBlock(aBuffer + pos, aBlocksize);
       
   452 		pos += aBlocksize;
       
   453 		remaining -= aBlocksize;
       
   454 		}
       
   455 	
       
   456 	aChecksum.ChecksumBlock(aBuffer + pos, remaining);
       
   457 	pos += remaining;
       
   458 	
       
   459 	return (pos == aBufferLen);
       
   460 	}
       
   461 
       
   462 //---------------------------------------------
       
   463 //! @SYMTestCaseID KBASE-T_SCMLIB-2365
       
   464 //! @SYMTestType
       
   465 //! @SYMPREQ PREQ1700
       
   466 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TSCMLockData structure 
       
   467 //! @SYMTestActions TSCMLockData serialized & then deserialized
       
   468 //! @SYMTestExpectedResults TSCMLockData structure serialized / deserialized ok
       
   469 //! @SYMTestPriority High
       
   470 //! @SYMTestStatus Implemented
       
   471 //--------------------------------------------- 
       
   472 void CSCMLibraryClient::TestLockDataSerialization()
       
   473 	{	
       
   474 	test.Next(_L("TestLockDataSerialization\n"));	
       
   475 
       
   476 	TSCMLockData lockData1;
       
   477 	
       
   478 	//Arbitrary values
       
   479 	lockData1.SetLockCount(10);
       
   480 	lockData1.SetMutexHoldCount(17);
       
   481 	lockData1.SetMutexThreadWaitCount(36);
       
   482 
       
   483 	DoWrite(lockData1);
       
   484 	
       
   485 	iReader.SetPosition(0);
       
   486 	//Test deserialisation works
       
   487 	TSCMLockData lockData2;	
       
   488 	test(lockData2.Deserialize(iReader) == KErrNone);
       
   489 	
       
   490 	//Test we got back the correct object
       
   491 	test(lockData1 == lockData2);
       
   492 	}
       
   493 
       
   494 //---------------------------------------------
       
   495 //! //! @SYMTestCaseID KBASE-T_SCMLIB-2366
       
   496 //! @SYMTestType
       
   497 //! @SYMPREQ PREQ1700
       
   498 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TCrashOffsetsHeader structure 
       
   499 //! @SYMTestActions TCrashOffsetsHeader serialized & then deserialized
       
   500 //! @SYMTestExpectedResults TCrashOffsetsHeader structure serialized / deserialized ok
       
   501 //! @SYMTestPriority High
       
   502 //! @SYMTestStatus Implemented
       
   503 //--------------------------------------------- 
       
   504 void CSCMLibraryClient::TestOffsetsHeaderSerialization()
       
   505 	{
       
   506 	test.Next(_L("TestOffsetsHeaderSer ialization\n"));	
       
   507 	
       
   508 	TCrashOffsetsHeader header1;
       
   509 	header1.iCTFullRegOffset = 123; 
       
   510 	header1.iCTUsrStkOffset = 456;
       
   511 	header1.iCTSvrStkOffset = 789;
       
   512 	header1.iCPMetaOffset = 1001;
       
   513 	header1.iCTMetaOffset = 99;		
       
   514 	header1.iCPCodeSegOffset = 1234;
       
   515 	header1.iSysUsrStkOffset = 3456;
       
   516 	header1.iSysSvrStkOffset = 255;
       
   517 	header1.iSysUsrRegOffset = 999;
       
   518 	header1.iSysSvrRegOffset = 2002;
       
   519 	header1.iTLstOffset = 3003;
       
   520 	header1.iPLstOffset = 4004;
       
   521 	header1.iSysCodeSegOffset = 5005;
       
   522 	header1.iExcStkOffset = 6006;
       
   523 	header1.iTraceOffset = 1233;
       
   524 	header1.iScmLocksOffset = 3421;
       
   525 	header1.iKernelHeapOffset = 89;
       
   526 	header1.iVarSpecInfOffset = 0;
       
   527 	header1.iRomInfoOffset = 123;
       
   528 
       
   529 	DoWrite(header1);
       
   530 	
       
   531 	iReader.SetPosition(0);
       
   532 	TCrashOffsetsHeader header2;
       
   533 	
       
   534 	test(header2.Deserialize(iReader) == KErrNone);
       
   535 	
       
   536 	test(header2 == header1);
       
   537 	
       
   538 	}
       
   539 
       
   540 //---------------------------------------------
       
   541 //! @SYMTestCaseID KBASE-T_SCMLIB-2367
       
   542 //! @SYMTestType
       
   543 //! @SYMPREQ PREQ1700
       
   544 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TCrashInfoHeader structure 
       
   545 //! @SYMTestActions TCrashInfoHeader serialized & then deserialized
       
   546 //! @SYMTestExpectedResults TCrashInfoHeader structure serialized / deserialized ok
       
   547 //! @SYMTestPriority High
       
   548 //! @SYMTestStatus Implemented
       
   549 //---------------------------------------------
       
   550 void CSCMLibraryClient::TestInfoHeaderSerialization()
       
   551 	{
       
   552 	test.Next(_L("TestInfoHeaderSerialization\n"));	
       
   553 
       
   554 	TCrashInfoHeader infoHeader1;
       
   555 	infoHeader1.iLogSize = 5000;	
       
   556 	infoHeader1.iFlashAlign = 4;
       
   557 	infoHeader1.iCachedWriterSize = 16;
       
   558 	infoHeader1.iPid = 1001;
       
   559 	infoHeader1.iTid = 2002;
       
   560 	infoHeader1.iExitType = 90;
       
   561 	infoHeader1.iExitReason = 23;	
       
   562 	infoHeader1.iExcCode = 8899;
       
   563 	infoHeader1.iCrashTime = 12345;	
       
   564 	infoHeader1.iCrashId = 23;
       
   565 	infoHeader1.iFlashBlockSize = 256 * 1024;
       
   566 	infoHeader1.iFlashPartitionSize = 1024 * 1024;
       
   567 	
       
   568 	TVersion ver(21,43,54);
       
   569 	
       
   570 	infoHeader1.iSCMDataTypesVersion = ver;
       
   571 
       
   572 	DoWrite(infoHeader1);
       
   573 	
       
   574 	iReader.SetPosition(0);
       
   575 	TCrashInfoHeader infoHeader2;
       
   576 	
       
   577 	test(infoHeader2.Deserialize(iReader) == KErrNone);
       
   578 	
       
   579 	test(infoHeader2 == infoHeader1);
       
   580 		
       
   581 	}
       
   582 
       
   583 //---------------------------------------------
       
   584 //! @SYMTestCaseID KBASE-T_SCMLIB-2368 
       
   585 //! @SYMTestType
       
   586 //! @SYMPREQ PREQ1700
       
   587 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TRawData structure 
       
   588 //! @SYMTestActions TRawData serialized & then deserialized
       
   589 //! @SYMTestExpectedResults TRawData structure serialized / deserialized ok
       
   590 //! @SYMTestPriority High
       
   591 //! @SYMTestStatus Implemented
       
   592 //---------------------------------------------
       
   593 void CSCMLibraryClient::TestRawData()
       
   594 	{
       
   595 	test.Next(_L("TestRawData\n"));
       
   596 	
       
   597 	const TInt KLen = 256;
       
   598 	
       
   599 	TUint8 data[KLen];
       
   600 	
       
   601 	for(TInt i=0;i<KLen;i++)
       
   602 		{
       
   603 		data[i] = ((i<<2) % KLen) + i;
       
   604 		}
       
   605 	
       
   606 	TRawData rawData1;
       
   607 
       
   608 	rawData1.iLength = KLen;
       
   609 	rawData1.iData.Set(const_cast<TUint8*>(data), KLen, KLen);;
       
   610 
       
   611 	DoWrite(rawData1);
       
   612 	
       
   613 	TPtr8 p(iBuffer, KBufLen, KBufLen);
       
   614 	TCrashLogWalker walker(p);
       
   615 	TInt pos = 0;
       
   616 	TInt len = 0;
       
   617 	TRawData* rawData2 = walker.GetRawDataTypeL(pos, len, p, 0);
       
   618 
       
   619 	CleanupStack::PushL(rawData2);
       
   620 	
       
   621 	test(rawData1.iLength == rawData2->iLength);
       
   622 	test(rawData1.iData.Compare(rawData2->iData) == 0);
       
   623 	
       
   624 	CleanupStack::PopAndDestroy(rawData2);
       
   625 	}
       
   626 
       
   627 //---------------------------------------------
       
   628 //! @SYMTestCaseID KBASE-T_SCMLIB-2369 
       
   629 //! @SYMTestType
       
   630 //! @SYMPREQ PREQ1700
       
   631 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TProcessData structure 
       
   632 //! @SYMTestActions TProcessData serialized & then deserialized
       
   633 //! @SYMTestExpectedResults TProcessData structure serialized / deserialized ok
       
   634 //! @SYMTestPriority High
       
   635 //! @SYMTestStatus Implemented
       
   636 //---------------------------------------------
       
   637 void CSCMLibraryClient::TestProcessData()
       
   638 	{
       
   639 	test.Next(_L("TestProcessData\n"));
       
   640 	
       
   641 	TProcessData procData1;
       
   642 	
       
   643 	procData1.iPriority = 99;		
       
   644 	procData1.iPid = MAKE_TINT64(34567,12345);
       
   645 	
       
   646 	
       
   647 	procData1.iName.Zero();
       
   648 	for(TInt i=0;i<KMaxProcessName;i++)
       
   649 		{	
       
   650 		procData1.iName.Append( TChar( (i%60) + 32 ));
       
   651 		}
       
   652 	
       
   653 	procData1.iNamesize = KMaxProcessName;		
       
   654 
       
   655 	DoWrite(procData1);
       
   656 	
       
   657 	TProcessData procData2;
       
   658 	iReader.SetPosition(0);
       
   659 	
       
   660 	test(procData2.Deserialize(iReader) == KErrNone);
       
   661 	test(procData1.iPriority == procData1.iPriority);	
       
   662 	test(procData1.iPid == procData2.iPid);	
       
   663 	test(procData1.iNamesize == procData2.iNamesize);
       
   664 	test(procData1.iName.Compare(procData2.iName) == 0);	
       
   665 	}
       
   666 
       
   667 //---------------------------------------------
       
   668 //! @SYMTestCaseID KBASE-T_SCMLIB-2370 
       
   669 //! @SYMTestType
       
   670 //! @SYMPREQ PREQ1700
       
   671 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TThreadData structure 
       
   672 //! @SYMTestActions TThreadData serialized & then deserialized
       
   673 //! @SYMTestExpectedResults TThreadData structure serialized / deserialized ok
       
   674 //! @SYMTestPriority High
       
   675 //! @SYMTestStatus Implemented
       
   676 //---------------------------------------------
       
   677 void CSCMLibraryClient::TestThreadData()
       
   678 	{
       
   679 	test.Next(_L("TestThreadData\n"));
       
   680 	
       
   681 	TThreadData threadData1;
       
   682 
       
   683 	threadData1.iPriority = 3455;
       
   684 	threadData1.iTid = MAKE_TINT64(34998,18345);
       
   685 	threadData1.iOwnerId = MAKE_TINT64(34448,48345);
       
   686 	threadData1.iSvcSP = 67272;
       
   687 	threadData1.iSvcStack = 888882;
       
   688 	threadData1.iSvcStacksize = 4535;
       
   689 	threadData1.iUsrSP = 892;
       
   690 	threadData1.iUsrStack = 7727;
       
   691 	threadData1.iUsrStacksize = 343;
       
   692 	threadData1.iLastCpu = 12312;
       
   693 	threadData1.iSvcHeap = 8738;
       
   694 	threadData1.iSvcHeapSize = 4;
       
   695 	
       
   696 	threadData1.iNamesize = TThreadData::KMaxThreadName;
       
   697 	
       
   698 	threadData1.iName.Zero();
       
   699 	for(TInt i=0;i<TThreadData::KMaxThreadName;i++)
       
   700 		{	
       
   701 		threadData1.iName.Append( TChar( (i%60) + 32 ));
       
   702 		}
       
   703 
       
   704 
       
   705 	DoWrite(threadData1);
       
   706 	
       
   707 	iReader.SetPosition(0);
       
   708 	TThreadData threadData2;
       
   709 	
       
   710 	test(threadData2.Deserialize(iReader) == KErrNone);
       
   711 	
       
   712 
       
   713 	test(threadData1.iPriority == threadData2.iPriority);
       
   714 	test(threadData1.iTid == threadData2.iTid);
       
   715 	test(threadData1.iOwnerId == threadData2.iOwnerId);
       
   716 	test(threadData1.iSvcSP == threadData2.iSvcSP);
       
   717 	test(threadData1.iSvcStack == threadData2.iSvcStack);
       
   718 	test(threadData1.iSvcStacksize == threadData2.iSvcStacksize);
       
   719 	test(threadData1.iUsrSP == threadData2.iUsrSP);
       
   720 	test(threadData1.iUsrStack == threadData2.iUsrStack);
       
   721 	test(threadData1.iUsrStacksize == threadData2.iUsrStacksize);
       
   722 	test(threadData1.iLastCpu == threadData2.iLastCpu);
       
   723 	test(threadData1.iSvcHeap == threadData2.iSvcHeap);
       
   724 	test(threadData1.iSvcHeapSize == threadData2.iSvcHeapSize);	
       
   725 	test(threadData1.iNamesize == threadData2.iNamesize);
       
   726 	test(threadData1.iName.Compare(threadData2.iName) == 0);	
       
   727 	}
       
   728 
       
   729 //---------------------------------------------
       
   730 //! @SYMTestCaseID KBASE-T_SCMLIB-2371 
       
   731 //! @SYMTestType
       
   732 //! @SYMPREQ PREQ1700
       
   733 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TThreadStack structure 
       
   734 //! @SYMTestActions TThreadStack serialized & then deserialized
       
   735 //! @SYMTestExpectedResults TThreadStack structure serialized / deserialized ok
       
   736 //! @SYMTestPriority High
       
   737 //! @SYMTestStatus Implemented
       
   738 //---------------------------------------------
       
   739 void CSCMLibraryClient::TestThreadStack()
       
   740 	{
       
   741 	test.Next(_L("TestThreadStack\n"));
       
   742 	
       
   743 	TThreadStack threadStack1;
       
   744 	threadStack1.iStackType = TThreadStack::ESvrStack;
       
   745 	threadStack1.iThreadId = MAKE_TINT64(774998,17345);
       
   746 	
       
   747 	DoWrite(threadStack1);
       
   748 
       
   749 	iReader.SetPosition(0);
       
   750 	TThreadStack threadStack2;
       
   751 	test(threadStack2.Deserialize(iReader) == KErrNone);
       
   752 	
       
   753 	test(threadStack1.iStackType == threadStack2.iStackType);
       
   754 	test(threadStack1.iThreadId == threadStack2.iThreadId);
       
   755 	}
       
   756 
       
   757 //---------------------------------------------
       
   758 //! @SYMTestCaseID KBASE-T_SCMLIB-2372 
       
   759 //! @SYMTestType
       
   760 //! @SYMPREQ PREQ1700
       
   761 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TRegisterValue structure 
       
   762 //! @SYMTestActions TRegisterValue serialized & then deserialized
       
   763 //! @SYMTestExpectedResults TRegisterValue structure serialized / deserialized ok
       
   764 //! @SYMTestPriority High
       
   765 //! @SYMTestStatus Implemented
       
   766 //---------------------------------------------
       
   767 void CSCMLibraryClient::TestRegisterValue()
       
   768 	{
       
   769 	test.Next(_L("TestregisterValue\n"));
       
   770 	TRegisterValue regValue1;
       
   771 	
       
   772 	regValue1.iOwnId = MAKE_TINT64(55498,58345);
       
   773 	regValue1.iType = 3456;
       
   774 	regValue1.iClass = 45;
       
   775 	regValue1.iSubId = 5546;
       
   776 	regValue1.iSize = 2;
       
   777 	
       
   778 	DoWrite(regValue1);
       
   779 	
       
   780 	iReader.SetPosition(0);
       
   781 	TRegisterValue regValue2;
       
   782 	test(regValue2.Deserialize(iReader) == KErrNone);
       
   783 	
       
   784 	test(regValue1.iOwnId == regValue2.iOwnId);
       
   785 	test(regValue1.iType == regValue2.iType);
       
   786 	test(regValue1.iClass == regValue2.iClass);
       
   787 	test(regValue1.iSubId == regValue2.iSubId);
       
   788 	test(regValue1.iSize == regValue2.iSize);	
       
   789 	
       
   790 	switch(regValue1.iSize)
       
   791 		{
       
   792 		case 0:
       
   793 			test(regValue1.iValue8 == regValue2.iValue8);
       
   794 			break;
       
   795 		case 1:
       
   796 			test(regValue1.iValue16 == regValue2.iValue16);
       
   797 			break;
       
   798 		case 2:
       
   799 			test(regValue1.iValue32 == regValue2.iValue32);
       
   800 			break;
       
   801 		case 3:
       
   802 			test(regValue1.iValue64 == regValue2.iValue64);
       
   803 			break;
       
   804 		default:
       
   805 			test(EFalse);
       
   806 			break;
       
   807 		}	
       
   808 	}
       
   809 
       
   810 //---------------------------------------------
       
   811 //! @SYMTestCaseID KBASE-T_SCMLIB-2373 
       
   812 //! @SYMTestType
       
   813 //! @SYMPREQ PREQ1700
       
   814 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TRegisterSet structure 
       
   815 //! @SYMTestActions TRegisterSet serialized & then deserialized
       
   816 //! @SYMTestExpectedResults TRegisterSet structure serialized / deserialized ok
       
   817 //! @SYMTestPriority High
       
   818 //! @SYMTestStatus Implemented
       
   819 //---------------------------------------------
       
   820 void CSCMLibraryClient::TestRegisterSet()
       
   821 	{
       
   822 	test.Next(_L("TRegisterSet\n"));
       
   823 	
       
   824 	TRegisterSet set1;	
       
   825 	set1.iNumRegisters = 3784;
       
   826 	DoWrite(set1);
       
   827 	
       
   828 	iReader.SetPosition(0); 
       
   829 	TRegisterSet set2;
       
   830 	test(set2.Deserialize(iReader) == KErrNone);
       
   831 		
       
   832 	test(set1.iNumRegisters == set2.iNumRegisters);	
       
   833 	}
       
   834 
       
   835 //---------------------------------------------
       
   836 //! @SYMTestCaseID KBASE-T_SCMLIB-2374 
       
   837 //! @SYMTestType
       
   838 //! @SYMPREQ PREQ1700
       
   839 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TMemoryDump structure 
       
   840 //! @SYMTestActions TMemoryDump serialized & then deserialized
       
   841 //! @SYMTestExpectedResults TMemoryDump structure serialized / deserialized ok
       
   842 //! @SYMTestPriority High
       
   843 //! @SYMTestStatus Implemented
       
   844 //---------------------------------------------
       
   845 void CSCMLibraryClient::TestMemoryDump()
       
   846 	{
       
   847 	test.Next(_L("TestMemoryDump\n"));
       
   848 	
       
   849 	TMemoryDump memDump1;
       
   850 	memDump1.iStartAddress = 0x23FACED0;
       
   851 	memDump1.iPid = MAKE_TINT64(1234, 5678);
       
   852 	memDump1.iLength = 999;
       
   853 	
       
   854 	DoWrite(memDump1);
       
   855 	
       
   856 	iReader.SetPosition(0); 
       
   857 	TMemoryDump memDump2;
       
   858 	test(memDump2.Deserialize(iReader) == KErrNone);
       
   859 
       
   860 	test(memDump1.iStartAddress = memDump2.iStartAddress);
       
   861 	test(memDump1.iPid = memDump2.iPid);
       
   862 	test(memDump1.iLength = memDump2.iLength);
       
   863 	}
       
   864 
       
   865 //---------------------------------------------
       
   866 //! @SYMTestCaseID KBASE-T_SCMLIB-2375 
       
   867 //! @SYMTestType
       
   868 //! @SYMPREQ PREQ1700
       
   869 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TCodeSegmentSet structure 
       
   870 //! @SYMTestActions TCodeSegmentSet serialized & then deserialized
       
   871 //! @SYMTestExpectedResults TCodeSegmentSet structure serialized / deserialized ok
       
   872 //! @SYMTestPriority High
       
   873 //! @SYMTestStatus Implemented
       
   874 //---------------------------------------------
       
   875 void CSCMLibraryClient::TestCodeSegmentSet()
       
   876 	{
       
   877 	test.Next(_L("TestCodeSegmentSet\n"));
       
   878 	TCodeSegmentSet tss1;
       
   879 		
       
   880 	tss1.iNumSegs = 45;	
       
   881 	tss1.iPid = MAKE_TINT64(28272,671717);
       
   882 	
       
   883 	DoWrite(tss1);
       
   884 	
       
   885 	iReader.SetPosition(0);
       
   886 	TCodeSegmentSet tss2;
       
   887 	test(tss2.Deserialize(iReader) == KErrNone);
       
   888 	
       
   889 	test(tss1.iNumSegs == tss2.iNumSegs);
       
   890 	test(tss1.iPid == tss2.iPid);
       
   891 	}
       
   892 
       
   893 //---------------------------------------------
       
   894 //! @SYMTestCaseID KBASE-T_SCMLIB-2376 
       
   895 //! @SYMTestType
       
   896 //! @SYMPREQ PREQ1700
       
   897 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TCodeSegment structure 
       
   898 //! @SYMTestActions TCodeSegment serialized & then deserialized
       
   899 //! @SYMTestExpectedResults TCodeSegment structure serialized / deserialized ok
       
   900 //! @SYMTestPriority High
       
   901 //! @SYMTestStatus Implemented
       
   902 //---------------------------------------------
       
   903 void CSCMLibraryClient::TestCodeSegment()
       
   904 	{
       
   905 	test.Next(_L("TestCodeSegment\n"));
       
   906 	
       
   907 	TCodeSegment cs1;
       
   908 	cs1.iCodeSegType = EExeCodeSegType;	
       
   909 	cs1.iCodeSegMemInfo.iCodeBase = 345;
       
   910 	cs1.iCodeSegMemInfo.iCodeSize = 566;
       
   911 	cs1.iCodeSegMemInfo.iConstDataBase = 776;
       
   912 	cs1.iCodeSegMemInfo.iConstDataSize = 626267;
       
   913 	cs1.iCodeSegMemInfo.iInitialisedDataBase = 873;
       
   914 	cs1.iCodeSegMemInfo.iInitialisedDataSize = 52625;
       
   915 	cs1.iCodeSegMemInfo.iUninitialisedDataBase = 3737;
       
   916 	cs1.iCodeSegMemInfo.iUninitialisedDataSize = 53535;
       
   917 	
       
   918 	cs1.iName.Zero();
       
   919 	for(TInt i=0;i<TCodeSegment::KMaxSegmentNameSize;i++)
       
   920 		{
       
   921 		cs1.iName.Append( TChar( (i%60) + 32 ));
       
   922 		}
       
   923 
       
   924 	cs1.iNameLength = TCodeSegment::KMaxSegmentNameSize;
       
   925 	cs1.iXip = ETrue;
       
   926 	
       
   927 	DoWrite(cs1);
       
   928 	
       
   929 	iReader.SetPosition(0);	
       
   930 	TCodeSegment cs2;
       
   931 	test(cs2.Deserialize(iReader) == KErrNone);
       
   932 		
       
   933 	test(cs1.iCodeSegType == cs2.iCodeSegType);	
       
   934 	test(cs1.iCodeSegMemInfo.iCodeBase == cs2.iCodeSegMemInfo.iCodeBase);
       
   935 	test(cs1.iCodeSegMemInfo.iCodeSize == cs2.iCodeSegMemInfo.iCodeSize);
       
   936 	test(cs1.iCodeSegMemInfo.iConstDataBase == cs2.iCodeSegMemInfo.iConstDataBase);
       
   937 	test(cs1.iCodeSegMemInfo.iConstDataSize == cs2.iCodeSegMemInfo.iConstDataSize); 
       
   938 	test(cs1.iCodeSegMemInfo.iInitialisedDataBase == cs2.iCodeSegMemInfo.iInitialisedDataBase);
       
   939 	test(cs1.iCodeSegMemInfo.iInitialisedDataSize == cs2.iCodeSegMemInfo.iInitialisedDataSize);
       
   940 	test(cs1.iCodeSegMemInfo.iUninitialisedDataBase == cs2.iCodeSegMemInfo.iUninitialisedDataBase);
       
   941 	test(cs1.iCodeSegMemInfo.iUninitialisedDataSize == cs2.iCodeSegMemInfo.iUninitialisedDataSize);
       
   942 		
       
   943 	test(cs1.iNameLength == cs2.iNameLength);
       
   944 	test(cs1.iName.Compare(cs2.iName) == 0);	
       
   945 	test(cs1.iXip == cs2.iXip);
       
   946 	
       
   947 	}
       
   948 
       
   949 //---------------------------------------------
       
   950 //! @SYMTestCaseID KBASE-T_SCMLIB-2377 
       
   951 //! @SYMTestType
       
   952 //! @SYMPREQ PREQ1700
       
   953 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TTraceDump structure 
       
   954 //! @SYMTestActions TTraceDump serialized & then deserialized
       
   955 //! @SYMTestExpectedResults TTraceDump structure serialized / deserialized ok
       
   956 //! @SYMTestPriority High
       
   957 //! @SYMTestStatus Implemented
       
   958 //---------------------------------------------
       
   959 void CSCMLibraryClient::TestTraceDump()
       
   960 	{
       
   961 	test.Next(_L("TestTraceDump\n"));
       
   962 	
       
   963 	TTraceDump td1;
       
   964 	td1.iSizeOfMemory = 378282;
       
   965 	td1.iNumberOfParts = 440;
       
   966 	
       
   967 	DoWrite(td1);
       
   968 	
       
   969 	iReader.SetPosition(0);
       
   970 
       
   971 	TTraceDump td2;
       
   972 	test(td2.Deserialize(iReader) == KErrNone);
       
   973 	test(td1.iSizeOfMemory == td2.iSizeOfMemory);
       
   974 	test(td1.iNumberOfParts == td2.iNumberOfParts);
       
   975 	}
       
   976 	
       
   977 
       
   978 //---------------------------------------------
       
   979 //! @SYMTestCaseID KBASE-T_SCMLIB-2379 
       
   980 //! @SYMTestType
       
   981 //! @SYMPREQ PREQ1700
       
   982 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TVariantSpecificData structure 
       
   983 //! @SYMTestActions TVariantSpecificData serialized & then deserialized
       
   984 //! @SYMTestExpectedResults TVariantSpecificData structure serialized / deserialized ok
       
   985 //! @SYMTestPriority High
       
   986 //! @SYMTestStatus Implemented
       
   987 //---------------------------------------------
       
   988 void CSCMLibraryClient::TestVariantSpecificData()
       
   989 	{
       
   990 	test.Next(_L("TestVariantSpecificData\n"));		
       
   991 	TVariantSpecificData vsd1;
       
   992 	
       
   993 	vsd1.iSize = 37372;
       
   994 	DoWrite(vsd1);
       
   995 	
       
   996 	iReader.SetPosition(0);		
       
   997 	TVariantSpecificData vsd2;
       
   998 	test(vsd2.Deserialize(iReader) == KErrNone);	
       
   999 	}
       
  1000 
       
  1001 //---------------------------------------------
       
  1002 //! @SYMTestCaseID KBASE-T_SCMLIB-2380 
       
  1003 //! @SYMTestType
       
  1004 //! @SYMPREQ PREQ1700
       
  1005 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TRomHeaderData structure 
       
  1006 //! @SYMTestActions TRomHeaderData serialized & then deserialized
       
  1007 //! @SYMTestExpectedResults TRomHeaderData structure serialized / deserialized ok
       
  1008 //! @SYMTestPriority High
       
  1009 //! @SYMTestStatus Implemented
       
  1010 //---------------------------------------------
       
  1011 void CSCMLibraryClient::TestRomHeaderData()
       
  1012 	{
       
  1013 	test.Next(_L("TestRomHeaderData\n"));
       
  1014 	
       
  1015 	TRomHeaderData rhd1;
       
  1016 	rhd1.iMajorVersion = 12;
       
  1017 	rhd1.iMinorVersion = 2;							
       
  1018 	rhd1.iBuildNumber = 7828;				
       
  1019 	rhd1.iTime = MAKE_TINT64(716171, 62672);
       
  1020 	
       
  1021 	DoWrite(rhd1);
       
  1022 	
       
  1023 	iReader.SetPosition(0);
       
  1024 	TRomHeaderData rhd2;
       
  1025 	test(rhd2.Deserialize(iReader) == KErrNone);
       
  1026 	test(rhd1.iMajorVersion == rhd2.iMajorVersion);
       
  1027 	test(rhd1.iMinorVersion == rhd2.iMinorVersion);							
       
  1028 	test(rhd1.iBuildNumber == rhd2.iBuildNumber);				
       
  1029 	test(rhd1.iTime == rhd2.iTime);		
       
  1030 	}
       
  1031 
       
  1032 //---------------------------------------------
       
  1033 //! //! @SYMTestCaseID KBASE-T_SCMLIB-2381 
       
  1034 //! @SYMTestType
       
  1035 //! @SYMPREQ PREQ1700
       
  1036 //! @SYMTestCaseDesc Ensures we can serialise and deserialise the TSCMLockData structure 
       
  1037 //! @SYMTestActions TSCMLockData serialized & then deserialized
       
  1038 //! @SYMTestExpectedResults <> structure serialized / deserialized ok
       
  1039 //! @SYMTestPriority High
       
  1040 //! @SYMTestStatus Implemented
       
  1041 //---------------------------------------------
       
  1042 void CSCMLibraryClient::TestSCMLockData()
       
  1043 	{
       
  1044 	
       
  1045 	test.Next(_L("TestSCMLockData\n"));
       
  1046 
       
  1047 	TSCMLockData ld1;	
       
  1048 	ld1.SetMutexHoldCount(3);
       
  1049 	ld1.SetLockCount(4);
       
  1050 	ld1.SetMutexThreadWaitCount(5);
       
  1051 
       
  1052 	DoWrite(ld1);
       
  1053 	
       
  1054 	iReader.SetPosition(0);
       
  1055 	TSCMLockData ld2;
       
  1056 	test(ld2.Deserialize(iReader) == KErrNone);
       
  1057 	
       
  1058 	test(ld1.MutexHoldCount() == ld2.MutexHoldCount());
       
  1059 	test(ld1.MutexThreadWaitCount() == ld2.MutexThreadWaitCount());
       
  1060 	test(ld1.LockCount() == ld2.LockCount());
       
  1061 	test(ld1 == ld2);
       
  1062 	test(!(ld1 != ld2));
       
  1063 	}	
       
  1064 		
       
  1065 //eof
       
  1066