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