24
|
1 |
// Copyright (c) 1997-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 |
// WAP prot test suite server
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@test
|
|
21 |
*/
|
|
22 |
|
|
23 |
// Include your own server header file and step header file(s) here
|
|
24 |
#include "WapProtSuiteServer.h"
|
|
25 |
|
|
26 |
#include "WapIoctlSteps.h"
|
|
27 |
#include "WapStatusReports.h"
|
|
28 |
|
|
29 |
CWapProtSuite* CWapProtSuite::NewL()
|
|
30 |
/**
|
|
31 |
* @return - Instance of the test server
|
|
32 |
* Same code for Secure and non-secure variants
|
|
33 |
* Called inside the MainL() function to create and start the
|
|
34 |
* CTestServer derived server.
|
|
35 |
*/
|
|
36 |
{
|
|
37 |
CWapProtSuite* server = new (ELeave) CWapProtSuite();
|
|
38 |
CleanupStack::PushL(server);
|
|
39 |
|
|
40 |
// CSmsStackTestServer intermediate base class call
|
|
41 |
server->InitializeTsyAndPhonesL();
|
|
42 |
|
|
43 |
// CServer base class call
|
|
44 |
RProcess handle = RProcess();
|
|
45 |
TParsePtrC serverName(handle.FileName());
|
|
46 |
server->ConstructL(serverName.Name());
|
|
47 |
|
|
48 |
CleanupStack::Pop(server);
|
|
49 |
return server;
|
|
50 |
}
|
|
51 |
|
|
52 |
LOCAL_C void MainL()
|
|
53 |
{
|
|
54 |
CActiveScheduler* sched=NULL;
|
|
55 |
sched=new(ELeave) CActiveScheduler;
|
|
56 |
CActiveScheduler::Install(sched);
|
|
57 |
CWapProtSuite* server = NULL;
|
|
58 |
// Create the CTestServer derived server
|
|
59 |
TRAPD(err,server = CWapProtSuite::NewL());
|
|
60 |
if(!err)
|
|
61 |
{
|
|
62 |
// sync with the client and enter the active scheduler
|
|
63 |
RProcess::Rendezvous(KErrNone);
|
|
64 |
sched->Start();
|
|
65 |
}
|
|
66 |
delete server;
|
|
67 |
delete sched;
|
|
68 |
}
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
GLDEF_C TInt E32Main()
|
|
73 |
/**
|
|
74 |
* @return - Standard Epoc error code on process exit
|
|
75 |
* Secure variant only
|
|
76 |
* Process entry point. Called by client using RProcess API
|
|
77 |
*/
|
|
78 |
{
|
|
79 |
__UHEAP_MARK;
|
|
80 |
CTrapCleanup* cleanup = CTrapCleanup::New();
|
|
81 |
if(cleanup == NULL)
|
|
82 |
{
|
|
83 |
return KErrNoMemory;
|
|
84 |
}
|
|
85 |
TRAPD(err,MainL());
|
|
86 |
delete cleanup;
|
|
87 |
__UHEAP_MARKEND;
|
|
88 |
|
|
89 |
return err;
|
|
90 |
}
|
|
91 |
|
|
92 |
CTestStep* CWapProtSuite::CreateTestStep(const TDesC& aStepName)
|
|
93 |
/**
|
|
94 |
* @return - A CTestStep derived instance
|
|
95 |
* Secure and non-secure variants
|
|
96 |
* Implementation of CTestServer pure virtual
|
|
97 |
*/
|
|
98 |
{
|
|
99 |
CTestStep* testStep = NULL;
|
|
100 |
|
|
101 |
//
|
|
102 |
// Here the test step is created when it is needed. Note that this
|
|
103 |
// function is non-leaving so we cannot use new(ELeave). Therefore
|
|
104 |
// the new could return NULL, but that is not a problem as it implies
|
|
105 |
// the test step is missing and this will be marked in the log file.
|
|
106 |
//
|
|
107 |
|
|
108 |
//*************************************
|
|
109 |
// IOCTL tests
|
|
110 |
//*************************************
|
|
111 |
|
|
112 |
// IOCTL steps [1 - XYZ]
|
|
113 |
if (aStepName == _L("IoctlStep_1"))
|
|
114 |
{
|
|
115 |
testStep = new CIoctlStep_1();
|
|
116 |
}
|
|
117 |
else if (aStepName == _L("IoctlStep_2"))
|
|
118 |
{
|
|
119 |
testStep = new CIoctlStep_2();
|
|
120 |
}
|
|
121 |
else if (aStepName == _L("IoctlStep_3"))
|
|
122 |
{
|
|
123 |
testStep = new CIoctlStep_3();
|
|
124 |
}
|
|
125 |
else if (aStepName == _L("IoctlStep_4"))
|
|
126 |
{
|
|
127 |
testStep = new CIoctlStep_4();
|
|
128 |
}
|
|
129 |
else if (aStepName == _L("IoctlStep_5"))
|
|
130 |
{
|
|
131 |
testStep = new CIoctlStep_5();
|
|
132 |
}
|
|
133 |
else if (aStepName == _L("IoctlStep_6"))
|
|
134 |
{
|
|
135 |
testStep = new CIoctlStep_6();
|
|
136 |
}
|
|
137 |
else if (aStepName == _L("IoctlStep_7"))
|
|
138 |
{
|
|
139 |
testStep = new CIoctlStep_7();
|
|
140 |
}
|
|
141 |
else if (aStepName == _L("IoctlStep_8"))
|
|
142 |
{
|
|
143 |
testStep = new CIoctlStep_8();
|
|
144 |
}
|
|
145 |
else if (aStepName == _L("IoctlStep_9"))
|
|
146 |
{
|
|
147 |
testStep = new CIoctlStep_9();
|
|
148 |
}
|
|
149 |
else if (aStepName == _L("IoctlStep_10"))
|
|
150 |
{
|
|
151 |
testStep = new CIoctlStep_10();
|
|
152 |
}
|
|
153 |
else if (aStepName == _L("IoctlStep_11"))
|
|
154 |
{
|
|
155 |
testStep = new CIoctlStep_11();
|
|
156 |
}
|
|
157 |
else if (aStepName == _L("IoctlStep_12"))
|
|
158 |
{
|
|
159 |
testStep = new CIoctlStep_12();
|
|
160 |
}
|
|
161 |
else if (aStepName == _L("IoctlStep_13"))
|
|
162 |
{
|
|
163 |
testStep = new CIoctlStep_13();
|
|
164 |
}
|
|
165 |
else if (aStepName == _L("IoctlStep_14"))
|
|
166 |
{
|
|
167 |
testStep = new CIoctlStep_14();
|
|
168 |
}
|
|
169 |
else if (aStepName == _L("IoctlStep_15"))
|
|
170 |
{
|
|
171 |
testStep = new CIoctlStep_15();
|
|
172 |
}
|
|
173 |
else if (aStepName == _L("BackupRestoreStep"))
|
|
174 |
{
|
|
175 |
testStep = new CBackupRestoreStep();
|
|
176 |
}
|
|
177 |
else if (aStepName == _L("IoctlStep_17"))
|
|
178 |
{
|
|
179 |
testStep = new CIoctlStep_17();
|
|
180 |
}
|
|
181 |
else if (aStepName == _L("IoctlStep_18"))
|
|
182 |
{
|
|
183 |
testStep = new CIoctlStep_18();
|
|
184 |
}
|
|
185 |
else if (aStepName == _L("IoctlStep_19"))
|
|
186 |
{
|
|
187 |
testStep = new CIoctlStep_19();
|
|
188 |
}
|
|
189 |
else if (aStepName == _L("IoctlStep_20"))
|
|
190 |
{
|
|
191 |
testStep = new CIoctlStep_20();
|
|
192 |
}
|
|
193 |
else if (aStepName == _L("IoctlStep_21"))
|
|
194 |
{
|
|
195 |
testStep = new CIoctlStep_21();
|
|
196 |
}
|
|
197 |
else if (aStepName == _L("IoctlStep_22"))
|
|
198 |
{
|
|
199 |
testStep = new CIoctlStep_22();
|
|
200 |
}
|
|
201 |
else if (aStepName == _L("IoctlStep_23"))
|
|
202 |
{
|
|
203 |
testStep = new CIoctlStep_23();
|
|
204 |
}
|
|
205 |
else if (aStepName == _L("IoctlStep_24"))
|
|
206 |
{
|
|
207 |
testStep = new CIoctlStep_24();
|
|
208 |
}
|
|
209 |
else if (aStepName == _L("IoctlStep_25"))
|
|
210 |
{
|
|
211 |
testStep = new CIoctlStep_25();
|
|
212 |
}
|
|
213 |
else if (aStepName == _L("IoctlStep_26"))
|
|
214 |
{
|
|
215 |
testStep = new CIoctlStep_26();
|
|
216 |
}
|
|
217 |
else if (aStepName == _L("IoctlStep_27"))
|
|
218 |
{
|
|
219 |
testStep = new CIoctlStep_27();
|
|
220 |
}
|
|
221 |
else if (aStepName == _L("IoctlStep_28"))
|
|
222 |
{
|
|
223 |
testStep = new CIoctlStep_28();
|
|
224 |
}
|
|
225 |
//Status report tests
|
|
226 |
else if (aStepName == _L("TestRequestingStatusReports"))
|
|
227 |
{
|
|
228 |
testStep = new CTestRequestingStatusReports();
|
|
229 |
}
|
|
230 |
else if(aStepName == _L("TestRequestingStatusReportsWithOption"))
|
|
231 |
{
|
|
232 |
testStep = new CTestRequestingStatusReportsWithOption();
|
|
233 |
}
|
|
234 |
else if (aStepName == _L("TestReceivingStatusReports"))
|
|
235 |
{
|
|
236 |
testStep = new CTestReceivingStatusReports();
|
|
237 |
}
|
|
238 |
else if (aStepName == _L("TestReceivingStatusReportsSevenBitMultiplePDUs"))
|
|
239 |
{
|
|
240 |
testStep = new CTestReceivingStatusReportsSevenBitMultiplePDUs();
|
|
241 |
}
|
|
242 |
else if (aStepName == _L("TestReceivingStatusReportsWithOption"))
|
|
243 |
{
|
|
244 |
testStep = new CTestReceivingStatusReportsWithOption();
|
|
245 |
}
|
|
246 |
else if (aStepName == _L("SetDiskMonitorLimits"))
|
|
247 |
{
|
|
248 |
testStep = new CSetDiskMonitorLimits();
|
|
249 |
}
|
|
250 |
else if (aStepName == _L("SetDiskSpace"))
|
|
251 |
{
|
|
252 |
testStep = new CSetDiskSpace();
|
|
253 |
}
|
|
254 |
else if (aStepName == _L("FreeDiskSpace"))
|
|
255 |
{
|
|
256 |
testStep = new CFreeDiskSpace();
|
|
257 |
}
|
|
258 |
else if (aStepName == _L("ReceiveWapMessage"))
|
|
259 |
{
|
|
260 |
testStep = new CReceiveWapMessage();
|
|
261 |
}
|
|
262 |
else if (aStepName == _L("TestEnumeratingVCard"))
|
|
263 |
{
|
|
264 |
testStep = new CTestEnumeratingVCard();
|
|
265 |
}
|
|
266 |
else if (aStepName == _L("Test7BitBusinessCardWithEmail"))
|
|
267 |
{
|
|
268 |
testStep = new CTest7BitBusinessCardWithEmail();
|
|
269 |
}
|
|
270 |
else if (aStepName == _L("TestOversizedDatagram"))
|
|
271 |
{
|
|
272 |
testStep = new CTestOversizedDatagram();
|
|
273 |
}
|
|
274 |
else if (aStepName == _L("TestWapDatagramSegmentContainingNoData"))
|
|
275 |
{
|
|
276 |
testStep = new CTestWapDatagramSegmentContainingNoData();
|
|
277 |
}
|
|
278 |
|
|
279 |
//
|
|
280 |
// Set the test step name here to save code!!!
|
|
281 |
//
|
|
282 |
if (testStep != NULL)
|
|
283 |
{
|
|
284 |
testStep->SetTestStepName(aStepName);
|
|
285 |
}
|
|
286 |
|
|
287 |
return testStep;
|
|
288 |
}
|