| 
sl@0
 | 
     1  | 
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
  | 
| 
sl@0
 | 
     2  | 
// All rights reserved.
  | 
| 
sl@0
 | 
     3  | 
// This component and the accompanying materials are made available
  | 
| 
sl@0
 | 
     4  | 
// under the terms of "Eclipse Public License v1.0"
  | 
| 
sl@0
 | 
     5  | 
// which accompanies this distribution, and is available
  | 
| 
sl@0
 | 
     6  | 
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
  | 
| 
sl@0
 | 
     7  | 
//
  | 
| 
sl@0
 | 
     8  | 
// Initial Contributors:
  | 
| 
sl@0
 | 
     9  | 
// Nokia Corporation - initial contribution.
  | 
| 
sl@0
 | 
    10  | 
//
  | 
| 
sl@0
 | 
    11  | 
// Contributors:
  | 
| 
sl@0
 | 
    12  | 
//
  | 
| 
sl@0
 | 
    13  | 
// Description:
  | 
| 
sl@0
 | 
    14  | 
//
  | 
| 
sl@0
 | 
    15  | 
  | 
| 
sl@0
 | 
    16  | 
/**
  | 
| 
sl@0
 | 
    17  | 
 @file
  | 
| 
sl@0
 | 
    18  | 
 @test
  | 
| 
sl@0
 | 
    19  | 
 @internalComponent
  | 
| 
sl@0
 | 
    20  | 
*/
  | 
| 
sl@0
 | 
    21  | 
 
  | 
| 
sl@0
 | 
    22  | 
  | 
| 
sl@0
 | 
    23  | 
#include <e32std.h>
  | 
| 
sl@0
 | 
    24  | 
#include <fbs.h>
  | 
| 
sl@0
 | 
    25  | 
  | 
| 
sl@0
 | 
    26  | 
#include "test_step_logger.h"
  | 
| 
sl@0
 | 
    27  | 
#include "comparison.h"
  | 
| 
sl@0
 | 
    28  | 
#include "utils.h"
  | 
| 
sl@0
 | 
    29  | 
#include "compwin.h"
  | 
| 
sl@0
 | 
    30  | 
#include "crpwin.h"
  | 
| 
sl@0
 | 
    31  | 
#include "edgedwin.h"
  | 
| 
sl@0
 | 
    32  | 
#include "coordinatewin.h"
  | 
| 
sl@0
 | 
    33  | 
#include "backedupwin.h"
  | 
| 
sl@0
 | 
    34  | 
#include "enormouswin.h"
  | 
| 
sl@0
 | 
    35  | 
#include "animatedwin.h"
  | 
| 
sl@0
 | 
    36  | 
#include "spritewin.h"
  | 
| 
sl@0
 | 
    37  | 
#include "panic.h"
  | 
| 
sl@0
 | 
    38  | 
  | 
| 
sl@0
 | 
    39  | 
  | 
| 
sl@0
 | 
    40  | 
const TInt KSteps = 10;
  | 
| 
sl@0
 | 
    41  | 
  | 
| 
sl@0
 | 
    42  | 
CComparison::COperationTimer::COperationTimer(CComparison* aComp):CTimer(0), iComp(aComp)
  | 
| 
sl@0
 | 
    43  | 
{}
 | 
| 
sl@0
 | 
    44  | 
  | 
| 
sl@0
 | 
    45  | 
void CComparison::COperationTimer::ConstructL()
  | 
| 
sl@0
 | 
    46  | 
	{
 | 
| 
sl@0
 | 
    47  | 
	CTimer::ConstructL();
  | 
| 
sl@0
 | 
    48  | 
	}
  | 
| 
sl@0
 | 
    49  | 
  | 
| 
sl@0
 | 
    50  | 
void CComparison::COperationTimer::DoCancel()
  | 
| 
sl@0
 | 
    51  | 
	{}
 | 
| 
sl@0
 | 
    52  | 
  | 
| 
sl@0
 | 
    53  | 
void CComparison::COperationTimer::RunL()
  | 
| 
sl@0
 | 
    54  | 
	{
 | 
| 
sl@0
 | 
    55  | 
	iComp->Tick();
  | 
| 
sl@0
 | 
    56  | 
	}
  | 
| 
sl@0
 | 
    57  | 
  | 
| 
sl@0
 | 
    58  | 
  | 
| 
sl@0
 | 
    59  | 
/*-------------------------------------------------------------------------*/
  | 
| 
sl@0
 | 
    60  | 
// COneShotCompare
  | 
| 
sl@0
 | 
    61  | 
CComparison::COneShotCompare* CComparison::COneShotCompare::NewL(TInt aPriority, CComparison& aComparison)
  | 
| 
sl@0
 | 
    62  | 
	{
 | 
| 
sl@0
 | 
    63  | 
	return new(ELeave)CComparison::COneShotCompare(aPriority, aComparison);
  | 
| 
sl@0
 | 
    64  | 
	}
  | 
| 
sl@0
 | 
    65  | 
  | 
| 
sl@0
 | 
    66  | 
CComparison::COneShotCompare::COneShotCompare(TInt aPriority, CComparison& aComparison)
  | 
| 
sl@0
 | 
    67  | 
	:CAsyncOneShot(aPriority), iComparison(aComparison)
  | 
| 
sl@0
 | 
    68  | 
	{
 | 
| 
sl@0
 | 
    69  | 
	}
  | 
| 
sl@0
 | 
    70  | 
  | 
| 
sl@0
 | 
    71  | 
void CComparison::COneShotCompare::RunL()
  | 
| 
sl@0
 | 
    72  | 
	{
 | 
| 
sl@0
 | 
    73  | 
	iComparison.iScreen->CopyScreenToBitmap(iComparison.iScreenBitmap);
  | 
| 
sl@0
 | 
    74  | 
	iComparison.SetVerifyTick(User::NTickCount());
  | 
| 
sl@0
 | 
    75  | 
	iComparison.Verify(iComparison.iScreenBitmap);
  | 
| 
sl@0
 | 
    76  | 
	}
  | 
| 
sl@0
 | 
    77  | 
/*-------------------------------------------------------------------------*/
  | 
| 
sl@0
 | 
    78  | 
  | 
| 
sl@0
 | 
    79  | 
_LIT(KConfigurationWindowSuffix, "-Window");
  | 
| 
sl@0
 | 
    80  | 
  | 
| 
sl@0
 | 
    81  | 
/*******************************************************************************
  | 
| 
sl@0
 | 
    82  | 
This is the stresslet itself
  | 
| 
sl@0
 | 
    83  | 
*******************************************************************************/
  | 
| 
sl@0
 | 
    84  | 
CComparison * CComparison::NewLC(MTestStepReporter& aReporter)
  | 
| 
sl@0
 | 
    85  | 
	{
 | 
| 
sl@0
 | 
    86  | 
	CComparison * self = new (ELeave) CComparison(aReporter);
  | 
| 
sl@0
 | 
    87  | 
	CleanupStack::PushL(self);
  | 
| 
sl@0
 | 
    88  | 
	self->ConstructL();
  | 
| 
sl@0
 | 
    89  | 
	return self;
  | 
| 
sl@0
 | 
    90  | 
	}
  | 
| 
sl@0
 | 
    91  | 
  | 
| 
sl@0
 | 
    92  | 
void CComparison::ConstructL()
  | 
| 
sl@0
 | 
    93  | 
	{
 | 
| 
sl@0
 | 
    94  | 
	iWatchCat = CTestExecWatchCat::NewL( CExecutionContext::ECtxRandomAndRecord );
  | 
| 
sl@0
 | 
    95  | 
	}
  | 
| 
sl@0
 | 
    96  | 
  | 
| 
sl@0
 | 
    97  | 
CComparison::CComparison (MTestStepReporter& aReporter):
  | 
| 
sl@0
 | 
    98  | 
	CStresslet(aReporter), iDifferenceBitmap(NULL), iDifferenceDevice(NULL), iOneShotCompare(NULL)
  | 
| 
sl@0
 | 
    99  | 
	{
 | 
| 
sl@0
 | 
   100  | 
	}
  | 
| 
sl@0
 | 
   101  | 
  | 
| 
sl@0
 | 
   102  | 
/**
  | 
| 
sl@0
 | 
   103  | 
 Sets stress-test configuration (read from ini file).
  | 
| 
sl@0
 | 
   104  | 
 @param aRunData configuration data
  | 
| 
sl@0
 | 
   105  | 
 @param aConfFactory a factory interface for creating "section" readers. These
  | 
| 
sl@0
 | 
   106  | 
 are used to supply configuration data for each window type.
  | 
| 
sl@0
 | 
   107  | 
 */
  | 
| 
sl@0
 | 
   108  | 
void CComparison::SetRunDataL(const TRunData& aRunData, MTestStepConfigurationContextFactory* aConfFactory)
  | 
