|
1 // Copyright (c) 2001-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 "TestStepNetCon.h" |
|
17 #include <networking/log.h> |
|
18 #include "QueueTests.h" |
|
19 |
|
20 CTestStepNetCon::CTestStepNetCon(TInt aTestNumber) |
|
21 // |
|
22 // C'tor |
|
23 // |
|
24 : iTestNumber(aTestNumber) |
|
25 { |
|
26 |
|
27 _LIT(KTestStepNameFormat, "NC-1-%d"); |
|
28 iTestStepName.AppendFormat(KTestStepNameFormat(), iTestNumber); |
|
29 } |
|
30 |
|
31 CTestStepNetCon::~CTestStepNetCon() |
|
32 // |
|
33 // D'tor |
|
34 // |
|
35 { |
|
36 } |
|
37 |
|
38 enum TVerdict CTestStepNetCon::doTestStepL() |
|
39 // |
|
40 // Run a netcon test step |
|
41 // |
|
42 { |
|
43 |
|
44 CActiveScheduler* scheduler = new(ELeave) CActiveScheduler; |
|
45 CActiveScheduler::Install(scheduler); |
|
46 |
|
47 CNetConTestBase* test = NULL; |
|
48 |
|
49 switch(iTestNumber) |
|
50 { |
|
51 case 1: |
|
52 test = CNetConTest0101::NewLC(); |
|
53 break; |
|
54 case 2: |
|
55 test = CNetConTest0102::NewLC(); |
|
56 break; |
|
57 case 3: |
|
58 test = CNetConTest0103::NewLC(); |
|
59 break; |
|
60 case 4: |
|
61 test = CNetConTest0104::NewLC(); |
|
62 break; |
|
63 case 5: |
|
64 test = CNetConTest0105::NewLC(); |
|
65 break; |
|
66 case 6: |
|
67 test = CNetConTest0106::NewLC(); |
|
68 break; |
|
69 case 7: |
|
70 test = CNetConTest0107::NewLC(); |
|
71 break; |
|
72 case 8: |
|
73 test = CNetConTest0108::NewLC(); |
|
74 break; |
|
75 case 9: |
|
76 test = CNetConTest0109::NewLC(); |
|
77 break; |
|
78 case 10: |
|
79 test = CNetConTest0110::NewLC(); |
|
80 break; |
|
81 case 11: |
|
82 test = CNetConTest0111::NewLC(); |
|
83 break; |
|
84 case 12: |
|
85 test = CNetConTest0112::NewLC(); |
|
86 break; |
|
87 case 13: |
|
88 test = CNetConTest0113::NewLC(); |
|
89 break; |
|
90 default: |
|
91 User::Leave(KErrArgument); |
|
92 } |
|
93 |
|
94 test->Start(); |
|
95 |
|
96 if(test->Result() == MNetConTest::EPassed) |
|
97 { |
|
98 iTestStepResult = EPass; |
|
99 } |
|
100 else |
|
101 { |
|
102 iTestStepResult = EFail; |
|
103 } |
|
104 |
|
105 CleanupStack::PopAndDestroy(test); |
|
106 |
|
107 delete scheduler; |
|
108 scheduler = NULL; |
|
109 |
|
110 // test steps return a result |
|
111 return iTestStepResult; |
|
112 } |
|
113 |