|
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 //The two ways to get thru |
|
41 #define API_RetValue_ServerPanic 0 |
|
42 #define API_RetValue_NoCapError 0 |
|
43 |
|
44 //The only way to get rejected |
|
45 #define API_RetValue_PermissionDenied 1 |
|
46 #define DEBUG_ONLY 1 |
|
47 #define DYNAMIC_IPC 2 |
|
48 |
|
49 |
|
50 // |
|
51 // Bunch up IPCs that need similar action |
|
52 // |
|
53 template <TInt S> |
|
54 struct dispatch_num |
|
55 { |
|
56 enum { result = S }; |
|
57 /*enum { result = |
|
58 S >= ESSProtocolStart && S <= ESSProtocolStop ? ESSProtocolStart : |
|
59 S >= ESoCreate && S <= ESoCreateNull ? ESoCreate : |
|
60 S >= ESoSend && S <= ESoWrite ? ESoSend : |
|
61 S >= ESoSendTo && S <= ESoRecvFromNoLength ? ESoSendTo : |
|
62 S >= ESoSetOpt && S <= ESoGetOpt ? ESoSetOpt : |
|
63 S >= ESoGetDiscData && S <= ESoGetRemoteName ? ESoGetDiscData : |
|
64 S >= EHRGetHostName && S <= EHRSetHostName ? EHRGetHostName : |
|
65 S >= ESRRegisterService && S <= ESRRemoveService ? ESRRegisterService: |
|
66 S >= ENDAdd && S <= ENDRemove ? ENDAdd : |
|
67 S >= ECNCreate && S<= ECNCreateWithName ? ECNCreate : |
|
68 S == ECNProgress || S == ECNLastProgressError ? ECNProgress : |
|
69 #if defined(_DEBUG) |
|
70 S >= ESSDbgCheckHeap && S <= ESSDbgCheckMbuf ? ESSDbgCheckHeap : |
|
71 S >= ESSDbgMbufFreeSpace && S <= ESSDbgMbufTotalSpace ? ESSDbgMbufFreeSpace : |
|
72 #else |
|
73 S >= ESSDbgMarkHeap && S <= ESSDbgMbufTotalSpace ? ESSDbgMbufFreeSpace: |
|
74 #endif |
|
75 S };*/ |
|
76 }; |
|
77 |
|
78 template <TInt v> |
|
79 struct Int2Type |
|
80 { |
|
81 enum { value = v}; |
|
82 }; |
|
83 |
|
84 |
|
85 // TS_PARAM_SVR_SUITENAMEServer.h |
|
86 // |
|
87 // This contains CTestPARAM_SVR_SUITENAMESuite |
|
88 |
|
89 const TUint KTestSecureServerMajorVersionNumber = 0; |
|
90 const TUint KTestSecureServerMinorVersionNumber = 1; |
|
91 const TUint KTestSecureServerBuildVersionNumber = 1; |
|
92 |
|
93 |
|
94 class CTestPARAM_SVR_SUITENAMEServer : public CTestServer |
|
95 { |
|
96 public: |
|
97 static CTestPARAM_SVR_SUITENAMEServer* NewL(); |
|
98 // Base class pure virtual override |
|
99 virtual CTestStep* CreateTestStep(const TDesC& aStepName); |
|
100 |
|
101 private: |
|
102 void CTestPARAM_SVR_SUITENAMEServer::RetrieveUpsAuthorisationGrantedL(); |
|
103 |
|
104 private: |
|
105 // Flag indicating whether UPS authorisation will always be granted and thus override |
|
106 // the standard Platform Security check. |
|
107 TBool iUpsAuthorisationGranted; |
|
108 }; |
|
109 |
|
110 |
|
111 |
|
112 class CCapabilityTestStep : public CTestStep, public RSessionBase |
|
113 { |
|
114 public: |
|
115 virtual TVerdict doTestStepPreambleL( void ); |
|
116 virtual TVerdict doTestStepPostambleL( void ); |
|
117 // void ServerClose(RTelServer& aServer); |
|
118 CActiveScheduler* testScheduler; |
|
119 |
|
120 TInt StartServer() ; |
|
121 // from CStep.h |
|
122 #define SR_MESSAGE_TYPE_CHNGED 2 |
|
123 #define SR_MESSAGE_ID_CHNGED 10 |
|
124 #define SR_ServerName_CHNGED _L("FLogger server") |
|
125 |
|
126 #define SR_CAPTEST_INVERSE 0 |
|
127 |
|
128 //The Server Name (eg: CommServer, EtelServer,FLogger server, etc) |
|
129 TBuf<100> SR_ServerName; |
|
130 TBuf<100> iServer_Panic; |
|
131 |
|
132 //Following flags influence inverse tests |
|
133 TBool iExpect_Rejection; |
|
134 |
|
135 TUint32 iStepCap; |
|
136 |
|
137 |
|
138 //Is it Async or sync? |
|
139 TInt SR_MESSAGE_TYPE; |
|
140 |
|
141 //It holds the IPC number |
|
142 TInt SR_MESSAGE_ID; |
|
143 |
|
144 // ECNControl parameters |
|
145 TInt iControlLevel; |
|
146 TInt iControlOption; |
|
147 |
|
148 //Holds the cap mask for the message |
|
149 TInt SR_MESSAGE_MASK; |
|
150 |
|
151 //We name the child thread appended by the IPC_Number it tests |
|
152 TBuf<100> ChildThread_SR; |
|
153 |
|
154 //The flag informs the main thread whether the connection to the server was established |
|
155 volatile TBool iSessionCreated; |
|
156 |
|
157 //To find out if an Async message was completed and if then with what result? |
|
158 TRequestStatus RequestStatus_SR; |
|
159 |
|
160 //For an Sync message, nResult_SR get you the return value |
|
161 TInt iResult_SR; |
|
162 |
|
163 //Hold the retusn value from "CreateSession" API |
|
164 TInt iResult_Server; |
|
165 |
|
166 TInt iResult_C32; |
|
167 |
|
168 enum TDbgFns {MarkHeapStart, MarkHeapEnd, CheckHeap, FailNext, ResetFailNext}; |
|
169 |
|
170 TInt iOptions; |
|
171 |
|
172 |
|
173 //The Child thread object |
|
174 RThread tChildThread; |
|
175 |
|
176 //This is the Function called from "doTestStepL" by the test Suite,and it creates an |
|
177 //child thread which internally calls the corresponding Exec_SendReceive_SERVERNAME fn. |
|
178 TVerdict MainThread(); |
|
179 TVerdict GetVerdict(TInt aAPIretValue); |
|
180 TVerdict GetVerdict(TExitType aExit,TInt aInitRetValue, TInt aApiRetValue); |
|
181 TInt TestDebugHeap(TInt *iDbgIPCNo); |
|
182 |
|
183 |
|
184 //This is for the scheduler test framework |
|
185 virtual enum TVerdict doTestStepL(); |
|
186 |
|
187 // Stuff that derived classes need to implement |
|
188 virtual TVersion Version()=0; |
|
189 virtual TInt Exec_SendReceive()=0; |
|
190 |
|
191 |
|
192 }; |
|
193 |
|
194 |
|
195 #endif /* TS_PARAM_SVR_SUITENAME_SERVER_H_ */ |
|
196 |