| 
sl@0
 | 
   109  | 
	{
 | 
| 
sl@0
 | 
   110  | 
	iData = aRunData;
  | 
| 
sl@0
 | 
   111  | 
	User::LeaveIfError(iFs.Connect());
  | 
| 
sl@0
 | 
   112  | 
	iFs.MkDirAll(iData.loggingPath);
  | 
| 
sl@0
 | 
   113  | 
	iWatchCat->SetLoggingPathL(iData.loggingPath);
  | 
| 
sl@0
 | 
   114  | 
  | 
| 
sl@0
 | 
   115  | 
	//each window type can have its own configuration
  | 
| 
sl@0
 | 
   116  | 
	MTestStepConfigurationContext* context; //context created by the factory argument
  | 
| 
sl@0
 | 
   117  | 
	RBuf section; //section name (window-type + "-window"
  | 
| 
sl@0
 | 
   118  | 
	section.Create(32);
  | 
| 
sl@0
 | 
   119  | 
	CleanupStack::PushL(§ion);
  | 
| 
sl@0
 | 
   120  | 
  | 
| 
sl@0
 | 
   121  | 
	struct STestStepConfEntry
  | 
| 
sl@0
 | 
   122  | 
		{
 | 
| 
sl@0
 | 
   123  | 
		const TPtrC8 iType;	//section name
  | 
| 
sl@0
 | 
   124  | 
		void (*iFunc)(const MTestStepConfigurationContext*); //configuration loader
  | 
| 
sl@0
 | 
   125  | 
		} confLoaders[] = 
  | 
| 
sl@0
 | 
   126  | 
		{
 | 
| 
sl@0
 | 
   127  | 
			{KCommonWindowType(),    CCompWin::LoadConfiguration},
 | 
| 
sl@0
 | 
   128  | 
			{KAnimatedWindowType(),   CAnimatedWin::LoadConfiguration},
 | 
| 
sl@0
 | 
   129  | 
			{KBackedupWindowType(),   CBackedupWin::LoadConfiguration},
 | 
| 
sl@0
 | 
   130  | 
			{KCoordinateWindowType(), CCoordinateWin::LoadConfiguration},
 | 
| 
sl@0
 | 
   131  | 
			{KCrpWindowType(),        CCrpWin::LoadConfiguration},
 | 
| 
sl@0
 | 
   132  | 
			{KEdgedWindowType(),      CEdgedWin::LoadConfiguration},
 | 
| 
sl@0
 | 
   133  | 
			{KEnormousWindowType(),   CEnormousWin::LoadConfiguration},
 | 
| 
sl@0
 | 
   134  | 
			{KSpritedWindowType(),    CSpritedWin::LoadConfiguration}
 | 
| 
sl@0
 | 
   135  | 
		};
  | 
| 
sl@0
 | 
   136  | 
  | 
| 
sl@0
 | 
   137  | 
	for (int i=0; i<sizeof(confLoaders)/sizeof(STestStepConfEntry); i++)
  | 
| 
sl@0
 | 
   138  | 
		{
 | 
| 
sl@0
 | 
   139  | 
		section.Copy(confLoaders[i].iType);
  | 
| 
sl@0
 | 
   140  | 
		section.Append(KConfigurationWindowSuffix);
  | 
| 
sl@0
 | 
   141  | 
		context = aConfFactory->GetConfigurationContextLC(section);
  | 
| 
sl@0
 | 
   142  | 
		confLoaders[i].iFunc(context);
  | 
| 
sl@0
 | 
   143  | 
		CleanupStack::PopAndDestroy(context);
  | 
| 
sl@0
 | 
   144  | 
		}
  | 
| 
sl@0
 | 
   145  | 
	
  | 
| 
sl@0
 | 
   146  | 
	CleanupStack::Pop(§ion);
  | 
| 
sl@0
 | 
   147  | 
	}
  | 
| 
sl@0
 | 
   148  | 
  | 
| 
sl@0
 | 
   149  | 
void CComparison::StartL()
  | 
| 
sl@0
 | 
   150  | 
	{
 | 
| 
sl@0
 | 
   151  | 
	iStartTime.UniversalTime();
  | 
| 
sl@0
 | 
   152  | 
	if (iData.randomSeed > -1)
  | 
| 
sl@0
 | 
   153  | 
		{
 | 
| 
sl@0
 | 
   154  | 
		//use seed from ini file
  | 
| 
sl@0
 | 
   155  | 
		iFirstSeed = iData.randomSeed;
  | 
| 
sl@0
 | 
   156  | 
		}
  | 
| 
sl@0
 | 
   157  | 
	else 
  | 
| 
sl@0
 | 
   158  | 
		{
 | 
| 
sl@0
 | 
   159  | 
		// randomize seed by time
  | 
| 
sl@0
 | 
   160  | 
		iFirstSeed = iStartTime.Int64();
  | 
| 
sl@0
 | 
   161  | 
		}
  | 
| 
sl@0
 | 
   162  | 
	TRnd::SetSeed(iFirstSeed);
  | 
| 
sl@0
 | 
   163  | 
	
  | 
| 
sl@0
 | 
   164  | 
	iWasOk = ETrue;
  | 
| 
sl@0
 | 
   165  | 
	iMode = EAct;
  | 
| 
sl@0
 | 
   166  | 
	iErrorNum = 0;
  | 
| 
sl@0
 | 
   167  | 
	iWinGroup=new(ELeave) RWindowGroup(Session());
  | 
| 
sl@0
 | 
   168  | 
	User::LeaveIfError(iWinGroup->Construct( (TUint32)(iWinGroup) ));
  | 
| 
sl@0
 | 
   169  | 
	iWinGroup->SetOrdinalPosition(0,0);
  | 
| 
sl@0
 | 
   170  | 
  | 
| 
sl@0
 | 
   171  | 
	//make sure at least minNumWindows are created, or if it's zero no limit
  | 
| 
sl@0
 | 
   172  | 
	iNumWindowsLeft = iData.minNumWindows;
  | 
| 
sl@0
 | 
   173  | 
  | 
| 
sl@0
 | 
   174  | 
	iScreen = new (ELeave) CWsScreenDevice(Session());	
  | 
| 
sl@0
 | 
   175  | 
	User::LeaveIfError(iScreen->Construct(0));
  | 
| 
sl@0
 | 
   176  | 
	TDisplayMode screenMode = iScreen->DisplayMode();
  | 
| 
sl@0
 | 
   177  | 
	
  | 
| 
sl@0
 | 
   178  | 
	iScreenBitmap = new (ELeave) CFbsBitmap;
  | 
| 
sl@0
 | 
   179  | 
	iScreenBitmap->Create(TSize(iData.windowWidth, iData.windowHeight), screenMode);
  | 
| 
sl@0
 | 
   180  | 
	
  | 
| 
sl@0
 | 
   181  | 
	iBackground = new(ELeave) RBlankWindow(Session());
  | 
| 
sl@0
 | 
   182  | 
	iBackground->Construct(*iWinGroup,reinterpret_cast<TUint32>(iBackground));
  | 
| 
sl@0
 | 
   183  | 
	iBackground->SetColor(KRgbBlack);
  | 
| 
sl@0
 | 
   184  | 
	iBackground->SetExtent(TPoint(0,0), TSize(iData.windowWidth, iData.windowHeight));
  | 
| 
sl@0
 | 
   185  | 
	iBackground->SetOrdinalPosition(0);
  | 
| 
sl@0
 | 
   186  | 
	iBackground->Activate();
  | 
| 
sl@0
 | 
   187  | 
  | 
| 
sl@0
 | 
   188  | 
	iCurrentBmp = 0;
  | 
| 
sl@0
 | 
   189  | 
	iLastBmp = 1;
  | 
| 
sl@0
 | 
   190  | 
	iBmpGc = CFbsBitGc::NewL();
  | 
| 
sl@0
 | 
   191  | 
	for (TInt bmp = 0; bmp < 2; ++bmp)
  | 
| 
sl@0
 | 
   192  | 
		{
 | 
| 
sl@0
 | 
   193  | 
		iBitmap[bmp] = new (ELeave) CFbsBitmap;
  | 
| 
sl@0
 | 
   194  | 
		iBitmap[bmp]->Create(TSize(iData.windowWidth, iData.windowHeight), screenMode); //EColor16MU); //
  | 
| 
sl@0
 | 
   195  | 
		iDevice[bmp] = CFbsBitmapDevice::NewL(iBitmap[bmp]);
  | 
| 
sl@0
 | 
   196  | 
		//clear bitmap background
  | 
| 
sl@0
 | 
   197  | 
		iBmpGc->Activate(iDevice[bmp]);
  | 
| 
sl@0
 | 
   198  | 
		iBmpGc->Reset();
  | 
| 
sl@0
 | 
   199  | 
		iBmpGc->SetPenStyle(CGraphicsContext::ENullPen);
  | 
| 
sl@0
 | 
   200  | 
		iBmpGc->SetBrushColor(KRgbBlack);
  | 
| 
sl@0
 | 
   201  | 
		iBmpGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
  | 
| 
sl@0
 | 
   202  | 
		TPoint origin(0,0);
  | 
| 
sl@0
 | 
   203  | 
		TRect rect(origin, TSize(iData.windowWidth, iData.windowHeight));
  | 
| 
sl@0
 | 
   204  | 
		iBmpGc->DrawRect(rect);
  | 
| 
sl@0
 | 
   205  | 
		}
  | 
| 
sl@0
 | 
   206  | 
  | 
| 
sl@0
 | 
   207  | 
	iDifferenceBitmap = new (ELeave) CFbsBitmap;
  | 
| 
sl@0
 | 
   208  | 
	iDifferenceBitmap->Create(TSize(iData.windowWidth, iData.windowHeight), screenMode); //EColor16MU); //
  | 
| 
sl@0
 | 
   209  | 
	iDifferenceDevice = CFbsBitmapDevice::NewL(iDifferenceBitmap);
  | 
| 
sl@0
 | 
   210  | 
  | 
| 
sl@0
 | 
   211  | 
	iTimer = new(ELeave) COperationTimer(this);
  | 
| 
sl@0
 | 
   212  | 
	iTimer->ConstructL();
  | 
| 
sl@0
 | 
   213  | 
	CActiveScheduler::Add (iTimer);
  | 
| 
sl@0
 | 
   214  | 
	iTimer->After(iData.initPeriod);
  | 
| 
sl@0
 | 
   215  | 
	}
  | 
