kerneltest/e32test/pccd/t_idrv.cpp
changeset 90 947f0dc9f7a8
parent 33 0173bcd7697c
child 109 b3a1d9898418
equal deleted inserted replaced
52:2d65c2f76d7b 90:947f0dc9f7a8
   100 	TInt r=User::LoadPhysicalDevice(PDD_NAME);
   100 	TInt r=User::LoadPhysicalDevice(PDD_NAME);
   101 	test(r==KErrNone || r==KErrAlreadyExists);
   101 	test(r==KErrNone || r==KErrAlreadyExists);
   102 
   102 
   103 	test.Next(_L("Find internal drive"));
   103 	test.Next(_L("Find internal drive"));
   104 	
   104 	
   105 	TDriveInfoV1Buf driveInfoBuf;
   105 	TInt drive;
   106 	UserHal::DriveInfo(driveInfoBuf);
   106 	for (drive = 0; drive < KMaxLocalDrives; drive++)
   107 	TDriveInfoV1& driveInfo = driveInfoBuf();
       
   108 
       
   109 	TInt drive = 0;
       
   110 	for ( ; drive < driveInfo.iTotalSupportedDrives; ++drive)
       
   111 		{
   107 		{
   112 		TBool changedFlag;
   108 		TBool changedFlag;
   113 		theInternalDrive.Connect(drive, changedFlag);
   109 		if (theInternalDrive.Connect(drive, changedFlag) != KErrNone)
       
   110 			continue;
   114 
   111 
   115 		TLocalDriveCapsV2 info;
   112 		TLocalDriveCapsV2 info;
   116 		TPckg<TLocalDriveCapsV2> infoPckg(info);
   113 		TPckg<TLocalDriveCapsV2> infoPckg(info);
   117 		theInternalDrive.Caps(infoPckg);
   114 		theInternalDrive.Caps(infoPckg);
   118 
   115 
   119 		if (info.iType == EMediaRam)
   116 		if (info.iType == EMediaRam)
   120 			{
   117 			break;						// found it
   121 			break;
       
   122 			}
       
   123 
   118 
   124 		theInternalDrive.Disconnect();
   119 		theInternalDrive.Disconnect();
   125 		}
   120 		}
   126 	test(drive < driveInfo.iTotalSupportedDrives);
   121 	test(drive < KMaxLocalDrives);		// iterated over all, found none
   127 
   122 
   128 	test.Next(_L("Capabilities"));
   123 	test.Next(_L("Capabilities"));
   129 	TLocalDriveCapsV2 info;
   124 	TLocalDriveCapsV2 info;
   130 	TPckg<TLocalDriveCapsV2> infoPckg(info);
   125 	TPckg<TLocalDriveCapsV2> infoPckg(info);
   131 	test(theInternalDrive.Caps(infoPckg)==KErrNone);
   126 	test(theInternalDrive.Caps(infoPckg)==KErrNone);