changeset 130 | c30940f6d922 |
parent 90 | 947f0dc9f7a8 |
child 199 | 189ece41fa29 |
child 247 | d8d70de2bd36 |
129:a990138eda40 | 130:c30940f6d922 |
---|---|
22 |
22 |
23 const TCallbackRecord threadCallback(TCallbackRecord::EThread,1); |
23 const TCallbackRecord threadCallback(TCallbackRecord::EThread,1); |
24 const TCallbackRecord isrCallback(TCallbackRecord::EIsr,1); |
24 const TCallbackRecord isrCallback(TCallbackRecord::EIsr,1); |
25 |
25 |
26 const TInt size = 128 * KKilo; |
26 const TInt size = 128 * KKilo; |
27 const TInt trans64K_1 = ((64 * KKilo) -1); // 65535 |
|
28 |
|
29 //---------------------------------------------------------------------------------------------- |
|
30 //! TestCaseID KBASE-DMA-2571 |
|
31 //! TestType CIT |
|
32 //! PREQ REQ |
|
33 //! TestCaseDesc This test verifies the correct behavior of CancelAll API in the new DMA |
|
34 //! framework |
|
35 //! |
|
36 //! TestActions |
|
37 //! 1. Open a DMA channel for a transfer. |
|
38 //! 2. Queue multiple request on the DMA channel. |
|
39 //! 3. Call CancelAll () on the DMA channel. |
|
40 //! 4. Verify that all transfers have been cancelled. |
|
41 //! 5 Open a DMA channel for a transfer. This channel should support pause and resume. |
|
42 //! 6. Call Pause () on the channel. |
|
43 //! 7. Queue multiple request on the DMA channel. |
|
44 //! 8. Call CancelAll () on the channel. |
|
45 //! 9. Verify that all transfers have been cancelled. |
|
46 //! |
|
47 //! |
|
48 //! TestExpectedResults 1. DMA channel opens and KErrNone returned. |
|
49 //! 2. DMA queue request created and KErrNone returned. |
|
50 //! 3. CancelAll () cancels all queued request. |
|
51 //! 4. All queued request are cancelled |
|
52 //! 5. DMA Request completes |
|
53 //! |
|
54 //! |
|
55 //! TestPriority High |
|
56 //! TestStatus Implemented |
|
57 //---------------------------------------------------------------------------------------------- |
|
58 namespace CancelAllTest |
|
59 { |
|
60 const TInt size = 2 * KMega; |
|
61 const TDmaTransferArgs transferArgArray[] = { |
|
62 TDmaTransferArgs(0, size, size, KDmaMemAddr), |
|
63 TDmaTransferArgs(2 * size, 3 * size, size, KDmaMemAddr) |
|
64 }; |
|
65 |
|
66 TResultSet noTransferExpected = TResultSet() |
|
67 .PostTransferResult(KErrNone) |
|
68 .CallbackRecord(TCallbackRecord::Empty()); |
|
69 |
|
70 const TResultSet expected[] = |
|
71 { |
|
72 TResultSet(noTransferExpected), |
|
73 TResultSet(noTransferExpected) |
|
74 }; |
|
75 |
|
76 // Test that 2 requests can be queued on a paused channel |
|
77 // then cleared using CancelAll. |
|
78 // It is expected that no data will have been transferred to the |
|
79 // destination buffer. |
|
80 CCancelAllTest testcancelall = |
|
81 CCancelAllTest(_L("CancelAllTest : Cancel and verify cancellation of requests"), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray)) |
|
82 .SetPreTransferTest(&KPreTransferIncrBytes) |
|
83 .SetPostTransferTest(&KCheckNoTransfer); |
|
84 |
|
85 TTestCase testCase(&testcancelall,EFalse,capAboveV1,pauseRequired_skip); |
|
86 } |
|
87 |
|
27 //-------------------------------------------------------------------------------------------- |
88 //-------------------------------------------------------------------------------------------- |
28 //! @SYMTestCaseID KBASE-DMA-2560 |
89 //! TestCaseID KBASE-DMA-2569 |
29 //! @SYMTestType CIT |
90 //! TestType CIT |
30 //! @SYMPREQ REQ |
91 //! PREQ REQ |
31 //! @SYMTestCaseDesc Simple DMA transfer test using CSingleTransferTest and New DMA APIs |
92 //! TestCaseDesc This test verifies the correct behavior of Pause and Resume API in the new DMA |
32 //! |
93 //! framework |
33 //! @SYMTestActions |
94 //! |
34 //! 1. |
95 //! TestActions |
35 //! 2. |
96 //! 1. Open a DMA channel for a transfer. |
36 //! |
97 //! 2. Setup a DMA request and time how long the transfer takes |
37 //! |
98 //! 3. Pause the DMA channel |
38 //! @SYMTestExpectedResults |
99 //! 4. Repeat DMA transfer (queued asynchronously) |
39 //! 1. |
100 //! 5. Resume DMA Channel |
40 //! 2. |
101 //! |
102 //! TestExpectedResults 1. DMA channel opens and KErrNone returned. |
|
103 //! 2. DMA request created and KErrNone returned. |
|
104 //! 3. DMA channel Paused. |
|
105 //! 4. Request queued and waits until Resume is called |
|
106 //! 5. DMA Request completes |
|
107 //! |
|
108 //! TestPriority High |
|
109 //! TestStatus Implemented |
|
110 //---------------------------------------------------------------------------------------------- |
|
111 namespace PauseResumeApiTest |
|
112 { |
|
113 const TInt srcAddr = 0; |
|
114 const TInt desAddr = 2 * KMega; |
|
115 const TInt transferSize = 1 * KMega; |
|
116 |
|
117 TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr); |
|
118 const TResultSet expectedResults(threadCallback); |
|
119 CPauseResumeTest testPauseResume = CPauseResumeTest(_L("Pause and Resume Test"), 1, transferArgs, expectedResults); |
|
120 TTestCase testCasePauseResume(&testPauseResume, EFalse, capAboveV1,pauseRequired_skip); |
|
121 } |
|
122 |
|
123 //-------------------------------------------------------------------------------------------- |
|
124 //! TestCaseID KBASE-DMA-2560 |
|
125 //! TestType CIT |
|
126 //! PREQ REQ |
|
127 //! TestCaseDesc Simple DMA transfer test using CSingleTransferTest and New DMA APIs |
|
128 //! |
|
129 //! TestActions |
|
130 //! 1. Open a DMA channel for a transfer. |
|
131 //! 2. Create single transfer test and run test |
|
132 //! |
|
133 //! |
|
134 //! |
|
135 //! TestExpectedResults |
|
136 //! 1. DMA channel opens and KErrNone returned. |
|
137 //! 2. DMA transfer completes with no errors. |
|
41 //! |
138 //! |
42 //! |
139 //! |
43 //! @SYMTestPriority High |
140 //! TestPriority High |
44 //! @SYMTestStatus Implemented |
141 //! TestStatus Implemented |
45 //---------------------------------------------------------------------------------------------- |
142 //---------------------------------------------------------------------------------------------- |
46 namespace Simple_1 |
143 namespace Simple_1 |
47 { |
144 { |
48 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
145 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
49 |
146 |
50 const TResultSet expectedResults(threadCallback); |
147 const TResultSet expectedResults(threadCallback); |
51 |
148 |
52 CSingleTransferTest simpleTest(_L("Simple Test - New DMA APIs"), 1, transferArgs, expectedResults); |
149 CSingleTransferTest simpleTest(_L("Simple Test - New DMA APIs"), 1, transferArgs, expectedResults); |
53 |
150 |
54 TTestCase testCase(&simpleTest, EFalse, capAboveV1); |
151 TTestCase testCase(new (ELeave) CMultiVersionTest(&simpleTest), EFalse); |
55 TTestCase testCaseConcurrent(&simpleTest, ETrue, capAboveV1); |
152 TTestCase testCaseConcurrent(new (ELeave) CMultiVersionTest(&simpleTest), ETrue); |
56 } |
153 } |
57 |
154 |
58 //---------------------------------------------------------------------------------------------- |
155 //---------------------------------------------------------------------------------------------- |
59 //! @SYMTestCaseID KBASE-DMA-2561 |
156 //! TestCaseID KBASE-DMA-2573 |
60 //! @SYMTestType CIT |
157 //! TestType CIT |
61 //! @SYMPREQ REQ |
158 //! PREQ REQ |
62 //! @SYMTestCaseDesc Simple DMA transfer test using CSingleTransferTest and OLD DMA APIs |
159 //! TestCaseDesc DMA ISR Callback test (Isr Callback - use old request Ctor) |
63 //! |
160 //! |
64 //! @SYMTestActions |
161 //! TestActions |
65 //! 1. |
162 //! 1. Setup DMA transfer to request a callback from ISR using old style DDmaRequest. |
66 //! 2. |
163 //! 2. Create single transfer test and run test |
67 //! |
164 //! 3. Verify that DDmaRequest request fails |
68 //! |
165 //! |
69 //! @SYMTestExpectedResults |
166 //! TestExpectedResults |
70 //! 1. |
167 //! 1. DMA channel opens and KErrNone returned. |
71 //! 2. |
168 //! 2. DMA transfer created with no errors. |
72 //! |
169 //! 3. DDmaRequest request fails. |
73 //! |
170 //! |
74 //! @SYMTestPriority High |
171 //! |
75 //! @SYMTestStatus Implemented |
172 //! TestPriority High |
76 //---------------------------------------------------------------------------------------------- |
173 //! TestStatus Implemented |
77 namespace Simple_2 |
|
78 { |
|
79 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
|
80 |
|
81 const TResultSet expectedResults(threadCallback); |
|
82 |
|
83 CSingleTransferTest simpleTest = CSingleTransferTest(_L("Simple Test - Old DMA APIs"), 1, transferArgs, expectedResults, 0). |
|
84 UseNewDmaApi(EFalse); |
|
85 |
|
86 TTestCase testCase(&simpleTest, EFalse); |
|
87 TTestCase testCaseConcurrent(&simpleTest, ETrue); |
|
88 } |
|
89 |
|
90 //---------------------------------------------------------------------------------------------- |
|
91 //! @SYMTestCaseID KBASE-DMA-2573 |
|
92 //! @SYMTestType CIT |
|
93 //! @SYMPREQ REQ |
|
94 //! @SYMTestCaseDesc DMA ISR Callback test (Isr Callback - use old request Ctor) |
|
95 //! |
|
96 //! @SYMTestActions |
|
97 //! 1. |
|
98 //! 2. |
|
99 //! |
|
100 //! |
|
101 //! @SYMTestExpectedResults |
|
102 //! 1. |
|
103 //! 2. |
|
104 //! |
|
105 //! |
|
106 //! @SYMTestPriority High |
|
107 //! @SYMTestStatus Implemented |
|
108 //---------------------------------------------------------------------------------------------- |
174 //---------------------------------------------------------------------------------------------- |
109 namespace Callback |
175 namespace Callback |
110 { |
176 { |
111 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr); |
177 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr); |
112 |
178 |
129 .UseNewRequest(EFalse); |
195 .UseNewRequest(EFalse); |
130 TTestCase testCaseOldRequest(&isrTestOldRequest, EFalse, capAboveV1); |
196 TTestCase testCaseOldRequest(&isrTestOldRequest, EFalse, capAboveV1); |
131 } |
197 } |
132 |
198 |
133 //---------------------------------------------------------------------------------------------- |
199 //---------------------------------------------------------------------------------------------- |
134 //! @SYMTestCaseID KBASE-DMA-2574,KBASE-DMA-2575 |
200 //! TestCaseID KBASE-DMA-2574,KBASE-DMA-2575 |
135 //! @SYMTestType CIT |
201 //! TestType CIT |
136 //! @SYMPREQ REQ |
202 //! PREQ REQ |
137 //! @SYMTestCaseDesc DMA ISR Reque test |
203 //! TestCaseDesc DMA ISR Reque test |
138 //! |
204 //! |
139 //! @SYMTestActions |
205 //! TestActions |
140 //! 1. |
206 //! 1. Setup DMA transfer to request a callback from ISR. |
141 //! 2. |
207 //! 2. Set up ISR to requeue the DMA request on the same channel and adjust its transfer parameters. |
142 //! |
208 //! 3. Create single transfer test and run test |
143 //! |
209 //! 4. Verify a client can queue the just completed DMA request from within an ISR callback. |
144 //! @SYMTestExpectedResults |
210 //! |
145 //! 1. |
211 //! TestExpectedResults |
146 //! 2. |
212 //! |
213 //! DMA transfer completes and just completed request can be requeued from within an ISR |
|
214 //! callback on the same channel. Requeued DMA request completes successfully |
|
147 //! |
215 //! |
148 //! |
216 //! |
149 //! @SYMTestPriority High |
217 //! TestPriority High |
150 //! @SYMTestStatus Implemented |
218 //! TestStatus Implemented |
151 //---------------------------------------------------------------------------------------------- |
219 //---------------------------------------------------------------------------------------------- |
152 namespace ISR_Reque |
220 namespace ISR_Reque |
153 { |
221 { |
154 const TInt size = 4 * KKilo; |
222 const TInt size = 4 * KKilo; |
155 TDmaTransferArgs tferArgs(0, 2*size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr); |
223 TDmaTransferArgs tferArgs(0, 2*size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr); |
156 |
224 |
157 const TRequestResults requestResult(KErrNone, 1); // request must be in a single fragment |
225 const TRequestResults requestResult(KErrNone, 1); // request must be in a single fragment |
158 |
226 |
227 //------------------------------------------------------------- |
|
228 //This case requeues 4 transfers at the end of an ISR callback |
|
229 //------------------------------------------------------------- |
|
159 namespace endOnIsrCb |
230 namespace endOnIsrCb |
160 { |
231 { |
161 TIsrRequeArgs requeArgs[] = { |
232 TIsrRequeArgs requeArgs[] = { |
162 TIsrRequeArgs(), |
233 TIsrRequeArgs(), |
163 TIsrRequeArgs(size,3*size,size,0, ETrue), |
234 TIsrRequeArgs(size,3*size,size,0, ETrue), |
172 const TResultSet expected(KErrNone, requestResult, KErrNone, callbackRecord); |
243 const TResultSet expected(KErrNone, requestResult, KErrNone, callbackRecord); |
173 |
244 |
174 TTestCase testCase(new (ELeave) CIsrRequeTest(_L("4 Requeues - end on isr cb"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst), ETrue, capAboveV1); |
245 TTestCase testCase(new (ELeave) CIsrRequeTest(_L("4 Requeues - end on isr cb"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst), ETrue, capAboveV1); |
175 } |
246 } |
176 |
247 |
248 //--------------------------------------------------------------- |
|
249 ///This case requeues 4 transfers at the end of a thread callback |
|
250 //--------------------------------------------------------------- |
|
177 namespace endOnThreadCb |
251 namespace endOnThreadCb |
178 { |
252 { |
179 TIsrRequeArgs requeArgs[] = { |
253 TIsrRequeArgs requeArgs[] = { |
180 TIsrRequeArgs(), |
254 TIsrRequeArgs(), |
181 TIsrRequeArgs(size,3*size,size,0, ETrue), |
255 TIsrRequeArgs(size,3*size,size,0, ETrue), |
187 const TCallbackRecord callbackRecord = TCallbackRecord(TCallbackRecord::EThread, count + 1).IsrRedoResult(KErrNone); |
261 const TCallbackRecord callbackRecord = TCallbackRecord(TCallbackRecord::EThread, count + 1).IsrRedoResult(KErrNone); |
188 const TResultSet expected(KErrNone, requestResult, KErrNone, callbackRecord); |
262 const TResultSet expected(KErrNone, requestResult, KErrNone, callbackRecord); |
189 |
263 |
190 TTestCase testCase(new (ELeave) CIsrRequeTest(_L("4 Requeues - end on thread cb"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst), ETrue, capAboveV1); |
264 TTestCase testCase(new (ELeave) CIsrRequeTest(_L("4 Requeues - end on thread cb"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst), ETrue, capAboveV1); |
191 } |
265 } |
192 |
266 |
267 //---------------------------------------------------------------------------------------------- |
|
268 // This case requeues a transfer from within an thread callback after changing the transfer size |
|
269 //---------------------------------------------------------------------------------------------- |
|
193 namespace changeSize |
270 namespace changeSize |
194 { |
271 { |
195 TIsrRequeArgs requeArgs[] = { |
272 TIsrRequeArgs requeArgs[] = { |
196 TIsrRequeArgs(3*size,5*size,2*size,0, EFalse), |
273 TIsrRequeArgs(3*size,5*size,2*size,0, EFalse), |
197 }; |
274 }; |
201 const TResultSet expected(KErrNone, requestResult, KErrNone, callbackRecord); |
278 const TResultSet expected(KErrNone, requestResult, KErrNone, callbackRecord); |
202 |
279 |
203 TTestCase testCase(new (ELeave) CIsrRequeTest(_L("1 Requeues - change transfer size"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst), ETrue, capAboveV1); |
280 TTestCase testCase(new (ELeave) CIsrRequeTest(_L("1 Requeues - change transfer size"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst), ETrue, capAboveV1); |
204 } |
281 } |
205 |
282 |
283 //-------------------------------------------------------------------------------------------- |
|
284 // This case requeues a just completed request from within an ISR callback |
|
285 //-------------------------------------------------------------------------------------------- |
|
206 namespace endOnRedo |
286 namespace endOnRedo |
207 { |
287 { |
208 // TODO have made this bigger than 4k so that we don't miss the second interrupt when tracing enabled |
288 // The transfer size has been made bigger than 4K so that we do not miss the second interrupt when tracing |
209 // this indicates the PSL's interrupt handler misses an interrupt if it occurs during the interrupt. |
289 // enabled is. This indicates the PSL's interrupt handler misses an interrupt if it occurs during the interrupt. |
210 const TInt size = 0x10000; |
290 const TInt size = 0x10000; |
211 TDmaTransferArgs tferArgs(0, 2*size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr); |
291 TDmaTransferArgs tferArgs(0, 2*size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr); |
212 |
292 |
213 TIsrRequeArgs requeArgs[] = { |
293 TIsrRequeArgs requeArgs[] = { |
214 TIsrRequeArgs(3*size,5*size,2*size,0, ETrue), |
294 TIsrRequeArgs(3*size,5*size,2*size,0, ETrue), |
220 const TResultSet expected(KErrNone, requestResult, KErrNone, callbackRecord); |
300 const TResultSet expected(KErrNone, requestResult, KErrNone, callbackRecord); |
221 |
301 |
222 TTestCase testCase(new (ELeave) CIsrRequeTest(_L("2 Requeues - Isr redo request repeated"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst), EFalse, capAboveV1); |
302 TTestCase testCase(new (ELeave) CIsrRequeTest(_L("2 Requeues - Isr redo request repeated"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst), EFalse, capAboveV1); |
223 } |
303 } |
224 |
304 |
305 //-------------------------------------------------------------------------------------------- |
|
306 // This case requeues a request from within an ISR callback using invalid requeue parameters |
|
307 //-------------------------------------------------------------------------------------------- |
|
225 namespace invalidAddresses |
308 namespace invalidAddresses |
226 { |
309 { |
227 TIsrRequeArgs requeArgs[] = { |
310 TIsrRequeArgs requeArgs[] = { |
228 TIsrRequeArgs(size, size) |
311 TIsrRequeArgs(size, size) |
229 }; |
312 }; |
233 const TResultSet expected(KErrNone, requestResult, KErrUnknown, callbackRecord); |
316 const TResultSet expected(KErrNone, requestResult, KErrUnknown, callbackRecord); |
234 |
317 |
235 // pre and post test would fail because of bad requeue parameters |
318 // pre and post test would fail because of bad requeue parameters |
236 TTestCase testCase(new (ELeave) CIsrRequeTest(_L("Requeue with matching addresses"), 1, tferArgs, requeArgs, count, expected, NULL, NULL), ETrue, capAboveV1); |
319 TTestCase testCase(new (ELeave) CIsrRequeTest(_L("Requeue with matching addresses"), 1, tferArgs, requeArgs, count, expected, NULL, NULL), ETrue, capAboveV1); |
237 } |
320 } |
238 |
321 //-------------------------------------------------------------------------------------------- |
322 // This case requeues a request containing more than 1 fragment from within an ISR callback |
|
323 // |
|
324 // |
|
325 // This test case is currently caught by a FAULT instead of a return code |
|
326 // as expected. Currently, the facility to return an error code to the test |
|
327 // framework is not yet supported. |
|
328 // |
|
329 // It has been implemented to expect an error code of KErrGeneral as requeues for request that |
|
330 // contains more than one fragments are not allowed. |
|
331 //-------------------------------------------------------------------------------------------- |
|
239 namespace multipleFragments |
332 namespace multipleFragments |
240 { |
333 { |
241 TIsrRequeArgs requeArgs[] = { |
334 TIsrRequeArgs requeArgs[] = { |
242 TIsrRequeArgs() |
335 TIsrRequeArgs() |
243 }; |
336 }; |
244 const TInt count = ARRAY_LENGTH(requeArgs); |
337 const TInt count = ARRAY_LENGTH(requeArgs); |
245 |
338 const TRequestResults isrequestResult(KErrNone, 2); // request contains 2 fragments |
246 const TCallbackRecord callbackRecord = TCallbackRecord(TCallbackRecord::EThread, count + 1).IsrRedoResult(KErrNone); |
339 |
247 |
340 const TCallbackRecord callbackRecord = TCallbackRecord(TCallbackRecord::EIsr, 1).IsrRedoResult(KErrGeneral); |
248 TRequestResults results2Fragments = TRequestResults(requestResult).FragmentCount(2); |
341 TRequestResults results2Fragments = TRequestResults(isrequestResult).FragmentCount(2); |
249 const TResultSet expected(KErrNone, results2Fragments, KErrNone, callbackRecord); |
342 const TResultSet expected(KErrNone, results2Fragments, KErrNone, callbackRecord); |
250 |
343 |
251 TTestCase testCase(new (ELeave) CIsrRequeTest(_L("Attempt to Requeue 2 fragment request"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst, size/2), ETrue, capAboveV1); |
344 TTestCase testCase(new (ELeave) CIsrRequeTest(_L("Attempt to Requeue 2 fragment request"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst, size/2), ETrue, capAboveV1); |
252 |
345 |
253 } |
346 } |
254 } |
347 } |
255 |
348 |
256 //---------------------------------------------------------------------------------------------- |
349 //---------------------------------------------------------------------------------------------- |
257 //! @SYMTestCaseID PBASE-DMA-FUNC-xxx |
350 //! TestCaseID PBASE-DMA-FUNC-2586 |
258 //! @SYMTestType CIT |
351 //! TestType CIT |
259 //! @SYMPREQ REQ |
352 //! PREQ REQ |
260 //! @SYMTestCaseDesc DMA Multiple transfer test |
353 //! TestCaseDesc DMA Multiple transfer test |
261 //! @SYMTestActions |
354 //! TestActions |
262 //! 1. |
355 //! 1.Setup DMA transfer to using muliple transfers. |
263 //! 2. |
356 //! 2.Create multipart transfer test and run test. |
264 //! |
357 //! |
265 //! |
358 //! |
266 //! @SYMTestExpectedResults |
359 //! TestExpectedResults |
267 //! 1. |
360 //! 1. DMA tranfer set up with no errors. |
268 //! 2. |
361 //! 2. Multipart transfer tests completes with no issues. |
269 //! |
362 //! |
270 //! |
363 //! |
271 //! @SYMTestPriority High |
364 //! TestPriority High |
272 //! @SYMTestStatus Implemented |
365 //! TestStatus Implemented |
273 //---------------------------------------------------------------------------------------------- |
366 //---------------------------------------------------------------------------------------------- |
274 namespace Multipart |
367 namespace Multipart |
275 { |
368 { |
276 // need long transfer, to try and force adjacent |
369 // need long transfer, to try and force adjacent |
277 // requests to be concatinated |
370 // requests to be concatinated |
278 const TInt size = 2 * KMega; |
371 const TInt size = 2 * KMega; |
279 const TDmaTransferArgs transferArgArray[] = { |
372 const TDmaTransferArgs transferArgArray[] = { |
280 TDmaTransferArgs(0, size, size, KDmaMemAddr), |
373 TDmaTransferArgs(0, size, size, KDmaMemAddr), |
281 TDmaTransferArgs(size, 2 * size, size, KDmaMemAddr) |
374 TDmaTransferArgs(2 * size, 3 * size, size, KDmaMemAddr) |
282 }; |
375 }; |
283 |
376 |
284 const TResultSet expected[] = |
377 const TResultSet expected[] = |
285 { |
378 { |
286 TResultSet(), |
379 TResultSet(), |
287 TResultSet() |
380 TResultSet() |
288 }; |
381 }; |
289 const TResultSet expectedResults(isrCallback); |
|
290 |
382 |
291 CMultiTransferTest multipart = |
383 CMultiTransferTest multipart = |
292 CMultiTransferTest(_L("Sg request concatination"), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray)) |
384 CMultiTransferTest(_L("Sg request concatination"), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray)) |
293 .SetPreTransferTest(&KPreTransferIncrBytes) |
385 .SetPreTransferTest(&KPreTransferIncrBytes) |
294 .SetPostTransferTest(&KCompareSrcDst); |
386 .SetPostTransferTest(&KCompareSrcDst); |
295 |
387 |
296 TTestCase testCase(&multipart, EFalse, hwDesWanted_skip); |
388 TTestCase testCase(&multipart, EFalse, hwDesWanted_skip); |
297 } |
389 } |
298 |
390 |
299 //---------------------------------------------------------------------------------------------- |
391 //---------------------------------------------------------------------------------------------- |
300 //! @SYMTestCaseID KBASE-DMA-2580 |
392 //! TestCaseID KBASE-DMA-2580 |
301 //! @SYMTestType CIT |
393 //! TestType CIT |
302 //! @SYMPREQ REQ |
394 //! PREQ REQ |
303 //! @SYMTestCaseDesc These tests attempt to queue ISR cb requests while the queue is not |
395 //! TestCaseDesc These tests attempt to queue ISR cb requests while the queue is not |
304 //! empty and queing normal requests when an ISR cb is pending |
396 //! empty and queing normal requests when an ISR cb is pending |
305 //! @SYMTestActions |
397 //! TestActions |
306 //! 1. |
398 //! |
307 //! 2. |
399 //! 1. Setup DMA transfer to request a callback from ISR. |
308 //! |
400 //! 2. Create single transfer test and run test |
309 //! |
401 //! 3. Queue another request using Queue()before ISR Callback completion |
310 //! @SYMTestExpectedResults |
402 //! 4. Verify a DMA framework flags an error. |
311 //! 1. |
403 //! |
312 //! 2. |
404 //! |
313 //! |
405 //! TestExpectedResults |
314 //! |
406 //! DMA framework flags an error if ISR callback has not been executed |
315 //! @SYMTestPriority High |
407 //! for the last time without re-queueing the initial transfer request |
316 //! @SYMTestStatus Implemented |
408 //! |
409 //! TestPriority High |
|
410 //! TestStatus Implemented |
|
317 //---------------------------------------------------------------------------------------------- |
411 //---------------------------------------------------------------------------------------------- |
318 namespace IsrAndDfc |
412 namespace IsrAndDfc |
319 { |
413 { |
320 // need long transfer, so that 1st request is still queued |
414 // This test case needs a long transfer so that 1st request is still queued when the second |
321 // when the second one is queued |
415 // one is queued. The use of Pause is recommended in order to guarantee this. For this case, |
322 // TODO pause is the better way to ensure this |
416 // the size has been selected to ensure that the first isr callback request in IsrBeforeDfc |
323 //const TInt size = 2 * KMega; |
417 // will only have one fragment |
324 //TODO have changed size to ensure that the first isr callback request in IsrBeforeDfc |
|
325 //will only have one fragment |
|
326 const TInt size = 0x40000; |
418 const TInt size = 0x40000; |
327 TDmaTransferArgs dfcTransfer(0, size, size, KDmaMemAddr); |
419 TDmaTransferArgs dfcTransfer(0, size, size, KDmaMemAddr); |
328 TDmaTransferArgs isrTransfer(2*size, 3*size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr); |
420 TDmaTransferArgs isrTransfer(2*size, 3*size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr); |
329 |
421 |
330 const TResultSet success = TResultSet(); |
422 const TResultSet success = TResultSet(); |
346 queueFailure |
438 queueFailure |
347 }; |
439 }; |
348 CMultiTransferTest dfcBeforeIsr = |
440 CMultiTransferTest dfcBeforeIsr = |
349 CMultiTransferTest(_L("DFC cb req before ISR cb req "), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray)) |
441 CMultiTransferTest(_L("DFC cb req before ISR cb req "), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray)) |
350 .SetPreTransferTest(&KPreTransferIncrBytes) |
442 .SetPreTransferTest(&KPreTransferIncrBytes) |
351 .SetPostTransferTest(&KCompareSrcDst); |
443 .SetPostTransferTest(&KCompareSrcDst) |
352 TTestCase testCase(&dfcBeforeIsr, EFalse, hwDesWanted_skip); |
444 .PauseWhileQueuing(); |
445 TTestCase testCase(&dfcBeforeIsr, EFalse, pauseRequired_skip, capAboveV1); |
|
353 } |
446 } |
354 |
447 |
355 namespace IsrBeforeDfc |
448 namespace IsrBeforeDfc |
356 { |
449 { |
357 const TDmaTransferArgs transferArgArray[] = { |
450 const TDmaTransferArgs transferArgArray[] = { |
366 queueFailure |
459 queueFailure |
367 }; |
460 }; |
368 CMultiTransferTest dfcBeforeIsr = |
461 CMultiTransferTest dfcBeforeIsr = |
369 CMultiTransferTest(_L("ISR cb req before DFC cb req "), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray)) |
462 CMultiTransferTest(_L("ISR cb req before DFC cb req "), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray)) |
370 .SetPreTransferTest(&KPreTransferIncrBytes) |
463 .SetPreTransferTest(&KPreTransferIncrBytes) |
371 .SetPostTransferTest(&KCompareSrcDst); |
464 .SetPostTransferTest(&KCompareSrcDst) |
372 TTestCase testCase(&dfcBeforeIsr, EFalse, hwDesWanted_skip); |
465 .PauseWhileQueuing(); |
466 TTestCase testCase(&dfcBeforeIsr, EFalse, pauseRequired_skip, capAboveV1); |
|
373 } |
467 } |
374 |
468 |
375 } |
469 } |
376 |
470 |
377 //---------------------------------------------------------------------------------------------- |
471 //---------------------------------------------------------------------------------------------- |
378 //! @SYMTestCaseID PBASE-DMA-FUNC-xxx |
472 //! TestCaseID PBASE-DMA-FUNC-2587 |
379 //! @SYMTestType CIT |
473 //! TestType CIT |
380 //! @SYMPREQ REQ |
474 //! PREQ REQ |
381 //! @SYMTestCaseDesc DMA 2D transfer test |
475 //! TestCaseDesc DMA 2D transfer test |
382 //! |
476 //! |
383 //! @SYMTestActions |
477 //! TestActions |
384 //! 1. |
478 //! 1. Set up DMA transfer using TDmaTransArgs parameters specified in order to |
385 //! 2. |
479 //! rotate an image by 90 degrees clockwise. |
386 //! |
480 //! 2. Verify that destination buffer gets transformed according to the DMA |
387 //! |
481 //! transfer arguments after transfer. |
388 //! @SYMTestExpectedResults |
482 //! |
389 //! 1. |
483 //! TestExpectedResults |
390 //! 2. |
484 //! 1. DMA tranfer set up with no errors. |
485 //! 2. Destination buffer gets transformed accordingly. |
|
391 //! |
486 //! |
392 //! |
487 //! |
393 //! @SYMTestPriority High |
488 //! TestPriority High |
394 //! @SYMTestStatus Implemented |
489 //! TestStatus Implemented |
395 //---------------------------------------------------------------------------------------------- |
490 //---------------------------------------------------------------------------------------------- |
396 namespace _2D_Test |
491 namespace _2D_Test |
397 { |
492 { |
398 // Image @ 0x0 with 640x480 pixels and 24 bits/pixel. |
493 // Image @ 0x0 with 640x480 pixels and 24 bits/pixel. |
399 |
494 |
427 |
522 |
428 TTestCase testCase2d(&transfer2d, EFalse, cap_2DRequired, capAboveV1); |
523 TTestCase testCase2d(&transfer2d, EFalse, cap_2DRequired, capAboveV1); |
429 } |
524 } |
430 |
525 |
431 //---------------------------------------------------------------------------------------------- |
526 //---------------------------------------------------------------------------------------------- |
432 //! @SYMTestCaseID KBASE-DMA-2565 |
527 //! TestCaseID KBASE-DMA-2565 |
433 //! @SYMTestType CIT |
528 //! TestType CIT |
434 //! @SYMPREQ REQ |
529 //! PREQ REQ |
435 //! @SYMTestCaseDesc DMA Fragmentation count test |
530 //! TestCaseDesc DMA Fragmentation count test |
436 //! |
531 //! |
437 //! @SYMTestActions |
532 //! TestActions |
438 //! 1. |
533 //! 1. Set up the arguments for Fragment using the setting in the test scenario table below. |
439 //! 2. |
534 //! 2. Create single transfer test and run test |
440 //! |
535 //! 3. Verify that FragmentCount API returns the expected value and framework responds correctly |
441 //! |
536 //! 4. Repeat steps 1 to 3 above until all the settings in the scenario table below have been used. |
442 //! @SYMTestExpectedResults |
537 //! |
443 //! 1. |
538 //! TestExpectedResults |
444 //! 2. |
539 //! On calling FragmentCount (), the number of fragments (descriptors / pseudo descriptors) that |
540 //! the transfer request has been split into is returned. |
|
541 //! |
|
445 //! |
542 //! |
446 //! |
543 //! |
447 //! @SYMTestPriority High |
544 //! TestPriority High |
448 //! @SYMTestStatus Implemented |
545 //! TestStatus Implemented |
449 //---------------------------------------------------------------------------------------------- |
546 //---------------------------------------------------------------------------------------------- |
450 namespace FragmentationCount |
547 namespace FragmentationCount |
451 { |
548 { |
452 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
549 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
453 |
550 |
454 const TRequestResults requestResult(KErrNone, 128); |
551 const TRequestResults requestResult(KErrNone, 128); |
455 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
552 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
456 CSingleTransferTest test1(_L("Fragmentation Count - 128 fragments"), 1, transferArgs, expectedResults, KKilo); |
553 CSingleTransferTest test1(_L("Fragmentation Count - 128 fragments"), 1, transferArgs, expectedResults, KKilo); |
457 TTestCase testCase(&test1, EFalse); |
554 TTestCase testCase(new (ELeave) CMultiVersionTest(&test1), EFalse); |
458 |
555 |
459 const TRequestResults requestResult2(KErrNone, 4); |
556 const TRequestResults requestResult2(KErrNone, 4); |
460 const TResultSet expectedResults2(KErrNone, requestResult2, KErrNone, threadCallback); |
557 const TResultSet expectedResults2(KErrNone, requestResult2, KErrNone, threadCallback); |
461 CSingleTransferTest test2(_L("Fragmentation Count - 4 fragments"), 1, transferArgs, expectedResults2, 32*KKilo); |
558 CSingleTransferTest test2(_L("Fragmentation Count - 4 fragments"), 1, transferArgs, expectedResults2, 32*KKilo); |
462 TTestCase testCase2(&test2, EFalse); |
559 TTestCase testCase2(new (ELeave) CMultiVersionTest(&test2), EFalse); |
463 } |
560 |
464 |
561 // Also specifying an element size to get the PIL to further adjust the |
465 //---------------------------------------------------------------------------------------------- |
562 // fragment size(s): element size = 32, transfer length = 128KB, max |
466 //! @SYMTestCaseID KBASE-DMA-2584,KBASE-DMA-2585 |
563 // transfer length = 6500 bytes, # of fragments expected = 21 (20 with 6496 |
467 //! @SYMTestType CIT |
564 // bytes each + 1 with 1152 bytes). |
468 //! @SYMPREQ REQ |
565 TDmaTransferArgs transferArgs3(0, size, size, KDmaMemAddr, KDmaSyncAuto, 0, KDmaAddrModePostIncrement, 32); |
469 //! @SYMTestCaseDesc DMA Benchmark tests |
566 const TRequestResults requestResult3(KErrNone, 21); |
470 //! |
567 const TResultSet expectedResults3(KErrNone, requestResult3, KErrNone, threadCallback); |
471 //! @SYMTestActions |
568 CSingleTransferTest test3(_L("Fragmentation Count - 21 fragments"), |
472 //! 1. |
569 1, transferArgs3, expectedResults3, 6500); |
473 //! 2. |
570 TTestCase testCase3(new (ELeave) CMultiVersionTest(&test3), EFalse); |
474 //! |
571 } |
475 //! |
572 |
476 //! @SYMTestExpectedResults |
573 //---------------------------------------------------------------------------------------------- |
477 //! 1. |
574 //! TestCaseID KBASE-DMA-2584,KBASE-DMA-2585 |
478 //! 2. |
575 //! TestType CIT |
479 //! |
576 //! PREQ REQ |
480 //! |
577 //! TestCaseDesc DMA Benchmark tests |
481 //! @SYMTestPriority High |
578 //! To compare the speed of request fragmentation for a given transfer |
482 //! @SYMTestStatus Implemented |
579 //! between the new and old frameworks on the NaviEngine platform. |
580 //! TestActions |
|
581 //! 1. Fragment a memory to memory dma transfer of 4Mb, where both source and destination are physically contiguous. |
|
582 //! 2. Fragment using the default element size, and also with a 4K limit. |
|
583 //! 3. Carry out for a channel using pseudo descriptors and for a scatter gather channel. |
|
584 //! |
|
585 //! TestExpectedResults |
|
586 //! The results obtained for both framework versions should be comparable. |
|
587 //! |
|
588 //! TestPriority High |
|
589 //! TestStatus Implemented |
|
483 //----------------------------------------------------------------------------------------------- |
590 //----------------------------------------------------------------------------------------------- |
484 namespace Benchmark |
591 namespace Benchmark |
485 { |
592 { |
486 const TInt bmIters = 10; |
593 const TInt bmIters = 10; |
487 namespace Frag |
594 namespace Frag |
488 { |
595 { |
489 const TInt size = 1 * KMega; |
596 const TInt size = 1 * KMega; |
490 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
597 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
491 |
598 |
492 TTestCase testCase_256k(new (ELeave) CDmaBmFragmentation(_L("1 Mb transfer - 256k frag size"), bmIters, transferArgs, 256 * KKilo), EFalse); |
599 TTestCase testCase_256K(new (ELeave) CDmaBmFragmentation(_L("1 MB transfer - 256K frag size"), bmIters, transferArgs, 256 * KKilo), EFalse); |
493 TTestCase testCase_8k(new (ELeave) CDmaBmFragmentation(_L("1 Mb transfer - 8k frag size"), bmIters, transferArgs, 8 * KKilo), EFalse); |
600 TTestCase testCase_8K(new (ELeave) CDmaBmFragmentation(_L("1 MB transfer - 8K frag size"), bmIters, transferArgs, 8 * KKilo), EFalse); |
494 } |
601 } |
495 |
602 |
496 namespace Transfer |
603 namespace Transfer |
497 { |
604 { |
498 namespace _4Bytes |
605 namespace _4Bytes |
507 { |
614 { |
508 const TInt size = 128 * KKilo; |
615 const TInt size = 128 * KKilo; |
509 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
616 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
510 |
617 |
511 TTestCase testCase_128(new (ELeave) CDmaBmTransfer(_L("128 K - 128K frag size"), bmIters, transferArgs, 128 * KKilo), EFalse); |
618 TTestCase testCase_128(new (ELeave) CDmaBmTransfer(_L("128 K - 128K frag size"), bmIters, transferArgs, 128 * KKilo), EFalse); |
512 TTestCase testCase_16(new (ELeave) CDmaBmTransfer(_L("128 K - 16k frag size"), bmIters, transferArgs, 16 * KKilo), EFalse); |
619 TTestCase testCase_16(new (ELeave) CDmaBmTransfer(_L("128 K - 16K frag size"), bmIters, transferArgs, 16 * KKilo), EFalse); |
513 TTestCase testCase_4(new (ELeave) CDmaBmTransfer(_L("128 K - 4k frag size"), bmIters, transferArgs, 4 * KKilo), EFalse); |
620 TTestCase testCase_4(new (ELeave) CDmaBmTransfer(_L("128 K - 4K frag size"), bmIters, transferArgs, 4 * KKilo), EFalse); |
514 TTestCase testCase_1(new (ELeave) CDmaBmTransfer(_L("128 K - 1k frag size"), bmIters, transferArgs, 1 * KKilo), EFalse); |
621 TTestCase testCase_1(new (ELeave) CDmaBmTransfer(_L("128 K - 1K frag size"), bmIters, transferArgs, 1 * KKilo), EFalse); |
515 } |
622 } |
516 namespace _4Mb |
623 namespace _4MB |
517 { |
624 { |
518 const TInt size = 4 * KMega; |
625 const TInt size = 4 * KMega; |
519 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
626 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
520 |
627 |
521 CDmaBmTransfer bmTest(_L("4 Mb"), bmIters, transferArgs, 0); |
628 CDmaBmTransfer bmTest(_L("4 MB"), bmIters, transferArgs, 0); |
522 TTestCase testCase(&bmTest, EFalse); |
629 TTestCase testCase(&bmTest, EFalse); |
523 } |
630 } |
524 } |
631 } |
525 |
632 |
526 /** |
633 /** |
542 const TInt size = 4; |
649 const TInt size = 4; |
543 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
650 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
544 CDmaBmTransfer bmTest = CDmaBmTransfer(_L("4 bytes DFC cb"), iterations, transferArgs, 0). |
651 CDmaBmTransfer bmTest = CDmaBmTransfer(_L("4 bytes DFC cb"), iterations, transferArgs, 0). |
545 UseNewDmaApi(ETrue). |
652 UseNewDmaApi(ETrue). |
546 ExpectedResults(expected); |
653 ExpectedResults(expected); |
547 TTestCase testCase(&bmTest, EFalse); |
654 TTestCase testCase(&bmTest, EFalse, capAboveV1); |
548 } |
655 } |
549 namespace _4K |
656 namespace _4K |
550 { |
657 { |
551 const TInt size = 4 * KKilo; |
658 const TInt size = 4 * KKilo; |
552 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
659 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
553 CDmaBmTransfer bmTest = CDmaBmTransfer(_L("4K DFC cb"), iterations, transferArgs, 0). |
660 CDmaBmTransfer bmTest = CDmaBmTransfer(_L("4K DFC cb"), iterations, transferArgs, 0). |
554 UseNewDmaApi(ETrue). |
661 UseNewDmaApi(ETrue). |
555 ExpectedResults(expected); |
662 ExpectedResults(expected); |
556 TTestCase testCase(&bmTest, EFalse); |
663 TTestCase testCase(&bmTest, EFalse, capAboveV1); |
557 } |
664 } |
558 } |
665 } |
559 |
666 |
560 namespace Isr |
667 namespace Isr |
561 { |
668 { |
567 const TInt size = 4; |
674 const TInt size = 4; |
568 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr); |
675 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr); |
569 CDmaBmTransfer bmTest = CDmaBmTransfer(_L("4 bytes Isr cb"), iterations, transferArgs, 0). |
676 CDmaBmTransfer bmTest = CDmaBmTransfer(_L("4 bytes Isr cb"), iterations, transferArgs, 0). |
570 UseNewDmaApi(ETrue). |
677 UseNewDmaApi(ETrue). |
571 ExpectedResults(expected); |
678 ExpectedResults(expected); |
572 TTestCase testCase(&bmTest, EFalse); |
679 TTestCase testCase(&bmTest, EFalse, capAboveV1); |
573 } |
680 } |
574 namespace _4K |
681 namespace _4K |
575 { |
682 { |
576 const TInt size = 4 * KKilo; |
683 const TInt size = 4 * KKilo; |
577 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr); |
684 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr); |
578 CDmaBmTransfer bmTest = CDmaBmTransfer(_L("4K Isr cb"), iterations, transferArgs, 0). |
685 CDmaBmTransfer bmTest = CDmaBmTransfer(_L("4K Isr cb"), iterations, transferArgs, 0). |
579 UseNewDmaApi(ETrue). |
686 UseNewDmaApi(ETrue). |
580 ExpectedResults(expected); |
687 ExpectedResults(expected); |
581 TTestCase testCase(&bmTest, EFalse); |
688 TTestCase testCase(&bmTest, EFalse, capAboveV1); |
582 } |
689 } |
583 } |
690 } |
584 } |
691 } |
585 } |
692 } |
586 |
693 |
587 //---------------------------------------------------------------------------------------------- |
694 //---------------------------------------------------------------------------------------------- |
588 //! @SYMTestCaseID KBASE-DMA-2560 |
695 //! TestCaseID KBASE-DMA-2560 |
589 //! @SYMTestType CIT |
696 //! TestCaseID KBASE-DMA-2561 |
590 //! @SYMPREQ REQ |
697 //! TestType CIT |
591 //! @SYMTestCaseDesc TestNewStyleFragment using CSingleTransferTest |
698 //! PREQ REQ |
699 //! TestCaseDesc Test new & old style fragment using CSingleTransferTest |
|
592 //! Test Scenario 1 - DstAddr > SrcAddr & TransferSize=32K & Location is |
700 //! Test Scenario 1 - DstAddr > SrcAddr & TransferSize=32K & Location is |
593 //! address of a memory buffer |
701 //! address of a memory buffer |
594 //! @SYMTestActions |
702 //! TestActions |
595 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
703 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
596 //! |
704 //! |
597 //! SrcAddr = 4 * KKilo; |
705 //! SrcAddr = 4 * KKilo; |
598 //! desAddr = 64 * KKilo; |
706 //! desAddr = 64 * KKilo; |
599 //! transferSize = 32 * KKilo; |
707 //! transferSize = 32 * KKilo; |
600 //! iFlags = KDmaMemAddr; |
708 //! iFlags = KDmaMemAddr; |
601 //! |
709 //! |
602 //! 2. Setup expected result. |
710 //! 2. Setup expected result. |
603 //! 3. Create single transfer test and run test |
711 //! 3. Create single transfer test and run test |
604 //! |
712 //! |
605 //! @SYMTestExpectedResults |
713 //! TestExpectedResults |
606 //! 1. TransfeArgs set up in DMA framework |
714 //! 1. TransfeArgs set up in DMA framework |
607 //! 2. Expected results set up in DMA framework |
715 //! 2. Expected results set up in DMA framework |
608 //! 3. Fragment request completes and KErrNone returned |
716 //! 3. Fragment request completes and KErrNone returned |
609 //! |
717 //! |
610 //! @SYMTestPriority High |
718 //! TestPriority High |
611 //! @SYMTestStatus Implemented |
719 //! TestStatus Implemented |
612 //---------------------------------------------------------------------------------------------- |
720 //---------------------------------------------------------------------------------------------- |
613 namespace TestNewStyleFragment_1 |
721 namespace Fragment_1 |
614 { |
722 { |
615 const TInt srcAddr = 4 * KKilo; |
723 const TInt srcAddr = 4 * KKilo; |
616 const TInt desAddr = 64 * KKilo; |
724 const TInt desAddr = 64 * KKilo; |
617 |
725 |
618 const TInt transferSize = 32 * KKilo; |
726 const TInt transferSize = 32 * KKilo; |
620 TDmaTransferArgs transferArgs( srcAddr, desAddr, transferSize, KDmaMemAddr); |
728 TDmaTransferArgs transferArgs( srcAddr, desAddr, transferSize, KDmaMemAddr); |
621 |
729 |
622 const TRequestResults requestResult(KErrNone, 32); |
730 const TRequestResults requestResult(KErrNone, 32); |
623 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
731 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
624 |
732 |
625 CSingleTransferTest testscenario_1(_L("TestNewStyleFragment - Test Scenario 1"), 1, transferArgs, expectedResults,KKilo); |
733 CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("Fragment - Scenario 1"), 1, transferArgs, expectedResults,KKilo)); |
626 |
734 |
627 TTestCase testCase(&testscenario_1, EFalse, capAboveV1); |
735 TTestCase testCase(&multiVersion, EFalse); |
628 TTestCase testCaseConcurrent(&testscenario_1, ETrue, capAboveV1); |
736 TTestCase testCaseConcurrent(&multiVersion, ETrue); |
629 } |
737 } |
630 |
738 |
631 //---------------------------------------------------------------------------------------------- |
739 //---------------------------------------------------------------------------------------------- |
632 //! @SYMTestCaseID KBASE-DMA-2560 |
740 //! TestCaseID KBASE-DMA-2560 |
633 //! @SYMTestType CIT |
741 //! TestCaseID KBASE-DMA-2561 |
634 //! @SYMPREQ REQ |
742 //! TestType CIT |
635 //! @SYMTestCaseDesc TestNewStyleFragment using CSingleTransferTest |
743 //! PREQ REQ |
636 //! Test Scenario 2 - SrcAddr == DstAddr |
744 //! TestCaseDesc Test new & old style fragment using CSingleTransferTest |
637 //! |
|
638 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
|
639 //! |
|
640 //! SrcAddr = 4 * KKilo; |
|
641 //! desAddr = 4 * KKilo; |
|
642 //! transferSize = 32 * KKilo; |
|
643 //! iFlags = KDmaMemAddr; |
|
644 //! |
|
645 //! 2. Setup expected result. |
|
646 //! 3. Create single transfer test and run test |
|
647 //! |
|
648 //! @SYMTestExpectedResults |
|
649 //! |
|
650 //! 1. TransfeArgs set up in DMA framework |
|
651 //! 2. Expected results set up in DMA framework |
|
652 //! 3. Fragment passes and KErrNone returned |
|
653 //! |
|
654 //! @SYMTestPriority High |
|
655 //! @SYMTestStatus Implemented |
|
656 //---------------------------------------------------------------------------------------------- |
|
657 namespace TestNewStyleFragment_2 |
|
658 { |
|
659 const TInt srcAddr = 4 * KKilo; |
|
660 const TInt desAddr = 4 * KKilo; |
|
661 const TInt transferSize = 32 * KKilo; |
|
662 |
|
663 TDmaTransferArgs transferArgs(srcAddr,desAddr, transferSize, KDmaMemAddr); |
|
664 const TRequestResults requestResult(KErrNone, 32); |
|
665 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
|
666 |
|
667 CSingleTransferTest testscenario_2(_L("TestNewStyleFragment - Test Scenario 2"), 1, transferArgs, expectedResults,KKilo); |
|
668 |
|
669 TTestCase testCase(&testscenario_2, EFalse, capAboveV1); |
|
670 TTestCase testCaseConcurrent(&testscenario_2, ETrue, capAboveV1); |
|
671 } |
|
672 |
|
673 //---------------------------------------------------------------------------------------------- |
|
674 //! @SYMTestCaseID KBASE-DMA-2560 |
|
675 //! @SYMTestType CIT |
|
676 //! @SYMPREQ REQ |
|
677 //! @SYMTestCaseDesc TestNewStyleFragment using CSingleTransferTest |
|
678 //! Test Scenario 3 - TransferSize=0 |
745 //! Test Scenario 3 - TransferSize=0 |
679 //! |
746 //! |
680 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
747 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
681 //! |
748 //! |
682 //! SrcAddr = 32 * KKilo; |
749 //! SrcAddr = 32 * KKilo; |
686 //! |
753 //! |
687 //! 2. Setup expected result. |
754 //! 2. Setup expected result. |
688 //! 3. Create single transfer test and run test |
755 //! 3. Create single transfer test and run test |
689 //! |
756 //! |
690 //! |
757 //! |
691 //! @SYMTestExpectedResults |
758 //! TestExpectedResults |
692 //! |
759 //! |
693 //! 1. TransfeArgs set up in DMA framework |
760 //! 1. TransfeArgs set up in DMA framework |
694 //! 2. Expected results set up in DMA framework |
761 //! 2. Expected results set up in DMA framework |
695 //! 3. Fragment request fails and KErrArgument returned |
762 //! 3. Fragment request fails and KErrArgument returned |
696 //! |
763 //! |
697 //! @SYMTestPriority High |
764 //! TestPriority High |
698 //! @SYMTestStatus Implemented |
765 //! TestStatus Implemented |
699 //---------------------------------------------------------------------------------------------- |
766 //---------------------------------------------------------------------------------------------- |
700 namespace TestNewStyleFragment_3 |
767 namespace Fragment_2 |
701 { |
768 { |
702 const TInt srcAddr = 32 * KKilo; |
769 const TInt srcAddr = 32 * KKilo; |
703 const TInt desAddr = 64 * KKilo; |
770 const TInt desAddr = 64 * KKilo; |
704 const TInt transferSize = 0; |
771 const TInt transferSize = 0; |
705 |
772 |
706 TDmaTransferArgs transferArgs( srcAddr, desAddr, transferSize,KDmaMemAddr); |
773 TDmaTransferArgs transferArgs( srcAddr, desAddr, transferSize,KDmaMemAddr); |
707 const TRequestResults requestResult(KErrArgument, 0); |
774 const TRequestResults requestResult(KErrNone, 0, KErrArgument, KErrUnknown); |
708 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
775 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, TCallbackRecord::Empty()); |
709 |
776 |
710 CSingleTransferTest testscenario_3(_L("TestNewStyleFragment - Test Scenario 3"), 1, transferArgs, expectedResults); |
777 |
711 |
778 CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("Fragment - Scenario 3"), 1, transferArgs, expectedResults)); |
712 TTestCase testCase(&testscenario_3, EFalse, capAboveV1); |
779 |
713 TTestCase testCaseConcurrent(&testscenario_3, ETrue, capAboveV1); |
780 TTestCase testCase(&multiVersion, EFalse); |
714 } |
781 TTestCase testCaseConcurrent(&multiVersion, ETrue); |
715 |
782 } |
716 //---------------------------------------------------------------------------------------------- |
783 |
717 //! @SYMTestCaseID KBASE-DMA-2560 |
784 //---------------------------------------------------------------------------------------------- |
718 //! @SYMTestType CIT |
785 //! TestCaseID KBASE-DMA-2560 |
719 //! @SYMPREQ REQ |
786 //! TestCaseID KBASE-DMA-2561 |
720 //! @SYMTestCaseDesc TestNewStyleFragment using CSingleTransferTest |
787 //! TestType CIT |
788 //! PREQ REQ |
|
789 //! TestCaseDesc Test new & old style fragment using CSingleTransferTest |
|
721 //! Test Scenario 4 - TransferSize=1Byte |
790 //! Test Scenario 4 - TransferSize=1Byte |
722 //! |
791 //! |
723 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
792 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
724 //! |
793 //! |
725 //! SrcAddr = 32K; |
794 //! SrcAddr = 32K; |
728 //! iFlags = KDmaMemAddr; |
797 //! iFlags = KDmaMemAddr; |
729 //! |
798 //! |
730 //! 2. Setup expected result. |
799 //! 2. Setup expected result. |
731 //! 3. Create single transfer test and run test |
800 //! 3. Create single transfer test and run test |
732 //! |
801 //! |
733 //! @SYMTestExpectedResults |
802 //! TestExpectedResults |
734 //! |
803 //! |
735 //! 1. TransfeArgs set up in DMA framework |
804 //! 1. TransfeArgs set up in DMA framework |
736 //! 2. Expected results set up in DMA framework |
805 //! 2. Expected results set up in DMA framework |
737 //! 3. Fragment request completes and KErrNone returned |
806 //! 3. Fragment request completes and KErrNone returned |
738 //! |
807 //! |
739 //! @SYMTestPriority High |
808 //! TestPriority High |
740 //! @SYMTestStatus Implemented |
809 //! TestStatus Implemented |
741 //---------------------------------------------------------------------------------------------- |
810 //---------------------------------------------------------------------------------------------- |
742 namespace TestNewStyleFragment_4 |
811 namespace Fragment_3 |
743 { |
812 { |
744 const TInt srcAddr = 32 * KKilo; |
813 const TInt srcAddr = 32 * KKilo; |
745 const TInt desAddr = 64 * KKilo; |
814 const TInt desAddr = 64 * KKilo; |
746 const TInt transferSize = 1; |
815 const TInt transferSize = 1; |
747 |
816 |
748 TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr); |
817 TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr); |
749 const TRequestResults requestResult(KErrNone, 1); |
818 const TRequestResults requestResult(KErrNone, 1); |
750 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
819 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
751 |
820 |
752 CSingleTransferTest testscenario_4(_L("TestNewStyleFragment - Test Scenario 4"), 1, transferArgs, expectedResults); |
821 CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("Fragment - Scenario 4"), 1, transferArgs, expectedResults)); |
753 |
822 |
754 TTestCase testCase(&testscenario_4, EFalse, capAboveV1); |
823 TTestCase testCase(&multiVersion, EFalse); |
755 TTestCase testCaseConcurrent(&testscenario_4, ETrue, capAboveV1); |
824 TTestCase testCaseConcurrent(&multiVersion, ETrue); |
756 } |
825 } |
757 |
826 |
758 //---------------------------------------------------------------------------------------------- |
827 //---------------------------------------------------------------------------------------------- |
759 //! @SYMTestCaseID KBASE-DMA-2560 |
828 //! TestCaseID KBASE-DMA-2560 |
760 //! @SYMTestType CIT |
829 //! TestCaseID KBASE-DMA-2561 |
761 //! @SYMPREQ REQ |
830 //! TestType CIT |
762 //! @SYMTestCaseDesc TestNewStyleFragment using CSingleTransferTest |
831 //! PREQ REQ |
832 //! TestCaseDesc Test new & old style fragment using CSingleTransferTest |
|
763 //! Test Scenario 5 - TransferSize=128KB |
833 //! Test Scenario 5 - TransferSize=128KB |
764 //! |
834 //! |
765 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
835 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
766 //! |
836 //! |
767 //! SrcAddr = 16K; |
837 //! SrcAddr = 16K; |
770 //! iFlags = KDmaMemAddr; |
840 //! iFlags = KDmaMemAddr; |
771 //! |
841 //! |
772 //! 2. Setup expected result. |
842 //! 2. Setup expected result. |
773 //! 3. Create single transfer test and run test |
843 //! 3. Create single transfer test and run test |
774 //! |
844 //! |
775 //! @SYMTestExpectedResults |
845 //! TestExpectedResults |
776 //! |
846 //! |
777 //! 1. TransfeArgs set up in DMA framework |
847 //! 1. TransfeArgs set up in DMA framework |
778 //! 2. Expected results set up in DMA framework |
848 //! 2. Expected results set up in DMA framework |
779 //! 3. Fragment request completes and KErrNone returned |
849 //! 3. Fragment request completes and KErrNone returned |
780 //! |
850 //! |
781 //! @SYMTestPriority High |
851 //! TestPriority High |
782 //! @SYMTestStatus Implemented |
852 //! TestStatus Implemented |
783 //---------------------------------------------------------------------------------------------- |
853 //---------------------------------------------------------------------------------------------- |
784 namespace TestNewStyleFragment_5 |
854 namespace Fragment_4 |
785 { |
855 { |
786 |
|
787 const TInt srcAddr = 16 * KKilo; |
856 const TInt srcAddr = 16 * KKilo; |
788 const TInt desAddr = 2 * KMega; |
857 const TInt desAddr = 2 * KMega; |
789 const TInt transferSize = 1 * KMega; |
858 const TInt transferSize = 1 * KMega; |
790 |
859 |
791 TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr); |
860 TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr); |
792 const TRequestResults requestResult(KErrNone); |
861 const TRequestResults requestResult(KErrNone); |
793 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
862 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
794 |
863 |
795 CSingleTransferTest testscenario_5(_L("TestNewStyleFragment - Test Scenario 5"), 1, transferArgs, expectedResults); |
864 CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("Fragment - Scenario 5"), 1, transferArgs, expectedResults)); |
796 |
865 |
797 TTestCase testCase(&testscenario_5, EFalse, capAboveV1); |
866 TTestCase testCase(&multiVersion, EFalse); |
798 TTestCase testCaseConcurrent(&testscenario_5, ETrue, capAboveV1); |
867 TTestCase testCaseConcurrent(&multiVersion, ETrue); |
799 } |
868 } |
800 |
869 |
801 //---------------------------------------------------------------------------------------------- |
870 //---------------------------------------------------------------------------------------------- |
802 //! @SYMTestCaseID KBASE-DMA-2560 |
871 //! TestCaseID KBASE-DMA-2560 |
803 //! @SYMTestType CIT |
872 //! TestCaseID KBASE-DMA-2561 |
804 //! @SYMPREQ REQ |
873 //! TestType CIT |
805 //! @SYMTestCaseDesc TestNewStyleFragment using CSingleTransferTest |
874 //! PREQ REQ |
875 //! TestCaseDesc Test new & old style fragment using CSingleTransferTest |
|
806 //! Test Scenario 6 - TransferSize=3MB |
876 //! Test Scenario 6 - TransferSize=3MB |
807 //! |
877 //! |
808 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
878 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
809 //! |
879 //! |
810 //! SrcAddr = 16K; |
880 //! SrcAddr = 16K; |
813 //! iFlags = KDmaMemAddr; |
883 //! iFlags = KDmaMemAddr; |
814 //! |
884 //! |
815 //! 2. Setup expected result. |
885 //! 2. Setup expected result. |
816 //! 3. Create single transfer test and run test |
886 //! 3. Create single transfer test and run test |
817 //! |
887 //! |
818 //! @SYMTestExpectedResults |
888 //! TestExpectedResults |
819 //! |
889 //! |
820 //! 1. TransfeArgs set up in DMA framework |
890 //! 1. TransfeArgs set up in DMA framework |
821 //! 2. Expected results set up in DMA framework |
891 //! 2. Expected results set up in DMA framework |
822 //! 3. Fragment request completes and KErrNone returned |
892 //! 3. Fragment request completes and KErrNone returned |
823 //! |
893 //! |
824 //! @SYMTestPriority High |
894 //! TestPriority High |
825 //! @SYMTestStatus Implemented |
895 //! TestStatus Implemented |
826 //---------------------------------------------------------------------------------------------- |
896 //---------------------------------------------------------------------------------------------- |
827 namespace TestNewStyleFragment_6 |
897 namespace Fragment_5 |
828 { |
898 { |
829 const TInt srcAddr = 16 * KKilo; |
899 const TInt srcAddr = 16 * KKilo; |
830 const TInt desAddr = 4 * KMega; |
900 const TInt desAddr = 4 * KMega; |
831 const TInt transferSize = 3 * KMega; |
901 const TInt transferSize = 3 * KMega; |
832 |
902 |
833 TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr); |
903 TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr); |
834 const TRequestResults requestResult(KErrNone); |
904 const TRequestResults requestResult(KErrNone); |
835 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
905 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
836 |
906 |
837 CSingleTransferTest testscenario_6(_L("TestNewStyleFragment - Test Scenario 6"), 1, transferArgs, expectedResults); |
907 CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("Fragment - Scenario 6"), 1, transferArgs, expectedResults)); |
838 |
908 |
839 TTestCase testCase(&testscenario_6, EFalse, capAboveV1); |
909 TTestCase testCase(&multiVersion, EFalse); |
840 TTestCase testCaseConcurrent(&testscenario_6, ETrue, capAboveV1); |
910 TTestCase testCaseConcurrent(&multiVersion, ETrue); |
841 } |
911 } |
842 |
912 |
843 //---------------------------------------------------------------------------------------------- |
913 |
844 //! @SYMTestCaseID KBASE-DMA-2561 |
914 //---------------------------------------------------------------------------------------------- |
845 //! @SYMTestType CIT |
915 //! TestCaseID KBASE-DMA-2562 |
846 //! @SYMPREQ REQ |
916 //! TestCaseID KBASE-DMA-2563 |
847 //! @SYMTestCaseDesc TestOldstyleFragment using CSingleTransferTest |
917 //! TestType CIT |
848 //! Test Scenario 1 - DstAddr > SrcAddr & TransferSize=32K & Location is |
918 //! PREQ REQ |
849 //! address of a memory buffer |
919 //! TestCaseDesc Test new and old style DDmaRequest using CSingleTransferTest |
850 //! |
920 //! Test Scenario 1 - aMaxTransferSize=0 |
851 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
921 //! |
852 //! |
922 //! 1. Set up the DDmaRequest using aMaxTransferSize set to 0. |
853 //! SrcAddr = 4 * KKilo; |
|
854 //! desAddr = 64 * KKilo; |
|
855 //! transferSize = 32 * KKilo; |
|
856 //! iFlags = KDmaMemAddr; |
|
857 |
|
858 //! 2. Setup expected result. |
923 //! 2. Setup expected result. |
859 //! 3. Create single transfer test and run test |
924 //! 3. Create single transfer test and run test |
860 //! |
925 //! |
861 //! @SYMTestExpectedResults |
926 //! TestExpectedResults |
862 //! |
927 //! |
863 //! 1. TransfeArgs set up in DMA framework |
928 //! 1. TransfeArgs set up in DMA framework |
864 //! 2. Expected results set up in DMA framework |
929 //! 2. Expected results set up in DMA framework |
865 //! 3. Fragment request completes and KErrNone returned |
930 //! 3. DDmaRequest constructor behaves as expected and KErrArgument returned |
866 //! |
931 //! |
867 //! @SYMTestPriority High |
932 //! TestPriority High |
868 //! @SYMTestStatus Implemented |
933 //! TestStatus Implemented |
869 //---------------------------------------------------------------------------------------------- |
|
870 namespace TestOldStyleFragment_1 |
|
871 { |
|
872 const TInt srcAddr = 4 * KKilo; |
|
873 const TInt desAddr = 64 * KKilo; |
|
874 const TInt transferSize = 32 * KKilo; |
|
875 |
|
876 TDmaTransferArgs transferArgs( srcAddr, desAddr, transferSize, KDmaMemAddr); |
|
877 |
|
878 const TRequestResults requestResult(KErrNone,32); |
|
879 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
|
880 |
|
881 CSingleTransferTest testscenario_1 = CSingleTransferTest(_L("TestOldStyleFragment - Test Scenario 1"), 1, transferArgs, expectedResults,KKilo). |
|
882 UseNewDmaApi(EFalse); |
|
883 |
|
884 TTestCase testCase(&testscenario_1, EFalse, capAboveV1); |
|
885 TTestCase testCaseConcurrent(&testscenario_1, ETrue, capAboveV1); |
|
886 } |
|
887 |
|
888 //---------------------------------------------------------------------------------------------- |
|
889 //! @SYMTestCaseID KBASE-DMA-2561 |
|
890 //! @SYMTestType CIT |
|
891 //! @SYMPREQ REQ |
|
892 //! @SYMTestCaseDesc TestOldstyleFragment using CSingleTransferTest |
|
893 //! Test Scenario 2 - DstAddr == SrcAddr |
|
894 //! |
|
895 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
|
896 //! |
|
897 //! SrcAddr = 4 * KKilo; |
|
898 //! desAddr = 4 * KKilo; |
|
899 //! transferSize = 4 * KKilo |
|
900 //! iFlags = KDmaMemAddr; |
|
901 //! |
|
902 //! 2. Setup expected result. |
|
903 //! 3. Create single transfer test and run test |
|
904 //! |
|
905 //! @SYMTestExpectedResults |
|
906 //! |
|
907 //! 1. TransfeArgs set up in DMA framework |
|
908 //! 2. Expected results set up in DMA framework |
|
909 //! 3. Fragment passes and KErrNone returned |
|
910 //! |
|
911 //! @SYMTestPriority High |
|
912 //! @SYMTestStatus Implemented |
|
913 //---------------------------------------------------------------------------------------------- |
|
914 namespace TestOldStyleFragment_2 |
|
915 { |
|
916 const TInt srcAddr = 4 * KKilo; |
|
917 const TInt desAddr = 4 * KKilo; |
|
918 const TInt transferSize = 4 * KKilo; |
|
919 |
|
920 TDmaTransferArgs transferArgs(srcAddr,desAddr, transferSize, KDmaMemAddr); |
|
921 const TRequestResults requestResult(KErrNone, 4); |
|
922 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
|
923 |
|
924 CSingleTransferTest testscenario_2 = CSingleTransferTest(_L("TestOldStyleFragment - Test Scenario 2"), 1, transferArgs, expectedResults,KKilo) |
|
925 .UseNewDmaApi(EFalse); |
|
926 |
|
927 TTestCase testCase(&testscenario_2, EFalse, capAboveV1); |
|
928 TTestCase testCaseConcurrent(&testscenario_2, ETrue, capAboveV1); |
|
929 } |
|
930 |
|
931 //---------------------------------------------------------------------------------------------- |
|
932 //! @SYMTestCaseID KBASE-DMA-2561 |
|
933 //! @SYMTestType CIT |
|
934 //! @SYMPREQ REQ |
|
935 //! @SYMTestCaseDesc TestOldstyleFragment using CSingleTransferTest |
|
936 //! Test Scenario 3 - TransferSize=0 |
|
937 //! |
|
938 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
|
939 //! |
|
940 //! SrcAddr = 32K |
|
941 //! desAddr = 64K; |
|
942 //! transferSize = 0 |
|
943 //! iFlags = KDmaMemAddr; |
|
944 //! |
|
945 //! 2. Setup expected result. |
|
946 //! 3. Create single transfer test and run test |
|
947 //! |
|
948 //! @SYMTestExpectedResults |
|
949 //! |
|
950 //! 1. TransfeArgs set up in DMA framework |
|
951 //! 2. Expected results set up in DMA framework |
|
952 //! 3. Fragment request Fails and KErrArgument returned |
|
953 //! |
|
954 //! @SYMTestPriority High |
|
955 //! @SYMTestStatus Implemented |
|
956 //---------------------------------------------------------------------------------------------- |
|
957 namespace TestOldStyleFragment_3 |
|
958 { |
|
959 |
|
960 const TInt srcAddr = 32 * KKilo; |
|
961 const TInt desAddr = 64 * KKilo; |
|
962 const TInt transferSize = 0; |
|
963 |
|
964 TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize,KDmaMemAddr); |
|
965 const TRequestResults requestResult(KErrArgument, 0); |
|
966 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
|
967 |
|
968 CSingleTransferTest testscenario_3 = CSingleTransferTest(_L("TestOldStyleFragment - Test Scenario 3"), 1, transferArgs, expectedResults). |
|
969 UseNewDmaApi(EFalse); |
|
970 |
|
971 TTestCase testCase(&testscenario_3, EFalse, capAboveV1); |
|
972 TTestCase testCaseConcurrent(&testscenario_3, ETrue, capAboveV1); |
|
973 } |
|
974 |
|
975 //---------------------------------------------------------------------------------------------- |
|
976 //! @SYMTestCaseID KBASE-DMA-2561 |
|
977 //! @SYMTestType CIT |
|
978 //! @SYMPREQ REQ |
|
979 //! @SYMTestCaseDesc TestOldstyleFragment using CSingleTransferTest |
|
980 //! Test Scenario 4 - TransferSize=1Byte |
|
981 //! |
|
982 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
|
983 //! |
|
984 //! |
|
985 //! SrcAddr = 32K; |
|
986 //! desAddr = 64K; |
|
987 //! transferSize = 1 byte |
|
988 //! iFlags = KDmaMemAddr; |
|
989 //! |
|
990 //! 2. Setup expected result. |
|
991 //! 3. Create single transfer test and run test |
|
992 //! |
|
993 //! @SYMTestExpectedResults |
|
994 //! |
|
995 //! 1. TransfeArgs set up in DMA framework |
|
996 //! 2. Expected results set up in DMA framework |
|
997 //! 3. Fragment request completes and KErrNone returned |
|
998 //! |
|
999 //! @SYMTestPriority High |
|
1000 //! @SYMTestStatus Implemented |
|
1001 //------------------------------------------------------------------------------------------------ |
934 //------------------------------------------------------------------------------------------------ |
1002 namespace TestOldStyleFragment_4 |
935 namespace DDmaRequest_1 |
1003 { |
|
1004 const TInt srcAddr = 32 * KKilo; |
|
1005 const TInt desAddr = 64 * KKilo; |
|
1006 const TInt transferSize = 1; |
|
1007 |
|
1008 TDmaTransferArgs transferArgs( srcAddr, desAddr, transferSize, KDmaMemAddr); |
|
1009 const TRequestResults requestResult(KErrNone, 1); |
|
1010 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
|
1011 |
|
1012 CSingleTransferTest testscenario_4 = CSingleTransferTest(_L("TestOldStyleFragment - Test Scenario 4"), 1, transferArgs, expectedResults). |
|
1013 UseNewDmaApi(EFalse); |
|
1014 |
|
1015 TTestCase testCase(&testscenario_4, EFalse, capAboveV1); |
|
1016 TTestCase testCaseConcurrent(&testscenario_4, ETrue, capAboveV1); |
|
1017 } |
|
1018 |
|
1019 //---------------------------------------------------------------------------------------------- |
|
1020 //! @SYMTestCaseID KBASE-DMA-2561 |
|
1021 //! @SYMTestType CIT |
|
1022 //! @SYMPREQ REQ |
|
1023 //! @SYMTestCaseDesc TestOldstyleFragment using CSingleTransferTest |
|
1024 //! Test Scenario 5 - TransferSize=1MB |
|
1025 //! |
|
1026 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
|
1027 //! |
|
1028 //! SrcAddr = 16K; |
|
1029 //! desAddr = 2MB; |
|
1030 //! transferSize = 1MB |
|
1031 //! iFlags = KDmaMemAddr; |
|
1032 //! |
|
1033 //! 2. Setup expected result. |
|
1034 //! 3. Create single transfer test and run test |
|
1035 //! |
|
1036 //! @SYMTestExpectedResults |
|
1037 //! |
|
1038 //! 1. TransfeArgs set up in DMA framework |
|
1039 //! 2. Expected results set up in DMA framework |
|
1040 //! 3. Fragment request completes and KErrNone returned |
|
1041 //! |
|
1042 //! @SYMTestPriority High |
|
1043 //! @SYMTestStatus Implemented |
|
1044 //---------------------------------------------------------------------------------------------- |
|
1045 namespace TestOldStyleFragment_5 |
|
1046 { |
|
1047 const TInt srcAddr = 16 * KKilo; |
|
1048 const TInt desAddr = 2 * KMega; |
|
1049 const TInt transferSize = 1 * KMega; |
|
1050 |
|
1051 TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr); |
|
1052 |
|
1053 const TRequestResults requestResult(KErrNone); |
|
1054 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
|
1055 |
|
1056 CSingleTransferTest testscenario_5 = CSingleTransferTest(_L("TestOldStyleFragment - Test Scenario 5"), 1, transferArgs, expectedResults). |
|
1057 UseNewDmaApi(EFalse); |
|
1058 |
|
1059 TTestCase testCase(&testscenario_5, EFalse, capAboveV1); |
|
1060 TTestCase testCaseConcurrent(&testscenario_5, ETrue, capAboveV1); |
|
1061 } |
|
1062 |
|
1063 //---------------------------------------------------------------------------------------------- |
|
1064 //! @SYMTestCaseID KBASE-DMA-2561 |
|
1065 //! @SYMTestType CIT |
|
1066 //! @SYMPREQ REQ |
|
1067 //! @SYMTestCaseDesc TestOldstyleFragment using CSingleTransferTest |
|
1068 //! Test Scenario 6 - TransferSize=3MB |
|
1069 //! |
|
1070 //! 1. Set up the arguments for aTransfeArgs using the settings below. |
|
1071 //! |
|
1072 //! SrcAddr = 16K |
|
1073 //! desAddr = 4MB; |
|
1074 //! transferSize = 3MB |
|
1075 //! iFlags = KDmaMemAddr; |
|
1076 //! |
|
1077 //! 2. Setup expected result. |
|
1078 //! 3. Create single transfer test and run test |
|
1079 //! |
|
1080 //! @SYMTestExpectedResults |
|
1081 //! |
|
1082 //! 1. TransfeArgs set up in DMA framework |
|
1083 //! 2. Expected results set up in DMA framework |
|
1084 //! 3. Fragment request completes and KErrNone returned |
|
1085 //! |
|
1086 //! @SYMTestPriority High |
|
1087 //! @SYMTestStatus Implemented |
|
1088 //---------------------------------------------------------------------------------------------- |
|
1089 namespace TestOldStyleFragment_6 |
|
1090 { |
|
1091 const TInt srcAddr = 16 * KKilo; |
|
1092 const TInt desAddr = 4 * KMega; |
|
1093 const TInt transferSize = 3 * KMega; |
|
1094 TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr); |
|
1095 |
|
1096 const TRequestResults requestResult(KErrNone); |
|
1097 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
|
1098 |
|
1099 CSingleTransferTest testscenario_6 = CSingleTransferTest(_L("TestOldStyleFragment - Test Scenario 6"), 1, transferArgs, expectedResults). |
|
1100 UseNewDmaApi(EFalse); |
|
1101 |
|
1102 TTestCase testCase(&testscenario_6, EFalse, capAboveV1); |
|
1103 TTestCase testCaseConcurrent(&testscenario_6, ETrue, capAboveV1); |
|
1104 } |
|
1105 |
|
1106 //---------------------------------------------------------------------------------------------- |
|
1107 //! @SYMTestCaseID KBASE-DMA-2562 |
|
1108 //! @SYMTestType CIT |
|
1109 //! @SYMPREQ REQ |
|
1110 //! @SYMTestCaseDesc TestOldStyleDDmaRequest using CSingleTransferTest |
|
1111 //! Test Scenario 1 - aMaxTransferSize=0 |
|
1112 //! |
|
1113 //! 1. Set up the DDmaRequest using aMaxTransferSize set to 0. |
|
1114 //! 2. Setup expected result. |
|
1115 //! 3. Create single transfer test and run test |
|
1116 //! |
|
1117 //! @SYMTestExpectedResults |
|
1118 //! |
|
1119 //! 1. TransfeArgs set up in DMA framework |
|
1120 //! 2. Expected results set up in DMA framework |
|
1121 //! 3. DDmaRequest constructor behaves as expected and KErrArgument returned |
|
1122 //! |
|
1123 //! @SYMTestPriority High |
|
1124 //! @SYMTestStatus Implemented |
|
1125 //------------------------------------------------------------------------------------------------ |
|
1126 namespace TestOldStyleDDmaRequest_1 |
|
1127 { |
936 { |
1128 const TInt desAddr = 4 * KKilo; |
937 const TInt desAddr = 4 * KKilo; |
1129 const TInt transferSize = 4 * KKilo; |
938 const TInt transferSize = 4 * KKilo; |
1130 TDmaTransferArgs transferArgs(0, desAddr, transferSize, KDmaMemAddr); |
939 TDmaTransferArgs transferArgs(0, desAddr, transferSize, KDmaMemAddr); |
1131 |
940 |
1132 const TRequestResults requestResult(KErrNone, 0); |
941 const TRequestResults requestResult(KErrNone, 0); |
1133 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
942 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
1134 |
943 |
1135 CSingleTransferTest testscenario_1 = CSingleTransferTest(_L("TestOldStyleDDmaRequest - Test Scenario 1"), 1, transferArgs, expectedResults,0). |
944 CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("DDmaRequest - Scenario 1"), 1, transferArgs, expectedResults,0)); |
1136 UseNewDmaApi(EFalse); |
945 |
1137 |
946 TTestCase testCase(&multiVersion, EFalse); |
1138 TTestCase testCase(&testscenario_1, EFalse, capAboveV1); |
947 TTestCase testCaseConcurrent(&multiVersion, ETrue); |
1139 TTestCase testCaseConcurrent(&testscenario_1, ETrue, capAboveV1); |
|
1140 } |
948 } |
1141 |
949 |
1142 //!------------------------------------------------------------------------------------------------- |
950 //!------------------------------------------------------------------------------------------------- |
1143 //! @SYMTestCaseID KBASE-DMA-2562 |
951 //! TestCaseID KBASE-DMA-2562 |
1144 //! @SYMTestType CIT |
952 //! TestCaseID KBASE-DMA-2563 |
1145 //! @SYMPREQ REQ |
953 //! TestType CIT |
1146 //! @SYMTestCaseDesc TestOldStyleDDmaRequest using CSingleTransferTest |
954 //! PREQ REQ |
1147 //! Test Scenario 2 - aMaxTransferSize= 65535 |
955 //! TestCaseDesc Test new and old style DDmaRequest using CSingleTransferTest |
1148 //! |
956 //! Test Scenario 2 - aMaxTransferSize= (64K - 1) // 65535 |
1149 //! 1. Set up the arguments for DDmaRequest using aMaxTransferSize set to 65535. |
957 //! |
958 //! 1. Set up the arguments for DDmaRequest using aMaxTransferSize set to (64K - 1). |
|
1150 //! 2. Setup expected result. |
959 //! 2. Setup expected result. |
1151 //! 3. Create single transfer test and run test |
960 //! 3. Create single transfer test and run test |
1152 //! |
961 //! |
1153 //! @SYMTestExpectedResults |
962 //! TestExpectedResults |
1154 //! |
963 //! |
1155 //! 1. TransfeArgs set up in DMA framework |
964 //! 1. TransfeArgs set up in DMA framework |
1156 //! 2. Expected results set up in DMA framework |
965 //! 2. Expected results set up in DMA framework |
1157 //! 3. DDmaRequest constructor behaves as expected and KErrArgument returned |
966 //! 3. DDmaRequest constructor behaves as expected and KErrArgument returned |
1158 //! |
967 //! |
1159 //! @SYMTestPriority High |
968 //! TestPriority High |
1160 //! @SYMTestStatus Implemented |
969 //! TestStatus Implemented |
1161 //--------------------------------------------------------------------------------------------------- |
970 //--------------------------------------------------------------------------------------------------- |
1162 namespace TestOldStyleDDmaRequest_2 |
971 namespace DDmaRequest_2 |
1163 { |
972 { |
1164 const TInt desAddr = 4 * KKilo; |
973 const TInt desAddr = 4 * KKilo; |
1165 const TInt transferSize = 4 * KKilo; |
974 const TInt transferSize = 4 * KKilo; |
1166 TDmaTransferArgs transferArgs(0, desAddr, transferSize, KDmaMemAddr); |
975 TDmaTransferArgs transferArgs(0, desAddr, transferSize, KDmaMemAddr); |
1167 |
976 |
1168 const TRequestResults requestResult(KErrNone, 1); |
977 const TRequestResults requestResult(KErrNone, 1); |
1169 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
978 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
1170 |
979 |
1171 CSingleTransferTest testscenario_2 = CSingleTransferTest(_L("TestOldStyleDDmaRequest - Test Scenario 2"), 1, transferArgs, expectedResults, 65535). |
980 CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("DDmaRequest - Scenario 2"), 1, transferArgs, expectedResults, trans64K_1)); |
1172 UseNewDmaApi(EFalse); |
981 |
1173 |
982 TTestCase testCase(&multiVersion, EFalse); |
1174 TTestCase testCase(&testscenario_2, EFalse, capAboveV1); |
983 TTestCase testCaseConcurrent(&multiVersion, ETrue); |
1175 TTestCase testCaseConcurrent(&testscenario_2, ETrue, capAboveV1); |
984 } |
1176 } |
985 |
1177 |
986 //---------------------------------------------------------------------------------------------- |
1178 //---------------------------------------------------------------------------------------------- |
987 //! TestCaseID KBASE-DMA-2585 |
1179 //! @SYMTestCaseID KBASE-DMA-2563 |
988 //! TestType CIT |
1180 //! @SYMTestType CIT |
989 //! PREQ REQ |
1181 //! @SYMPREQ REQ |
990 //! TestCaseDesc SmallFrags: This test provokes the failure seen in DEF140598 |
1182 //! @SYMTestCaseDesc TestNewStyleDDmaRequest using CSingleTransferTest |
|
1183 //! Test Scenario 1 - aMaxTransferSize=0 |
|
1184 //! |
|
1185 //! 1. Set up the DDmaRequest using aMaxTransferSize set to 0. |
|
1186 //! 2. Setup expected result. |
|
1187 //! 3. Create single transfer test and run test |
|
1188 //! |
|
1189 //! @SYMTestExpectedResults |
|
1190 //! |
|
1191 //! 1. TransfeArgs set up in DMA framework |
|
1192 //! 2. Expected results set up in DMA framework |
|
1193 //! 3. DDmaRequest constructor behaves as expected and KErrArgument returned |
|
1194 //! |
|
1195 //! @SYMTestPriority High |
|
1196 //! @SYMTestStatus Implemented |
|
1197 //---------------------------------------------------------------------------------------------- |
|
1198 namespace TestNewStyleDDmaRequest_1 |
|
1199 { |
|
1200 const TInt desAddr = 4 * KKilo; |
|
1201 const TInt transferSize = 4 * KKilo; |
|
1202 TDmaTransferArgs transferArgs(0, desAddr, transferSize, KDmaMemAddr); |
|
1203 |
|
1204 const TRequestResults requestResult(KErrNone, 0); |
|
1205 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
|
1206 |
|
1207 CSingleTransferTest testscenario_1(_L("TestNewStyleDDmaRequest - Test Scenario 1"), 1, transferArgs, expectedResults,0); |
|
1208 |
|
1209 TTestCase testCase(&testscenario_1, EFalse, capAboveV1); |
|
1210 TTestCase testCaseConcurrent(&testscenario_1, ETrue, capAboveV1); |
|
1211 } |
|
1212 |
|
1213 //!------------------------------------------------------------------------------------------------- |
|
1214 //! @SYMTestCaseID KBASE-DMA-2563 |
|
1215 //! @SYMTestType CIT |
|
1216 //! @SYMPREQ REQ |
|
1217 //! @SYMTestCaseDesc TestNewStyleDDmaRequest using CSingleTransferTest |
|
1218 //! Test Scenario 2 - aMaxTransferSize= 65535 |
|
1219 //! |
|
1220 //! 1. Set up the arguments for DDmaRequest using aMaxTransferSize set to 65535. |
|
1221 //! 2. Setup expected result. |
|
1222 //! 3. Create single transfer test and run test |
|
1223 //! |
|
1224 //! @SYMTestExpectedResults |
|
1225 //! |
|
1226 //! 1. TransfeArgs set up in DMA framework |
|
1227 //! 2. Expected results set up in DMA framework |
|
1228 //! 3. DDmaRequest constructor behaves as expected and KErrArgument returned |
|
1229 //! |
|
1230 //! @SYMTestPriority High |
|
1231 //! @SYMTestStatus Implemented |
|
1232 //--------------------------------------------------------------------------------------------------- |
|
1233 namespace TestNewStyleDDmaRequest_2 |
|
1234 { |
|
1235 const TInt desAddr = 4 * KKilo; |
|
1236 const TInt transferSize = 4 * KKilo; |
|
1237 TDmaTransferArgs transferArgs(0, desAddr, transferSize, KDmaMemAddr); |
|
1238 |
|
1239 const TRequestResults requestResult(KErrNone, 1); |
|
1240 const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback); |
|
1241 |
|
1242 CSingleTransferTest testscenario_2(_L("TestNewStyleDDmaRequest - Test Scenario 2"), 1, transferArgs, expectedResults, 65535); |
|
1243 |
|
1244 TTestCase testCase(&testscenario_2, EFalse, capAboveV1); |
|
1245 TTestCase testCaseConcurrent(&testscenario_2, ETrue, capAboveV1); |
|
1246 } |
|
1247 |
|
1248 //---------------------------------------------------------------------------------------------- |
|
1249 //! @SYMTestCaseID PBASE-DMA-FUNC-xxx |
|
1250 //! @SYMTestType CIT |
|
1251 //! @SYMPREQ REQ |
|
1252 //! @SYMTestCaseDesc SmallFrags: This test provokes the failure seen in DEF140598 |
|
1253 //! The test checks that requests with small fragments |
991 //! The test checks that requests with small fragments |
1254 //! do not trigger a spurious missed interrupt clean up |
992 //! do not trigger a spurious missed interrupt clean up |
1255 //! |
993 //! |
1256 //! @SYMTestExpectedResults |
994 //! TestActions |
1257 //! |
995 //! 1. Open a DMA channel for a transfer. |
1258 //! 1. |
996 //! 2. Create single transfer test using small frags and run test |
1259 //! 2. |
997 //! |
1260 //! |
998 //! TestExpectedResults |
1261 //! @SYMTestPriority High |
999 //! 1. DMA channel opens and KErrNone returned. |
1262 //! @SYMTestStatus Implemented |
1000 //! 2. DMA transfer completes with no errors. |
1001 //! |
|
1002 //! TestPriority High |
|
1003 //! TestStatus Implemented |
|
1263 //---------------------------------------------------------------------------------------------- |
1004 //---------------------------------------------------------------------------------------------- |
1264 namespace SmallFrags |
1005 namespace SmallFrags |
1265 { |
1006 { |
1266 const TInt size = 32; |
1007 const TInt size = 32; |
1267 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
1008 TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr); |
1268 |
1009 |
1269 const TResultSet expectedResults(threadCallback); |
1010 const TResultSet expectedResults(threadCallback); |
1270 |
1011 |
1271 TTestCase testCase( |
1012 TTestCase testCase( |
1272 new (ELeave) CSingleTransferTest(_L("8 * 4byte frags"), 10, transferArgs, expectedResults, 4), |
1013 new (ELeave) CMultiVersionTest(new (ELeave) CSingleTransferTest(_L("8 * 4byte frags"), 10, transferArgs, expectedResults, 4)), |
1273 EFalse, capAboveV1); |
1014 EFalse); |
1274 } |
1015 } |
1275 |
1016 |
1276 |
1017 //---------------------------------------------------------------------------------------------- |
1277 //TODO TTestCase could automatically be added to aray by ctor |
1018 //! TestCaseID KBASE-DMA-2568 |
1278 // |
1019 //! TestType CIT |
1020 //! PREQ REQ |
|
1021 //! TestCaseDesc This test checks the correct behaviour of Close API in the new DMA framework |
|
1022 //! |
|
1023 //! TestActions |
|
1024 //! 1. Open a DMA channel |
|
1025 //! 2. Open DMA Channel again |
|
1026 //! 3 Close the DMA channel. |
|
1027 //! 4 Open DMA channel to verify that the DMA channel closed. |
|
1028 //! |
|
1029 //! TestExpectedResults |
|
1030 //! 1. DMA channel opens and KErrNone returned. |
|
1031 //! 2. DMA Framework returns KErrInUse as channel is already open. |
|
1032 //! 3. DMA channel closes and KErrNone returned. |
|
1033 //! 4. DMA channel opens and KErrNone returned. |
|
1034 //! |
|
1035 //! |
|
1036 //! TestPriority High |
|
1037 //! TestStatus Implemented |
|
1038 //---------------------------------------------------------------------------------------------- |
|
1039 namespace CloseApiTest |
|
1040 { |
|
1041 COpenCloseTest testCloseApi = COpenCloseTest(_L("Close API Test"), 1).RunOpenApiTest(EFalse); |
|
1042 TTestCase testCaseCloseApi(&testCloseApi, EFalse, capAboveV1); |
|
1043 } |
|
1044 |
|
1045 //---------------------------------------------------------------------------------------------- |
|
1046 //! TestCaseID KBASE-DMA-2564 |
|
1047 //! TestType CIT |
|
1048 //! PREQ REQ |
|
1049 //! TestCaseDesc This test checks the correct behaviour of Open API in the new DMA framework |
|
1050 //! |
|
1051 //! TestActions |
|
1052 //! 1. Open a DMA channel |
|
1053 //! 2. Verify that channel is really open by closing DMA channel |
|
1054 //! |
|
1055 //! TestExpectedResults |
|
1056 //! 1. DMA channel opens and KErrNone returned |
|
1057 //! 2. DMA channel closes again returns KErrNone. |
|
1058 //! |
|
1059 //! TestPriority High |
|
1060 //! TestStatus Implemented |
|
1061 //---------------------------------------------------------------------------------------------- |
|
1062 namespace OpenApiTest |
|
1063 { |
|
1064 COpenCloseTest testOpenApi = COpenCloseTest(_L("Open API Test"), 1).RunOpenApiTest(ETrue); |
|
1065 TTestCase testCaseOpenApi(&testOpenApi, EFalse, capAboveV1); |
|
1066 } |
|
1067 |
|
1068 //---------------------------------------------------------------------------------------------- |
|
1069 //! TestCaseID KBASE-DMA-2567 |
|
1070 //! TestType CIT |
|
1071 //! PREQ REQ |
|
1072 //! TestCaseDesc This test verifies the correct behavior of TBool IsQueueEmpty() in the new DMA |
|
1073 //! framework and check its return value |
|
1074 //! |
|
1075 //! TestActions |
|
1076 //! 1. Open a single DMA channel for a transfer. |
|
1077 //! 2. Setup a DMA request and Fragment the request. |
|
1078 //! 3. Call IsQueueEmpty(). |
|
1079 //! 4. Queue the DMA request. |
|
1080 //! 5. Call IsQueueEmpty(). |
|
1081 //! TestExpectedResults |
|
1082 //! 1. DMA channel opens and KErrNone returned. |
|
1083 //! 2. DMA request created and fragmented and KErrNone returned. |
|
1084 //! 3. IsQueueEmpty() returns ETrue. |
|
1085 //! 4. Request queued and KErrNone returned |
|
1086 //! 5. IsQueueEmpty() returns EFalse. |
|
1087 //! |
|
1088 //! TestPriority High |
|
1089 //! TestStatus Implemented |
|
1090 //---------------------------------------------------------------------------------------------- |
|
1091 namespace IsQueueEmptyTest |
|
1092 { |
|
1093 const TInt size = 2 * KMega; |
|
1094 const TDmaTransferArgs transferArgArray[] = { |
|
1095 TDmaTransferArgs(0, size, size, KDmaMemAddr), |
|
1096 TDmaTransferArgs(2 * size, 3 * size, size, KDmaMemAddr) |
|
1097 }; |
|
1098 |
|
1099 const TResultSet expected[] = |
|
1100 { |
|
1101 TResultSet(), |
|
1102 TResultSet() |
|
1103 }; |
|
1104 const TResultSet expectedResults(isrCallback); |
|
1105 |
|
1106 CIsQueueEmptyTest isQueueEmpty = |
|
1107 CIsQueueEmptyTest(_L("IsQueueEmptyTest using muliple frags"), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray)) |
|
1108 .SetPreTransferTest(&KPreTransferIncrBytes) |
|
1109 .SetPostTransferTest(&KCompareSrcDst); |
|
1110 |
|
1111 TTestCase testCase(&isQueueEmpty,EFalse,capAboveV1,pauseRequired_skip); |
|
1112 } |
|
1113 |
|
1114 |
|
1115 static TTestCase* StaticSimpleTestArray[] = { |
|
1116 &Simple_1::testCase, |
|
1117 &Simple_1::testCaseConcurrent, |
|
1118 }; |
|
1119 |
|
1120 static TTestCase* StaticCallbackTestArray[] = { |
|
1121 &Callback::testCase, |
|
1122 &Callback::testCaseOldRequest, |
|
1123 }; |
|
1124 |
|
1125 static TTestCase* StaticIsrRequeTestArray[] = { |
|
1126 &ISR_Reque::endOnRedo::testCase, |
|
1127 &ISR_Reque::endOnIsrCb::testCase, |
|
1128 &ISR_Reque::endOnThreadCb::testCase, |
|
1129 &ISR_Reque::changeSize::testCase, |
|
1130 #ifdef _DEBUG |
|
1131 &ISR_Reque::invalidAddresses::testCase, // addresses only checked in UDEB |
|
1132 #endif |
|
1133 #ifdef _REMOVEDTEST |
|
1134 // This test case is currently caught by a FAULT instead of a return code |
|
1135 // as expected. Currently, the facility to return an error code to the test |
|
1136 // framework is not yet supported. |
|
1137 &ISR_Reque::multipleFragments::testCase, |
|
1138 #endif |
|
1139 }; |
|
1140 |
|
1141 static TTestCase* StaticMultipartTestArray[] = { |
|
1142 &Multipart::testCase, |
|
1143 }; |
|
1144 |
|
1145 static TTestCase* StaticIsrAndDfcTestArray[] = { |
|
1146 &IsrAndDfc::DfcBeforeIsr::testCase, |
|
1147 &IsrAndDfc::IsrBeforeDfc::testCase, |
|
1148 }; |
|
1149 |
|
1150 static TTestCase* Static2DTestArray[] = { |
|
1151 &_2D_Test::testCase2d |
|
1152 }; |
|
1153 |
|
1154 static TTestCase* StaticFragmentTestArray[] = { |
|
1155 &FragmentationCount::testCase, |
|
1156 &FragmentationCount::testCase2, |
|
1157 &SmallFrags::testCase, |
|
1158 &Fragment_1::testCase, |
|
1159 &Fragment_1::testCaseConcurrent, |
|
1160 &Fragment_2::testCase, |
|
1161 &Fragment_2::testCaseConcurrent, |
|
1162 &Fragment_3::testCase, |
|
1163 &Fragment_3::testCaseConcurrent, |
|
1164 &Fragment_4::testCase, |
|
1165 &Fragment_4::testCaseConcurrent, |
|
1166 &Fragment_5::testCase, |
|
1167 &Fragment_5::testCaseConcurrent, |
|
1168 }; |
|
1169 |
|
1170 static TTestCase* StaticBenchmarkTestArray[] = { |
|
1171 // Benchmarks are only really meaningful |
|
1172 // on UREL builds |
|
1173 &Benchmark::Frag::testCase_256K, |
|
1174 &Benchmark::Frag::testCase_8K, |
|
1175 &Benchmark::Transfer::_128K::testCase_128, |
|
1176 &Benchmark::Transfer::_128K::testCase_16, |
|
1177 &Benchmark::Transfer::_128K::testCase_4, |
|
1178 &Benchmark::Transfer::_128K::testCase_1, |
|
1179 &Benchmark::Transfer::_4Bytes::testCase, |
|
1180 &Benchmark::Transfer::_4MB::testCase, |
|
1181 &Benchmark::CompareIsrDfcCb::Dfc::_4Bytes::testCase, |
|
1182 &Benchmark::CompareIsrDfcCb::Isr::_4Bytes::testCase, |
|
1183 &Benchmark::CompareIsrDfcCb::Dfc::_4K::testCase, |
|
1184 &Benchmark::CompareIsrDfcCb::Isr::_4K::testCase, |
|
1185 }; |
|
1186 |
|
1187 static TTestCase* StaticRequestTestArray[] = { |
|
1188 &DDmaRequest_1::testCase, |
|
1189 &DDmaRequest_1::testCaseConcurrent, |
|
1190 &DDmaRequest_2::testCase, |
|
1191 &DDmaRequest_2::testCaseConcurrent, |
|
1192 }; |
|
1193 |
|
1194 static TTestCase* StaticChannelTestArray[] = { |
|
1195 &CloseApiTest::testCaseCloseApi, |
|
1196 &OpenApiTest::testCaseOpenApi, |
|
1197 }; |
|
1198 |
|
1199 static TTestCase* StaticSuspendTestArray[] = { |
|
1200 &PauseResumeApiTest::testCasePauseResume, |
|
1201 }; |
|
1202 |
|
1203 static TTestCase* StaticQueueTestArray[] = { |
|
1204 &CancelAllTest::testCase, |
|
1205 &IsQueueEmptyTest::testCase, |
|
1206 }; |
|
1207 |
|
1279 //Append new test cases here |
1208 //Append new test cases here |
1280 static TTestCase* StaticTestArray[] = { |
1209 static TTestCase* StaticTestArray[] = { |
1281 &Simple_1::testCase, |
1210 &Simple_1::testCase, |
1282 &Simple_1::testCaseConcurrent, |
1211 &Simple_1::testCaseConcurrent, |
1283 &Simple_2::testCase, |
|
1284 &Simple_2::testCaseConcurrent, |
|
1285 &Callback::testCase, |
1212 &Callback::testCase, |
1286 &Callback::testCaseOldRequest, |
1213 &Callback::testCaseOldRequest, |
1287 &ISR_Reque::endOnRedo::testCase, |
1214 &ISR_Reque::endOnRedo::testCase, |
1288 &ISR_Reque::endOnIsrCb::testCase, |
1215 &ISR_Reque::endOnIsrCb::testCase, |
1289 &ISR_Reque::endOnThreadCb::testCase, |
1216 &ISR_Reque::endOnThreadCb::testCase, |
1290 &ISR_Reque::changeSize::testCase, |
1217 &ISR_Reque::changeSize::testCase, |
1291 #ifdef _DEBUG |
1218 #ifdef _DEBUG |
1292 &ISR_Reque::invalidAddresses::testCase, // addresses only checked in UDEB |
1219 &ISR_Reque::invalidAddresses::testCase, // addresses only checked in UDEB |
1293 #endif |
1220 #endif |
1294 //&ISR_Reque::multipleFragments::testCase, // This error condition is currently caught by a FAULT instead of a return code |
1221 #ifdef _REMOVEDTEST |
1222 // This test case is currently caught by a FAULT instead of a return code |
|
1223 // as expected. Currently, the facility to return an error code to the test |
|
1224 // framework is not yet supported. |
|
1225 &ISR_Reque::multipleFragments::testCase, |
|
1226 #endif |
|
1295 &Multipart::testCase, |
1227 &Multipart::testCase, |
1296 &IsrAndDfc::DfcBeforeIsr::testCase, |
1228 &IsrAndDfc::DfcBeforeIsr::testCase, |
1297 &IsrAndDfc::IsrBeforeDfc::testCase, |
1229 &IsrAndDfc::IsrBeforeDfc::testCase, |
1298 &_2D_Test::testCase2d, |
1230 &_2D_Test::testCase2d, |
1299 &FragmentationCount::testCase, |
1231 &FragmentationCount::testCase, |
1300 &FragmentationCount::testCase2, |
1232 &FragmentationCount::testCase2, |
1233 &FragmentationCount::testCase3, |
|
1301 &SmallFrags::testCase, |
1234 &SmallFrags::testCase, |
1302 #ifndef _DEBUG |
1235 #ifndef _DEBUG |
1303 // Benchmarks are only really meaningful |
1236 // Benchmarks are only really meaningful |
1304 // on UREL builds |
1237 // on UREL builds |
1305 &Benchmark::Frag::testCase_256k, |
1238 &Benchmark::Frag::testCase_256K, |
1306 &Benchmark::Frag::testCase_8k, |
1239 &Benchmark::Frag::testCase_8K, |
1307 &Benchmark::Transfer::_128K::testCase_128, |
1240 &Benchmark::Transfer::_128K::testCase_128, |
1308 &Benchmark::Transfer::_128K::testCase_16, |
1241 &Benchmark::Transfer::_128K::testCase_16, |
1309 &Benchmark::Transfer::_128K::testCase_4, |
1242 &Benchmark::Transfer::_128K::testCase_4, |
1310 &Benchmark::Transfer::_128K::testCase_1, |
1243 &Benchmark::Transfer::_128K::testCase_1, |
1311 &Benchmark::Transfer::_4Bytes::testCase, |
1244 &Benchmark::Transfer::_4Bytes::testCase, |
1312 &Benchmark::Transfer::_4Mb::testCase, |
1245 &Benchmark::Transfer::_4MB::testCase, |
1313 &Benchmark::CompareIsrDfcCb::Dfc::_4Bytes::testCase, |
1246 &Benchmark::CompareIsrDfcCb::Dfc::_4Bytes::testCase, |
1314 &Benchmark::CompareIsrDfcCb::Isr::_4Bytes::testCase, |
1247 &Benchmark::CompareIsrDfcCb::Isr::_4Bytes::testCase, |
1315 &Benchmark::CompareIsrDfcCb::Dfc::_4K::testCase, |
1248 &Benchmark::CompareIsrDfcCb::Dfc::_4K::testCase, |
1316 &Benchmark::CompareIsrDfcCb::Isr::_4K::testCase, |
1249 &Benchmark::CompareIsrDfcCb::Isr::_4K::testCase, |
1317 #endif |
1250 #endif |
1318 &TestNewStyleFragment_1::testCase, |
1251 &Fragment_1::testCase, |
1319 &TestNewStyleFragment_1::testCaseConcurrent, |
1252 &Fragment_1::testCaseConcurrent, |
1320 &TestNewStyleFragment_2::testCase, |
1253 &Fragment_2::testCase, |
1321 &TestNewStyleFragment_2::testCaseConcurrent, |
1254 &Fragment_2::testCaseConcurrent, |
1322 //&TestNewStyleFragment_3::testCase, |
1255 &Fragment_3::testCase, |
1323 //&TestNewStyleFragment_3::testCaseConcurrent, |
1256 &Fragment_3::testCaseConcurrent, |
1324 &TestNewStyleFragment_4::testCase, |
1257 &Fragment_4::testCase, |
1325 &TestNewStyleFragment_4::testCaseConcurrent, |
1258 &Fragment_4::testCaseConcurrent, |
1326 &TestNewStyleFragment_5::testCase, |
1259 &Fragment_5::testCase, |
1327 &TestNewStyleFragment_5::testCaseConcurrent, |
1260 &Fragment_5::testCaseConcurrent, |
1328 &TestNewStyleFragment_6::testCase, |
1261 &DDmaRequest_1::testCase, |
1329 &TestNewStyleFragment_6::testCaseConcurrent, |
1262 &DDmaRequest_1::testCaseConcurrent, |
1330 &TestOldStyleFragment_1::testCase, |
1263 &DDmaRequest_2::testCase, |
1331 &TestOldStyleFragment_1::testCaseConcurrent, |
1264 &DDmaRequest_2::testCaseConcurrent, |
1332 &TestOldStyleFragment_2::testCase, |
1265 &CloseApiTest::testCaseCloseApi, |
1333 &TestOldStyleFragment_2::testCaseConcurrent, |
1266 &OpenApiTest::testCaseOpenApi, |
1334 //&TestOldStyleFragment_3::testCase, |
1267 &PauseResumeApiTest::testCasePauseResume, |
1335 //&TestOldStyleFragment_3::testCaseConcurrent, |
1268 &CancelAllTest::testCase, |
1336 &TestOldStyleFragment_4::testCase, |
1269 &IsQueueEmptyTest::testCase, |
1337 &TestOldStyleFragment_4::testCaseConcurrent, |
|
1338 &TestOldStyleFragment_5::testCase, |
|
1339 &TestOldStyleFragment_5::testCaseConcurrent, |
|
1340 &TestOldStyleFragment_6::testCase, |
|
1341 &TestOldStyleFragment_6::testCaseConcurrent, |
|
1342 &TestOldStyleDDmaRequest_1::testCase, |
|
1343 &TestOldStyleDDmaRequest_1::testCaseConcurrent, |
|
1344 &TestOldStyleDDmaRequest_2::testCase, |
|
1345 &TestOldStyleDDmaRequest_2::testCaseConcurrent, |
|
1346 &TestNewStyleDDmaRequest_1::testCase, |
|
1347 &TestNewStyleDDmaRequest_1::testCaseConcurrent, |
|
1348 &TestNewStyleDDmaRequest_2::testCase, |
|
1349 &TestNewStyleDDmaRequest_2::testCaseConcurrent, |
|
1350 }; |
1270 }; |
1351 |
1271 |
1352 RPointerArray<TTestCase> TestArray(StaticTestArray, ARRAY_LENGTH(StaticTestArray)); |
1272 RPointerArray<TTestCase> TestArray(StaticTestArray, ARRAY_LENGTH(StaticTestArray)); |
1273 RPointerArray<TTestCase> TestArrayIsrAndDfc(StaticIsrAndDfcTestArray, ARRAY_LENGTH(StaticIsrAndDfcTestArray)); |
|
1274 RPointerArray<TTestCase> TestArraySimple(StaticSimpleTestArray, ARRAY_LENGTH(StaticSimpleTestArray)); |
|
1275 RPointerArray<TTestCase> TestArrayQueue(StaticQueueTestArray, ARRAY_LENGTH(StaticQueueTestArray)); |
|
1276 RPointerArray<TTestCase> TestArrayChannel(StaticChannelTestArray, ARRAY_LENGTH(StaticChannelTestArray)); |
|
1277 RPointerArray<TTestCase> TestArraySuspend(StaticSuspendTestArray, ARRAY_LENGTH(StaticSuspendTestArray)); |
|
1278 RPointerArray<TTestCase> TestArrayFragment(StaticFragmentTestArray, ARRAY_LENGTH(StaticFragmentTestArray)); |
|
1279 RPointerArray<TTestCase> TestArrayBenchmark(StaticBenchmarkTestArray, ARRAY_LENGTH(StaticBenchmarkTestArray)); |
|
1280 RPointerArray<TTestCase> TestArray2DTest(Static2DTestArray, ARRAY_LENGTH(Static2DTestArray)); |
|
1281 RPointerArray<TTestCase> TestArrayMultiPart(StaticMultipartTestArray, ARRAY_LENGTH(StaticMultipartTestArray)); |
|
1282 RPointerArray<TTestCase> TestArrayIsrReque(StaticIsrRequeTestArray, ARRAY_LENGTH(StaticIsrRequeTestArray)); |
|
1283 RPointerArray<TTestCase> TestArrayCallback(StaticCallbackTestArray, ARRAY_LENGTH(StaticCallbackTestArray)); |
|
1284 RPointerArray<TTestCase> TestArrayRequest(StaticRequestTestArray, ARRAY_LENGTH(StaticRequestTestArray)); |