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