author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 15 Mar 2010 12:45:50 +0200 | |
branch | RCL_3 |
changeset 81 | e7d2d738d3c2 |
parent 36 | 538db54a451d |
child 87 | 2f92ad2dc5db |
permissions | -rw-r--r-- |
81
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1 |
// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 2 |
// All rights reserved. |
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// e32test\dma\t_dma.cpp |
|
15 |
// Overview: |
|
16 |
// Test the DMA channel functionality. |
|
17 |
// API Information: |
|
18 |
// RBusLogicalChannel, DLogicalChannelBase, DLogicalDevice |
|
19 |
// Details: |
|
20 |
// - Load the DMA LDD, create a critical section, an active scheduler and |
|
21 |
// a CPeriodic object. |
|
22 |
// - Test one shot single buffer transfers: test simple transfer, request |
|
23 |
// reconfiguration and cancelling. Verify results are as expected. |
|
24 |
// - Test one shot double buffer transfers: test simple transfer, request |
|
25 |
// reconfiguration and cancelling. Verify results are as expected. |
|
26 |
// - Test streaming single buffer transfers: test simple transfer and |
|
27 |
// cancelling. Test that framework behaves correctly if one or more DMA |
|
28 |
// interrupts are missed. Verify results are as expected. |
|
29 |
// - Test streaming double buffer transfers: test simple transfer and |
|
30 |
// cancelling. Test that framework behaves correctly if one or more DMA |
|
31 |
// interrupts are missed. Verify results are as expected. |
|
32 |
// - Test streaming scatter/gather transfers: test simple transfer and |
|
33 |
// cancelling. Test that framework behaves correctly if one or more DMA |
|
34 |
// interrupts are missed. Verify results are as expected. |
|
35 |
// Platforms/Drives/Compatibility: |
|
36 |
// Hardware (Automatic). |
|
37 |
// Assumptions/Requirement/Pre-requisites: |
|
38 |
// Failures and causes: |
|
39 |
// Base Port information: |
|
40 |
// |
|
41 |
// |
|
42 |
||
43 |
#define __E32TEST_EXTENSION__ |
|
44 |
#include <e32test.h> |
|
45 |
#include "d_dma.h" |
|
46 |
#include <e32debug.h> |
|
47 |
#include <e32svr.h> |
|
48 |
#include <e32def.h> |
|
49 |
#include <e32def_private.h> |
|
50 |
#include "u32std.h" |
|
51 |
||
52 |
#ifdef __DMASIM__ |
|
53 |
RTest test(_L("T_DMASIM")); |
|
54 |
#else |
|
55 |
RTest test(_L("T_DMA")); |
|
56 |
#endif |
|
57 |
||
58 |
////////////////////////////////////////////////////////////////////////////// |
|
59 |
// Mini-framework for running tests either in a single thread or in |
|
60 |
// several concurrent ones. |
|
61 |
||
62 |
RTestDma::TInfo Info; |
|
63 |
TBool JitEnabled; |
|
64 |
RCriticalSection TheCriticalSection; // protect following variables |
|
65 |
TInt ThreadCount; // decremented when tester thread dies |
|
66 |
CPeriodic* Bipper; // display dots during tests to detect lock-ups |
|
67 |
||
68 |
// Test macro used inside tester threads |
|
69 |
_LIT(KTestFailure, "XTEST"); |
|
70 |
static void TestPanic(TInt aLine, TUint32 a1, TUint32 a2, TUint32 a3) |
|
71 |
{ |
|
72 |
RDebug::Printf("Line %d test failed a1=%08x a2=%08x a3=%08x", aLine, a1, a2, a3); |
|
73 |
RThread().Panic(KTestFailure, aLine); |
|
74 |
} |
|
75 |
#define XTEST(e) if (!(e)) TestPanic(__LINE__, 0, 0, 0) |
|
76 |
#define XTEST1(e,a1) if (!(e)) TestPanic(__LINE__, (a1), 0, 0) |
|
77 |
#define XTEST2(e,a1,a2) if (!(e)) TestPanic(__LINE__, (a1), (a2), 0) |
|
78 |
#define XTEST3(e,a1,a2,a3) if (!(e)) TestPanic(__LINE__, (a1), (a2), (a3)) |
|
79 |
||
80 |
||
81 |
/** |
|
82 |
Specifies a DMA test |
|
83 |
@note Have not inherited from CBase so that implicit copy ctors are used |
|
84 |
*/ |
|
85 |
class CTest |
|
86 |
{ |
|
87 |
public: |
|
88 |
typedef void (*TTestFunction)(RTestDma aChannel, TInt aMaxFragment, TInt aFragmentSize); |
|
89 |
||
90 |
CTest(TTestFunction aFn, TInt aMaxIter) |
|
91 |
:iTestFn(aFn), iChannelId(0), iMaxIter(aMaxIter) |
|
92 |
{} |
|
93 |
||
94 |
virtual ~CTest() |
|
95 |
{} |
|
96 |
||
97 |
TInt RunTest(); |
|
98 |
||
99 |
virtual TBool OpenChannel(TInt aDesCount, TInt aMaxFragmentSize=0); |
|
100 |
||
101 |
virtual void AnnounceTest(TDes& aDes) |
|
102 |
{aDes.AppendFormat(_L("Channel Id %d, iMaxIter %d"), iChannelId, iMaxIter);} |
|
103 |
virtual void ReportState(TDes& aDes) |
|
104 |
{aDes.AppendFormat(_L("Channel Id %d, iCurIter %d"), iChannelId, iCurIter);} |
|
105 |
||
106 |
||
107 |
void SetChannelId(TUint32 aChannelId) |
|
108 |
{iChannelId = aChannelId;} |
|
109 |
||
110 |
TInt MaxIter() const {return iMaxIter;} |
|
111 |
TInt CurIter() const {return iCurIter;} |
|
112 |
||
113 |
/** |
|
114 |
@return A copy of this test |
|
115 |
*/ |
|
116 |
virtual CTest* Clone() const =0; |
|
117 |
||
118 |
protected: |
|
119 |
TInt virtual DoRunTest() =0; |
|
120 |
||
121 |
const TTestFunction iTestFn; |
|
122 |
TUint32 iChannelId; |
|
123 |
const TInt iMaxIter; |
|
124 |
TInt iCurIter; |
|
125 |
RTestDma iChannel; |
|
126 |
}; |
|
127 |
||
128 |
/** |
|
129 |
Specifies a DMA test where the maximum fragmentation is |
|
130 |
explicitly limited. This tests that requests are split |
|
131 |
in to the number of fragments expected. |
|
132 |
||
133 |
This test also requires that physically contiguous buffers |
|
134 |
are used. For this reason the product of iMaxFragment and |
|
135 |
iMaxFragmentSize should be kept small |
|
136 |
*/ |
|
137 |
class CFragmentationTest : public CTest |
|
138 |
{ |
|
139 |
public: |
|
140 |
CFragmentationTest(TTestFunction aFn, TInt aMaxIter, TInt aMaxFragment, TInt aMaxFragmentSize) |
|
141 |
: CTest(aFn, aMaxIter), iMaxFragment(aMaxFragment), iMaxFragmentSize(aMaxFragmentSize), iCurFragment(0) |
|
142 |
{} |
|
143 |
||
144 |
TInt virtual DoRunTest(); |
|
145 |
||
146 |
virtual void AnnounceTest(TDes& aDes) |
|
147 |
{ |
|
148 |
aDes.AppendFormat(_L("CFragmentationTest: Frag count = [1..%d], Max Frag Size = 0x%08x bytes: "), iMaxFragment, iMaxFragmentSize); |
|
149 |
CTest::AnnounceTest(aDes); |
|
150 |
} |
|
151 |
||
152 |
virtual void ReportState(TDes& aDes) |
|
153 |
{ |
|
154 |
aDes.AppendFormat(_L("CFragmentationTest: Current Fragment %d: "), iCurFragment); |
|
155 |
CTest::ReportState(aDes); |
|
156 |
} |
|
157 |
||
158 |
CTest* Clone() const |
|
159 |
{return new CFragmentationTest(*this);} |
|
160 |
||
161 |
private: |
|
162 |
const TInt iMaxFragment; |
|
163 |
TInt iMaxFragmentSize; |
|
164 |
TInt iCurFragment; |
|
165 |
}; |
|
166 |
||
167 |
/** |
|
168 |
Specifies a DMA test where the maximum fragment size is |
|
169 |
not limited - and we do not care how many fragments are |
|
170 |
used |
|
171 |
||
172 |
- This checks that transfers work correctly with the DMAC's |
|
173 |
default fragment size |
|
174 |
*/ |
|
175 |
class CDefaultFragTest : public CTest |
|
176 |
{ |
|
177 |
public: |
|
178 |
CDefaultFragTest(TTestFunction aFn, TInt aMaxIter, TUint aTotalTransferSize) |
|
179 |
: CTest(aFn, aMaxIter), iTotalTransferSize(aTotalTransferSize) |
|
180 |
{} |
|
181 |
||
182 |
TInt virtual DoRunTest(); |
|
183 |
||
184 |
virtual void AnnounceTest(TDes& aDes) |
|
185 |
{ |
|
186 |
aDes.AppendFormat(_L("CDefaultFragTest: Transfer = 0x%08x bytes: "), iTotalTransferSize); |
|
187 |
CTest::AnnounceTest(aDes); |
|
188 |
} |
|
189 |
||
190 |
CTest* Clone() const |
|
191 |
{return new CDefaultFragTest(*this);} |
|
192 |
||
193 |
const TInt iTotalTransferSize; |
|
194 |
}; |
|
195 |
||
81
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
196 |
/** |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
197 |
Test that it is possible to close a channel from a callback |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
198 |
*/ |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
199 |
class CCloseInCb : public CTest |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
200 |
{ |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
201 |
public: |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
202 |
CCloseInCb() |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
203 |
: CTest(NULL, 1), iTransferSize(4 * KKilo) |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
204 |
{} |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
205 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
206 |
TInt virtual DoRunTest(); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
207 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
208 |
virtual void AnnounceTest(TDes& aDes) |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
209 |
{ |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
210 |
aDes.AppendFormat(_L("CCloseInCb")); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
211 |
CTest::AnnounceTest(aDes); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
212 |
} |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
213 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
214 |
CTest* Clone() const |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
215 |
{return new CCloseInCb(*this);} |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
216 |
private: |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
217 |
const TInt iTransferSize; |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
218 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
219 |
}; |
0 | 220 |
|
221 |
// |
|
222 |
// Active object used to create a tester thread, log on to it and |
|
223 |
// interpret its exit status. |
|
224 |
// |
|
225 |
class CTesterThread : public CActive |
|
226 |
{ |
|
227 |
public: |
|
228 |
CTesterThread(TInt aIdx, CTest* aTest); |
|
229 |
~CTesterThread() |
|
230 |
{ |
|
231 |
delete iTest; |
|
232 |
} |
|
233 |
private: |
|
234 |
static TInt ThreadFunction(TAny* aSelf); |
|
235 |
TInt StartThread(); |
|
236 |
// from CActive |
|
237 |
virtual void DoCancel(); |
|
238 |
virtual void RunL(); |
|
239 |
private: |
|
240 |
RThread iThread; |
|
241 |
CTest* iTest; |
|
242 |
}; |
|
243 |
||
244 |
||
245 |
/** |
|
246 |
Run the test for iMaxIter iterations |
|
247 |
*/ |
|
248 |
TInt CTest::RunTest() |
|
249 |
{ |
|
250 |
TInt r = KErrNone; |
|
251 |
for (iCurIter=0; iCurIter<iMaxIter; ++iCurIter) |
|
252 |
{ |
|
253 |
r = DoRunTest(); |
|
254 |
if(KErrNone != r) |
|
255 |
break; |
|
256 |
} |
|
257 |
return r; |
|
258 |
} |
|
259 |
||
260 |
/** |
|
261 |
Open iChannel |
|
262 |
||
263 |
@pre iChannel is not open |
|
264 |
@return |
|
265 |
- KErrNotSupported Channel does not exist on DMAC |
|
266 |
- KErrNone Success |
|
267 |
- KErrInUse |
|
268 |
*/ |
|
269 |
TInt CTest::OpenChannel(TInt aDesCount, TInt aMaxFragmentSize) |
|
270 |
{ |
|
271 |
ASSERT(!iChannel.Handle()); |
|
272 |
const TInt r = iChannel.Open(iChannelId, aDesCount, aMaxFragmentSize); |
|
273 |
if (r == KErrNotSupported) |
|
274 |
return r; |
|
275 |
XTEST1(KErrNone == r || KErrInUse == r, r); |
|
276 |
||
277 |
if(KErrInUse == r) |
|
278 |
{ |
|
279 |
// Channel is in use. |
|
280 |
RDebug::Printf("\nDMA Channel %d is in use",iChannelId); |
|
281 |
if(0 == iCurIter) |
|
282 |
{ |
|
283 |
// Terminate thread by returning this error code KErrInUse. |
|
284 |
return r; |
|
285 |
} |
|
286 |
else |
|
287 |
{ |
|
288 |
#ifdef __WINS__ |
|
289 |
#pragma warning( disable : 4127 ) // warning C4127: conditional expression is constant |
|
290 |
#endif // __WINS__ |
|
291 |
XTEST1(EFalse, iCurIter); |
|
292 |
#ifdef __WINS__ |
|
293 |
#pragma warning( default : 4127 ) // warning C4127: conditional expression is constant |
|
294 |
#endif // __WINS__ |
|
295 |
} |
|
296 |
} |
|
297 |
return r; |
|
298 |
} |
|
299 |
||
300 |
||
301 |
||
302 |
// Spawn thread. Will auto-delete when thread exits. |
|
303 |
CTesterThread::CTesterThread(TInt aIdx, CTest* aTest) |
|
304 |
: CActive(EPriorityStandard), iTest(aTest) |
|
305 |
{ |
|
306 |
CActiveScheduler::Add(this); |
|
307 |
TBuf<16> name; |
|
308 |
name = _L("TESTER-"); |
|
309 |
name.AppendNum(aIdx); |
|
310 |
test(iThread.Create(name, ThreadFunction, 0x1000, NULL, this) == KErrNone); |
|
311 |
iThread.SetPriority(EPriorityLess); |
|
312 |
iThread.Logon(iStatus); |
|
313 |
SetActive(); |
|
314 |
iThread.Resume(); |
|
315 |
} |
|
316 |
||
317 |
||
318 |
TInt CTesterThread::ThreadFunction(TAny* aSelf) |
|
319 |
{ |
|
320 |
CTesterThread* self = (CTesterThread*)aSelf; |
|
321 |
return self->StartThread(); |
|
322 |
} |
|
323 |
||
324 |
TInt CTesterThread::StartThread() |
|
325 |
{ |
|
326 |
return iTest->RunTest(); |
|
327 |
} |
|
328 |
||
329 |
||
330 |
||
331 |
TInt CFragmentationTest::DoRunTest() |
|
332 |
{ |
|
333 |
// In case iMaxFragmentSize was larger than suppported (we need to know what fragment |
|
334 |
// size will actually be used) |
|
335 |
iMaxFragmentSize = Min(iMaxFragmentSize, Info.iMaxTransferSize); |
|
336 |
||
337 |
// Open channel with enough descriptors for 3 open DMA |
|
338 |
// requests (see TestStreaming). |
|
339 |
TInt r = OpenChannel(3* iMaxFragment, iMaxFragmentSize); |
|
340 |
if(r != KErrNone) |
|
341 |
return r; |
|
342 |
||
343 |
//we are controlling fragment size, so we know how |
|
344 |
//many to expect |
|
345 |
for (iCurFragment=1; iCurFragment<=iMaxFragment; iCurFragment*=2) |
|
346 |
{ |
|
347 |
const TInt size = iCurFragment * ( iMaxFragmentSize & ~Info.iMemAlignMask); |
|
348 |
iTestFn(iChannel, iCurFragment, size); |
|
349 |
} |
|
350 |
iChannel.Close(); |
|
351 |
return KErrNone; |
|
352 |
} |
|
353 |
||
354 |
TInt CDefaultFragTest::DoRunTest() |
|
355 |
{ |
|
356 |
// +1 so we don't underestimate maxFragount for inexact division |
|
357 |
const TUint maxFragCount = (iTotalTransferSize / Info.iMaxTransferSize) +1; |
|
358 |
||
359 |
// Open channel with enough descriptors for 3 open DMA |
|
360 |
// requests (see TestStreaming). |
|
361 |
const TUint descriptorCount = 3 * maxFragCount; |
|
362 |
||
363 |
TInt r = OpenChannel(descriptorCount); |
|
364 |
if(r != KErrNone) |
|
365 |
return r; |
|
366 |
||
367 |
iTestFn(iChannel, 0, iTotalTransferSize); |
|
368 |
||
369 |
iChannel.Close(); |
|
370 |
return KErrNone; |
|
371 |
} |
|
372 |
||
81
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
373 |
TInt CCloseInCb::DoRunTest() |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
374 |
{ |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
375 |
TInt r = KErrNone; |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
376 |
RTest test(_L("CCloseInCb test")); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
377 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
378 |
r = OpenChannel(1); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
379 |
test_KErrNone(r); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
380 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
381 |
const TInt KRequest = 0; |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
382 |
const TInt KSrcBuf = 0; |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
383 |
const TInt KDestBuf = 1; |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
384 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
385 |
const TInt size = Min(iTransferSize, Info.iMaxTransferSize); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
386 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
387 |
r = iChannel.AllocBuffer(KSrcBuf, size); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
388 |
test_KErrNone(r); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
389 |
iChannel.FillBuffer(KSrcBuf, 'A'); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
390 |
r = iChannel.AllocBuffer(KDestBuf, size); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
391 |
test_KErrNone(r); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
392 |
iChannel.FillBuffer(KDestBuf, '\0'); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
393 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
394 |
TRequestStatus rs = KRequestPending; |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
395 |
r = iChannel.Fragment(KRequest, KSrcBuf, KDestBuf, size, &rs); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
396 |
test_KErrNone(r); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
397 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
398 |
// "X" will cause channel to be closed during callback |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
399 |
r = iChannel.Execute(_L8("QX0")); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
400 |
test_KErrNone(r); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
401 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
402 |
User::WaitForRequest(rs); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
403 |
test_KErrNone(rs.Int()); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
404 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
405 |
test(iChannel.CheckBuffer(KDestBuf, 'A')); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
406 |
iChannel.FreeAllBuffers(); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
407 |
|
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
408 |
test.Close(); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
409 |
return KErrNone; |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
410 |
} |
0 | 411 |
|
412 |
// Called when thread completed. |
|
413 |
void CTesterThread::RunL() |
|
414 |
{ |
|
415 |
TExitType et = iThread.ExitType(); |
|
416 |
TInt er = iThread.ExitReason(); |
|
417 |
TExitCategoryName ec = iThread.ExitCategory(); |
|
418 |
TName name = iThread.Name(); |
|
419 |
CLOSE_AND_WAIT(iThread); |
|
420 |
||
421 |
switch (et) |
|
422 |
{ |
|
423 |
case EExitKill: |
|
424 |
// nothing to do |
|
425 |
break; |
|
426 |
case EExitPanic: |
|
427 |
{ |
|
428 |
User::SetJustInTime(JitEnabled); |
|
429 |
TBuf<128> buffer; |
|
430 |
iTest->ReportState(buffer); |
|
431 |
test.Printf(_L("Tester Thread Panic: %S: Test: %S\n"), |
|
432 |
&name, &buffer); |
|
433 |
if (ec.Match(KTestFailure) == 0) |
|
434 |
test.Panic(_L("Test failure line %d"), er); |
|
435 |
else |
|
436 |
test.Panic(_L("Unexpected panic: %S-%d"), &ec, er); |
|
437 |
break; |
|
438 |
} |
|
439 |
default: |
|
440 |
test.Panic(_L("Invalid thread exit type")); |
|
441 |
} |
|
442 |
||
443 |
TheCriticalSection.Wait(); |
|
444 |
if (--ThreadCount == 0) |
|
445 |
{ |
|
446 |
Bipper->Cancel(); |
|
447 |
test.Console()->Printf(_L("\n")); |
|
448 |
CActiveScheduler::Stop(); |
|
449 |
} |
|
450 |
TheCriticalSection.Signal(); |
|
451 |
||
452 |
// We commit suicide as the alternative (being deleted by |
|
453 |
// RunTest()) implies keeping a list of all instances in |
|
454 |
// RunTest(). |
|
455 |
delete this; |
|
456 |
} |
|
457 |
||
458 |
||
459 |
void CTesterThread::DoCancel() |
|
460 |
{ |
|
461 |
test.Panic(_L("CTesterThread::DoCancel called")); |
|
462 |
} |
|
463 |
||
464 |
||
465 |
static TInt Bip(TAny*) |
|
466 |
{ |
|
467 |
test.Console()->Printf(_L(".")); |
|
468 |
return 0; |
|
469 |
} |
|
470 |
||
471 |
||
472 |
// Execute provided test object in one or more tester threads. |
|
473 |
void RunTest(TUint32 aChannelIds[], TInt aMaxThread, CTest* aTest) |
|
474 |
{ |
|
475 |
test_NotNull(aTest); |
|
476 |
||
477 |
if (aMaxThread == 0) |
|
478 |
{ |
|
479 |
delete aTest; |
|
480 |
test.Printf(_L("transfer mode not supported - skipped\n")); |
|
481 |
return; |
|
482 |
} |
|
483 |
||
484 |
test.Printf(_L("Using %d thread(s)\n"), aMaxThread); |
|
485 |
||
486 |
// We don't want JIT debugging here because the tester threads may panic |
|
487 |
JitEnabled = User::JustInTime(); |
|
488 |
User::SetJustInTime(EFalse); |
|
489 |
||
490 |
// must be set before spawning threads to avoid premature active scheduler stop |
|
491 |
ThreadCount = aMaxThread; |
|
492 |
||
493 |
TBuf<128> buffer; |
|
494 |
for (TInt i=0; i<aMaxThread; ++i) |
|
495 |
{ |
|
496 |
//each CTesterThread needs its own CTest object |
|
497 |
CTest* dmaTest = aTest->Clone(); |
|
498 |
test_NotNull(dmaTest); |
|
499 |
||
500 |
dmaTest->SetChannelId(aChannelIds[i]); |
|
501 |
||
502 |
buffer.Zero(); |
|
503 |
dmaTest->AnnounceTest(buffer); |
|
504 |
test.Printf(_L("Thread %d: %S\n"), i, &buffer); |
|
505 |
||
506 |
test(new CTesterThread(i, dmaTest) != NULL); |
|
507 |
dmaTest = NULL; //ownership transferred to CTesterThread |
|
508 |
} |
|
509 |
//the orginal isn't needed |
|
510 |
delete aTest; |
|
511 |
aTest = NULL; |
|
512 |
||
513 |
const TTimeIntervalMicroSeconds32 KPeriod = 1000000; // 1s |
|
514 |
Bipper->Start(KPeriod, KPeriod, Bip); |
|
515 |
||
516 |
CActiveScheduler::Start(); |
|
517 |
||
518 |
User::SetJustInTime(JitEnabled); |
|
519 |
} |
|
520 |
||
521 |
||
522 |
inline void RunSbTest(TInt aMaxThread, CTest* aTest) |
|
523 |
{ |
|
524 |
RunTest(Info.iSbChannels, Min(aMaxThread,Info.iMaxSbChannels), aTest); |
|
525 |
} |
|
526 |
||
527 |
inline void RunDbTest(TInt aMaxThread, CTest* aTest) |
|
528 |
{ |
|
529 |
RunTest(Info.iDbChannels, Min(aMaxThread,Info.iMaxDbChannels), aTest); |
|
530 |
} |
|
531 |
||
532 |
inline void RunSgTest(TInt aMaxThread, CTest* aTest) |
|
533 |
{ |
|
534 |
RunTest(Info.iSgChannels, Min(aMaxThread,Info.iMaxSgChannels), aTest); |
|
535 |
} |
|
536 |
////////////////////////////////////////////////////////////////////////////// |
|
537 |
||
538 |
static void GetChannelInfo() |
|
539 |
{ |
|
540 |
RTestDma channel; |
|
541 |
test(channel.GetInfo(Info) == KErrNone); |
|
542 |
test(Info.iMaxSbChannels>0 || Info.iMaxDbChannels>0 || Info.iMaxSgChannels>0); |
|
543 |
} |
|
544 |
||
545 |
||
546 |
static void TestOneShot(RTestDma aChannel, TInt aFragmentCount, TInt aSize) |
|
547 |
{ |
|
548 |
const TInt KRequest = 0; |
|
549 |
const TInt KSrcBuf = 0; |
|
550 |
const TInt KDestBuf1 = 1; |
|
551 |
const TInt KDestBuf2 = 2; |
|
552 |
||
553 |
TInt r = aChannel.AllocBuffer(KSrcBuf, aSize); |
|
554 |
XTEST2(r == KErrNone, r, aSize); |
|
555 |
aChannel.FillBuffer(KSrcBuf, 'A'); |
|
556 |
r = aChannel.AllocBuffer(KDestBuf1, aSize); |
|
557 |
XTEST2(r == KErrNone, r, aSize); |
|
558 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
559 |
r = aChannel.AllocBuffer(KDestBuf2, aSize); |
|
560 |
XTEST2(r == KErrNone, r, aSize); |
|
561 |
aChannel.FillBuffer(KDestBuf2, '\0'); |
|
562 |
||
563 |
// Test simple transfer |
|
564 |
TRequestStatus rs; |
|
565 |
r = aChannel.Fragment(KRequest, KSrcBuf, KDestBuf1, aSize, &rs); |
|
566 |
XTEST2(r == KErrNone, r, aSize); |
|
567 |
test(aChannel.FragmentCheck(KRequest, aFragmentCount)); |
|
568 |
r = aChannel.Execute(_L8("Q0")); |
|
569 |
XTEST1(r == KErrNone, r); |
|
570 |
User::WaitForRequest(rs); |
|
571 |
XTEST1(rs == KErrNone, rs.Int()); |
|
572 |
XTEST(aChannel.CheckBuffer(KDestBuf1, 'A')); |
|
573 |
||
574 |
// Test request reconfiguration. |
|
575 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
576 |
r = aChannel.Fragment(KRequest, KSrcBuf, KDestBuf2, aSize, &rs); |
|
577 |
XTEST2(r == KErrNone, r, aSize); |
|
578 |
test(aChannel.FragmentCheck(KRequest, aFragmentCount)); |
|
579 |
r = aChannel.Execute(_L8("Q0")); |
|
580 |
XTEST1(r == KErrNone, r); |
|
581 |
User::WaitForRequest(rs); |
|
582 |
XTEST1(rs == KErrNone, rs.Int()); |
|
583 |
XTEST(aChannel.CheckBuffer(KDestBuf1, '\0')); // previous dest unchanged? |
|
584 |
XTEST(aChannel.CheckBuffer(KDestBuf2, 'A')); |
|
585 |
||
586 |
// Test cancelling |
|
587 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
588 |
r = aChannel.Fragment(KRequest, KSrcBuf, KDestBuf1, aSize); |
|
589 |
XTEST2(r == KErrNone, r, aSize); |
|
590 |
test(aChannel.FragmentCheck(KRequest, aFragmentCount)); |
|
591 |
r = aChannel.Execute(_L8("Q0C")); |
|
592 |
XTEST1(r == KErrNone, r); |
|
593 |
// Part of the destination buffer should be unchanged if the |
|
594 |
// cancel occured before the transfer completed. |
|
595 |
#ifdef __DMASIM__ |
|
596 |
// At least part of the last destination buffer should be |
|
597 |
// unchanged if cancel occured before the transfer completed. |
|
598 |
// Assert only on WINS as real DMACs are too fast. |
|
599 |
XTEST(! aChannel.CheckBuffer(KDestBuf2, 'C')); |
|
600 |
#endif |
|
601 |
||
602 |
// Perform another transfer to ensure cancel operation let the |
|
603 |
// framework in a consistent state. |
|
604 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
605 |
r = aChannel.Fragment(KRequest, KSrcBuf, KDestBuf1, aSize, &rs); |
|
606 |
XTEST2(r == KErrNone, r, aSize); |
|
607 |
test(aChannel.FragmentCheck(KRequest, aFragmentCount)); |
|
608 |
r = aChannel.Execute(_L8("Q0")); |
|
609 |
XTEST1(r == KErrNone, r); |
|
610 |
User::WaitForRequest(rs); |
|
611 |
XTEST1(rs == KErrNone, rs.Int()); |
|
612 |
XTEST(aChannel.CheckBuffer(KDestBuf1, 'A')); |
|
613 |
||
614 |
// |
|
615 |
// Test failure if the underlying DMA kernel extension allows it. |
|
616 |
// |
|
617 |
// As long as only "CancelAllFragments" is supported, it's okay to |
|
618 |
// always fail on the first fragment. |
|
619 |
// |
|
620 |
||
621 |
if (aChannel.FailNext(1) == KErrNone) |
|
622 |
{ |
|
623 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
624 |
r = aChannel.Fragment(KRequest, KSrcBuf, KDestBuf1, aSize, &rs); |
|
625 |
XTEST2(r == KErrNone, r, aSize); |
|
626 |
test(aChannel.FragmentCheck(KRequest, aFragmentCount)); |
|
627 |
r = aChannel.Execute(_L8("Q0")); |
|
628 |
XTEST1(r == KErrNone, r); |
|
629 |
User::WaitForRequest(rs); |
|
630 |
XTEST1(rs != KErrNone, rs.Int()); |
|
631 |
XTEST(! aChannel.CheckBuffer(KDestBuf1, 'A')); |
|
632 |
r = aChannel.Execute(_L8("C")); |
|
633 |
XTEST1(r == KErrNone, r); |
|
634 |
||
635 |
// Perform another transfer to ensure we are still in a |
|
636 |
// consistent state. |
|
637 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
638 |
r = aChannel.Fragment(KRequest, KSrcBuf, KDestBuf1, aSize, &rs); |
|
639 |
XTEST2(r == KErrNone, r, aSize); |
|
640 |
test(aChannel.FragmentCheck(KRequest, aFragmentCount)); |
|
641 |
r = aChannel.Execute(_L8("Q0")); |
|
642 |
XTEST1(r == KErrNone, r); |
|
643 |
User::WaitForRequest(rs); |
|
644 |
XTEST1(rs == KErrNone, rs.Int()); |
|
645 |
XTEST(aChannel.CheckBuffer(KDestBuf1, 'A')); |
|
646 |
} |
|
647 |
||
648 |
aChannel.FreeAllBuffers(); |
|
649 |
} |
|
650 |
||
651 |
||
652 |
static void TestStreaming(RTestDma aChannel, TInt aFragmentCount, TInt aSize) |
|
653 |
{ |
|
654 |
const TInt KRequest0 = 0; |
|
655 |
const TInt KRequest1 = 1; |
|
656 |
const TInt KRequest2 = 2; |
|
657 |
const TInt KSrcBuf0 = 0; |
|
658 |
const TInt KSrcBuf1 = 1; |
|
659 |
const TInt KSrcBuf2 = 2; |
|
660 |
const TInt KDestBuf0 = 3; |
|
661 |
const TInt KDestBuf1 = 4; |
|
662 |
const TInt KDestBuf2 = 5; |
|
663 |
||
664 |
// |
|
665 |
// Allocate and initialise source buffers |
|
666 |
// |
|
667 |
||
668 |
TInt r = aChannel.AllocBuffer(KSrcBuf0, aSize); |
|
669 |
XTEST2(r == KErrNone, r, aSize); |
|
670 |
aChannel.FillBuffer(KSrcBuf0, 'A'); |
|
671 |
||
672 |
r = aChannel.AllocBuffer(KSrcBuf1, aSize); |
|
673 |
XTEST2(r == KErrNone, r, aSize); |
|
674 |
aChannel.FillBuffer(KSrcBuf1, 'B'); |
|
675 |
||
676 |
r = aChannel.AllocBuffer(KSrcBuf2, aSize); |
|
677 |
XTEST2(r == KErrNone, r, aSize); |
|
678 |
aChannel.FillBuffer(KSrcBuf2, 'C'); |
|
679 |
||
680 |
// |
|
681 |
// Allocate destination buffers |
|
682 |
// |
|
683 |
||
684 |
r = aChannel.AllocBuffer(KDestBuf0, aSize); |
|
685 |
XTEST2(r == KErrNone, r, aSize); |
|
686 |
r = aChannel.AllocBuffer(KDestBuf1, aSize); |
|
687 |
XTEST2(r == KErrNone, r, aSize); |
|
688 |
r = aChannel.AllocBuffer(KDestBuf2, aSize); |
|
689 |
XTEST2(r == KErrNone, r, aSize); |
|
690 |
||
691 |
// |
|
692 |
// Test simple transfer. |
|
693 |
// (no need to test for request reconfiguration afterwards because |
|
694 |
// this was exercised in the one-shot test case) |
|
695 |
// |
|
696 |
||
697 |
TRequestStatus rs0; |
|
698 |
r = aChannel.Fragment(KRequest0, KSrcBuf0, KDestBuf0, aSize, &rs0); |
|
699 |
XTEST2(r == KErrNone, r, aSize); |
|
700 |
test(aChannel.FragmentCheck(KRequest0, aFragmentCount)); |
|
701 |
TRequestStatus rs1; |
|
702 |
r = aChannel.Fragment(KRequest1, KSrcBuf1, KDestBuf1, aSize, &rs1); |
|
703 |
XTEST2(r == KErrNone, r, aSize); |
|
704 |
test(aChannel.FragmentCheck(KRequest1, aFragmentCount)); |
|
705 |
TRequestStatus rs2; |
|
706 |
r = aChannel.Fragment(KRequest2, KSrcBuf2, KDestBuf2, aSize, &rs2); |
|
707 |
XTEST2(r == KErrNone, r, aSize); |
|
708 |
test(aChannel.FragmentCheck(KRequest2, aFragmentCount)); |
|
709 |
||
710 |
r = aChannel.Execute(_L8("Q0Q1Q2")); |
|
711 |
XTEST1(r == KErrNone, r); |
|
712 |
User::WaitForRequest(rs0); |
|
713 |
XTEST1(rs0 == KErrNone, rs0.Int()); |
|
714 |
XTEST(aChannel.CheckBuffer(KDestBuf0, 'A')); |
|
715 |
User::WaitForRequest(rs1); |
|
716 |
XTEST1(rs1 == KErrNone, rs1.Int()); |
|
717 |
XTEST(aChannel.CheckBuffer(KDestBuf1, 'B')); |
|
718 |
User::WaitForRequest(rs2); |
|
719 |
XTEST1(rs2 == KErrNone, rs2.Int()); |
|
720 |
XTEST(aChannel.CheckBuffer(KDestBuf2, 'C')); |
|
721 |
||
722 |
// |
|
723 |
// Test cancel |
|
724 |
// |
|
725 |
||
726 |
aChannel.FillBuffer(KDestBuf0, '\0'); |
|
727 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
728 |
aChannel.FillBuffer(KDestBuf2, '\0'); |
|
729 |
||
730 |
r = aChannel.Fragment(KRequest0, KSrcBuf0, KDestBuf0, aSize); |
|
731 |
XTEST2(r == KErrNone, r, aSize); |
|
732 |
test(aChannel.FragmentCheck(KRequest0, aFragmentCount)); |
|
733 |
r = aChannel.Fragment(KRequest1, KSrcBuf1, KDestBuf1, aSize); |
|
734 |
XTEST2(r == KErrNone, r, aSize); |
|
735 |
test(aChannel.FragmentCheck(KRequest1, aFragmentCount)); |
|
736 |
r = aChannel.Fragment(KRequest2, KSrcBuf2, KDestBuf2, aSize); |
|
737 |
XTEST2(r == KErrNone, r, aSize); |
|
738 |
test(aChannel.FragmentCheck(KRequest2, aFragmentCount)); |
|
739 |
||
740 |
r = aChannel.Execute(_L8("Q0Q1Q2C")); |
|
741 |
XTEST1(r == KErrNone, r); |
|
742 |
#ifdef __DMASIM__ |
|
743 |
// At least part of the last destination buffer should be |
|
744 |
// unchanged if cancel occured before the transfer completed. |
|
745 |
// Assert only on WINS as real DMACs are too fast. |
|
746 |
XTEST(! aChannel.CheckBuffer(KDestBuf2, 'C')); |
|
747 |
#endif |
|
748 |
||
749 |
// |
|
750 |
// Perform another transfer to ensure cancel operation let the |
|
751 |
// framework in a consistent state. |
|
752 |
// |
|
753 |
||
754 |
aChannel.FillBuffer(KDestBuf0, '\0'); |
|
755 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
756 |
aChannel.FillBuffer(KDestBuf2, '\0'); |
|
757 |
// Reconfigure last request to enable transfer completion notification |
|
758 |
r = aChannel.Fragment(KRequest2, KSrcBuf2, KDestBuf2, aSize, &rs2); |
|
759 |
XTEST2(r == KErrNone, r, aSize); |
|
760 |
test(aChannel.FragmentCheck(KRequest2, aFragmentCount)); |
|
761 |
r = aChannel.Execute(_L8("Q0Q1Q2")); |
|
762 |
XTEST1(r == KErrNone, r); |
|
763 |
User::WaitForRequest(rs2); |
|
764 |
XTEST1(rs2 == KErrNone, rs2.Int()); |
|
765 |
XTEST(aChannel.CheckBuffer(KDestBuf0, 'A')); |
|
766 |
XTEST(aChannel.CheckBuffer(KDestBuf1, 'B')); |
|
767 |
XTEST(aChannel.CheckBuffer(KDestBuf2, 'C')); |
|
768 |
||
769 |
// |
|
770 |
// Test for proper implementation of UnlinkHwDes() in the PSL. |
|
771 |
// |
|
772 |
||
773 |
aChannel.FillBuffer(KDestBuf0, '\0'); |
|
774 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
775 |
aChannel.FillBuffer(KDestBuf2, '\0'); |
|
776 |
// Reconfigure last request to enable transfer completion notification |
|
777 |
r = aChannel.Fragment(KRequest2, KSrcBuf2, KDestBuf2, aSize, &rs2); |
|
778 |
XTEST2(r == KErrNone, r, aSize); |
|
779 |
test(aChannel.FragmentCheck(KRequest2, aFragmentCount)); |
|
780 |
// Queue first request (Q0) |
|
781 |
r = aChannel.Execute(_L8("Q0")); |
|
782 |
// Wait a second, so next request will be queued on its own |
|
783 |
// (instead of being appended to the previous one) |
|
784 |
User::After(1000000); |
|
785 |
// Queue third request (Q2) |
|
786 |
r = aChannel.Execute(_L8("Q2")); |
|
787 |
XTEST1(r == KErrNone, r); |
|
788 |
User::WaitForRequest(rs2); |
|
789 |
XTEST1(rs2 == KErrNone, rs2.Int()); |
|
790 |
XTEST(aChannel.CheckBuffer(KDestBuf0, 'A')); |
|
791 |
// KDestBuf1 should have been left untouched! |
|
792 |
// If we find all B's in KDestBuf1, that means the last descriptor of the |
|
793 |
// first request (Q0) wasn't properly unlinked and still points to the Q1 |
|
794 |
// descriptor chain from the previous run. |
|
795 |
XTEST(aChannel.CheckBuffer(KDestBuf1, '\0')); |
|
796 |
XTEST(aChannel.CheckBuffer(KDestBuf2, 'C')); |
|
797 |
||
798 |
// |
|
799 |
// Test failure if the underlying DMA kernel extension allows it. |
|
800 |
// |
|
801 |
// As long as only "CancelAllFragments" is supported, it's okay to |
|
802 |
// always fail on the first fragment. |
|
803 |
// |
|
804 |
||
805 |
if (aChannel.FailNext(1) == KErrNone) |
|
806 |
{ |
|
807 |
aChannel.FillBuffer(KDestBuf0, '\0'); |
|
808 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
809 |
aChannel.FillBuffer(KDestBuf2, '\0'); |
|
810 |
XTEST(aChannel.Fragment(KRequest0, KSrcBuf0, KDestBuf0, aSize, &rs0) == KErrNone); |
|
811 |
test(aChannel.FragmentCheck(KRequest0, aFragmentCount)); |
|
812 |
XTEST(aChannel.Fragment(KRequest1, KSrcBuf1, KDestBuf1, aSize) == KErrNone); |
|
813 |
test(aChannel.FragmentCheck(KRequest1, aFragmentCount)); |
|
814 |
XTEST(aChannel.Fragment(KRequest2, KSrcBuf2, KDestBuf2, aSize) == KErrNone); |
|
815 |
test(aChannel.FragmentCheck(KRequest2, aFragmentCount)); |
|
816 |
XTEST(aChannel.Execute(_L8("Q0Q1Q2")) == KErrNone); |
|
817 |
User::WaitForRequest(rs0); |
|
818 |
XTEST(rs0 != KErrNone); |
|
819 |
XTEST(! aChannel.CheckBuffer(KDestBuf0, 'A')); |
|
820 |
XTEST(! aChannel.CheckBuffer(KDestBuf1, 'B')); |
|
821 |
XTEST(! aChannel.CheckBuffer(KDestBuf2, 'C')); |
|
822 |
XTEST(aChannel.Execute(_L8("C")) == KErrNone); |
|
823 |
||
824 |
// Transfer again to ensure cancel cleaned-up correctly |
|
825 |
aChannel.FillBuffer(KDestBuf0, '\0'); |
|
826 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
827 |
aChannel.FillBuffer(KDestBuf2, '\0'); |
|
828 |
XTEST(aChannel.Fragment(KRequest0, KSrcBuf0, KDestBuf0, aSize, &rs0) == KErrNone); |
|
829 |
test(aChannel.FragmentCheck(KRequest0, aFragmentCount)); |
|
830 |
XTEST(aChannel.Fragment(KRequest1, KSrcBuf1, KDestBuf1, aSize, &rs1) == KErrNone); |
|
831 |
test(aChannel.FragmentCheck(KRequest1, aFragmentCount)); |
|
832 |
XTEST(aChannel.Fragment(KRequest2, KSrcBuf2, KDestBuf2, aSize, &rs2) == KErrNone); |
|
833 |
test(aChannel.FragmentCheck(KRequest2, aFragmentCount)); |
|
834 |
XTEST(aChannel.Execute(_L8("Q0Q1Q2")) == KErrNone); |
|
835 |
User::WaitForRequest(rs0); |
|
836 |
XTEST(rs0 == KErrNone); |
|
837 |
User::WaitForRequest(rs1); |
|
838 |
XTEST(rs1 == KErrNone); |
|
839 |
User::WaitForRequest(rs2); |
|
840 |
XTEST(rs2 == KErrNone); |
|
841 |
XTEST(aChannel.CheckBuffer(KDestBuf0, 'A')); |
|
842 |
XTEST(aChannel.CheckBuffer(KDestBuf1, 'B')); |
|
843 |
XTEST(aChannel.CheckBuffer(KDestBuf2, 'C')); |
|
844 |
} |
|
845 |
||
846 |
// |
|
847 |
// Test that framework behaves correctly if one or more DMA interrupts are |
|
848 |
// missed. |
|
849 |
// |
|
850 |
||
851 |
if (aChannel.MissNextInterrupts(1) == KErrNone) |
|
852 |
{ |
|
853 |
aChannel.FillBuffer(KDestBuf0, '\0'); |
|
854 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
855 |
aChannel.FillBuffer(KDestBuf2, '\0'); |
|
856 |
XTEST(aChannel.Fragment(KRequest0, KSrcBuf0, KDestBuf0, aSize, &rs0) == KErrNone); |
|
857 |
test(aChannel.FragmentCheck(KRequest0, aFragmentCount)); |
|
858 |
XTEST(aChannel.Fragment(KRequest1, KSrcBuf1, KDestBuf1, aSize, &rs1) == KErrNone); |
|
859 |
test(aChannel.FragmentCheck(KRequest1, aFragmentCount)); |
|
860 |
XTEST(aChannel.Fragment(KRequest2, KSrcBuf2, KDestBuf2, aSize, &rs2) == KErrNone); |
|
861 |
test(aChannel.FragmentCheck(KRequest2, aFragmentCount)); |
|
862 |
XTEST(aChannel.Execute(_L8("Q0Q1Q2")) == KErrNone); |
|
863 |
User::WaitForRequest(rs0); |
|
864 |
XTEST(rs0 == KErrNone); |
|
865 |
User::WaitForRequest(rs1); |
|
866 |
XTEST(rs1 == KErrNone); |
|
867 |
User::WaitForRequest(rs2); |
|
868 |
XTEST(rs2 == KErrNone); |
|
869 |
XTEST(aChannel.CheckBuffer(KDestBuf0, 'A')); |
|
870 |
XTEST(aChannel.CheckBuffer(KDestBuf1, 'B')); |
|
871 |
XTEST(aChannel.CheckBuffer(KDestBuf2, 'C')); |
|
872 |
} |
|
873 |
||
874 |
if (aChannel.MissNextInterrupts(2) == KErrNone) |
|
875 |
{ |
|
876 |
aChannel.FillBuffer(KDestBuf0, '\0'); |
|
877 |
aChannel.FillBuffer(KDestBuf1, '\0'); |
|
878 |
aChannel.FillBuffer(KDestBuf2, '\0'); |
|
879 |
XTEST(aChannel.Fragment(KRequest0, KSrcBuf0, KDestBuf0, aSize, &rs0) == KErrNone); |
|
880 |
test(aChannel.FragmentCheck(KRequest0, aFragmentCount)); |
|
881 |
XTEST(aChannel.Fragment(KRequest1, KSrcBuf1, KDestBuf1, aSize, &rs1) == KErrNone); |
|
882 |
test(aChannel.FragmentCheck(KRequest1, aFragmentCount)); |
|
883 |
XTEST(aChannel.Fragment(KRequest2, KSrcBuf2, KDestBuf2, aSize, &rs2) == KErrNone); |
|
884 |
test(aChannel.FragmentCheck(KRequest2, aFragmentCount)); |
|
885 |
XTEST(aChannel.Execute(_L8("Q0Q1Q2")) == KErrNone); |
|
886 |
User::WaitForRequest(rs0); |
|
887 |
XTEST(rs0 == KErrNone); |
|
888 |
User::WaitForRequest(rs1); |
|
889 |
XTEST(rs1 == KErrNone); |
|
890 |
User::WaitForRequest(rs2); |
|
891 |
XTEST(rs2 == KErrNone); |
|
892 |
XTEST(aChannel.CheckBuffer(KDestBuf0, 'A')); |
|
893 |
XTEST(aChannel.CheckBuffer(KDestBuf1, 'B')); |
|
894 |
XTEST(aChannel.CheckBuffer(KDestBuf2, 'C')); |
|
895 |
} |
|
896 |
||
897 |
aChannel.FreeAllBuffers(); |
|
898 |
} |
|
899 |
||
900 |
||
901 |
static TBool ParseCmdLine(TBool& aCrashDbg, TInt& aMaxfrag, TInt& aMaxIter, TInt& aMaxchannel, TInt& aMaxFragSize) |
|
902 |
// |
|
903 |
// The command line. Syntax is: |
|
904 |
// |
|
905 |
// t_dma [enableCrashDebugger [aMaxFrag [aMaxIter [aMaxchannel [aMaxFragSize]]]]] |
|
906 |
// |
|
907 |
{ |
|
908 |
TBuf<256> cmdline; |
|
909 |
User::CommandLine(cmdline); |
|
910 |
TLex lex(cmdline); |
|
911 |
||
912 |
lex.SkipSpace(); |
|
913 |
||
914 |
if (lex.Eos()) |
|
915 |
return ETrue; |
|
916 |
if (lex.Val(aCrashDbg) != KErrNone) |
|
917 |
return EFalse; |
|
918 |
lex.SkipSpace(); |
|
919 |
if (lex.Eos()) |
|
920 |
return ETrue; |
|
921 |
if (lex.Val(aMaxfrag) != KErrNone) |
|
922 |
return EFalse; |
|
923 |
lex.SkipSpace(); |
|
924 |
if (lex.Eos()) |
|
925 |
return ETrue; |
|
926 |
if (lex.Val(aMaxIter) != KErrNone) |
|
927 |
return EFalse; |
|
928 |
lex.SkipSpace(); |
|
929 |
if (lex.Eos()) |
|
930 |
return ETrue; |
|
931 |
if (lex.Val(aMaxchannel) != KErrNone) |
|
932 |
return EFalse; |
|
933 |
lex.SkipSpace(); |
|
934 |
if (lex.Eos()) |
|
935 |
return ETrue; |
|
936 |
||
937 |
return lex.Val(aMaxFragSize) == KErrNone; |
|
938 |
} |
|
939 |
||
940 |
||
941 |
TInt E32Main() |
|
942 |
{ |
|
943 |
test.Title(); |
|
944 |
||
945 |
test.Start(_L("Parsing command-line")); |
|
946 |
// Default values when run with empty command-line |
|
947 |
TInt maxfrag = 16; // 5 fragments needed to exercise fully double-buffering state machine |
|
948 |
TInt maxIter = 3; |
|
949 |
TInt maxchannel = KMaxTInt; |
|
950 |
TBool crashDbg = EFalse; |
|
951 |
TInt maxFragSize = 0x4000; //16k |
|
952 |
||
953 |
(void) ParseCmdLine(crashDbg, maxfrag, maxIter, maxchannel, maxFragSize); |
|
954 |
||
955 |
if (crashDbg) |
|
956 |
{ |
|
957 |
User::SetCritical(User::ESystemCritical); |
|
958 |
User::SetProcessCritical(User::ESystemCritical); |
|
959 |
} |
|
960 |
||
36
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
961 |
|
0 | 962 |
TInt r; |
963 |
#if defined(__DMASIM__) && defined(__WINS__) |
|
964 |
test.Next(_L("Loading DMA simulator")); |
|
965 |
r = User::LoadLogicalDevice(_L("DMASIM.DLL")); |
|
966 |
test(r == KErrNone || r == KErrAlreadyExists); |
|
967 |
#endif |
|
968 |
||
969 |
test.Next(_L("Loading test LDD")); |
|
970 |
#ifdef __DMASIM__ |
|
971 |
r = User::LoadLogicalDevice(_L("D_DMASIM")); |
|
36
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
972 |
test(r == KErrNone || r == KErrAlreadyExists); |
0 | 973 |
#else |
36
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
974 |
//load either the original test ldd, d_dma.ldd, |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
975 |
//or d_dma_compat.ldd - an ldd providing the same interface |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
976 |
//but linked against the new MHA dma framework |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
977 |
_LIT(KDma, "D_DMA.LDD"); |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
978 |
r = User::LoadLogicalDevice(KDma); |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
979 |
const TBool dmaPresent = (r == KErrNone || r == KErrAlreadyExists); |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
980 |
|
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
981 |
_LIT(KDmaCompat, "D_DMA_COMPAT.LDD"); |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
982 |
r = User::LoadLogicalDevice(KDmaCompat); |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
983 |
const TBool dmaCompatPresent = (r == KErrNone || r == KErrAlreadyExists); |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
984 |
|
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
985 |
if (!(dmaPresent || dmaCompatPresent)) |
0 | 986 |
{ |
36
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
987 |
test.Printf(_L("DMA test driver not found - test skipped\n")); |
0 | 988 |
return 0; |
989 |
} |
|
36
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
990 |
else if (dmaPresent && !dmaCompatPresent) |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
991 |
{ |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
992 |
test.Printf(_L("Loaded %S\n"), &KDma); |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
993 |
} |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
994 |
else if (!dmaPresent && dmaCompatPresent) |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
995 |
{ |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
996 |
test.Printf(_L("Loaded %S\n"), &KDmaCompat); |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
997 |
} |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
998 |
else |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
999 |
{ |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1000 |
test.Printf(_L("The ROM contains %S and %S - only one should be present\n"), &KDma, &KDmaCompat); |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1001 |
test(EFalse); |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1002 |
} |
0 | 1003 |
#endif |
1004 |
||
1005 |
// Turn off evil lazy dll unloading |
|
1006 |
RLoader l; |
|
1007 |
test(l.Connect()==KErrNone); |
|
1008 |
test(l.CancelLazyDllUnload()==KErrNone); |
|
1009 |
l.Close(); |
|
1010 |
||
1011 |
__UHEAP_MARK; |
|
1012 |
__KHEAP_MARK; |
|
1013 |
||
1014 |
test.Next(_L("Creating critical section")); |
|
1015 |
test(TheCriticalSection.CreateLocal() == KErrNone); |
|
1016 |
||
1017 |
test.Next(_L("Creating active scheduler")); |
|
1018 |
CActiveScheduler* pS = new CActiveScheduler; |
|
1019 |
test(pS != NULL); |
|
1020 |
CActiveScheduler::Install(pS); |
|
1021 |
||
1022 |
test.Next(_L("Creating bipper")); |
|
1023 |
Bipper = CPeriodic::New(CActive::EPriorityStandard); |
|
1024 |
test(Bipper != NULL); |
|
1025 |
||
1026 |
test.Next(_L("Getting channel info")); |
|
1027 |
GetChannelInfo(); |
|
1028 |
||
81
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1029 |
test.Next(_L("Test that channel can be closed from callback")); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1030 |
test.Next(_L("sb")); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1031 |
RunSbTest(maxchannel, new CCloseInCb() ); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1032 |
test.Next(_L("db")); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1033 |
RunDbTest(maxchannel, new CCloseInCb() ); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1034 |
test.Next(_L("sg")); |
e7d2d738d3c2
Revision: 201010
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1035 |
RunSgTest(maxchannel, new CCloseInCb() ); |
0 | 1036 |
// Size for the single transfer test |
1037 |
TInt totalTransferSize = 64 * KKilo; |
|
1038 |
||
1039 |
test.Next(_L("Testing one shot single buffer transfer")); |
|
1040 |
RunSbTest(maxchannel, new CFragmentationTest(TestOneShot, maxIter, maxfrag, maxFragSize)); |
|
1041 |
RunSbTest(maxchannel, new CDefaultFragTest(TestOneShot, maxIter, totalTransferSize)); |
|
1042 |
||
1043 |
test.Next(_L("Testing one shot double buffer transfer")); |
|
1044 |
RunDbTest(maxchannel, new CFragmentationTest(TestOneShot, maxIter, maxfrag, maxFragSize)); |
|
1045 |
RunDbTest(maxchannel, new CDefaultFragTest(TestOneShot, maxIter, totalTransferSize)); |
|
1046 |
||
1047 |
test.Next(_L("Testing one shot scatter/gather transfer")); |
|
1048 |
RunSgTest(maxchannel, new CFragmentationTest(TestOneShot, maxIter, maxfrag, maxFragSize)); |
|
1049 |
RunSgTest(maxchannel, new CDefaultFragTest(TestOneShot, maxIter, totalTransferSize)); |
|
1050 |
||
1051 |
test.Next(_L("Testing streaming single buffer transfer")); |
|
1052 |
RunSbTest(maxchannel, new CFragmentationTest(TestStreaming, maxIter, maxfrag, maxFragSize)); |
|
1053 |
RunSbTest(maxchannel, new CDefaultFragTest(TestStreaming, maxIter, totalTransferSize)); |
|
1054 |
||
1055 |
test.Next(_L("Testing streaming double buffer transfer")); |
|
1056 |
RunDbTest(maxchannel, new CFragmentationTest(TestStreaming, maxIter, maxfrag, maxFragSize)); |
|
1057 |
RunDbTest(maxchannel, new CDefaultFragTest(TestStreaming, maxIter, totalTransferSize)); |
|
1058 |
||
1059 |
test.Next(_L("Testing streaming scatter/gather transfer")); |
|
1060 |
RunSgTest(maxchannel, new CFragmentationTest(TestStreaming, maxIter, maxfrag, maxFragSize)); |
|
1061 |
RunSgTest(maxchannel, new CDefaultFragTest(TestStreaming, maxIter, totalTransferSize)); |
|
1062 |
||
1063 |
delete pS; |
|
1064 |
delete Bipper; |
|
1065 |
TheCriticalSection.Close(); |
|
1066 |
||
1067 |
UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier, (TAny*)5000, 0); |
|
1068 |
__KHEAP_MARKEND; |
|
1069 |
__UHEAP_MARKEND; |
|
1070 |
||
1071 |
test.End(); |
|
1072 |
return 0; |
|
1073 |
} |