739 buf8.SetLength(22); |
739 buf8.SetLength(22); |
740 nRes = file1.Write(buf8); |
740 nRes = file1.Write(buf8); |
741 test_Value(nRes, nRes == KErrDisMounted); |
741 test_Value(nRes, nRes == KErrDisMounted); |
742 file1.Close(); //-- this will make the previously "Dismounted" mount die. |
742 file1.Close(); //-- this will make the previously "Dismounted" mount die. |
743 |
743 |
744 //--------------------------------------------------------------------------------- |
|
745 //-- 3. check that forced formatting will complete NotifyDismount |
|
746 test.Printf(_L("Test forced formatting completes NotifyDismount\n")); |
|
747 TRequestStatus stat1; |
|
748 |
|
749 nRes = file1.Replace(TheFs, KFname, EFileWrite); |
|
750 test_KErrNone(nRes); |
|
751 |
|
752 TheFs.NotifyDismount(gDrive, stat1, EFsDismountRegisterClient); |
|
753 test(stat1.Int() == KRequestPending); |
|
754 |
|
755 fmtMode = EQuickFormat; |
|
756 nRes = format.Open(TheFs, drivePath, fmtMode, fmtCnt); |
|
757 test_Value(nRes, nRes == KErrInUse); |
|
758 format.Close(); |
|
759 |
|
760 test(stat1.Int() == KRequestPending); |
|
761 |
|
762 fmtMode = EQuickFormat | EForceFormat; |
|
763 nRes = format.Open(TheFs, drivePath, fmtMode, fmtCnt); |
|
764 test_KErrNone(nRes); |
|
765 format.Close(); |
|
766 |
|
767 User::WaitForRequest(stat1); |
|
768 test(stat1.Int() == KErrNone); |
|
769 |
|
770 buf8.SetLength(22); |
|
771 nRes = file1.Write(buf8); |
|
772 test_Value(nRes, nRes == KErrDisMounted); |
744 test_Value(nRes, nRes == KErrDisMounted); |
773 file1.Close(); |
745 file1.Close(); |
774 |
746 |
775 //--------------------------------------------------------------------------------- |
747 //--------------------------------------------------------------------------------- |
776 //-- 4.1 check that forced formatting will succeed with dirty file cache |
748 //-- 4.1 check that forced formatting will succeed with dirty file cache |