| 
sl@0
 | 
   216  | 
  | 
| 
sl@0
 | 
   217  | 
/**
  | 
| 
sl@0
 | 
   218  | 
 Simulate a Left key stroke
  | 
| 
sl@0
 | 
   219  | 
 */
  | 
| 
sl@0
 | 
   220  | 
void CComparison::Touch()
  | 
| 
sl@0
 | 
   221  | 
	{
 | 
| 
sl@0
 | 
   222  | 
	User::ResetInactivityTime();
  | 
| 
sl@0
 | 
   223  | 
  | 
| 
sl@0
 | 
   224  | 
	TRawEvent keyDown;  
  | 
| 
sl@0
 | 
   225  | 
	keyDown.Set(TRawEvent::EKeyDown,EStdKeyLeftArrow);
  | 
| 
sl@0
 | 
   226  | 
	Session().SimulateRawEvent(keyDown);
  | 
| 
sl@0
 | 
   227  | 
	
  | 
| 
sl@0
 | 
   228  | 
	TRawEvent keyUp;
  | 
| 
sl@0
 | 
   229  | 
	keyUp.Set(TRawEvent::EKeyUp,EStdKeyLeftArrow);
  | 
| 
sl@0
 | 
   230  | 
	Session().SimulateRawEvent(keyUp);
  | 
| 
sl@0
 | 
   231  | 
	}
  | 
| 
sl@0
 | 
   232  | 
  | 
| 
sl@0
 | 
   233  | 
/**
  | 
| 
sl@0
 | 
   234  | 
 Non leaving version of TickL that reports failures
  | 
| 
sl@0
 | 
   235  | 
 */
  | 
| 
sl@0
 | 
   236  | 
TInt CComparison::Tick()
  | 
| 
sl@0
 | 
   237  | 
	{
 | 
| 
sl@0
 | 
   238  | 
	TRAPD(err, TickL());
  | 
| 
sl@0
 | 
   239  | 
	if (err)
  | 
| 
sl@0
 | 
   240  | 
		{
 | 
| 
sl@0
 | 
   241  | 
		REPORT_EVENT( EFalse );
  | 
| 
sl@0
 | 
   242  | 
		}
  | 
| 
sl@0
 | 
   243  | 
	return err;
  | 
| 
sl@0
 | 
   244  | 
	}
  | 
| 
sl@0
 | 
   245  | 
  | 
| 
sl@0
 | 
   246  | 
/**
  | 
| 
sl@0
 | 
   247  | 
 Called periodically 
  | 
| 
sl@0
 | 
   248  | 
 */
  | 
| 
sl@0
 | 
   249  | 
void CComparison::TickL()
  | 
| 
sl@0
 | 
   250  | 
	{
 | 
| 
sl@0
 | 
   251  | 
	if (iMustConclude)
  | 
| 
sl@0
 | 
   252  | 
		{
 | 
| 
sl@0
 | 
   253  | 
		WriteLog();
  | 
| 
sl@0
 | 
   254  | 
		ConcludeNow();
  | 
| 
sl@0
 | 
   255  | 
		return;
  | 
| 
sl@0
 | 
   256  | 
		}
  | 
| 
sl@0
 | 
   257  | 
	if (0 == iTestNum % 100)
  | 
| 
sl@0
 | 
   258  | 
		{
 | 
| 
sl@0
 | 
   259  | 
		Touch();
  | 
| 
sl@0
 | 
   260  | 
		}
  | 
| 
sl@0
 | 
   261  | 
	DoStuffL();
  | 
| 
sl@0
 | 
   262  | 
	if (iStuffDone)
  | 
| 
sl@0
 | 
   263  | 
		{
 | 
| 
sl@0
 | 
   264  | 
		++iTestNum;
  | 
| 
sl@0
 | 
   265  | 
		}
  | 
| 
sl@0
 | 
   266  | 
	}
  | 
| 
sl@0
 | 
   267  | 
  | 
| 
sl@0
 | 
   268  | 
/**
  | 
| 
sl@0
 | 
   269  | 
 Dispatch work to selected operation by mode
  | 
| 
sl@0
 | 
   270  | 
 */
  | 
| 
sl@0
 | 
   271  | 
void CComparison::DoStuffL()
  | 
| 
sl@0
 | 
   272  | 
	{
 | 
| 
sl@0
 | 
   273  | 
	iStuffDone = EFalse;
  | 
| 
sl@0
 | 
   274  | 
	switch (iMode)
  | 
| 
sl@0
 | 
   275  | 
		{
 | 
| 
sl@0
 | 
   276  | 
		case EAct:
  | 
| 
sl@0
 | 
   277  | 
			ActL();
  | 
| 
sl@0
 | 
   278  | 
			break;
  | 
| 
sl@0
 | 
   279  | 
		case EMove:
  | 
| 
sl@0
 | 
   280  | 
			MoveL();
  | 
| 
sl@0
 | 
   281  | 
			break;
  | 
| 
sl@0
 | 
   282  | 
		case EResize:
  | 
| 
sl@0
 | 
   283  | 
			ResizeL();
  | 
| 
sl@0
 | 
   284  | 
			break;
  | 
| 
sl@0
 | 
   285  | 
		};
  | 
| 
sl@0
 | 
   286  | 
	if (iWasOk && iData.compareBitmaps && iStuffDone)
  | 
| 
sl@0
 | 
   287  | 
		{
 | 
| 
sl@0
 | 
   288  | 
		Session().Flush();
  | 
| 
sl@0
 | 
   289  | 
		// schedule a delayed compare, will take place after all updates to windows
  | 
| 
sl@0
 | 
   290  | 
		if (iOneShotCompare == NULL)
  | 
| 
sl@0
 | 
   291  | 
			{
 | 
| 
sl@0
 | 
   292  | 
			iOneShotCompare = CComparison::COneShotCompare::NewL(EPriorityMuchLess, *this);
  | 
| 
sl@0
 | 
   293  | 
			}
  | 
| 
sl@0
 | 
   294  | 
		iOneShotCompare->Call();
  | 
| 
sl@0
 | 
   295  | 
		}
  | 
| 
sl@0
 | 
   296  | 
	else
  | 
| 
sl@0
 | 
   297  | 
		{
 | 
| 
sl@0
 | 
   298  | 
		if (iTestNum > iData.maxRunCycles && iNumWindowsLeft == 0)
  | 
| 
sl@0
 | 
   299  | 
			{
 | 
| 
sl@0
 | 
   300  | 
			iMustConclude = ETrue;
  | 
| 
sl@0
 | 
   301  | 
			}
  | 
| 
sl@0
 | 
   302  | 
		iTimer->After(iData.period);
  | 
| 
sl@0
 | 
   303  | 
		}
  | 
| 
sl@0
 | 
   304  | 
	Session().Flush();
  | 
| 
sl@0
 | 
   305  | 
  | 
| 
sl@0
 | 
   306  | 
	Session().Finish(); 
  | 
| 
sl@0
 | 
   307  | 
	}
  | 
| 
sl@0
 | 
   308  | 
	
  | 
| 
sl@0
 | 
   309  | 
/**
  | 
| 
sl@0
 | 
   310  | 
 Performs a random operation on a random window
  | 
| 
sl@0
 | 
   311  | 
 Operation can be one of create, destroy, move, bring to front/back,
  | 
| 
sl@0
 | 
   312  | 
 resize, tick, toggle-visibility
  | 
| 
sl@0
 | 
   313  | 
 */
  | 
| 
sl@0
 | 
   314  | 
void CComparison::ActL()
  | 
| 
sl@0
 | 
   315  | 
	{
 | 
| 
sl@0
 | 
   316  | 
	TInt action = TRnd::rnd(EACount);
  | 
| 
sl@0
 | 
   317  | 
	if (iWindows.Count() == 0)
  | 
| 
sl@0
 | 
   318  | 
		{
 | 
| 
sl@0
 | 
   319  | 
		action = 0;
  | 
| 
sl@0
 | 
   320  | 
		}
  | 
| 
sl@0
 | 
   321  | 
	
  | 
| 
sl@0
 | 
   322  | 
	iBehaviour.iWin = RandomWindow();
  | 
| 
sl@0
 | 
   323  | 
	iAct = static_cast<TAct>(action);
  | 
| 
sl@0
 | 
   324  | 
	switch(iAct)
  | 
| 
sl@0
 | 
   325  | 
		{
 | 
| 
sl@0
 | 
   326  | 
		case EACreate:
  | 
| 
sl@0
 | 
   327  | 
			CreateWindowL();
  | 
| 
sl@0
 | 
   328  | 
			break;
  | 
| 
sl@0
 | 
   329  | 
		case EADestroy:
  | 
| 
sl@0
 | 
   330  | 
			DestroyWindow();
  | 
| 
sl@0
 | 
   331  | 
			break;
  | 
| 
sl@0
 | 
   332  | 
		case EAMove:
  | 
| 
sl@0
 | 
   333  | 
			MoveWindow();
  | 
| 
sl@0
 | 
   334  | 
			break;
  | 
| 
sl@0
 | 
   335  | 
		case EAFront:
  | 
| 
sl@0
 | 
   336  | 
			BringWindowToFrontL();
  | 
| 
sl@0
 | 
   337  | 
			break;
  | 
| 
sl@0
 | 
   338  | 
		case EABack:
  | 
| 
sl@0
 | 
   339  | 
			SendWindowToBackL();
  | 
| 
sl@0
 | 
   340  | 
			break;
  | 
| 
sl@0
 | 
   341  | 
		case EAResize:
  | 
| 
sl@0
 | 
   342  | 
			ResizeWindow();
  | 
| 
sl@0
 | 
   343  | 
			break;
  | 
| 
sl@0
 | 
   344  | 
		case EATick:
  | 
| 
sl@0
 | 
   345  | 
			TickWindowL();
  | 
| 
sl@0
 | 
   346  | 
			break;
  | 
| 
sl@0
 | 
   347  | 
		case EAToggleVisible:
  | 
| 
sl@0
 | 
   348  | 
			ToggleVisible();
  | 
| 
sl@0
 | 
   349  | 
			break;
  | 
| 
sl@0
 | 
   350  | 
		} //lint !e787 enum constant TAct::EACount not used within switch
  | 
| 
sl@0
 | 
   351  | 
	}
  | 
