kerneltest/f32test/server/t_fsys.cpp
changeset 4 56f325a607ea
parent 0 a41df078684a
child 6 0173bcd7697c
equal deleted inserted replaced
2:4122176ea935 4:56f325a607ea
   170 	if(r!=KErrNone && r!=KErrAlreadyExists)
   170 	if(r!=KErrNone && r!=KErrAlreadyExists)
   171 		{
   171 		{
   172 		test.Printf(_L("error=%d"),r);
   172 		test.Printf(_L("error=%d"),r);
   173 		test(EFalse);
   173 		test(EFalse);
   174 		}
   174 		}
   175 	
       
   176 
   175 
   177 	TFullName oldFs;
   176 	TFullName oldFs;
   178 	r=TheFs.FileSystemName(oldFs,aDrive);
   177 	r=TheFs.FileSystemName(oldFs,aDrive);
   179 //	TFileName oldFs;
   178 //	TFileName oldFs;
   180 //	r=TheFs.FileSystemName(oldFs,aDrive);
   179 //	r=TheFs.FileSystemName(oldFs,aDrive);
   269 	if(r!=KErrNone && r!=KErrAlreadyExists)
   268 	if(r!=KErrNone && r!=KErrAlreadyExists)
   270 		{
   269 		{
   271 		test.Printf(_L("error=%d"),r);
   270 		test.Printf(_L("error=%d"),r);
   272 		test(EFalse);
   271 		test(EFalse);
   273 		}
   272 		}
   274 	
       
   275 
   273 
   276 	TFullName oldFs;
   274 	TFullName oldFs;
   277 	r=TheFs.FileSystemName(oldFs,aDrive);
   275 	r=TheFs.FileSystemName(oldFs,aDrive);
   278 	test(r==KErrNone);
   276 	test(r==KErrNone);
   279 	r=TheFs.DismountFileSystem(oldFs,aDrive);
   277 	r=TheFs.DismountFileSystem(oldFs,aDrive);
   319 		(TUint)info.iBattery,info.iDriveAtt,info.iMediaAtt);
   317 		(TUint)info.iBattery,info.iDriveAtt,info.iMediaAtt);
   320 	remounts = (TInt) info.iBattery;
   318 	remounts = (TInt) info.iBattery;
   321 	test.Printf(_L("Remounts = %d"), remounts);
   319 	test.Printf(_L("Remounts = %d"), remounts);
   322 	test(remounts ==  KMaxMountFailures);
   320 	test(remounts ==  KMaxMountFailures);
   323 	
   321 	
   324 
       
   325 	// simulate a media change to reset failure count
   322 	// simulate a media change to reset failure count
   326 	r = TheFs.RemountDrive(aDrive, NULL, 0);
   323 	r = TheFs.RemountDrive(aDrive, NULL, 0);
   327 
   324 
   328 	// now try mounting again & verify the the file server attempts to mount the drive again
   325 	// now try mounting again & verify the the file server attempts to mount the drive again
   329 	for (entryAttempts=0; entryAttempts < KEntryAttempts; entryAttempts++)
   326 	for (entryAttempts=0; entryAttempts < KEntryAttempts; entryAttempts++)
   566 				}
   563 				}
   567 			else if (driveInfo.iType==EMediaCdRom)
   564 			else if (driveInfo.iType==EMediaCdRom)
   568 				{
   565 				{
   569 				test.Printf(_L("CD ROM with no media!\n"));
   566 				test.Printf(_L("CD ROM with no media!\n"));
   570                 r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
   567                 r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
   571 				test(r == KErrNone);
   568 				test(r == KErrNone || r == KErrNotReady);
   572 				}
   569 				}
   573 			else
   570 			else
   574 				{
   571 				{
   575 				r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
   572 				r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
   576 				test(KErrNone == r);
   573 				test(KErrNone == r);
   671 			if (driveInfo.iType==EMediaNotPresent)
   668 			if (driveInfo.iType==EMediaNotPresent)
   672 				{
   669 				{
   673 				r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
   670 				r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
   674 				test(r == KErrNone || r == KErrNotReady);
   671 				test(r == KErrNone || r == KErrNotReady);
   675 				}
   672 				}
       
   673 			else if (driveInfo.iType==EMediaCdRom)
       
   674 				{
       
   675 				test.Printf(_L("CD ROM with no media will report not ready!\n"));
       
   676                 r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
       
   677 				test(r == KErrNotReady);
       
   678 				}
   676 			else
   679 			else
   677 				{
   680 				{
   678 				r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
   681 				r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
   679 				test(KErrNone == r);
   682 				test(KErrNone == r);
   680 				// if MMC, test block size >= 512;
   683 				// if MMC, test block size >= 512;
   705 					TBool changeFlag = EFalse;	
   708 					TBool changeFlag = EFalse;	
   706 					TInt locDriveNumber;
   709 					TInt locDriveNumber;
   707 					TLocalDriveCaps DriveCaps;
   710 					TLocalDriveCaps DriveCaps;
   708 					TLocalDriveCapsV7 DriveCapsV7;
   711 					TLocalDriveCapsV7 DriveCapsV7;
   709 					for(locDriveNumber = 0; locDriveNumber < KMaxLocalDrives; locDriveNumber++)
   712 					for(locDriveNumber = 0; locDriveNumber < KMaxLocalDrives; locDriveNumber++)
   710 					{
   713 						{
   711 						r = drive.Connect(locDriveNumber,changeFlag);
   714 						r = drive.Connect(locDriveNumber,changeFlag);
   712 						if(r==KErrNone)
   715 						if(r==KErrNone)
   713 						{
   716 							{
   714 						TPckg<TLocalDriveCaps> capsPckg(DriveCaps);
   717 							TPckg<TLocalDriveCaps> capsPckg(DriveCaps);
   715 						r=drive.Caps(capsPckg);
   718 							r=drive.Caps(capsPckg);
   716 						if((r==KErrNone) && (DriveCaps.iFileSystemId==KDriveFileSysLFFS))
   719 							if((r==KErrNone) && (DriveCaps.iFileSystemId==KDriveFileSysLFFS))
   717 						{
   720 								{
   718 							
   721 								break;
   719 							break;
   722 								}
       
   723 							drive.Disconnect();
       
   724 							}
   720 						}
   725 						}
   721 						drive.Disconnect();
       
   722 						}
       
   723 					}
       
   724 					TPckg<TLocalDriveCapsV7> capsPckg(DriveCapsV7);
   726 					TPckg<TLocalDriveCapsV7> capsPckg(DriveCapsV7);
   725 					r=drive.Caps(capsPckg);
   727 					r=drive.Caps(capsPckg);
   726 					test(r==KErrNone);
   728 					test(r==KErrNone);
   727 					if ((fsName.CompareF(_L("Lffs"))==0) && (DriveCapsV7.iObjectModeSize != 0))
   729 					if ((fsName.CompareF(_L("Lffs"))==0) && (DriveCapsV7.iObjectModeSize != 0))
   728 					{	
   730 						{					
   729 									
       
   730 						test(ioInfo().iBlockSize == (TInt) DriveCapsV7.iObjectModeSize);
   731 						test(ioInfo().iBlockSize == (TInt) DriveCapsV7.iObjectModeSize);
   731 						continue;
   732 						continue;
   732 					}
   733 						}
   733 					else
   734 					else
   734 					{
   735 						{
   735 					test(ioInfo().iBlockSize == (TInt) KDefaultVolumeBlockSize);
   736 						test(ioInfo().iBlockSize == (TInt) KDefaultVolumeBlockSize);
   736 					continue;
   737 						continue;
   737 					}
   738 						}
   738 					}
   739 					}
   739 				// if Nand flash (with Fat file system), test block size == 512 (small-block) or 2048 (large-block)
   740 				// if Nand flash (with Fat file system), test block size == 512 (small-block) or 2048 (large-block)
   740 				if ((driveInfo.iType == EMediaNANDFlash) &&
   741 				if ((driveInfo.iType == EMediaNANDFlash) &&
   741 					(driveInfo.iDriveAtt & KDriveAttLocal) &&
   742 					(driveInfo.iDriveAtt & KDriveAttLocal) &&
   742 					(driveInfo.iDriveAtt & KDriveAttInternal))
   743 					(driveInfo.iDriveAtt & KDriveAttInternal))