Update contrib.
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 "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
28 /*******************************************************************************
29 This is a wrapper round the horrific Math::Rand interface
30 *******************************************************************************/
32 const TInt KPosLimit = 350;
34 _LIT(KLogFileName, "logging.log"); //to be used to replay the same testrun
35 _LIT(KAnimDllName, "a0005924.dll");
37 class CTestExecWatchCat;
39 class CExecutionContext : public CBase
41 friend class CTestExecWatchCat;
44 class CLogMediator : public CBase
48 void RecordInt (TInt aIntToBeRecorded);
49 static CLogMediator* NewLC (CExecutionContext& aExecutionContext, RFs& aFs, const TDesC& aFileName);
53 CLogMediator (CExecutionContext& aExecutionContext);
54 void ConstructL (RFs& aFs, const TDesC& aFileName);
58 CExecutionContext& iExecutionContext;
70 static CExecutionContext* NewL (TExecutionMode aExecutionMode, CTestExecWatchCat& aWatchCat);
71 TExecutionMode ContextMode ();
72 ~CExecutionContext ();
73 void MediatorDestroyed (CLogMediator* aMediator);
74 void MediatorEmptied (CLogMediator* aMediator);
77 CExecutionContext (TExecutionMode aExecutionMode, CTestExecWatchCat& aWatchCat);
79 CLogMediator& CreateLogMediatorL (const TDesC& aLogName);
83 RPointerArray<CLogMediator> iMediators;
84 CTestExecWatchCat& iWatchCat;
85 TExecutionMode iContextMode;
88 class CTestExecWatchCat : public CBase
90 friend class CExecutionContext;
93 static CTestExecWatchCat* NewL (CExecutionContext::TExecutionMode aExecutionMode);
94 void SetLoggingPathL(const TDesC& aPath);
97 CTestExecWatchCat ( );
98 ~CTestExecWatchCat ( );
100 void ConstructL (CExecutionContext::TExecutionMode aExecutionMode );
101 void ExecutionContextRunOut (CExecutionContext* aContext );
104 CExecutionContext* iExecutionContext;
110 static TInt rnd ( TInt x = 0 );
111 static TInt64 Seed();
112 static void SetSeed(TInt64 aSeed);
113 static void SetLogMediator(CExecutionContext::CLogMediator* aMediator);
114 static void SetExecutionContext(CExecutionContext* aExecutionContext);
116 static TInt GenRand (TInt x );
119 static CExecutionContext::CLogMediator* iMediator;
120 static CExecutionContext* iExecutionContext;
123 friend class CTestExecWatchCat;
129 static TUint32 CalcTickDelta (TUint32 tick1, TUint32 tick2 );
133 /*******************************************************************************
134 This is a small helper function for drawing regions
135 *******************************************************************************/
136 static void DrawRegion (const TRegion& aRegion, CGraphicsContext& aGc)
138 const TRect * rect = aRegion.RectangleList ();
139 for (TInt r = 0; r < aRegion.Count (); ++r)
141 aGc.DrawRect (*rect);