| 
sl@0
 | 
   352  | 
  | 
| 
sl@0
 | 
   353  | 
void CComparison::MoveL()
  | 
| 
sl@0
 | 
   354  | 
	{
 | 
| 
sl@0
 | 
   355  | 
	if (iBehaviour.iCount < 1)
  | 
| 
sl@0
 | 
   356  | 
		{
 | 
| 
sl@0
 | 
   357  | 
		iMode = EAct;
  | 
| 
sl@0
 | 
   358  | 
		}
  | 
| 
sl@0
 | 
   359  | 
	else
  | 
| 
sl@0
 | 
   360  | 
		{
 | 
| 
sl@0
 | 
   361  | 
		TPoint pos = iBehaviour.iWin->Pos() + iBehaviour.iPos;
  | 
| 
sl@0
 | 
   362  | 
		iBehaviour.iWin->SetPos(pos);
  | 
| 
sl@0
 | 
   363  | 
		--iBehaviour.iCount;
  | 
| 
sl@0
 | 
   364  | 
		iStuffDone = ETrue;
  | 
| 
sl@0
 | 
   365  | 
		}
  | 
| 
sl@0
 | 
   366  | 
	}
  | 
| 
sl@0
 | 
   367  | 
  | 
| 
sl@0
 | 
   368  | 
void CComparison::ResizeL()
  | 
| 
sl@0
 | 
   369  | 
	{
 | 
| 
sl@0
 | 
   370  | 
	if (iBehaviour.iCount < 1)
  | 
| 
sl@0
 | 
   371  | 
		{
 | 
| 
sl@0
 | 
   372  | 
		iMode = EAct;
  | 
| 
sl@0
 | 
   373  | 
		}
  | 
| 
sl@0
 | 
   374  | 
	else
  | 
| 
sl@0
 | 
   375  | 
		{
 | 
| 
sl@0
 | 
   376  | 
		TSize size = iBehaviour.iWin->Size();
  | 
| 
sl@0
 | 
   377  | 
		size.iWidth += iBehaviour.iPos.iX;
  | 
| 
sl@0
 | 
   378  | 
		size.iHeight += iBehaviour.iPos.iY;
  | 
| 
sl@0
 | 
   379  | 
		iBehaviour.iWin->SetSize(size);
  | 
| 
sl@0
 | 
   380  | 
		--iBehaviour.iCount;
  | 
| 
sl@0
 | 
   381  | 
		iStuffDone = ETrue;
  | 
| 
sl@0
 | 
   382  | 
		}
  | 
| 
sl@0
 | 
   383  | 
	}
  | 
| 
sl@0
 | 
   384  | 
  | 
| 
sl@0
 | 
   385  | 
/**
  | 
| 
sl@0
 | 
   386  | 
 Sets the position for a future window-move command, the actual move will be 
  | 
| 
sl@0
 | 
   387  | 
 done in the next step 
  | 
| 
sl@0
 | 
   388  | 
 */
  | 
| 
sl@0
 | 
   389  | 
void CComparison::MoveWindow()
  | 
| 
sl@0
 | 
   390  | 
	{
 | 
| 
sl@0
 | 
   391  | 
	__UHEAP_MARK;
  | 
| 
sl@0
 | 
   392  | 
	if (iBehaviour.iWin)
  | 
| 
sl@0
 | 
   393  | 
		{
 | 
| 
sl@0
 | 
   394  | 
		TPoint pos = TPoint(TRnd::rnd(KPosLimit), TRnd::rnd(KPosLimit));
  | 
| 
sl@0
 | 
   395  | 
		pos.iX -= iBehaviour.iWin->Size().iWidth / 2;
  | 
| 
sl@0
 | 
   396  | 
		pos.iY -= iBehaviour.iWin->Size().iHeight / 2;
  | 
| 
sl@0
 | 
   397  | 
		iBehaviour.iPos = pos - iBehaviour.iWin->Pos();
  | 
| 
sl@0
 | 
   398  | 
		iBehaviour.iCount = KSteps;
  | 
| 
sl@0
 | 
   399  | 
		iBehaviour.iPos.iX /= iBehaviour.iCount;
  | 
| 
sl@0
 | 
   400  | 
		iBehaviour.iPos.iY /= iBehaviour.iCount;
  | 
| 
sl@0
 | 
   401  | 
		iMode = EMove;
  | 
| 
sl@0
 | 
   402  | 
		}
  | 
| 
sl@0
 | 
   403  | 
	__UHEAP_MARKEND;
  | 
| 
sl@0
 | 
   404  | 
	}
  | 
| 
sl@0
 | 
   405  | 
  | 
| 
sl@0
 | 
   406  | 
/**
  | 
| 
sl@0
 | 
   407  | 
 Sets the size for a future window-resize command, the actual resize will be 
  | 
| 
sl@0
 | 
   408  | 
 done in the next step 
  | 
| 
sl@0
 | 
   409  | 
 */
  | 
| 
sl@0
 | 
   410  | 
void CComparison::ResizeWindow()
  | 
| 
sl@0
 | 
   411  | 
	{
 | 
| 
sl@0
 | 
   412  | 
	__UHEAP_MARK;
  | 
| 
sl@0
 | 
   413  | 
	if (iBehaviour.iWin)
  | 
| 
sl@0
 | 
   414  | 
		{
 | 
| 
sl@0
 | 
   415  | 
		TPoint newsize = TPoint(TRnd::rnd(KPosLimit), TRnd::rnd(KPosLimit));
  | 
| 
sl@0
 | 
   416  | 
		TPoint oldsize;
  | 
| 
sl@0
 | 
   417  | 
		oldsize.iX = iBehaviour.iWin->Size().iWidth;
  | 
| 
sl@0
 | 
   418  | 
		oldsize.iY = iBehaviour.iWin->Size().iHeight;
  | 
| 
sl@0
 | 
   419  | 
		iBehaviour.iPos = newsize - oldsize;
  | 
| 
sl@0
 | 
   420  | 
		iBehaviour.iCount = KSteps;
  | 
| 
sl@0
 | 
   421  | 
		iBehaviour.iPos.iX /= iBehaviour.iCount;
  | 
| 
sl@0
 | 
   422  | 
		iBehaviour.iPos.iY /= iBehaviour.iCount;
  | 
| 
sl@0
 | 
   423  | 
		iMode = EResize;
  | 
| 
sl@0
 | 
   424  | 
		}
  | 
| 
sl@0
 | 
   425  | 
	__UHEAP_MARKEND;
  | 
| 
sl@0
 | 
   426  | 
	}
  | 
| 
sl@0
 | 
   427  | 
  | 
| 
sl@0
 | 
   428  | 
void CComparison::BringWindowToFrontL()
  | 
| 
sl@0
 | 
   429  | 
	{
 | 
| 
sl@0
 | 
   430  | 
	__UHEAP_MARK;
  | 
| 
sl@0
 | 
   431  | 
	CCompWin* win = iBehaviour.iWin;
  | 
| 
sl@0
 | 
   432  | 
	if (win)
  | 
| 
sl@0
 | 
   433  | 
		{
 | 
| 
sl@0
 | 
   434  | 
		win->BringToFrontL();
  | 
| 
sl@0
 | 
   435  | 
		TInt pos = FindTopWindow(win);
  | 
| 
sl@0
 | 
   436  | 
		if (pos >= 0)
  | 
| 
sl@0
 | 
   437  | 
			{
 | 
| 
sl@0
 | 
   438  | 
			iWindows.Remove(pos);
  | 
| 
sl@0
 | 
   439  | 
			iWindows.Append(win);
  | 
| 
sl@0
 | 
   440  | 
			}
  | 
| 
sl@0
 | 
   441  | 
		iStuffDone = ETrue;
  | 
| 
sl@0
 | 
   442  | 
		}
  | 
| 
sl@0
 | 
   443  | 
	__UHEAP_MARKEND;
  | 
| 
sl@0
 | 
   444  | 
	}
  | 
| 
sl@0
 | 
   445  | 
	
  | 
| 
sl@0
 | 
   446  | 
void CComparison::SendWindowToBackL()
  | 
