|
1 // Copyright (c) 2002-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 #include "QueueTests.h" |
|
17 #include "NetConLog.h" |
|
18 #include "CStubbedAgent.h" |
|
19 |
|
20 // |
|
21 // Test Case NC-1-1 |
|
22 // |
|
23 |
|
24 CNetConTest0101* CNetConTest0101::NewLC() |
|
25 { |
|
26 CNetConTest0101* self = new(ELeave) CNetConTest0101(); |
|
27 CleanupStack::PushL(self); |
|
28 self->ConstructL(); |
|
29 return self; |
|
30 } |
|
31 |
|
32 const TDesC& CNetConTest0101::Name() const |
|
33 { |
|
34 |
|
35 _LIT(KTestName, "Test Case NC-1-1"); |
|
36 return KTestName(); |
|
37 } |
|
38 |
|
39 void CNetConTest0101::StartTestL() |
|
40 { |
|
41 |
|
42 iNetCon->SelectAgent(this, NULL, EConnStartExplicit, 100, KErrNone); |
|
43 } |
|
44 |
|
45 void CNetConTest0101::SelectComplete(const TDesC& aName) |
|
46 { |
|
47 |
|
48 _LIT(KAgentName, "An Agent Name"); |
|
49 |
|
50 if(aName == KAgentName()) |
|
51 CompleteTest(MNetConTest::EPassed); |
|
52 else |
|
53 CompleteTest(MNetConTest::EFailed); |
|
54 } |
|
55 |
|
56 void CNetConTest0101::SelectComplete(TInt) |
|
57 { |
|
58 |
|
59 CompleteTest(MNetConTest::EFailed); |
|
60 } |
|
61 |
|
62 |
|
63 // |
|
64 // Test Case NC-1-2 |
|
65 // |
|
66 |
|
67 CNetConTest0102* CNetConTest0102::NewLC() |
|
68 { |
|
69 CNetConTest0102* self = new(ELeave) CNetConTest0102(); |
|
70 CleanupStack::PushL(self); |
|
71 self->ConstructL(); |
|
72 return self; |
|
73 } |
|
74 |
|
75 const TDesC& CNetConTest0102::Name() const |
|
76 { |
|
77 |
|
78 _LIT(KTestName, "Test Case NC-1-2"); |
|
79 return KTestName(); |
|
80 } |
|
81 |
|
82 void CNetConTest0102::StartTestL() |
|
83 { |
|
84 |
|
85 iNetCon->SelectAgent(this, NULL, EConnStartExplicit, 200, KErrNone); |
|
86 } |
|
87 |
|
88 void CNetConTest0102::SelectComplete(const TDesC&) |
|
89 { |
|
90 |
|
91 CompleteTest(MNetConTest::EFailed); |
|
92 } |
|
93 |
|
94 void CNetConTest0102::SelectComplete(TInt aError) |
|
95 { |
|
96 |
|
97 if(aError == KErrBadPower) |
|
98 CompleteTest(MNetConTest::EPassed); |
|
99 else |
|
100 CompleteTest(MNetConTest::EFailed); |
|
101 } |
|
102 |
|
103 |
|
104 // |
|
105 // Test Case NC-1-3 |
|
106 // |
|
107 |
|
108 CNetConTest0103* CNetConTest0103::NewLC() |
|
109 { |
|
110 CNetConTest0103* self = new(ELeave) CNetConTest0103(); |
|
111 CleanupStack::PushL(self); |
|
112 self->ConstructL(); |
|
113 return self; |
|
114 } |
|
115 |
|
116 const TDesC& CNetConTest0103::Name() const |
|
117 { |
|
118 |
|
119 _LIT(KTestName, "Test Case NC-1-3"); |
|
120 return KTestName(); |
|
121 } |
|
122 |
|
123 void CNetConTest0103::StartTestL() |
|
124 { |
|
125 |
|
126 iNetCon->Reconnect(this, REINTERPRET_CAST(CNifAgentBase*, 300)); |
|
127 } |
|
128 |
|
129 void CNetConTest0103::ReconnectComplete(TInt aError) |
|
130 { |
|
131 |
|
132 if(aError == KErrNone) |
|
133 CompleteTest(MNetConTest::EPassed); |
|
134 else |
|
135 CompleteTest(MNetConTest::EFailed); |
|
136 } |
|
137 |
|
138 |
|
139 // |
|
140 // Test Case NC-1-4 |
|
141 // |
|
142 |
|
143 CNetConTest0104* CNetConTest0104::NewLC() |
|
144 { |
|
145 CNetConTest0104* self = new(ELeave) CNetConTest0104(); |
|
146 CleanupStack::PushL(self); |
|
147 self->ConstructL(); |
|
148 return self; |
|
149 } |
|
150 |
|
151 const TDesC& CNetConTest0104::Name() const |
|
152 { |
|
153 |
|
154 _LIT(KTestName, "Test Case NC-1-4"); |
|
155 return KTestName(); |
|
156 } |
|
157 |
|
158 void CNetConTest0104::StartTestL() |
|
159 { |
|
160 |
|
161 iNetCon->Reconnect(this, REINTERPRET_CAST(CNifAgentBase*, 400)); |
|
162 } |
|
163 |
|
164 void CNetConTest0104::ReconnectComplete(TInt aError) |
|
165 { |
|
166 |
|
167 if(aError == KErrDiskFull) |
|
168 CompleteTest(MNetConTest::EPassed); |
|
169 else |
|
170 CompleteTest(MNetConTest::EFailed); |
|
171 } |
|
172 |
|
173 |
|
174 // |
|
175 // Test Case NC-1-5 |
|
176 // |
|
177 |
|
178 CNetConTest0105* CNetConTest0105::NewLC() |
|
179 { |
|
180 CNetConTest0105* self = new(ELeave) CNetConTest0105(); |
|
181 CleanupStack::PushL(self); |
|
182 self->ConstructL(); |
|
183 return self; |
|
184 } |
|
185 |
|
186 const TDesC& CNetConTest0105::Name() const |
|
187 { |
|
188 |
|
189 _LIT(KTestName, "Test Case NC-1-5"); |
|
190 return KTestName(); |
|
191 } |
|
192 |
|
193 void CNetConTest0105::StartTestL() |
|
194 { |
|
195 |
|
196 iNetCon->SelectAgent(this, NULL, EConnStartExplicit, 500, KErrNone); |
|
197 TInt err = iNetCon->CancelRequest(this); |
|
198 |
|
199 if(err==KErrNone) |
|
200 CompleteTest(MNetConTest::EPassed); |
|
201 else |
|
202 CompleteTest(MNetConTest::EFailed); |
|
203 } |
|
204 |
|
205 void CNetConTest0105::SelectComplete(const TDesC&) |
|
206 { |
|
207 |
|
208 CompleteTest(MNetConTest::EFailed); |
|
209 } |
|
210 |
|
211 void CNetConTest0105::SelectComplete(TInt) |
|
212 { |
|
213 |
|
214 CompleteTest(MNetConTest::EFailed); |
|
215 } |
|
216 |
|
217 |
|
218 // |
|
219 // Test Case NC-1-6 |
|
220 // |
|
221 |
|
222 CNetConTest0106* CNetConTest0106::NewLC() |
|
223 { |
|
224 CNetConTest0106* self = new(ELeave) CNetConTest0106(); |
|
225 CleanupStack::PushL(self); |
|
226 self->ConstructL(); |
|
227 return self; |
|
228 } |
|
229 |
|
230 CNetConTest0106::CNetConTest0106() |
|
231 { |
|
232 } |
|
233 |
|
234 void CNetConTest0106::ConstructL() |
|
235 { |
|
236 |
|
237 CQueueTestBase::ConstructL(); |
|
238 |
|
239 TCallBack callback(CancelCb, this); |
|
240 iCancelCb = new(ELeave) CAsyncCallBack(callback, CActive::EPriorityStandard); |
|
241 } |
|
242 |
|
243 CNetConTest0106::~CNetConTest0106() |
|
244 { |
|
245 |
|
246 if(iCancelCb) |
|
247 delete iCancelCb; |
|
248 } |
|
249 |
|
250 const TDesC& CNetConTest0106::Name() const |
|
251 { |
|
252 |
|
253 _LIT(KTestName, "Test Case NC-1-6"); |
|
254 return KTestName(); |
|
255 } |
|
256 |
|
257 void CNetConTest0106::StartTestL() |
|
258 { |
|
259 |
|
260 iNetCon->SelectAgent(this, NULL, EConnStartExplicit, 600, KErrNone); |
|
261 iCancelCb->CallBack(); |
|
262 } |
|
263 |
|
264 TInt CNetConTest0106::CancelCb(TAny* aThisPtr) |
|
265 { |
|
266 |
|
267 CNetConTest0106* self = (CNetConTest0106*)aThisPtr; |
|
268 self->CancelCbComplete(); |
|
269 return KErrNone; |
|
270 } |
|
271 |
|
272 void CNetConTest0106::CancelCbComplete() |
|
273 { |
|
274 |
|
275 TInt err = iNetCon->CancelRequest(this); |
|
276 |
|
277 if(err==KErrNone) |
|
278 CompleteTest(MNetConTest::EPassed); |
|
279 else |
|
280 CompleteTest(MNetConTest::EFailed); |
|
281 } |
|
282 |
|
283 void CNetConTest0106::SelectComplete(const TDesC&) |
|
284 { |
|
285 |
|
286 CompleteTest(MNetConTest::EFailed); |
|
287 } |
|
288 |
|
289 void CNetConTest0106::SelectComplete(TInt) |
|
290 { |
|
291 |
|
292 CompleteTest(MNetConTest::EFailed); |
|
293 } |
|
294 |
|
295 |
|
296 // |
|
297 // Test Case NC-1-7 |
|
298 // |
|
299 |
|
300 CNetConTest0107* CNetConTest0107::NewLC() |
|
301 { |
|
302 CNetConTest0107* self = new(ELeave) CNetConTest0107(); |
|
303 CleanupStack::PushL(self); |
|
304 self->ConstructL(); |
|
305 return self; |
|
306 } |
|
307 |
|
308 const TDesC& CNetConTest0107::Name() const |
|
309 { |
|
310 |
|
311 _LIT(KTestName, "Test Case NC-1-7"); |
|
312 return KTestName(); |
|
313 } |
|
314 |
|
315 void CNetConTest0107::StartTestL() |
|
316 { |
|
317 |
|
318 iNetCon->Reconnect(this, REINTERPRET_CAST(CNifAgentBase*, 700)); |
|
319 TInt err = iNetCon->CancelRequest(this); |
|
320 |
|
321 if(err==KErrNone) |
|
322 CompleteTest(MNetConTest::EPassed); |
|
323 else |
|
324 CompleteTest(MNetConTest::EFailed); |
|
325 } |
|
326 |
|
327 void CNetConTest0107::ReconnectComplete(TInt) |
|
328 { |
|
329 |
|
330 CompleteTest(MNetConTest::EFailed); |
|
331 } |
|
332 |
|
333 |
|
334 // |
|
335 // Test Case NC-1-8 |
|
336 // |
|
337 |
|
338 CNetConTest0108* CNetConTest0108::NewLC() |
|
339 { |
|
340 CNetConTest0108* self = new(ELeave) CNetConTest0108(); |
|
341 CleanupStack::PushL(self); |
|
342 self->ConstructL(); |
|
343 return self; |
|
344 } |
|
345 |
|
346 CNetConTest0108::CNetConTest0108() |
|
347 { |
|
348 } |
|
349 |
|
350 void CNetConTest0108::ConstructL() |
|
351 { |
|
352 |
|
353 CQueueTestBase::ConstructL(); |
|
354 |
|
355 TCallBack callback(CancelCb, this); |
|
356 iCancelCb = new(ELeave) CAsyncCallBack(callback, CActive::EPriorityStandard); |
|
357 } |
|
358 |
|
359 CNetConTest0108::~CNetConTest0108() |
|
360 { |
|
361 |
|
362 if(iCancelCb) |
|
363 delete iCancelCb; |
|
364 } |
|
365 |
|
366 const TDesC& CNetConTest0108::Name() const |
|
367 { |
|
368 |
|
369 _LIT(KTestName, "Test Case NC-1-8"); |
|
370 return KTestName(); |
|
371 } |
|
372 |
|
373 void CNetConTest0108::StartTestL() |
|
374 { |
|
375 |
|
376 iNetCon->Reconnect(this, REINTERPRET_CAST(CNifAgentBase*, 800)); |
|
377 iCancelCb->CallBack(); |
|
378 } |
|
379 |
|
380 TInt CNetConTest0108::CancelCb(TAny* aThisPtr) |
|
381 { |
|
382 |
|
383 CNetConTest0108* self = (CNetConTest0108*)aThisPtr; |
|
384 self->CancelCbComplete(); |
|
385 return KErrNone; |
|
386 } |
|
387 |
|
388 void CNetConTest0108::CancelCbComplete() |
|
389 { |
|
390 |
|
391 TInt err = iNetCon->CancelRequest(this); |
|
392 |
|
393 if(err==KErrNone) |
|
394 CompleteTest(MNetConTest::EPassed); |
|
395 else |
|
396 CompleteTest(MNetConTest::EFailed); |
|
397 } |
|
398 |
|
399 void CNetConTest0108::ReconnectComplete(TInt) |
|
400 { |
|
401 |
|
402 CompleteTest(MNetConTest::EFailed); |
|
403 } |
|
404 |
|
405 |
|
406 // |
|
407 // Test Case NC-1-9 |
|
408 // |
|
409 |
|
410 CNetConTest0109* CNetConTest0109::NewLC() |
|
411 { |
|
412 CNetConTest0109* self = new(ELeave) CNetConTest0109(); |
|
413 CleanupStack::PushL(self); |
|
414 self->ConstructL(); |
|
415 return self; |
|
416 } |
|
417 |
|
418 CNetConTest0109::CNetConTest0109() |
|
419 { } |
|
420 |
|
421 void CNetConTest0109::ConstructL() |
|
422 { |
|
423 |
|
424 CQueueTestBase::ConstructL(); |
|
425 |
|
426 for(TInt i=0; i< KNumRequests; ++i) |
|
427 { |
|
428 CTestControllerObserver* test = new(ELeave) CTestControllerObserver(this); |
|
429 iObservers.Append(test); |
|
430 } |
|
431 } |
|
432 |
|
433 CNetConTest0109::~CNetConTest0109() |
|
434 { |
|
435 |
|
436 iObservers.ResetAndDestroy(); |
|
437 } |
|
438 |
|
439 const TDesC& CNetConTest0109::Name() const |
|
440 { |
|
441 |
|
442 _LIT(KTestName, "Test Case NC-1-9"); |
|
443 return KTestName(); |
|
444 } |
|
445 |
|
446 void CNetConTest0109::StartTestL() |
|
447 { |
|
448 |
|
449 iNetCon->Reconnect(iObservers[iNumRequestsOutstanding], REINTERPRET_CAST(CNifAgentBase*, 900)); |
|
450 iExpectedRequest[iNumRequestsOutstanding++] = EReconnect; |
|
451 |
|
452 iNetCon->SelectAgent(iObservers[iNumRequestsOutstanding], NULL, EConnStartExplicit, 900, KErrNone); |
|
453 iExpectedRequest[iNumRequestsOutstanding++] = ESelection; |
|
454 |
|
455 iNetCon->Reconnect(iObservers[iNumRequestsOutstanding], REINTERPRET_CAST(CNifAgentBase*, 900)); |
|
456 iExpectedRequest[iNumRequestsOutstanding++] = EReconnect; |
|
457 |
|
458 iNetCon->SelectAgent(iObservers[iNumRequestsOutstanding], NULL, EConnStartExplicit, 900, KErrNone); |
|
459 iExpectedRequest[iNumRequestsOutstanding++] = ESelection; |
|
460 |
|
461 iNetCon->SelectAgent(iObservers[iNumRequestsOutstanding], NULL, EConnStartExplicit, 900, KErrNone); |
|
462 iExpectedRequest[iNumRequestsOutstanding++] = ESelection; |
|
463 |
|
464 ASSERT(iNumRequestsOutstanding == KNumRequests); |
|
465 } |
|
466 |
|
467 |
|
468 void CNetConTest0109::SelectComplete(const TDesC& aName) |
|
469 { |
|
470 |
|
471 _LIT(KAgentName, "An Agent Name"); |
|
472 |
|
473 if(iExpectedRequest[KNumRequests - iNumRequestsOutstanding] != ESelection || aName != KAgentName()) |
|
474 { |
|
475 CompleteTest(MNetConTest::EFailed); |
|
476 } |
|
477 else if (iNumRequestsOutstanding == 1) |
|
478 { |
|
479 CompleteTest(MNetConTest::EPassed); |
|
480 } |
|
481 |
|
482 --iNumRequestsOutstanding; |
|
483 } |
|
484 |
|
485 void CNetConTest0109::SelectComplete(TInt) |
|
486 { |
|
487 |
|
488 CompleteTest(MNetConTest::EFailed); |
|
489 } |
|
490 |
|
491 void CNetConTest0109::ReconnectComplete(TInt aError) |
|
492 { |
|
493 |
|
494 if(iExpectedRequest[KNumRequests - iNumRequestsOutstanding] != EReconnect || aError != KErrNone) |
|
495 { |
|
496 CompleteTest(MNetConTest::EFailed); |
|
497 } |
|
498 else if (iNumRequestsOutstanding == 1) |
|
499 { |
|
500 CompleteTest(MNetConTest::EPassed); |
|
501 } |
|
502 |
|
503 --iNumRequestsOutstanding; |
|
504 } |
|
505 |
|
506 |
|
507 // |
|
508 // Test Case NC-1-10 |
|
509 // |
|
510 |
|
511 CTestControllerObserver::CTestControllerObserver(CQueueTestBase* aTestCase) |
|
512 : iTestCase(aTestCase) |
|
513 {} |
|
514 |
|
515 CTestControllerObserver::~CTestControllerObserver() |
|
516 {} |
|
517 |
|
518 void CTestControllerObserver::SelectComplete(const TDesC& aName) |
|
519 { |
|
520 iTestCase->SelectComplete(aName); |
|
521 } |
|
522 |
|
523 void CTestControllerObserver::SelectComplete(TInt aError) |
|
524 { |
|
525 iTestCase->SelectComplete(aError); |
|
526 } |
|
527 |
|
528 void CTestControllerObserver::ReconnectComplete(TInt aError) |
|
529 { |
|
530 iTestCase->ReconnectComplete(aError); |
|
531 } |
|
532 |
|
533 CNetConTest0110* CNetConTest0110::NewLC() |
|
534 { |
|
535 CNetConTest0110* self = new(ELeave) CNetConTest0110(); |
|
536 CleanupStack::PushL(self); |
|
537 self->ConstructL(); |
|
538 return self; |
|
539 } |
|
540 |
|
541 CNetConTest0110::CNetConTest0110() |
|
542 { } |
|
543 |
|
544 void CNetConTest0110::ConstructL() |
|
545 { |
|
546 |
|
547 CQueueTestBase::ConstructL(); |
|
548 |
|
549 for(TInt i=0; i< KNumRequests+3; ++i) |
|
550 { |
|
551 CTestControllerObserver* test = new(ELeave) CTestControllerObserver(this); |
|
552 iObservers.Append(test); |
|
553 } |
|
554 } |
|
555 |
|
556 CNetConTest0110::~CNetConTest0110() |
|
557 { |
|
558 |
|
559 iObservers.ResetAndDestroy(); |
|
560 } |
|
561 |
|
562 const TDesC& CNetConTest0110::Name() const |
|
563 { |
|
564 |
|
565 _LIT(KTestName, "Test Case NC-1-10"); |
|
566 return KTestName(); |
|
567 } |
|
568 |
|
569 void CNetConTest0110::StartTestL() |
|
570 { |
|
571 |
|
572 TInt observerNum(0); |
|
573 |
|
574 // request 1 |
|
575 iNetCon->Reconnect(iObservers[observerNum++], REINTERPRET_CAST(CNifAgentBase*, 1000)); |
|
576 iExpectedRequest[iNumRequestsOutstanding++] = EReconnect; |
|
577 |
|
578 // request 2 |
|
579 iNetCon->SelectAgent(iObservers[observerNum++], NULL, EConnStartExplicit, 1000, KErrNone); |
|
580 |
|
581 // request 3 |
|
582 iNetCon->Reconnect(iObservers[observerNum++], REINTERPRET_CAST(CNifAgentBase*, 1000)); |
|
583 iExpectedRequest[iNumRequestsOutstanding++] = EReconnect; |
|
584 |
|
585 // request 4 |
|
586 iNetCon->SelectAgent(iObservers[observerNum++], NULL, EConnStartExplicit, 1000, KErrNone); |
|
587 iExpectedRequest[iNumRequestsOutstanding++] = ESelection; |
|
588 |
|
589 // request 5 |
|
590 iNetCon->Reconnect(iObservers[observerNum++], REINTERPRET_CAST(CNifAgentBase*, 1000)); |
|
591 |
|
592 // request 6 |
|
593 iNetCon->SelectAgent(iObservers[observerNum++], NULL, EConnStartExplicit, 1000, KErrNone); |
|
594 |
|
595 // request 7 |
|
596 iNetCon->Reconnect(iObservers[observerNum++], REINTERPRET_CAST(CNifAgentBase*, 1000)); |
|
597 iExpectedRequest[iNumRequestsOutstanding++] = EReconnect; |
|
598 |
|
599 // request 8 |
|
600 iNetCon->SelectAgent(iObservers[observerNum++], NULL, EConnStartExplicit, 1000, KErrNone); |
|
601 iExpectedRequest[iNumRequestsOutstanding++] = ESelection; |
|
602 |
|
603 // Cancel requests 2, 5 and 6 |
|
604 iNetCon->CancelRequest(iObservers[1]); |
|
605 iNetCon->CancelRequest(iObservers[4]); |
|
606 iNetCon->CancelRequest(iObservers[5]); |
|
607 |
|
608 ASSERT(iNumRequestsOutstanding == KNumRequests); |
|
609 ASSERT(observerNum == KNumRequests+3); |
|
610 } |
|
611 |
|
612 void CNetConTest0110::SelectComplete(const TDesC& aName) |
|
613 { |
|
614 |
|
615 _LIT(KAgentName, "An Agent Name"); |
|
616 |
|
617 if(iExpectedRequest[KNumRequests - iNumRequestsOutstanding] != ESelection || aName != KAgentName()) |
|
618 { |
|
619 CompleteTest(MNetConTest::EFailed); |
|
620 } |
|
621 else if (iNumRequestsOutstanding == 1) |
|
622 { |
|
623 CompleteTest(MNetConTest::EPassed); |
|
624 } |
|
625 |
|
626 --iNumRequestsOutstanding; |
|
627 } |
|
628 |
|
629 void CNetConTest0110::SelectComplete(TInt) |
|
630 { |
|
631 |
|
632 CompleteTest(MNetConTest::EFailed); |
|
633 } |
|
634 |
|
635 void CNetConTest0110::ReconnectComplete(TInt aError) |
|
636 { |
|
637 |
|
638 if(iExpectedRequest[KNumRequests - iNumRequestsOutstanding] != EReconnect || aError != KErrNone) |
|
639 { |
|
640 CompleteTest(MNetConTest::EFailed); |
|
641 } |
|
642 else if (iNumRequestsOutstanding == 1) |
|
643 { |
|
644 CompleteTest(MNetConTest::EPassed); |
|
645 } |
|
646 |
|
647 --iNumRequestsOutstanding; |
|
648 } |
|
649 |
|
650 |
|
651 // |
|
652 // Test Case NC-1-11 |
|
653 // |
|
654 |
|
655 CNetConTest0111* CNetConTest0111::NewLC() |
|
656 { |
|
657 CNetConTest0111* self = new(ELeave) CNetConTest0111(); |
|
658 CleanupStack::PushL(self); |
|
659 self->ConstructL(); |
|
660 return self; |
|
661 } |
|
662 |
|
663 CNetConTest0111::CNetConTest0111() |
|
664 { } |
|
665 |
|
666 void CNetConTest0111::ConstructL() |
|
667 { |
|
668 |
|
669 CQueueTestBase::ConstructL(); |
|
670 iAgent = new(ELeave) CStubbedAgent(); |
|
671 } |
|
672 |
|
673 CNetConTest0111::~CNetConTest0111() |
|
674 { |
|
675 |
|
676 if (iAgent) |
|
677 delete iAgent; |
|
678 } |
|
679 |
|
680 const TDesC& CNetConTest0111::Name() const |
|
681 { |
|
682 |
|
683 _LIT(KTestName, "Test Case NC-1-11"); |
|
684 return KTestName(); |
|
685 } |
|
686 |
|
687 void CNetConTest0111::StartTestL() |
|
688 { |
|
689 TBuf8<40> agentName; |
|
690 iNetCon->AddAgentToNetworkL(iAgent, 11); |
|
691 TInt err(KErrNone); |
|
692 err = iAgent->Control(0, 0, agentName); |
|
693 if(err != KErrNotSupported) |
|
694 User::Leave(err); |
|
695 CompleteTest(MNetConTest::EPassed); |
|
696 } |
|
697 |
|
698 |
|
699 // |
|
700 // Test Case NC-1-12 |
|
701 // |
|
702 |
|
703 CNetConTest0112* CNetConTest0112::NewLC() |
|
704 { |
|
705 CNetConTest0112* self = new(ELeave) CNetConTest0112(); |
|
706 CleanupStack::PushL(self); |
|
707 self->ConstructL(); |
|
708 return self; |
|
709 } |
|
710 |
|
711 CNetConTest0112::CNetConTest0112() |
|
712 { } |
|
713 |
|
714 void CNetConTest0112::ConstructL() |
|
715 { |
|
716 |
|
717 CQueueTestBase::ConstructL(); |
|
718 iAgent = new(ELeave) CStubbedAgent(); |
|
719 iAnotherAgent = new(ELeave) CStubbedAgent(); |
|
720 } |
|
721 |
|
722 CNetConTest0112::~CNetConTest0112() |
|
723 { |
|
724 |
|
725 if (iAnotherAgent) |
|
726 delete iAnotherAgent; |
|
727 |
|
728 if (iAgent) |
|
729 delete iAgent; |
|
730 } |
|
731 |
|
732 const TDesC& CNetConTest0112::Name() const |
|
733 { |
|
734 |
|
735 _LIT(KTestName, "Test Case NC-1-12"); |
|
736 return KTestName(); |
|
737 } |
|
738 |
|
739 void CNetConTest0112::StartTestL() |
|
740 { |
|
741 |
|
742 iNetCon->AddAgentToNetworkL(iAgent, 12); |
|
743 iNetCon->AddAgentToNetworkL(iAnotherAgent, 12); |
|
744 CompleteTest(MNetConTest::EPassed); |
|
745 } |
|
746 |
|
747 |
|
748 // |
|
749 // Test Case NC-1-13 |
|
750 // |
|
751 |
|
752 CNetConTest0113* CNetConTest0113::NewLC() |
|
753 { |
|
754 CNetConTest0113* self = new(ELeave) CNetConTest0113(); |
|
755 CleanupStack::PushL(self); |
|
756 self->ConstructL(); |
|
757 return self; |
|
758 } |
|
759 |
|
760 CNetConTest0113::CNetConTest0113() |
|
761 { } |
|
762 |
|
763 void CNetConTest0113::ConstructL() |
|
764 { |
|
765 |
|
766 CQueueTestBase::ConstructL(); |
|
767 iAgent = new(ELeave) CStubbedAgent(); |
|
768 } |
|
769 |
|
770 CNetConTest0113::~CNetConTest0113() |
|
771 { |
|
772 |
|
773 if (iAgent) |
|
774 delete iAgent; |
|
775 } |
|
776 |
|
777 const TDesC& CNetConTest0113::Name() const |
|
778 { |
|
779 |
|
780 _LIT(KTestName, "Test Case NC-1-13"); |
|
781 return KTestName(); |
|
782 } |
|
783 |
|
784 void CNetConTest0113::StartTestL() |
|
785 { |
|
786 |
|
787 iNetCon->AddAgentToNetworkL(iAgent, 13); |
|
788 iNetCon->AddAgentToNetworkL(iAgent, 13); |
|
789 CompleteTest(MNetConTest::EPassed); |
|
790 } |
|
791 |