resourcemgmt/hwresourcesmgr/test/TestCapsHWRMPolicing/inc/CSuite.h
changeset 0 4e1aa6a622a0
child 21 ccb4f6b3db21
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2004-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 contains CTestHWRM_API_PolicingSuite 
       
    15 // 
       
    16 //
       
    17 
       
    18 #if (!defined CAP_HWRM_API_POLICING_SERVER_H_)
       
    19 #define CAP_HWRM_API_POLICING_SERVER_H_
       
    20 
       
    21 
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <e32svr.h>
       
    25 #include "f32file.h"
       
    26 #include "e32test.h"
       
    27 #include <testexecutestepbase.h>
       
    28 #include <testexecuteserverbase.h>
       
    29 
       
    30 //The two ways to get thru
       
    31 #define API_RetValue_ServerPanic			0
       
    32 #define API_RetValue_NoCapError				0
       
    33 
       
    34 //The only way to get rejected
       
    35 #define API_RetValue_PermissionDenied		1
       
    36 #define DEBUG_ONLY		1
       
    37 #define DYNAMIC_IPC		2
       
    38 
       
    39 
       
    40 const TUint KTestSecureServerMajorVersionNumber = 0;
       
    41 const TUint KTestSecureServerMinorVersionNumber	= 1; 
       
    42 const TUint KTestSecureServerBuildVersionNumber = 1;
       
    43 
       
    44 const TInt  KAsyncMessage                       = 1;
       
    45 const TInt  KSyncMessage                        = 2;
       
    46 
       
    47 enum TCapTestPanicCodes
       
    48 {
       
    49 ECapTestOutOfSequence	
       
    50 };
       
    51 
       
    52 
       
    53 class  CTestHWRM_API_PolicingServer : public CTestServer
       
    54 {
       
    55 public:
       
    56 	static CTestHWRM_API_PolicingServer	* NewL();
       
    57 	// Base class pure virtual override
       
    58 	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
       
    59 
       
    60 };
       
    61 
       
    62 
       
    63 
       
    64 class CCapabilityTestStep : public CTestStep, public RSessionBase
       
    65 {
       
    66 public:
       
    67  	virtual TVerdict doTestStepPreambleL( void );
       
    68 	virtual TVerdict doTestStepPostambleL( void );
       
    69 //	void ServerClose(RTelServer& aServer);
       
    70 	CActiveScheduler*	testScheduler;
       
    71 
       
    72 	TInt StartServer() ;
       
    73 // from CStep.h
       
    74 	#define SR_MESSAGE_TYPE_CHNGED		2
       
    75 	#define SR_MESSAGE_ID_CHNGED		10
       
    76 	#define SR_ServerName_CHNGED		_L("FLogger server")
       
    77 
       
    78 	#define SR_CAPTEST_INVERSE			0	
       
    79 
       
    80 	//The Server Name (eg: CommServer, EtelServer,FLogger server, etc)
       
    81 	TBuf<100>	SR_ServerName;	
       
    82 	TBuf<100>	iServer_Panic;
       
    83 
       
    84 	//Following flags influence inverse tests
       
    85 	TBool		iExpect_Rejection;
       
    86 	
       
    87 	TUint32  	iStepCap;
       
    88 
       
    89 	
       
    90 	//Is it Async or sync?
       
    91 	TInt		SR_MESSAGE_TYPE;
       
    92 
       
    93 	//It holds the IPC number
       
    94 	TInt		SR_MESSAGE_ID;
       
    95 
       
    96 	//Holds the cap mask for the message
       
    97 	TUint64		SR_MESSAGE_MASK;
       
    98 
       
    99 	//We name the child thread appended by the IPC_Number it tests
       
   100 	TBuf<100>	ChildThread_SR;		
       
   101 
       
   102 	//The flag informs the main thread whether the connection to the server was established
       
   103 	volatile TBool iSessionCreated;
       
   104 
       
   105 	//To find out if an Async message was completed and if then with what result?
       
   106 	TRequestStatus	RequestStatus_SR;
       
   107 
       
   108 	//For an Sync message, nResult_SR get you the return value
       
   109 	TInt	iResult_SR;	
       
   110 
       
   111 	//Hold the retusn value from "CreateSession" API
       
   112 	TInt	iResult_Server;
       
   113 
       
   114 	TInt	iResult_C32;
       
   115 		
       
   116 	enum 	TDbgFns  {MarkHeapStart, MarkHeapEnd, CheckHeap, FailNext, ResetFailNext};
       
   117    	   	   
       
   118  	TInt	iOptions;
       
   119    	
       
   120 
       
   121 	//The Child thread object
       
   122 	RThread tChildThread;	
       
   123 	
       
   124 	//This is the Function called from "doTestStepL" by the test Suite,and it creates an 
       
   125 	//child thread which internally calls the corresponding Exec_SendReceive_SERVERNAME fn.
       
   126 	TVerdict MainThread();
       
   127 	TVerdict GetVerdict(TInt aAPIretValue);
       
   128  	TVerdict GetVerdict(TExitType aExit,TInt aInitRetValue, TInt aApiRetValue);
       
   129  	TInt TestDebugHeap(TInt* aDbgIPCNo);
       
   130 
       
   131 
       
   132 	//This is for the scheduler test framework
       
   133 	virtual enum TVerdict doTestStepL();
       
   134 
       
   135 	// Stuff that derived classes need to implement
       
   136 	virtual TVersion Version()=0;
       
   137 	virtual TInt Exec_SendReceive()=0;
       
   138 	 
       
   139 	
       
   140 };
       
   141 
       
   142 
       
   143 #endif /* TS_PARAM_SVR_SUITENAME_SERVER_H_ */