| 
sl@0
 | 
   447  | 
	{
 | 
| 
sl@0
 | 
   448  | 
	__UHEAP_MARK;
  | 
| 
sl@0
 | 
   449  | 
	TInt ord = iBackground->OrdinalPosition();
  | 
| 
sl@0
 | 
   450  | 
	if (ord > 0)
  | 
| 
sl@0
 | 
   451  | 
		{
 | 
| 
sl@0
 | 
   452  | 
		CCompWin* win = iBehaviour.iWin;
  | 
| 
sl@0
 | 
   453  | 
		if (win)
  | 
| 
sl@0
 | 
   454  | 
			{
 | 
| 
sl@0
 | 
   455  | 
			TInt pos = FindTopWindow(win);
  | 
| 
sl@0
 | 
   456  | 
			if (pos >= 0)
  | 
| 
sl@0
 | 
   457  | 
				{
 | 
| 
sl@0
 | 
   458  | 
				iWindows.Remove(pos);
  | 
| 
sl@0
 | 
   459  | 
				iWindows.Insert(win, 0);
  | 
| 
sl@0
 | 
   460  | 
				win->Window()->SetOrdinalPosition(ord - 1);
  | 
| 
sl@0
 | 
   461  | 
				}
  | 
| 
sl@0
 | 
   462  | 
			else
  | 
| 
sl@0
 | 
   463  | 
				{
 | 
| 
sl@0
 | 
   464  | 
				win->SendToBackL();
  | 
| 
sl@0
 | 
   465  | 
				}
  | 
| 
sl@0
 | 
   466  | 
			iStuffDone = ETrue;
  | 
| 
sl@0
 | 
   467  | 
			}
  | 
| 
sl@0
 | 
   468  | 
		}
  | 
| 
sl@0
 | 
   469  | 
	__UHEAP_MARKEND;
  | 
| 
sl@0
 | 
   470  | 
	}
  | 
| 
sl@0
 | 
   471  | 
  | 
| 
sl@0
 | 
   472  | 
TInt CComparison::FindTopWindow(CCompWin* win)
  | 
| 
sl@0
 | 
   473  | 
	{
 | 
| 
sl@0
 | 
   474  | 
	return iWindows.Find(win);
  | 
| 
sl@0
 | 
   475  | 
	}
  | 
| 
sl@0
 | 
   476  | 
	
  | 
| 
sl@0
 | 
   477  | 
/**
  | 
| 
sl@0
 | 
   478  | 
 Returns a random window (which may be a NULL window)
  | 
| 
sl@0
 | 
   479  | 
*/
  | 
| 
sl@0
 | 
   480  | 
CCompWin * CComparison::RandomWindow()
  | 
| 
sl@0
 | 
   481  | 
	{
 | 
| 
sl@0
 | 
   482  | 
	if (iWindows.Count() == 0)
  | 
| 
sl@0
 | 
   483  | 
		{
 | 
| 
sl@0
 | 
   484  | 
		return 0;
  | 
| 
sl@0
 | 
   485  | 
		}
  | 
| 
sl@0
 | 
   486  | 
	
  | 
| 
sl@0
 | 
   487  | 
	TInt num = TRnd::rnd(iWindows.Count() + 1);
  | 
| 
sl@0
 | 
   488  | 
	
  | 
| 
sl@0
 | 
   489  | 
	if (num == iWindows.Count())
  | 
| 
sl@0
 | 
   490  | 
		{
 | 
| 
sl@0
 | 
   491  | 
		return 0;
  | 
| 
sl@0
 | 
   492  | 
		}
  | 
| 
sl@0
 | 
   493  | 
	else
  | 
| 
sl@0
 | 
   494  | 
		{
 | 
| 
sl@0
 | 
   495  | 
		return iWindows[num]->RandomWindow();
  | 
| 
sl@0
 | 
   496  | 
		}
  | 
| 
sl@0
 | 
   497  | 
	}
  | 
| 
sl@0
 | 
   498  | 
  | 
| 
sl@0
 | 
   499  | 
void CComparison::CreateWindowL()
  | 
| 
sl@0
 | 
   500  | 
	{
 | 
| 
sl@0
 | 
   501  | 
	CCompWin* parent = iBehaviour.iWin;
  | 
| 
sl@0
 | 
   502  | 
	CCompWin* win = CCompWin::NewLC(Session(), iWinGroup, parent, WindowGc());
  | 
| 
sl@0
 | 
   503  | 
	iBehaviour.iWin = win;
  | 
| 
sl@0
 | 
   504  | 
	if (!parent)
  | 
| 
sl@0
 | 
   505  | 
		{
 | 
| 
sl@0
 | 
   506  | 
		iWindows.AppendL(win);
  | 
| 
sl@0
 | 
   507  | 
		}
  | 
| 
sl@0
 | 
   508  | 
	CleanupStack::Pop(win);
  | 
| 
sl@0
 | 
   509  | 
	if (iNumWindowsLeft > 0)	//decrement window count
  | 
| 
sl@0
 | 
   510  | 
		{
 | 
| 
sl@0
 | 
   511  | 
		--iNumWindowsLeft;
  | 
| 
sl@0
 | 
   512  | 
		}
  | 
| 
sl@0
 | 
   513  | 
	iStuffDone = ETrue;
  | 
| 
sl@0
 | 
   514  | 
	}	
  | 
| 
sl@0
 | 
   515  | 
  | 
| 
sl@0
 | 
   516  | 
void CComparison::DestroyWindow()
  | 
| 
sl@0
 | 
   517  | 
	{
 | 
| 
sl@0
 | 
   518  | 
	CCompWin* win = iBehaviour.iWin;
  | 
| 
sl@0
 | 
   519  | 
	if (win)
  | 
| 
sl@0
 | 
   520  | 
		{
 | 
| 
sl@0
 | 
   521  | 
		TInt num = iWindows.Find(win);
  | 
| 
sl@0
 | 
   522  | 
		if (num != KErrNotFound)
  | 
| 
sl@0
 | 
   523  | 
			{
 | 
| 
sl@0
 | 
   524  | 
			iWindows.Remove(num);
  | 
| 
sl@0
 | 
   525  | 
			}
  | 
| 
sl@0
 | 
   526  | 
		delete win;
  | 
| 
sl@0
 | 
   527  | 
		iBehaviour.iWin = 0; // rby added
  | 
| 
sl@0
 | 
   528  | 
		iStuffDone = ETrue;
  | 
| 
sl@0
 | 
   529  | 
		}
  | 
| 
sl@0
 | 
   530  | 
	}	
  | 
| 
sl@0
 | 
   531  | 
  | 
| 
sl@0
 | 
   532  | 
void CComparison::TickWindowL()
  | 
| 
sl@0
 | 
   533  | 
	{
 | 
| 
sl@0
 | 
   534  | 
	CCompWin* win = iBehaviour.iWin;
  | 
| 
sl@0
 | 
   535  | 
	if (win)
  | 
| 
sl@0
 | 
   536  | 
		{
 | 
| 
sl@0
 | 
   537  | 
		if (win->TickL())
  | 
| 
sl@0
 | 
   538  | 
			{
 | 
| 
sl@0
 | 
   539  | 
			iStuffDone = ETrue;
  | 
| 
sl@0
 | 
   540  | 
			}
  | 
| 
sl@0
 | 
   541  | 
		}
  | 
| 
sl@0
 | 
   542  | 
	}
  | 
| 
sl@0
 | 
   543  | 
	
  | 
| 
sl@0
 | 
   544  | 
void CComparison::ToggleVisible()
  | 
| 
sl@0
 | 
   545  | 
	{
 | 
| 
sl@0
 | 
   546  | 
	__UHEAP_MARK;
  | 
| 
sl@0
 | 
   547  | 
	CCompWin* win = iBehaviour.iWin;
  | 
| 
sl@0
 | 
   548  | 
	if (win)
  | 
| 
sl@0
 | 
   549  | 
		{
 | 
| 
sl@0
 | 
   550  | 
		win->ToggleVisible();
  | 
| 
sl@0
 | 
   551  | 
		iStuffDone = ETrue;
  | 
| 
sl@0
 | 
   552  | 
		}
  | 
| 
sl@0
 | 
   553  | 
	__UHEAP_MARKEND;
  | 
| 
sl@0
 | 
   554  | 
	}
  | 
| 
sl@0
 | 
   555  | 
  | 
| 
sl@0
 | 
   556  | 
void CComparison::HandleRedraw(TWsRedrawEvent &aEvent)
  | 
| 
sl@0
 | 
   557  | 
	{
 | 
| 
sl@0
 | 
   558  | 
	__UHEAP_MARK;
  | 
| 
sl@0
 | 
   559  | 
	if (aEvent.Handle() != reinterpret_cast<TUint32>(iBackground))
  | 
| 
sl@0
 | 
   560  | 
		{
 | 
| 
sl@0
 | 
   561  | 
		reinterpret_cast<CCompWin*>(aEvent.Handle())->HandleRedraw(aEvent);
  | 
| 
sl@0
 | 
   562  | 
		}
  | 
| 
sl@0
 | 
   563  | 
	Session().Flush();
  | 
| 
sl@0
 | 
   564  | 
	__UHEAP_MARKEND;
  | 
| 
sl@0
 | 
   565  | 
	}
  | 
| 
sl@0
 | 
   566  | 
  | 
| 
sl@0
 | 
   567  | 
void CComparison::HandleEvent(TWsEvent &/*aEvent*/)
  | 
| 
sl@0
 | 
   568  | 
	{	
 | 
| 
sl@0
 | 
   569  | 
	}
  | 
| 
sl@0
 | 
   570  | 
  | 
| 
sl@0
 | 
   571  | 
/**
  | 
| 
sl@0
 | 
   572  | 
 Compares two bitmaps. Comparison is done on a pixel-by-pixel basis.
  | 
| 
sl@0
 | 
   573  | 
 If the bitmaps are of different sizes, the smaller axis of each is used for
  | 
| 
sl@0
 | 
   574  | 
 comparison (top-left subregions).
  | 
| 
sl@0
 | 
   575  | 
 First different pixel is stored in internally.
  | 
| 
sl@0
 | 
   576  | 
 @return ETrue if bitmaps match, EFalse otherwise.
  | 
| 
sl@0
 | 
   577  | 
*/
  | 
| 
sl@0
 | 
   578  | 
TBool CComparison::BitmapsMatch(const CFbsBitmap * aBitmap1, const CFbsBitmap * aBitmap2)
  | 
