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