695 remounts = (TInt) info.iBattery; |
695 remounts = (TInt) info.iBattery; |
696 test.Printf(_L("Remounts = %d\n"), remounts); |
696 test.Printf(_L("Remounts = %d\n"), remounts); |
697 test(remounts == KMaxMountFailures); |
697 test(remounts == KMaxMountFailures); |
698 |
698 |
699 // simulate a media change to reset failure count |
699 // simulate a media change to reset failure count |
700 r = TheFs.RemountDrive(aDrive, NULL, 0); |
700 r = TheFs.RemountDrive(aDrive, NULL, RFs::KForceMediaChangeReOpenAllMediaDrivers); |
701 |
701 |
702 // now try mounting again & verify the the file server attempts to mount the drive again |
702 // now try mounting again & verify the the file server attempts to mount the drive again |
703 for (entryAttempts=0; entryAttempts < KEntryAttempts; entryAttempts++) |
703 for (entryAttempts=0; entryAttempts < KEntryAttempts; entryAttempts++) |
704 { |
704 { |
705 TEntry entry; |
705 TEntry entry; |
1333 test_KErrNone(nRes); |
1333 test_KErrNone(nRes); |
1334 |
1334 |
1335 nRes = TheFs.DismountFileSystem(fsName, drvNumber); |
1335 nRes = TheFs.DismountFileSystem(fsName, drvNumber); |
1336 test_Value(nRes, nRes == KErrInUse); |
1336 test_Value(nRes, nRes == KErrInUse); |
1337 |
1337 |
1338 // Flag from locmedia.h to simulate ejecting and re-inserting the media. |
1338 |
1339 const TUint KMediaRemountForceMediaChange = 0x00000001; |
|
1340 TRequestStatus changeStatus; |
1339 TRequestStatus changeStatus; |
1341 TheFs.NotifyChange(ENotifyAll, changeStatus); |
1340 TheFs.NotifyChange(ENotifyAll, changeStatus); |
1342 |
1341 |
1343 |
1342 |
1344 //-- 3. forcedly remount the drive |
1343 //-- 3. forcedly remount the drive to simulate ejecting and re-inserting the media. |
1345 nRes = TheFs.RemountDrive(drvNumber, NULL, KMediaRemountForceMediaChange); |
1344 nRes = TheFs.RemountDrive(drvNumber, NULL, RFs::KMediaRemountForceMediaChange); |
1346 |
1345 |
1347 if(nRes == KErrNotSupported) |
1346 if(nRes == KErrNotSupported) |
1348 {//-- this feature is not supported and the test is inconsistent. |
1347 {//-- this feature is not supported and the test is inconsistent. |
1349 test.Printf(_L("RemountDrive() is not supported, the test is inconsistent!\n")); |
1348 test.Printf(_L("RemountDrive() is not supported, the test is inconsistent!\n")); |
1350 |
1349 |