| 
sl@0
 | 
   579  | 
	{
 | 
| 
sl@0
 | 
   580  | 
	TDisplayMode mode1 = aBitmap1->DisplayMode();
  | 
| 
sl@0
 | 
   581  | 
	TDisplayMode mode2 = aBitmap2->DisplayMode();
  | 
| 
sl@0
 | 
   582  | 
	
  | 
| 
sl@0
 | 
   583  | 
	TSize bmpSize = aBitmap1->SizeInPixels();
  | 
| 
sl@0
 | 
   584  | 
	TSize bmpSize2 = aBitmap2->SizeInPixels();
  | 
| 
sl@0
 | 
   585  | 
	if (bmpSize2.iWidth < bmpSize.iWidth)
  | 
| 
sl@0
 | 
   586  | 
		{
 | 
| 
sl@0
 | 
   587  | 
		bmpSize.iWidth = bmpSize2.iWidth;
  | 
| 
sl@0
 | 
   588  | 
		}
  | 
| 
sl@0
 | 
   589  | 
	if (bmpSize2.iHeight < bmpSize.iHeight)
  | 
| 
sl@0
 | 
   590  | 
		{
 | 
| 
sl@0
 | 
   591  | 
		bmpSize.iHeight = bmpSize2.iHeight;
  | 
| 
sl@0
 | 
   592  | 
		}
  | 
| 
sl@0
 | 
   593  | 
	
  | 
| 
sl@0
 | 
   594  | 
	TRgb c1;
  | 
| 
sl@0
 | 
   595  | 
	TRgb c2;
  | 
| 
sl@0
 | 
   596  | 
	for (TInt y=0; y < bmpSize.iHeight; y++)
  | 
| 
sl@0
 | 
   597  | 
		{
 | 
| 
sl@0
 | 
   598  | 
		for (TInt x=0; x < bmpSize.iWidth; x++)
  | 
| 
sl@0
 | 
   599  | 
			{
 | 
| 
sl@0
 | 
   600  | 
			TPoint point(x, y);
  | 
| 
sl@0
 | 
   601  | 
			aBitmap1->GetPixel(c1, point);
  | 
| 
sl@0
 | 
   602  | 
			aBitmap2->GetPixel(c2, point);
  | 
| 
sl@0
 | 
   603  | 
			if (c1 != c2)
  | 
| 
sl@0
 | 
   604  | 
       			{
 | 
| 
sl@0
 | 
   605  | 
       			iPixel1 = c1.Value();
  | 
| 
sl@0
 | 
   606  | 
       			iPixel2 = c2.Value();
  | 
| 
sl@0
 | 
   607  | 
       			iPixelPos = point;
  | 
| 
sl@0
 | 
   608  | 
				return EFalse;
  | 
| 
sl@0
 | 
   609  | 
				}
  | 
| 
sl@0
 | 
   610  | 
			}		
  | 
| 
sl@0
 | 
   611  | 
		}
  | 
| 
sl@0
 | 
   612  | 
	return ETrue;		
  | 
| 
sl@0
 | 
   613  | 
	}
  | 
| 
sl@0
 | 
   614  | 
void CComparison::Verify(CFbsBitmap * aServerBmp)
  | 
