graphicstest/uibench/src/te_graphicsperformanceSuiteDefs.h
changeset 0 5d03bc08d59c
child 19 bbf46f59e123
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file define all the common values thoughout your test project
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @test
       
    21  @internalComponent - Internal Symbian test code 
       
    22 */
       
    23  
       
    24 #ifndef __TE_GRAPHICSPERFORMANCE_SUITEDEFS_H__
       
    25 #define __TE_GRAPHICSPERFORMANCE_SUITEDEFS_H__
       
    26 
       
    27 #include <gdi.h>
       
    28 
       
    29 _LIT(KProfilerLogFile,"c:\\PROFILER.DAT");
       
    30 #define __MOVEFILETODRIVE (__SrcFile, __DestFile) 
       
    31 
       
    32 // use this to start and stop sampling profiler within this teststep
       
    33 //#define _USE_PROFILER 
       
    34 
       
    35 // Please modify below value with your project and must match with your configuration ini file which is required to be modified as well
       
    36 _LIT(KTe_graphicsperformanceSuiteString,"TheString");
       
    37 _LIT(KTe_graphicsperformanceSuiteInt,"TheInt");
       
    38 _LIT(KTe_graphicsperformanceSuiteBool,"TheBool");
       
    39 
       
    40 // For test step panics
       
    41 _LIT(KTe_graphicsperformanceSuitePanic,"Te_graphicsperformanceSuite");
       
    42 
       
    43 const TDisplayMode KValidBitmapModes[] = {EColor16MAP, EColor16MA, EColor16MU, EColor16M, EColor256, EGray256, EColor64K};
       
    44 const TInt KNumValidBitmapModes = TInt(sizeof(KValidBitmapModes)/sizeof(KValidBitmapModes[0]));
       
    45 
       
    46 const TDisplayMode KValidDisplayModes[] = {EColor16MAP, EColor16MA, EColor16MU, EColor64K};
       
    47 const TInt KNumValidDisplayModes = TInt(sizeof(KValidDisplayModes)/sizeof(KValidDisplayModes[0]));
       
    48 
       
    49 // Test macro to log Leaves.
       
    50 #define TESTNOERRORL(a) \
       
    51 	{\
       
    52 	TInt b = a;\
       
    53 	TBool c = (b == KErrNone);\
       
    54 	testBooleanTrueWithErrorCodeL((c), (b), (TText8*)__FILE__, __LINE__);\
       
    55 	}
       
    56 
       
    57 
       
    58 #ifdef _USE_PROFILER
       
    59 	#define __PROFILERMEMBERS RProcess iProcess; TInt iPErr; RFs iFSession; TBuf<256> iProfLog; TBuf<256> iProfLoE; CFileMan* iFileMan; 
       
    60 	#define __STARTPROFILER iPErr=iProcess.Create(_L("profiler"),_L("start")); \
       
    61 		if (iPErr==KErrNone) { \
       
    62 			iProcess.Resume(); \
       
    63 			iProcess.Close(); \
       
    64 		} else { \
       
    65 			INFO_PRINTF2(_L("Profiler process created return value:"),iPErr); \
       
    66 		}
       
    67 	#define __STOPPROFILER(__destfilename, __fnext1, __fnext2, __fnext3) 	Profiler::Stop(); \
       
    68 		Profiler::Close(); \
       
    69 		Profiler::Unload(); \
       
    70 		User::After(500*1000); \
       
    71 		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(); \
       
    72 		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(); \
       
    73 		iFSession.Delete(iProfLog); \
       
    74 		iFSession.Delete(iProfLoE); \
       
    75 		iFileMan->Copy(KProfilerLogFile,iProfLoE); \
       
    76 		iPErr = iFSession.Rename(KProfilerLogFile,iProfLog);	\
       
    77 		if (iPErr==KErrNone) \
       
    78 			INFO_PRINTF2(_L("renamed profiler logfile to %s"), iProfLog.Ptr()); \
       
    79 			else  INFO_PRINTF3(_L("ERROR %i renaming profiler logfile to %s "), iPErr, iProfLog.Ptr()); 
       
    80 		
       
    81 		#define __INITPROFILER User::LeaveIfError(iFSession.Connect()); iFileMan = CFileMan::NewL(iFSession);
       
    82 		#define __CLEANUPPROFILER delete iFileMan; iFSession.Close(); 		
       
    83 	
       
    84 #else // we dont use profiler, blank dummy defines
       
    85 	#define __PROFILERMEMBERS
       
    86 	#define __STARTPROFILER
       
    87 	#define __STOPPROFILER(__destfilename, __fnext1, __fnext2, __fnext3); 
       
    88 	#define __INITPROFILER
       
    89 	#define __CLEANUPPROFILER
       
    90 #endif
       
    91 
       
    92 #endif //__TE_GRAPHICSPERFORMANCE_SUITEDEFS_H__