1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
22 #include <e32base.h> |
22 #include <e32base.h> |
23 #include <e32base_private.h> |
23 #include <e32base_private.h> |
24 #include <e32Test.h> // RTest headder |
24 #include <e32Test.h> // RTest headder |
25 #include "testcaseroot.h" |
25 #include "testcaseroot.h" |
26 #include "testcase0458.h" |
26 #include "testcase0458.h" |
|
27 #include "OstTraceDefinitions.h" |
|
28 #ifdef OST_TRACE_COMPILER_IN_USE |
|
29 #include "testcase0458Traces.h" |
|
30 #endif |
27 |
31 |
28 |
32 |
29 |
33 |
30 |
34 |
31 // the name below is used to add a pointer to our construction method to a pointer MAP in |
35 // the name below is used to add a pointer to our construction method to a pointer MAP in |
53 /** |
57 /** |
54 ConstructL |
58 ConstructL |
55 */ |
59 */ |
56 void CTestCase0458::ConstructL() |
60 void CTestCase0458::ConstructL() |
57 { |
61 { |
58 LOG_FUNC |
62 if(gVerboseOutput) |
|
63 { |
|
64 OstTraceFunctionEntry0(CTESTCASE0458_CONSTRUCTL); |
|
65 } |
59 iRepeats = OPEN_REPEATS; |
66 iRepeats = OPEN_REPEATS; |
60 |
67 |
61 BaseConstructL(); |
68 BaseConstructL(); |
62 } |
69 } |
63 |
70 |
64 |
71 |
65 CTestCase0458::~CTestCase0458() |
72 CTestCase0458::~CTestCase0458() |
66 { |
73 { |
67 LOG_FUNC |
74 if(gVerboseOutput) |
|
75 { |
|
76 OstTraceFunctionEntry0(CTESTCASE0458_DCTESTCASE0458); |
|
77 } |
68 |
78 |
69 Cancel(); |
79 Cancel(); |
70 } |
80 } |
71 |
81 |
72 |
82 |
73 void CTestCase0458::ExecuteTestCaseL() |
83 void CTestCase0458::ExecuteTestCaseL() |
74 { |
84 { |
75 LOG_FUNC |
85 if(gVerboseOutput) |
|
86 { |
|
87 OstTraceFunctionEntry0(CTESTCASE0458_EXECUTETESTCASEL); |
|
88 } |
76 iCaseStep = EPreconditions; |
89 iCaseStep = EPreconditions; |
77 |
90 |
78 CActiveScheduler::Add(this); |
91 CActiveScheduler::Add(this); |
79 SelfComplete(); |
92 SelfComplete(); |
80 |
93 |
81 } |
94 } |
82 |
95 |
83 void CTestCase0458::DescribePreconditions() |
96 void CTestCase0458::DescribePreconditions() |
84 { |
97 { |
85 test.Printf(_L("Insert 'B' connector from cable\n")); |
98 test.Printf(_L("Insert 'B' connector from cable\n")); |
|
99 OstTrace0(TRACE_NORMAL, CTESTCASE0458_DESCRIBEPRECONDITIONS, "Insert 'B' connector from cable\n"); |
86 test.Printf(_L("attached to powered host beforehand.\n")); |
100 test.Printf(_L("attached to powered host beforehand.\n")); |
|
101 OstTrace0(TRACE_NORMAL, CTESTCASE0458_DESCRIBEPRECONDITIONS_DUP01, "attached to powered host beforehand.\n"); |
87 } |
102 } |
88 |
103 |
89 |
104 |
90 void CTestCase0458::DoCancel() |
105 void CTestCase0458::DoCancel() |
91 { |
106 { |
92 LOG_FUNC |
107 if(gVerboseOutput) |
|
108 { |
|
109 OstTraceFunctionEntry0(CTESTCASE0458_DOCANCEL); |
|
110 } |
93 |
111 |
94 // cancel our timer |
112 // cancel our timer |
95 iTimer.Cancel(); |
113 iTimer.Cancel(); |
96 } |
114 } |
97 |
115 |
98 |
116 |
99 // handle event completion |
117 // handle event completion |
100 void CTestCase0458::RunStepL() |
118 void CTestCase0458::RunStepL() |
101 { |
119 { |
102 LOG_FUNC |
120 if(gVerboseOutput) |
|
121 { |
|
122 OstTraceFunctionEntry0(CTESTCASE0458_RUNSTEPL); |
|
123 } |
103 |
124 |
104 // Obtain the completion code for this CActive obj. |
125 // Obtain the completion code for this CActive obj. |
105 TInt completionCode(iStatus.Int()); |
126 TInt completionCode(iStatus.Int()); |
106 |
127 |
107 switch(iCaseStep) |
128 switch(iCaseStep) |
108 { |
129 { |
109 case EPreconditions: |
130 case EPreconditions: |
110 { |
131 { |
111 test.Printf(KPressAnyKeyToStart); |
132 test.Printf(KPressAnyKeyToStart); |
|
133 OstTrace0(TRACE_NORMAL, CTESTCASE0458_RUNSTEPL_DUP01, KPressAnyKeyToStart); |
112 iCaseStep = ELoadLdd; |
134 iCaseStep = ELoadLdd; |
113 RequestCharacter(); |
135 RequestCharacter(); |
114 break; |
136 break; |
115 } |
137 } |
116 |
138 |
117 case ELoadLdd: |
139 case ELoadLdd: |
118 test.Printf(_L("Load the LDD iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS); |
140 test.Printf(_L("Load the LDD iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS); |
|
141 OstTraceExt2(TRACE_NORMAL, CTESTCASE0458_RUNSTEPL_DUP02, "Load the LDD iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS); |
119 if (!StepLoadLDD()) |
142 if (!StepLoadLDD()) |
120 { |
143 { |
121 break; |
144 break; |
122 } |
145 } |
123 |
146 |