| 
sl@0
 | 
   615  | 
	{	
 | 
| 
sl@0
 | 
   616  | 
	//Copy the currentBmp to lastBmp
  | 
| 
sl@0
 | 
   617  | 
	TInt dataStride = iBitmap[iCurrentBmp]->DataStride();
  | 
| 
sl@0
 | 
   618  | 
	TInt sizeInByte = dataStride * iBitmap[iCurrentBmp]->SizeInPixels().iHeight;
  | 
| 
sl@0
 | 
   619  | 
	TUint32* bitmapAddressSource = iBitmap[iCurrentBmp]->DataAddress();
  | 
| 
sl@0
 | 
   620  | 
	TUint32* bitmapAddressTarget = iBitmap[iLastBmp]->DataAddress();
  | 
| 
sl@0
 | 
   621  | 
	memcpy(bitmapAddressTarget, bitmapAddressSource, sizeInByte);
  | 
| 
sl@0
 | 
   622  | 
	// This method is only used by the animation and sprite windows; ignores 
  | 
| 
sl@0
 | 
   623  | 
	// comparisons for times that are too close to the sprite change. But as the 
  | 
| 
sl@0
 | 
   624  | 
	// difference error drifts, there is no point relying on it.
  | 
| 
sl@0
 | 
   625  | 
	if (!WindowsReadyForVerification())
  | 
| 
sl@0
 | 
   626  | 
		{
 | 
| 
sl@0
 | 
   627  | 
		Tick();
  | 
| 
sl@0
 | 
   628  | 
		return;
  | 
| 
sl@0
 | 
   629  | 
		}
  | 
| 
sl@0
 | 
   630  | 
  | 
| 
sl@0
 | 
   631  | 
	if (iWasOk)
  | 
| 
sl@0
 | 
   632  | 
		{
 | 
| 
sl@0
 | 
   633  | 
		DrawBitmap();
  | 
| 
sl@0
 | 
   634  | 
		
  | 
| 
sl@0
 | 
   635  | 
		const TBool bmpMatch = BitmapsMatch(aServerBmp, iBitmap[iCurrentBmp]);
  | 
| 
sl@0
 | 
   636  | 
		REPORT_EVENT( bmpMatch );
  | 
| 
sl@0
 | 
   637  | 
		
  | 
| 
sl@0
 | 
   638  | 
#ifdef __WINSCW__		
  | 
| 
sl@0
 | 
   639  | 
		if ( !bmpMatch )
  | 
| 
sl@0
 | 
   640  | 
			{
 | 
| 
sl@0
 | 
   641  | 
			__DEBUGGER();
  | 
| 
sl@0
 | 
   642  | 
			}
  | 
| 
sl@0
 | 
   643  | 
#endif
  | 
| 
sl@0
 | 
   644  | 
		
  | 
| 
sl@0
 | 
   645  | 
		if (!iData.saveOnlyDifferent || !bmpMatch)
  | 
| 
sl@0
 | 
   646  | 
			{
 | 
| 
sl@0
 | 
   647  | 
			TBuf<128> fileName;
  | 
| 
sl@0
 | 
   648  | 
			fileName.Append(iData.loggingPath);
  | 
| 
sl@0
 | 
   649  | 
			fileName.Append(_L("Stresslet_Comparison_"));
 | 
| 
sl@0
 | 
   650  | 
			if (iData.saveOnlyDifferent)
  | 
| 
sl@0
 | 
   651  | 
				{
 | 
| 
sl@0
 | 
   652  | 
				fileName.AppendNumFixedWidthUC((TUint)iErrorNum, EDecimal, 3);
  | 
| 
sl@0
 | 
   653  | 
				}
  | 
| 
sl@0
 | 
   654  | 
			else
  | 
| 
sl@0
 | 
   655  | 
				{
 | 
| 
sl@0
 | 
   656  | 
				fileName.AppendNumFixedWidthUC((TUint)iTestNum, EDecimal, 3);
  | 
| 
sl@0
 | 
   657  | 
				}
  | 
| 
sl@0
 | 
   658  | 
			TInt baseLength = fileName.Length();
  | 
| 
sl@0
 | 
   659  | 
			
  | 
| 
sl@0
 | 
   660  | 
			//previous is saved only when saving different bitmaps 
  | 
| 
sl@0
 | 
   661  | 
			//otherwise it is always the same as the previous expected
  | 
| 
sl@0
 | 
   662  | 
			if (iData.saveOnlyDifferent)
  | 
| 
sl@0
 | 
   663  | 
				{
 | 
| 
sl@0
 | 
   664  | 
				fileName.Append(_L("_Previous.mbm"));
 | 
| 
sl@0
 | 
   665  | 
				__ASSERT_ALWAYS(KErrNone == iBitmap[iLastBmp]->Save(fileName), Panic(EPanic6));
  | 
| 
sl@0
 | 
   666  | 
				}
  | 
| 
sl@0
 | 
   667  | 
			
  | 
| 
sl@0
 | 
   668  | 
			fileName.SetLength(baseLength);
  | 
| 
sl@0
 | 
   669  | 
			fileName.Append(_L("_Expected.mbm"));
 | 
| 
sl@0
 | 
   670  | 
			__ASSERT_ALWAYS(KErrNone == iBitmap[iCurrentBmp]->Save(fileName), Panic(EPanic7));
  | 
| 
sl@0
 | 
   671  | 
			
  | 
| 
sl@0
 | 
   672  | 
			fileName.SetLength(baseLength);
  | 
| 
sl@0
 | 
   673  | 
			fileName.Append(_L("_Screen.mbm"));
 | 
| 
sl@0
 | 
   674  | 
			__ASSERT_ALWAYS(KErrNone == aServerBmp->Save(fileName), Panic(EPanic8));
  | 
| 
sl@0
 | 
   675  | 
  | 
| 
sl@0
 | 
   676  | 
			//store difference between expected and screen bitmaps (XOR image)
  | 
| 
sl@0
 | 
   677  | 
			if (iData.saveDifferenceBitmap)
  | 
| 
sl@0
 | 
   678  | 
				{
 | 
| 
sl@0
 | 
   679  | 
				iBmpGc->Activate(iDifferenceDevice);
  | 
| 
sl@0
 | 
   680  | 
				iBmpGc->Reset();
  | 
| 
sl@0
 | 
   681  | 
				iBmpGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
  | 
| 
sl@0
 | 
   682  | 
				iBmpGc->BitBlt(TPoint(0,0), iBitmap[iCurrentBmp]);
  | 
| 
sl@0
 | 
   683  | 
				iBmpGc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
  | 
| 
sl@0
 | 
   684  | 
				iBmpGc->BitBlt(TPoint(0,0), aServerBmp);
  | 
| 
sl@0
 | 
   685  | 
				iBmpGc->Reset();
  | 
| 
sl@0
 | 
   686  | 
				fileName.SetLength(baseLength);
  | 
| 
sl@0
 | 
   687  | 
				fileName.Append(_L("_Difference.mbm"));
 | 
| 
sl@0
 | 
   688  | 
				__ASSERT_ALWAYS(KErrNone == iDifferenceBitmap->Save(fileName), Panic(EPanic19));
  | 
| 
sl@0
 | 
   689  | 
				}
  | 
| 
sl@0
 | 
   690  | 
			
  | 
| 
sl@0
 | 
   691  | 
			fileName.SetLength(baseLength);
  | 
| 
sl@0
 | 
   692  | 
			fileName.Append(_L("_info.txt"));
 | 
| 
sl@0
 | 
   693  | 
			RFile file;
  | 
| 
sl@0
 | 
   694  | 
			TInt err = file.Create(iFs, fileName, EFileWrite);
  | 
| 
sl@0
 | 
   695  | 
			if (err != KErrNone)
  | 
| 
sl@0
 | 
   696  | 
				err = file.Replace(iFs, fileName, EFileWrite);
  | 
| 
sl@0
 | 
   697  | 
			if (err == KErrNone)
  | 
| 
sl@0
 | 
   698  | 
				{
 | 
| 
sl@0
 | 
   699  | 
				TBuf8<128> info;
  | 
| 
sl@0
 | 
   700  | 
				info.Append(_L8("Seed = "));
 | 
| 
sl@0
 | 
   701  | 
				info.AppendNum(iFirstSeed);
  | 
| 
sl@0
 | 
   702  | 
				info.Append(_L8("\n"));
 | 
| 
sl@0
 | 
   703  | 
				file.Write(info);
  | 
| 
sl@0
 | 
   704  | 
				info.SetLength(0);
  | 
| 
sl@0
 | 
   705  | 
				TTime now;
  | 
| 
sl@0
 | 
   706  | 
				now.UniversalTime();
  | 
| 
sl@0
 | 
   707  | 
				info.Append(_L8(" Runtime = "));
 | 
| 
sl@0
 | 
   708  | 
				info.AppendNum(now.MicroSecondsFrom(iStartTime).Int64() / 1000);
  | 
| 
sl@0
 | 
   709  | 
				info.Append(_L8(" ms\r\n"));
 | 
| 
sl@0
 | 
   710  | 
				file.Write(info);
  | 
| 
sl@0
 | 
   711  | 
				info.SetLength(0);
  | 
| 
sl@0
 | 
   712  | 
				info.Append(_L8("Action = ["));
 | 
| 
sl@0
 | 
   713  | 
				info.AppendNum((TInt64)iAct);
  | 
| 
sl@0
 | 
   714  | 
				info.Append(_L8("]   Mode = ["));
 | 
| 
sl@0
 | 
   715  | 
				info.AppendNum((TInt64)iMode);
  | 
| 
sl@0
 | 
   716  | 
				info.Append(_L8("]   Test = ["));
 | 
| 
sl@0
 | 
   717  | 
				info.AppendNum((TInt64)iTestNum);
  | 
| 
sl@0
 | 
   718  | 
				info.Append(_L8("]\r\n"));
 | 
| 
sl@0
 | 
   719  | 
				file.Write(info);
  | 
| 
sl@0
 | 
   720  | 
				info.SetLength(0);
  | 
| 
sl@0
 | 
   721  | 
				info.Append(_L8("Pixel at ["));
 | 
| 
sl@0
 | 
   722  | 
				info.AppendNum((TInt64)iPixelPos.iX);
  | 
| 
sl@0
 | 
   723  | 
				info.Append(_L8(","));
 | 
| 
sl@0
 | 
   724  | 
				info.AppendNum((TInt64)iPixelPos.iY);
  | 
| 
sl@0
 | 
   725  | 
				info.Append(_L8("] mismatch screen 0x"));
 | 
| 
sl@0
 | 
   726  | 
				info.AppendNum((TInt64)iPixel1, EHex);
  | 
| 
sl@0
 | 
   727  | 
				info.Append(_L8(" != bitmap 0x"));
 | 
| 
sl@0
 | 
   728  | 
				info.AppendNum((TInt64)iPixel2, EHex);
  | 
| 
sl@0
 | 
   729  | 
				info.Append(_L8("\r\n\r\n"));
 | 
| 
sl@0
 | 
   730  | 
				file.Write(info);
  | 
| 
sl@0
 | 
   731  | 
				
  | 
| 
sl@0
 | 
   732  | 
				TPoint zero(0,0);
  | 
| 
sl@0
 | 
   733  | 
				for (TInt num = 0; num < iWindows.Count(); ++num)
  | 
| 
sl@0
 | 
   734  | 
					{
 | 
| 
sl@0
 | 
   735  | 
					iWindows[num]->Dump(file, zero, 0, iBehaviour.iWin);
  | 
| 
sl@0
 | 
   736  | 
					info.SetLength(0);
  | 
| 
sl@0
 | 
   737  | 
					info.Append(_L8("\r\n"));
 | 
| 
sl@0
 | 
   738  | 
					file.Write(info);
  | 
| 
sl@0
 | 
   739  | 
					}				
  | 
| 
sl@0
 | 
   740  | 
				file.Close();
  | 
| 
sl@0
 | 
   741  | 
				}
  | 
| 
sl@0
 | 
   742  | 
			else
  | 
| 
sl@0
 | 
   743  | 
				{
 | 
| 
sl@0
 | 
   744  | 
				//failed create logfile
  | 
| 
sl@0
 | 
   745  | 
				__ASSERT_ALWAYS(EFalse, Panic(EPanic9));
  | 
| 
sl@0
 | 
   746  | 
				}
  | 
| 
sl@0
 | 
   747  | 
			
  | 
| 
sl@0
 | 
   748  | 
			if (!bmpMatch)
  | 
| 
sl@0
 | 
   749  | 
				{
 | 
| 
sl@0
 | 
   750  | 
				++iErrorNum;
  | 
| 
sl@0
 | 
   751  | 
				}
  | 
| 
sl@0
 | 
   752  | 
			}
  | 
| 
sl@0
 | 
   753  | 
		}	
  | 
| 
sl@0
 | 
   754  | 
	if ((iTestNum > iData.maxRunCycles && iNumWindowsLeft == 0) || !iWasOk)
  | 
| 
sl@0
 | 
   755  | 
		{
 | 
| 
sl@0
 | 
   756  | 
		iMustConclude = ETrue;
  | 
| 
sl@0
 | 
   757  | 
		}
  | 
| 
sl@0
 | 
   758  | 
	iTimer->After(iData.period);
  | 
| 
sl@0
 | 
   759  | 
	}
  | 
| 
sl@0
 | 
   760  | 
  | 
| 
sl@0
 | 
   761  | 
/**
  | 
| 
sl@0
 | 
   762  | 
Write information(eg. seed, starttime, endtime and time elapse) to Stresslet_Log.txt file 
  | 
| 
sl@0
 | 
   763  | 
*/
  | 
| 
sl@0
 | 
   764  | 
void CComparison::WriteLog()
  | 
| 
sl@0
 | 
   765  | 
	{
 | 
| 
sl@0
 | 
   766  | 
	TBuf<128> fileName;
  | 
| 
sl@0
 | 
   767  | 
	fileName.Append(iData.loggingPath);
  | 
| 
sl@0
 | 
   768  | 
	fileName.Append(_L("Stresslet_Log.txt"));
 | 
| 
sl@0
 | 
   769  | 
	RFile file;
  | 
| 
sl@0
 | 
   770  | 
	TInt err = file.Create(iFs, fileName, EFileWrite);
  | 
| 
sl@0
 | 
   771  | 
	if (err != KErrNone)
  | 
| 
sl@0
 | 
   772  | 
		{
 | 
| 
sl@0
 | 
   773  | 
		err = file.Replace(iFs, fileName, EFileWrite);
  | 
| 
sl@0
 | 
   774  | 
		}
  | 
| 
sl@0
 | 
   775  | 
	if (err == KErrNone)
  | 
| 
sl@0
 | 
   776  | 
		{
 | 
| 
sl@0
 | 
   777  | 
		TBuf8<128> info;
  | 
| 
sl@0
 | 
   778  | 
		info.Append(_L8("Seed = "));
 | 
| 
sl@0
 | 
   779  | 
		info.AppendNum(iFirstSeed);
  | 
| 
sl@0
 | 
   780  | 
		info.Append(_L8("\r\n"));
 | 
| 
sl@0
 | 
   781  | 
		file.Write(info);
  | 
| 
sl@0
 | 
   782  | 
		info.SetLength(0);
  | 
| 
sl@0
 | 
   783  | 
		TBuf<40> dateTimeString;
  | 
| 
sl@0
 | 
   784  | 
	    _LIT(KFormat2,"%D%M%Y%/0%1%/1%2%/2%3%/3 %:0%H%:1%T%:2%S.%C%:3");
  | 
| 
sl@0
 | 
   785  | 
	    iStartTime.FormatL(dateTimeString,KFormat2);
  | 
| 
sl@0
 | 
   786  | 
		info.Append(_L8("StartTime = "));
 | 
| 
sl@0
 | 
   787  | 
		info.Append(dateTimeString);
  | 
| 
sl@0
 | 
   788  | 
		info.Append(_L8("\r\n"));
 | 
| 
sl@0
 | 
   789  | 
		TTime now;
  | 
| 
sl@0
 | 
   790  | 
		now.UniversalTime();
  | 
| 
sl@0
 | 
   791  | 
		now.FormatL(dateTimeString,KFormat2);
  | 
| 
sl@0
 | 
   792  | 
		info.Append(_L8("Endtime = "));
 | 
| 
sl@0
 | 
   793  | 
		info.Append(dateTimeString);
  | 
| 
sl@0
 | 
   794  | 
		info.Append(_L8("\r\n"));
 | 
| 
sl@0
 | 
   795  | 
		info.Append(_L8("Elapse = "));
 | 
| 
sl@0
 | 
   796  | 
		info.AppendNum(now.MicroSecondsFrom(iStartTime).Int64() / 1000);
  | 
| 
sl@0
 | 
   797  | 
		info.Append(_L8(" ms\r\n"));
 | 
| 
sl@0
 | 
   798  | 
		file.Write(info);
  | 
| 
sl@0
 | 
   799  | 
		file.Close();
  | 
| 
sl@0
 | 
   800  | 
		}
  | 
| 
sl@0
 | 
   801  | 
	}
  | 
