kerneltest/f32test/server/t_mmc.cpp
changeset 109 b3a1d9898418
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
102:ef2a444a7410 109:b3a1d9898418
    19 // appears exactly when indicated by the program.
    19 // appears exactly when indicated by the program.
    20 // 
    20 // 
    21 //
    21 //
    22 
    22 
    23 
    23 
       
    24 #define __E32TEST_EXTENSION__
    24 #include <f32file.h>
    25 #include <f32file.h>
    25 #include <e32test.h>
    26 #include <e32test.h>
    26 #include <f32dbg.h>
    27 #include <f32dbg.h>
    27 #include <f32fsys.h>
    28 #include <f32fsys.h>
    28 
    29 
   168 		{
   169 		{
   169 		User::After(100 * 1000);
   170 		User::After(100 * 1000);
   170 		r = TheFs.Delete(mediaPWrdFile);
   171 		r = TheFs.Delete(mediaPWrdFile);
   171 		} while (r == KErrInUse);
   172 		} while (r == KErrInUse);
   172 
   173 
   173 	test(r == KErrNone || r == KErrNotFound);
   174 	test_Value(r, r == KErrNone || r == KErrNotFound);
   174 	}
   175 	}
   175 
   176 
   176 
   177 
   177 /** attempt to create a file on the removable media and return any error code */
   178 /** attempt to create a file on the removable media and return any error code */
   178 
   179 
   651 
   652 
   652 	test(TheFs.ClearPassword(KDrv, oldPswd) == KErrNone);
   653 	test(TheFs.ClearPassword(KDrv, oldPswd) == KErrNone);
   653 	User::After(1 * 1000 * 1000);				// wait to finish writing
   654 	User::After(1 * 1000 * 1000);				// wait to finish writing
   654 	
   655 	
   655 	r = TheFs.Delete(mediaPWrdFile);
   656 	r = TheFs.Delete(mediaPWrdFile);
   656 	test(r == KErrNone || r == KErrNotFound);
   657 	test_Value(r, r == KErrNone || r == KErrNotFound);
   657 	test(TBusLocalDrive::WritePasswordData(noMappings) == KErrNone);
   658 	test(TBusLocalDrive::WritePasswordData(noMappings) == KErrNone);
   658 
   659 
   659 	// check contents of password file correspond to last written buffer.
   660 	// check contents of password file correspond to last written buffer.
   660 
   661 
   661 	test(chkBuf.Length() == KFileLen);
   662 	test(chkBuf.Length() == KFileLen);
   814 
   815 
   815 	TBuf<sizeof(KMediaPWrdFile)> mediaPWrdFile(KMediaPWrdFile);
   816 	TBuf<sizeof(KMediaPWrdFile)> mediaPWrdFile(KMediaPWrdFile);
   816 	mediaPWrdFile[0] = (TUint8) RFs::GetSystemDriveChar();
   817 	mediaPWrdFile[0] = (TUint8) RFs::GetSystemDriveChar();
   817 	TParsePtrC ppc(mediaPWrdFile);
   818 	TParsePtrC ppc(mediaPWrdFile);
   818 	TInt r = TheFs.MkDir(ppc.DriveAndPath());
   819 	TInt r = TheFs.MkDir(ppc.DriveAndPath());
   819 	test(r == KErrNone || r == KErrAlreadyExists);
   820 	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
   820 
   821 
   821 	// The media driver for the protected area of the SD card uses mount
   822 	// The media driver for the protected area of the SD card uses mount
   822 	// info. This is also used for password unlocking by the MMC media driver.
   823 	// info. This is also used for password unlocking by the MMC media driver.
   823 	// Due to a temporary problem with the way mount info. is assigned to DMedia
   824 	// Due to a temporary problem with the way mount info. is assigned to DMedia
   824 	// objects which results in a conflict between the two drivers, unload
   825 	// objects which results in a conflict between the two drivers, unload