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