0
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of 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\pccd\t_medch.cpp
|
|
15 |
// Continuously generate media changes followesd by a remount of the peripheral bus controller.
|
|
16 |
//
|
|
17 |
//
|
|
18 |
|
|
19 |
#define __E32TEST_EXTENSION__
|
|
20 |
#include <e32test.h>
|
|
21 |
#include <e32svr.h>
|
|
22 |
#include <hal.h>
|
|
23 |
#include "d_medch.h"
|
|
24 |
|
|
25 |
//#define __SOAK_TEST__ // Define to run until a key is pressed (Automatic tests only)
|
|
26 |
//#define __MANUAL_TEST__ // Define to allow manual control of the door/media
|
|
27 |
//#define __DEVICE_HAS_NO_DOOR__ // Define for devices that have no door (Manual tests only)
|
|
28 |
|
|
29 |
#if defined(__MANUAL_TEST__) && defined(__WINS__)
|
|
30 |
#define __DEVICE_HAS_NO_DOOR__
|
|
31 |
#endif
|
|
32 |
|
|
33 |
#if !defined(__MANUAL_TEST__) && defined(__DEVICE_HAS_NO_DOOR__)
|
|
34 |
#undef __DEVICE_HAS_NO_DOOR__
|
|
35 |
#endif
|
|
36 |
|
|
37 |
#if defined(__MANUAL_TEST__) && defined(__SOAK_TEST__)
|
|
38 |
#undef __SOAK_TEST__
|
|
39 |
#endif
|
|
40 |
|
|
41 |
#ifndef __SOAK_TEST__
|
|
42 |
#ifdef __WINS__
|
|
43 |
const TInt KMaxTestTime = 5000000; // Run the test for 5 seconds on emulator
|
|
44 |
#else
|
|
45 |
const TInt KMaxTestTime = 10000000; // Run the test for 10 seconds on target
|
|
46 |
#endif
|
|
47 |
#endif
|
|
48 |
|
|
49 |
#define MMC_PDD_NAME _L("MEDMMC")
|
|
50 |
|
|
51 |
const TInt KPowerUpTimeOut = 5000000; // Give the card 5 seconds to power up
|
|
52 |
|
189
|
53 |
const TUint KDriveAttMask = KDriveAttLocal | KDriveAttRom | KDriveAttRemote;
|
|
54 |
const TUint KMediaAttMask = KMediaAttVariableSize | KMediaAttDualDensity | KMediaAttLockable | KMediaAttLocked | KMediaAttHasPassword | KMediaAttReadWhileWrite;
|
|
55 |
|
0
|
56 |
LOCAL_D RTest test(_L("Media change test"));
|
|
57 |
|
|
58 |
LOCAL_D TBusLocalDrive TheDrive;
|
|
59 |
LOCAL_D RMedCh TheMediaChange;
|
|
60 |
LOCAL_D TRequestStatus TheMediaStatus;
|
|
61 |
LOCAL_D TBool TheChangedFlag;
|
|
62 |
|
189
|
63 |
LOCAL_C TInt FindDataPagingDrive()
|
|
64 |
/**
|
|
65 |
Find the drive containing the swap partition.
|
|
66 |
|
|
67 |
@return Local drive identifier or KErrNotFound if not found
|
|
68 |
*/
|
|
69 |
{
|
|
70 |
TInt drive = KErrNotFound;
|
|
71 |
|
|
72 |
RLocalDrive d;
|
|
73 |
TBool change = EFalse;
|
|
74 |
TLocalDriveCapsV5 driveCaps;
|
|
75 |
TPckg<TLocalDriveCapsV5> capsPack(driveCaps);
|
|
76 |
|
|
77 |
for(TInt i = 0; i < KMaxLocalDrives && drive < 0; ++i)
|
|
78 |
{
|
|
79 |
if(d.Connect(i, change) == KErrNone)
|
|
80 |
{
|
|
81 |
if(d.Caps(capsPack) == KErrNone)
|
|
82 |
{
|
|
83 |
if ((driveCaps.iMediaAtt & KMediaAttPageable) &&
|
|
84 |
(driveCaps.iPartitionType == KPartitionTypePagedData))
|
|
85 |
{
|
|
86 |
drive = i;
|
|
87 |
}
|
|
88 |
}
|
|
89 |
d.Close();
|
|
90 |
}
|
|
91 |
}
|
|
92 |
|
|
93 |
if(drive == KErrNotFound)
|
|
94 |
{
|
|
95 |
test.Printf(_L("No data paging drive found\n"));
|
|
96 |
}
|
|
97 |
|
|
98 |
return drive;
|
|
99 |
}
|
|
100 |
|
|
101 |
LOCAL_C TInt DataPagingMediaCaps(TLocalDriveCapsV5 &aCaps)
|
|
102 |
/**
|
|
103 |
Return the caps of the media containing a swap partition.
|
|
104 |
|
|
105 |
@return Error code, on success aCaps contains the capabilities of the paging drive
|
|
106 |
*/
|
|
107 |
{
|
|
108 |
TInt dataPagingDrive = FindDataPagingDrive();
|
|
109 |
|
|
110 |
if (dataPagingDrive == KErrNotFound)
|
|
111 |
{
|
|
112 |
return KErrNotFound;
|
|
113 |
}
|
|
114 |
|
|
115 |
RLocalDrive dpDrive;
|
|
116 |
TBool change = EFalse;
|
|
117 |
|
|
118 |
TInt r = dpDrive.Connect(dataPagingDrive, change);
|
|
119 |
test(r == KErrNone);
|
|
120 |
|
|
121 |
TLocalDriveCapsV5 dpDriveCaps;
|
|
122 |
TPckg<TLocalDriveCapsV5> capsPack(dpDriveCaps);
|
|
123 |
r = dpDrive.Caps(capsPack);
|
|
124 |
test(r == KErrNone);
|
|
125 |
|
|
126 |
if((dpDriveCaps.iDriveAtt & KDriveAttHidden) == 0)
|
|
127 |
{
|
|
128 |
test.Printf(_L("Paging partition is not hidden! Assuming it is correct anyway!\n"));
|
|
129 |
}
|
|
130 |
|
|
131 |
aCaps = dpDriveCaps;
|
|
132 |
|
|
133 |
return KErrNone;
|
|
134 |
}
|
|
135 |
|
|
136 |
LOCAL_C TBool IsDriveOnPagingMedia(TInt aDrive, TLocalDriveCapsV5 &aPagingMediaCaps)
|
|
137 |
/**
|
|
138 |
Determines whether a drive is on the same media as the paging media by comparing
|
|
139 |
media characteristics
|
|
140 |
|
|
141 |
@return ETrue if (likely) to be on the same media, EFalse if not.
|
|
142 |
*/ {
|
|
143 |
RLocalDrive drive;
|
|
144 |
TBool change = EFalse;
|
|
145 |
|
|
146 |
TInt r = drive.Connect(aDrive, change);
|
|
147 |
test(r == KErrNone);
|
|
148 |
|
|
149 |
TLocalDriveCapsV5 driveCaps;
|
|
150 |
TPckg<TLocalDriveCapsV5> capsPack(driveCaps);
|
|
151 |
r = drive.Caps(capsPack);
|
|
152 |
test(r == KErrNone);
|
|
153 |
|
|
154 |
// Check media serial number
|
|
155 |
if(aPagingMediaCaps.iSerialNumLength > 0)
|
|
156 |
{
|
|
157 |
if((driveCaps.iSerialNumLength > 0) &&
|
|
158 |
((memcompare(driveCaps.iSerialNum, driveCaps.iSerialNumLength,
|
|
159 |
aPagingMediaCaps.iSerialNum, aPagingMediaCaps.iSerialNumLength)) == 0))
|
|
160 |
{
|
|
161 |
// serial numbers equal, so drive in question is on same media as paging drive
|
|
162 |
test.Printf(_L("Based on serial number match, drive %d shares the same media as paging drive\n"), aDrive);
|
|
163 |
return ETrue;
|
|
164 |
}
|
|
165 |
}
|
|
166 |
else
|
|
167 |
{
|
|
168 |
// Turn off bits which may be different
|
|
169 |
aPagingMediaCaps.iDriveAtt &= KDriveAttMask;
|
|
170 |
aPagingMediaCaps.iMediaAtt &= KMediaAttMask;
|
|
171 |
driveCaps.iDriveAtt &= KDriveAttMask;
|
|
172 |
driveCaps.iMediaAtt &= KMediaAttMask;
|
|
173 |
|
|
174 |
if ((driveCaps.iType == aPagingMediaCaps.iType) &&
|
|
175 |
(driveCaps.iDriveAtt == aPagingMediaCaps.iDriveAtt) &&
|
|
176 |
(driveCaps.iMediaAtt == aPagingMediaCaps.iMediaAtt))
|
|
177 |
{
|
|
178 |
test.Printf(_L("Based on media characteristics match, drive %d shares the same media as paging drive\n"), aDrive);
|
|
179 |
return ETrue;
|
|
180 |
}
|
|
181 |
}
|
|
182 |
|
|
183 |
return EFalse;
|
|
184 |
}
|
|
185 |
|
0
|
186 |
|
|
187 |
LOCAL_C TBool SetupDrivesForPlatform(TInt& aDrive, TInt& aSocket)
|
|
188 |
/**
|
|
189 |
* Finds a suitable drive for the media change test
|
|
190 |
*
|
|
191 |
* @param aDrive The number of the local drive to test
|
|
192 |
* @param aSocket The number of the socket to test
|
|
193 |
* @return TBool ETrue if a suitable drive is found, EFalse otherwise.
|
|
194 |
*/
|
|
195 |
{
|
|
196 |
|
|
197 |
TDriveInfoV1Buf diBuf;
|
|
198 |
UserHal::DriveInfo(diBuf);
|
|
199 |
TDriveInfoV1 &di=diBuf();
|
|
200 |
|
|
201 |
aDrive = -1;
|
|
202 |
aSocket = -1;
|
|
203 |
|
189
|
204 |
TLocalDriveCapsV5 pagingMediaCaps;
|
|
205 |
TBool pagingMediaCheck = EFalse;
|
|
206 |
if(DataPagingMediaCaps(pagingMediaCaps) == KErrNone)
|
|
207 |
{
|
|
208 |
pagingMediaCheck = ETrue;
|
|
209 |
}
|
|
210 |
|
0
|
211 |
for(aDrive=0; aDrive < di.iTotalSupportedDrives; aDrive++)
|
|
212 |
{
|
|
213 |
test.Printf(_L(" Drive %d - %S\r\n"), aDrive, &di.iDriveName[aDrive]);
|
|
214 |
if(di.iDriveName[aDrive].MatchF(_L("MultiMediaCard0")) == KErrNone)
|
189
|
215 |
{
|
|
216 |
if(pagingMediaCheck)
|
|
217 |
{
|
|
218 |
if( ! IsDriveOnPagingMedia(aDrive, pagingMediaCaps))
|
|
219 |
{
|
|
220 |
break;
|
|
221 |
}
|
|
222 |
}
|
231
|
223 |
else
|
|
224 |
{
|
|
225 |
break;
|
|
226 |
}
|
189
|
227 |
}
|
0
|
228 |
}
|
|
229 |
|
|
230 |
if(aDrive == di.iTotalSupportedDrives)
|
|
231 |
{
|
|
232 |
test.Printf(_L(" MMC Drive Not Found\r\n"));
|
|
233 |
return EFalse;
|
|
234 |
}
|
|
235 |
|
|
236 |
|
|
237 |
for(aSocket=0; aSocket < di.iTotalSockets; aSocket++)
|
|
238 |
{
|
|
239 |
test.Printf(_L("Socket %d - %S\r\n"), aSocket, &di.iSocketName[aSocket]);
|
|
240 |
if(di.iSocketName[aSocket].MatchF(_L("MultiMediaCard0")) == KErrNone)
|
|
241 |
break;
|
|
242 |
}
|
|
243 |
|
|
244 |
if(aSocket == di.iTotalSockets)
|
|
245 |
{
|
|
246 |
test.Printf(_L(" MMC Socket Not Found\r\n"));
|
|
247 |
return EFalse;
|
|
248 |
}
|
|
249 |
|
|
250 |
return ETrue;
|
|
251 |
}
|
|
252 |
|
|
253 |
LOCAL_C void TestMediaAccess(TInt aExpectedError, TBool aExpectedChange)
|
|
254 |
/**
|
|
255 |
* Tests that the drive is accessable (or not) by issuing a request
|
|
256 |
* to power up the media. Also verifies that the attributes are correct.
|
|
257 |
*
|
|
258 |
* @param aExpectedError The expected result of powering up the drive
|
|
259 |
* @param aExpectedChange ETrue if the changed flag is expected to be set
|
|
260 |
*
|
|
261 |
* @return ETrue if successful, EFalse otherwise
|
|
262 |
*/
|
|
263 |
{
|
|
264 |
|
|
265 |
RTimer rto;
|
|
266 |
TInt r = rto.CreateLocal();
|
|
267 |
test(r == KErrNone);
|
|
268 |
|
|
269 |
TRequestStatus rtoStat;
|
|
270 |
rto.After(rtoStat, KPowerUpTimeOut);
|
|
271 |
test(rtoStat == KRequestPending);
|
|
272 |
|
|
273 |
if(aExpectedChange)
|
|
274 |
{
|
|
275 |
// TheChangedFlag is set when the door is opened if media was present.
|
|
276 |
// The asynch notifier is signalled when media is removed OR inserted.
|
|
277 |
User::WaitForRequest(TheMediaStatus, rtoStat);
|
|
278 |
test(TheMediaStatus != KRequestPending);
|
|
279 |
}
|
|
280 |
|
|
281 |
// ...aChangedFlag's purpose is to notify us of media removal.
|
|
282 |
test_Equal(aExpectedChange,TheChangedFlag);
|
|
283 |
|
|
284 |
TheDrive.NotifyChange(&TheMediaStatus);
|
|
285 |
TheChangedFlag = EFalse;
|
|
286 |
|
|
287 |
// Attempt to power up the drive
|
|
288 |
TLocalDriveCapsV2Buf info;
|
|
289 |
do
|
|
290 |
{
|
|
291 |
r = TheDrive.Caps(info);
|
|
292 |
}
|
|
293 |
while(r != aExpectedError && rtoStat == KRequestPending);
|
|
294 |
|
|
295 |
rto.Cancel();
|
|
296 |
rto.Close();
|
|
297 |
|
|
298 |
// ...was the error as expected?
|
|
299 |
test(r == aExpectedError);
|
|
300 |
|
|
301 |
// ...and are the caps still OK?
|
|
302 |
if(r == KErrNone)
|
|
303 |
test(info().iType == EMediaHardDisk);
|
|
304 |
else if(r == KErrNotReady)
|
|
305 |
test(info().iType == EMediaNotPresent);
|
|
306 |
|
|
307 |
if(aExpectedChange == EFalse)
|
|
308 |
test(TheMediaStatus == KRequestPending);
|
|
309 |
}
|
|
310 |
|
|
311 |
LOCAL_C void NextTest(const TDesC& aTitle, TInt aCycles)
|
|
312 |
/**
|
|
313 |
* Simply displays a string on the console and the current iteration.
|
|
314 |
*
|
|
315 |
* @param aTitle The text to be displayed
|
|
316 |
* @param aCycles The current iteration
|
|
317 |
*/
|
|
318 |
{
|
|
319 |
test.Console()->SetPos(20, 25);
|
189
|
320 |
test.Printf(_L("%S [%d cycles]\n"), &aTitle, aCycles);
|
0
|
321 |
#ifdef __MANUAL_TEST__
|
|
322 |
test.Console()->SetPos(20, 27);
|
189
|
323 |
test.Printf(_L("<press a key>\n"));
|
0
|
324 |
test.Getch();
|
|
325 |
#endif
|
|
326 |
}
|
189
|
327 |
|
0
|
328 |
GLDEF_C TInt E32Main()
|
|
329 |
/**
|
|
330 |
* Test Entry Point for T_MEDCH.
|
|
331 |
*
|
|
332 |
* This test uses the associated driver (D_MEDCH) to simulate media removal and
|
|
333 |
* door opening/closing. The media is powered up in each state and verified that
|
|
334 |
* the correct error code and changed count is returned.
|
|
335 |
*/
|
|
336 |
{
|
|
337 |
TBuf<64> b;
|
|
338 |
test.Title();
|
|
339 |
|
|
340 |
/**
|
|
341 |
* Load the associated media driver (MEDMMC by default). This is required to ensure
|
|
342 |
* that the device can be powered up and the capabilities if the media accessed.
|
|
343 |
*/
|
|
344 |
test.Start(_L("Load Media Driver"));
|
|
345 |
TInt r;
|
|
346 |
r=User::LoadPhysicalDevice(MMC_PDD_NAME);
|
|
347 |
if(r==KErrNotFound)
|
|
348 |
{
|
|
349 |
test.Printf(_L("Test not supported on this platform \n"));
|
|
350 |
test.End();
|
|
351 |
return(0);
|
|
352 |
}
|
|
353 |
test(r==KErrNone || r==KErrAlreadyExists);
|
|
354 |
|
|
355 |
/**
|
|
356 |
* Connect to the required local drive.
|
|
357 |
* TheChangedFlag is used for detection of media removal.
|
|
358 |
*/
|
|
359 |
TInt drive;
|
|
360 |
TInt socket;
|
189
|
361 |
|
0
|
362 |
if(SetupDrivesForPlatform(drive, socket))
|
|
363 |
{
|
|
364 |
b.Format(_L("Connect to local drive %d"), drive);
|
|
365 |
test.Next(b);
|
|
366 |
TheDrive.Connect(drive, TheChangedFlag);
|
|
367 |
|
|
368 |
/**
|
|
369 |
* Read the drive capabilities to ensure that this test may be run.
|
|
370 |
*/
|
|
371 |
test.Next(_L("Get drive capabilities"));
|
|
372 |
TLocalDriveCapsV2Buf info;
|
|
373 |
r = TheDrive.Caps(info);
|
|
374 |
if(r == KErrNotReady || r == KErrNotSupported)
|
|
375 |
{
|
|
376 |
test.Next(_L("\r\nTest requires media to be present and the door closed - Disconnecting"));
|
|
377 |
TheDrive.Disconnect();
|
|
378 |
test.End();
|
|
379 |
return KErrNone;
|
|
380 |
}
|
|
381 |
test(r == KErrNone);
|
|
382 |
|
|
383 |
test(TheDrive.Caps(info) == KErrNone);
|
|
384 |
test(info().iType == EMediaHardDisk);
|
|
385 |
|
|
386 |
/**
|
|
387 |
* Load the media simulation test driver
|
|
388 |
*/
|
|
389 |
test.Next(_L("Load media change logical device"));
|
|
390 |
r=User::LoadLogicalDevice(_L("D_MEDCH"));
|
|
391 |
test(r == KErrNone || r == KErrAlreadyExists);
|
|
392 |
|
|
393 |
test.Next(_L("Open device"));
|
|
394 |
r=TheMediaChange.Open(socket, TheMediaChange.VersionRequired());
|
|
395 |
if(r == KErrNotSupported)
|
|
396 |
{
|
|
397 |
test.Next(_L("\r\nTest not supported on this drive - Disconnecting"));
|
|
398 |
r=User::FreeLogicalDevice(_L("MedCh"));
|
|
399 |
test(r == KErrNone);
|
|
400 |
TheDrive.Disconnect();
|
|
401 |
test.End();
|
|
402 |
return KErrNone;
|
|
403 |
}
|
|
404 |
test(r == KErrNone);
|
|
405 |
|
|
406 |
/**
|
|
407 |
* Verify that the system supports simulation of media change events
|
|
408 |
*/
|
|
409 |
test.Next(_L("Test support for media change simulation"));
|
|
410 |
r = TheMediaChange.DoorNormal();
|
|
411 |
test(r == KErrNone || r == KErrNotSupported);
|
|
412 |
|
|
413 |
/**
|
|
414 |
* Now for the real testing...
|
|
415 |
*/
|
|
416 |
if(r == KErrNone)
|
|
417 |
{
|
|
418 |
/**
|
|
419 |
* Test0 - Simulate 2 consecutive door open interrupts
|
|
420 |
*/
|
|
421 |
test.Next(_L("Test that the pbus can handle 2 consecutive door open interrupts"));
|
|
422 |
TheDrive.NotifyChange(&TheMediaStatus);
|
|
423 |
r = TheMediaChange.DoubleDoorOpen();
|
|
424 |
test(r == KErrNone || r == KErrNotSupported);
|
|
425 |
TestMediaAccess(KErrNone, ETrue);
|
|
426 |
|
|
427 |
|
|
428 |
TInt cycles=0;
|
|
429 |
#if defined(__SOAK_TEST__)
|
|
430 |
TRequestStatus endStat;
|
|
431 |
test.Console()->Read(endStat);
|
|
432 |
while(endStat == KRequestPending)
|
|
433 |
#elif !defined(__MANUAL_TEST__)
|
|
434 |
RTimer t;
|
|
435 |
r=t.CreateLocal();
|
|
436 |
test(r == KErrNone);
|
|
437 |
TRequestStatus endStat;
|
|
438 |
t.After(endStat, KMaxTestTime);
|
|
439 |
test(endStat == KRequestPending);
|
|
440 |
while(endStat == KRequestPending)
|
|
441 |
#endif
|
|
442 |
{
|
|
443 |
TheChangedFlag = EFalse;
|
|
444 |
|
|
445 |
TheDrive.NotifyChange(&TheMediaStatus);
|
|
446 |
|
|
447 |
/**
|
|
448 |
* Test1 - Simulate door open
|
|
449 |
* - Power up responds with KErrNotReady
|
|
450 |
*/
|
|
451 |
NextTest(_L("Open Door......"), cycles);
|
|
452 |
#ifndef __MANUAL_TEST__
|
|
453 |
test(TheMediaChange.DoorOpen() == KErrNone);
|
|
454 |
#endif
|
|
455 |
TestMediaAccess(KErrNotReady, ETrue);
|
|
456 |
TheDrive.NotifyChange(&TheMediaStatus);
|
|
457 |
|
|
458 |
/**
|
|
459 |
* Test2 - Simulate door closed (with media removed)
|
|
460 |
* - Power up responds with KErrNotReady
|
|
461 |
*/
|
|
462 |
#ifndef __DEVICE_HAS_NO_DOOR__
|
|
463 |
NextTest(_L("Remove Media..."), cycles);
|
|
464 |
#ifndef __MANUAL_TEST__
|
|
465 |
test(TheMediaChange.DoorClose(EFalse) == KErrNone);
|
|
466 |
#endif
|
|
467 |
TestMediaAccess(KErrNotReady, EFalse);
|
|
468 |
/**
|
|
469 |
* Test3 - Simulate door open
|
|
470 |
* - Power up responds with KErrNotReady
|
|
471 |
*/
|
|
472 |
NextTest(_L("Open Door......"), cycles);
|
|
473 |
#ifndef __MANUAL_TEST__
|
|
474 |
test(TheMediaChange.DoorOpen() == KErrNone);
|
|
475 |
#endif
|
|
476 |
TestMediaAccess(KErrNotReady, EFalse); // Power up responds with KErrNotReady
|
|
477 |
#endif
|
|
478 |
/**
|
|
479 |
* Test4 - Simulate door closed (with media present)
|
|
480 |
* - Power up responds with KErrNone
|
|
481 |
*/
|
|
482 |
NextTest(_L("Insert Media..."), cycles);
|
|
483 |
#ifndef __MANUAL_TEST__
|
|
484 |
test(TheMediaChange.DoorClose(ETrue) == KErrNone);
|
|
485 |
#endif
|
|
486 |
TestMediaAccess(KErrNone, ETrue);
|
|
487 |
++cycles;
|
|
488 |
}
|
|
489 |
|
|
490 |
test.Console()->SetPos(0, 27);
|
|
491 |
#if !defined(__SOAK_TEST__) && !defined(__MANUAL_TEST__)
|
|
492 |
t.Close();
|
|
493 |
#endif
|
|
494 |
}
|
|
495 |
else if(r == KErrNotSupported)
|
|
496 |
{
|
|
497 |
test.Printf(_L("Media change simulation not supported"));
|
|
498 |
}
|
|
499 |
|
|
500 |
/**
|
|
501 |
* Tidy up and exit
|
|
502 |
*/
|
|
503 |
test.Next(_L("\r\nClose device"));
|
|
504 |
TheMediaChange.Close();
|
|
505 |
|
|
506 |
test.Next(_L("Free device"));
|
|
507 |
r=User::FreeLogicalDevice(_L("MedCh"));
|
|
508 |
test(r == KErrNone);
|
|
509 |
|
|
510 |
b.Format(_L("\r\nDisconnect from local drive %d "), drive);
|
|
511 |
test.Next(b);
|
|
512 |
TheDrive.Disconnect();
|
|
513 |
}
|
|
514 |
|
|
515 |
test.End();
|
|
516 |
return(0);
|
|
517 |
}
|
|
518 |
|