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