| 
sl@0
 | 
   802  | 
/**
  | 
| 
sl@0
 | 
   803  | 
 Returns true if all visible windows are ready for verification
  | 
| 
sl@0
 | 
   804  | 
 */
  | 
| 
sl@0
 | 
   805  | 
TBool CComparison::WindowsReadyForVerification() const
  | 
| 
sl@0
 | 
   806  | 
	{
 | 
| 
sl@0
 | 
   807  | 
	TBool res = ETrue;
  | 
| 
sl@0
 | 
   808  | 
	TInt idx = 0;
  | 
| 
sl@0
 | 
   809  | 
	while ( idx < iWindows.Count() && res )
  | 
| 
sl@0
 | 
   810  | 
		{
 | 
| 
sl@0
 | 
   811  | 
		if ( iWindows[ idx ]->IsVisible() )
  | 
| 
sl@0
 | 
   812  | 
			{
 | 
| 
sl@0
 | 
   813  | 
			res = iWindows[ idx ]->QueryReadyForVerification();
  | 
| 
sl@0
 | 
   814  | 
			}
  | 
| 
sl@0
 | 
   815  | 
		idx++;
  | 
| 
sl@0
 | 
   816  | 
		}
  | 
| 
sl@0
 | 
   817  | 
	return res;
  | 
| 
sl@0
 | 
   818  | 
	}
  | 
| 
sl@0
 | 
   819  | 
  | 
| 
sl@0
 | 
   820  | 
/**
  | 
| 
sl@0
 | 
   821  | 
 Calls all windows to draw themselves on a bitmap
  | 
| 
sl@0
 | 
   822  | 
 */
  | 
| 
sl@0
 | 
   823  | 
void CComparison::DrawBitmap()
  | 
| 
sl@0
 | 
   824  | 
	{
 | 
| 
sl@0
 | 
   825  | 
	iBmpGc->Activate(iDevice[iCurrentBmp]);
  | 
| 
sl@0
 | 
   826  | 
	iBmpGc->Reset();
  | 
| 
sl@0
 | 
   827  | 
  | 
| 
sl@0
 | 
   828  | 
	// clear background area
  | 
| 
sl@0
 | 
   829  | 
	iBmpGc->SetPenStyle(CGraphicsContext::ENullPen);
  | 
| 
sl@0
 | 
   830  | 
	iBmpGc->SetBrushColor(KRgbBlack);
  | 
| 
sl@0
 | 
   831  | 
	iBmpGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
  | 
| 
sl@0
 | 
   832  | 
  | 
| 
sl@0
 | 
   833  | 
	TPoint origin(0,0);
  | 
| 
sl@0
 | 
   834  | 
	TRect rect(origin, TSize(iData.windowWidth, iData.windowHeight));
  | 
| 
sl@0
 | 
   835  | 
  | 
| 
sl@0
 | 
   836  | 
	//create a region containing all screen, subtract all visible windows
  | 
| 
sl@0
 | 
   837  | 
	RRegion backClipping(rect);
  | 
| 
sl@0
 | 
   838  | 
	if (!iData.clearAllBackground)
  | 
| 
sl@0
 | 
   839  | 
		{
 | 
| 
sl@0
 | 
   840  | 
		for (TInt num = 0; num < iWindows.Count(); ++num)
  | 
| 
sl@0
 | 
   841  | 
			{
 | 
| 
sl@0
 | 
   842  | 
			if (iWindows[num]->IsVisible())
  | 
| 
sl@0
 | 
   843  | 
				iWindows[num]->SubSelfFromRegion(backClipping, rect, origin);
  | 
| 
sl@0
 | 
   844  | 
			}
  | 
| 
sl@0
 | 
   845  | 
		}
  | 
| 
sl@0
 | 
   846  | 
	
  | 
| 
sl@0
 | 
   847  | 
	//clip drawing to background only & clear
  | 
| 
sl@0
 | 
   848  | 
	iBmpGc->SetClippingRegion(backClipping);
  | 
| 
sl@0
 | 
   849  | 
	iBmpGc->DrawRect(rect);
  | 
| 
sl@0
 | 
   850  | 
	//go back to no clipping
  | 
| 
sl@0
 | 
   851  | 
	iBmpGc->CancelClipping();
  | 
| 
sl@0
 | 
   852  | 
	backClipping.Close();
  | 
| 
sl@0
 | 
   853  | 
  | 
| 
sl@0
 | 
   854  | 
	for (TInt num = 0; num < iWindows.Count(); ++num)
  | 
| 
sl@0
 | 
   855  | 
		{
 | 
| 
sl@0
 | 
   856  | 
		if (iWindows[num]->IsVisible())
  | 
| 
sl@0
 | 
   857  | 
			{
 | 
| 
sl@0
 | 
   858  | 
			iWindows[num]->ClearBitmapBackground(iBmpGc, rect, origin);
  | 
| 
sl@0
 | 
   859  | 
			iWindows[num]->DrawBitmap(iBmpGc, rect, origin);
  | 
| 
sl@0
 | 
   860  | 
			}
  | 
| 
sl@0
 | 
   861  | 
		}
  | 
| 
sl@0
 | 
   862  | 
	}
  | 
| 
sl@0
 | 
   863  | 
	
  | 
| 
sl@0
 | 
   864  | 
void CComparison::SetVerifyTick(TUint32 aTick)
  | 
| 
sl@0
 | 
   865  | 
	{
 | 
| 
sl@0
 | 
   866  | 
	for (TInt num = 0; num < iWindows.Count(); ++num)
  | 
| 
sl@0
 | 
   867  | 
		{
 | 
| 
sl@0
 | 
   868  | 
		if (iWindows[num]->IsVisible())
  | 
| 
sl@0
 | 
   869  | 
			iWindows[num]->SetVerifyTick(aTick);
  | 
| 
sl@0
 | 
   870  | 
		}
  | 
| 
sl@0
 | 
   871  | 
	}
  | 
| 
sl@0
 | 
   872  | 
  | 
| 
sl@0
 | 
   873  | 
CComparison::~CComparison()
  | 
| 
sl@0
 | 
   874  | 
	{
 | 
| 
sl@0
 | 
   875  | 
	iFs.Close();
  | 
| 
sl@0
 | 
   876  | 
	
  | 
| 
sl@0
 | 
   877  | 
	if (iBackground)
  | 
| 
sl@0
 | 
   878  | 
		{
 | 
| 
sl@0
 | 
   879  | 
		iBackground->Close();
  | 
| 
sl@0
 | 
   880  | 
		delete iBackground;
  | 
| 
sl@0
 | 
   881  | 
		}	
  | 
| 
sl@0
 | 
   882  | 
	
  | 
| 
sl@0
 | 
   883  | 
	iWindows.ResetAndDestroy();
  | 
| 
sl@0
 | 
   884  | 
	if (iWinGroup)
  | 
| 
sl@0
 | 
   885  | 
		{
 | 
| 
sl@0
 | 
   886  | 
		iWinGroup->Close();
  | 
| 
sl@0
 | 
   887  | 
		delete iWinGroup;
  | 
| 
sl@0
 | 
   888  | 
		}
  | 
| 
sl@0
 | 
   889  | 
  | 
| 
sl@0
 | 
   890  | 
	delete iOneShotCompare; //delayed compare
  | 
| 
sl@0
 | 
   891  | 
  | 
| 
sl@0
 | 
   892  | 
	delete iDifferenceDevice;
  | 
| 
sl@0
 | 
   893  | 
	delete iDifferenceBitmap;
  | 
| 
sl@0
 | 
   894  | 
	
  | 
| 
sl@0
 | 
   895  | 
	for (TInt bmp = 0; bmp < 2; ++bmp)
  | 
| 
sl@0
 | 
   896  | 
		{
 | 
| 
sl@0
 | 
   897  | 
		delete iDevice[bmp];
  | 
| 
sl@0
 | 
   898  | 
		delete iBitmap[bmp];
  | 
| 
sl@0
 | 
   899  | 
		}
  | 
| 
sl@0
 | 
   900  | 
	
  | 
| 
sl@0
 | 
   901  | 
	delete iBmpGc;
  | 
| 
sl@0
 | 
   902  | 
	delete iTimer;
  | 
| 
sl@0
 | 
   903  | 
  | 
| 
sl@0
 | 
   904  | 
	delete iScreenBitmap;
  | 
| 
sl@0
 | 
   905  | 
	delete iScreen;
  | 
| 
sl@0
 | 
   906  | 
	}
  |