sl@0
|
1 |
// Copyright (c) 2005-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 |
// This file define all the common values thoughout your test project
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
/**
|
sl@0
|
19 |
@file
|
sl@0
|
20 |
@test
|
sl@0
|
21 |
@internalComponent - Internal Symbian test code
|
sl@0
|
22 |
*/
|
sl@0
|
23 |
|
sl@0
|
24 |
#ifndef __TE_GRAPHICSPERFORMANCE_SUITEDEFS_H__
|
sl@0
|
25 |
#define __TE_GRAPHICSPERFORMANCE_SUITEDEFS_H__
|
sl@0
|
26 |
|
sl@0
|
27 |
#include <gdi.h>
|
sl@0
|
28 |
|
sl@0
|
29 |
_LIT(KProfilerLogFile,"c:\\PROFILER.DAT");
|
sl@0
|
30 |
#define __MOVEFILETODRIVE (__SrcFile, __DestFile)
|
sl@0
|
31 |
|
sl@0
|
32 |
// use this to start and stop sampling profiler within this teststep
|
sl@0
|
33 |
//#define _USE_PROFILER
|
sl@0
|
34 |
|
sl@0
|
35 |
// Please modify below value with your project and must match with your configuration ini file which is required to be modified as well
|
sl@0
|
36 |
_LIT(KTe_graphicsperformanceSuiteString,"TheString");
|
sl@0
|
37 |
_LIT(KTe_graphicsperformanceSuiteInt,"TheInt");
|
sl@0
|
38 |
_LIT(KTe_graphicsperformanceSuiteBool,"TheBool");
|
sl@0
|
39 |
|
sl@0
|
40 |
// For test step panics
|
sl@0
|
41 |
_LIT(KTe_graphicsperformanceSuitePanic,"Te_graphicsperformanceSuite");
|
sl@0
|
42 |
|
sl@0
|
43 |
const TDisplayMode KValidBitmapModes[] = {EColor16MAP, EColor16MA, EColor16MU, EColor16M, EColor256, EGray256, EColor64K};
|
sl@0
|
44 |
const TInt KNumValidBitmapModes = TInt(sizeof(KValidBitmapModes)/sizeof(KValidBitmapModes[0]));
|
sl@0
|
45 |
|
sl@0
|
46 |
const TDisplayMode KValidDisplayModes[] = {EColor16MAP, EColor16MA, EColor16MU, EColor64K};
|
sl@0
|
47 |
const TInt KNumValidDisplayModes = TInt(sizeof(KValidDisplayModes)/sizeof(KValidDisplayModes[0]));
|
sl@0
|
48 |
|
sl@0
|
49 |
// Test macro to log Leaves.
|
sl@0
|
50 |
#define TESTNOERRORL(a) \
|
sl@0
|
51 |
{\
|
sl@0
|
52 |
TInt b = a;\
|
sl@0
|
53 |
TBool c = (b == KErrNone);\
|
sl@0
|
54 |
testBooleanTrueWithErrorCodeL((c), (b), (TText8*)__FILE__, __LINE__);\
|
sl@0
|
55 |
}
|
sl@0
|
56 |
|
sl@0
|
57 |
// Redefine TEST/TESTE as TEST1/TESTE1 so that all errors are logged, not
|
sl@0
|
58 |
// just the first error.
|
sl@0
|
59 |
#ifdef TEST
|
sl@0
|
60 |
#undef TEST
|
sl@0
|
61 |
#define TEST(a) TEST1(a, ETrue)
|
sl@0
|
62 |
#endif // TEST
|
sl@0
|
63 |
|
sl@0
|
64 |
#ifdef TESTE
|
sl@0
|
65 |
#undef TESTE
|
sl@0
|
66 |
#define TESTE(a, b) TESTE1(a, b, ETrue)
|
sl@0
|
67 |
#endif // TESTE
|
sl@0
|
68 |
|
sl@0
|
69 |
#ifdef _USE_PROFILER
|
sl@0
|
70 |
#define __PROFILERMEMBERS RProcess iProcess; TInt iPErr; RFs iFSession; TBuf<256> iProfLog; TBuf<256> iProfLoE; CFileMan* iFileMan;
|
sl@0
|
71 |
#define __STARTPROFILER iPErr=iProcess.Create(_L("profiler"),_L("start")); \
|
sl@0
|
72 |
if (iPErr==KErrNone) { \
|
sl@0
|
73 |
iProcess.Resume(); \
|
sl@0
|
74 |
iProcess.Close(); \
|
sl@0
|
75 |
} else { \
|
sl@0
|
76 |
INFO_PRINTF2(_L("Profiler process created return value:"),iPErr); \
|
sl@0
|
77 |
}
|
sl@0
|
78 |
#define __STOPPROFILER(__destfilename, __fnext1, __fnext2, __fnext3) Profiler::Stop(); \
|
sl@0
|
79 |
Profiler::Close(); \
|
sl@0
|
80 |
Profiler::Unload(); \
|
sl@0
|
81 |
User::After(500*1000); \
|
sl@0
|
82 |
iProfLog.Zero(); iProfLog.Copy(_L("c:\\Profiles\\P_")); iProfLog.Append(__destfilename); iProfLog.AppendNum(__fnext1); iProfLog.Append(_L("_")); iProfLog.AppendNum(__fnext2); iProfLog.Append(_L("_")); iProfLog.AppendNum(__fnext3); iProfLog.Append(_L(".dat")); iProfLog.ZeroTerminate(); \
|
sl@0
|
83 |
iProfLoE.Zero(); iProfLoE.Copy(_L("e:\\Profiles\\P_")); iProfLoE.Append(__destfilename); iProfLoE.AppendNum(__fnext1); iProfLoE.Append(_L("_")); iProfLoE.AppendNum(__fnext2); iProfLoE.Append(_L("_")); iProfLoE.AppendNum(__fnext3); iProfLoE.Append(_L(".dat")); iProfLoE.ZeroTerminate(); \
|
sl@0
|
84 |
iFSession.Delete(iProfLog); \
|
sl@0
|
85 |
iFSession.Delete(iProfLoE); \
|
sl@0
|
86 |
iFileMan->Copy(KProfilerLogFile,iProfLoE); \
|
sl@0
|
87 |
iPErr = iFSession.Rename(KProfilerLogFile,iProfLog); \
|
sl@0
|
88 |
if (iPErr==KErrNone) \
|
sl@0
|
89 |
INFO_PRINTF2(_L("renamed profiler logfile to %s"), iProfLog.Ptr()); \
|
sl@0
|
90 |
else INFO_PRINTF3(_L("ERROR %i renaming profiler logfile to %s "), iPErr, iProfLog.Ptr());
|
sl@0
|
91 |
|
sl@0
|
92 |
#define __INITPROFILER User::LeaveIfError(iFSession.Connect()); iFileMan = CFileMan::NewL(iFSession);
|
sl@0
|
93 |
#define __CLEANUPPROFILER delete iFileMan; iFSession.Close();
|
sl@0
|
94 |
|
sl@0
|
95 |
#else // we dont use profiler, blank dummy defines
|
sl@0
|
96 |
#define __PROFILERMEMBERS
|
sl@0
|
97 |
#define __STARTPROFILER
|
sl@0
|
98 |
#define __STOPPROFILER(__destfilename, __fnext1, __fnext2, __fnext3);
|
sl@0
|
99 |
#define __INITPROFILER
|
sl@0
|
100 |
#define __CLEANUPPROFILER
|
sl@0
|
101 |
#endif
|
sl@0
|
102 |
|
sl@0
|
103 |
#endif //__TE_GRAPHICSPERFORMANCE_SUITEDEFS_H__
|