kerneltest/e32test/pccd/t_idrv.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
equal deleted inserted replaced
256:c1f20ce4abcf 257:3e88ff8f41d5
    42 
    42 
    43 #define PDD_NAME _L("MEDINT")
    43 #define PDD_NAME _L("MEDINT")
    44 
    44 
    45 const TInt KTestDriveLen=0x00040000;	//256K
    45 const TInt KTestDriveLen=0x00040000;	//256K
    46 const TInt KSmallDriveInc=0x00000400;	//1K
    46 const TInt KSmallDriveInc=0x00000400;	//1K
    47 #if defined (__WINS__)
       
    48 const TInt KBigDriveLen=0x00100000;		//1M - WINS
    47 const TInt KBigDriveLen=0x00100000;		//1M - WINS
    49 #endif
       
    50 const TInt KTestBufLen=256;
    48 const TInt KTestBufLen=256;
    51 
    49 
    52 
    50 
    53 RTest test(_L("T_IDRV"));
    51 RTest test(_L("T_IDRV"));
    54 
    52 
   102 	TInt r=User::LoadPhysicalDevice(PDD_NAME);
   100 	TInt r=User::LoadPhysicalDevice(PDD_NAME);
   103 	test(r==KErrNone || r==KErrAlreadyExists);
   101 	test(r==KErrNone || r==KErrAlreadyExists);
   104 
   102 
   105 	test.Next(_L("Find internal drive"));
   103 	test.Next(_L("Find internal drive"));
   106 	
   104 	
   107 	TInt drive;
   105 	TDriveInfoV1Buf driveInfoBuf;
   108 	for (drive = 0; drive < KMaxLocalDrives; drive++)
   106 	UserHal::DriveInfo(driveInfoBuf);
       
   107 	TDriveInfoV1& driveInfo = driveInfoBuf();
       
   108 
       
   109 	TInt drive = 0;
       
   110 	for ( ; drive < driveInfo.iTotalSupportedDrives; ++drive)
   109 		{
   111 		{
   110 		TBool changedFlag;
   112 		TBool changedFlag;
   111 		if (theInternalDrive.Connect(drive, changedFlag) != KErrNone)
   113 		theInternalDrive.Connect(drive, changedFlag);
   112 			continue;
       
   113 
   114 
   114 		TLocalDriveCapsV2 info;
   115 		TLocalDriveCapsV2 info;
   115 		TPckg<TLocalDriveCapsV2> infoPckg(info);
   116 		TPckg<TLocalDriveCapsV2> infoPckg(info);
   116 		theInternalDrive.Caps(infoPckg);
   117 		theInternalDrive.Caps(infoPckg);
   117 
   118 
   118 		if (info.iType == EMediaRam)
   119 		if (info.iType == EMediaRam)
   119 			break;						// found it
   120 			{
       
   121 			break;
       
   122 			}
   120 
   123 
   121 		theInternalDrive.Disconnect();
   124 		theInternalDrive.Disconnect();
   122 		}
   125 		}
   123 	test(drive < KMaxLocalDrives);		// iterated over all, found none
   126 	test(drive < driveInfo.iTotalSupportedDrives);
   124 
   127 
   125 	test.Next(_L("Capabilities"));
   128 	test.Next(_L("Capabilities"));
   126 	TLocalDriveCapsV2 info;
   129 	TLocalDriveCapsV2 info;
   127 	TPckg<TLocalDriveCapsV2> infoPckg(info);
   130 	TPckg<TLocalDriveCapsV2> infoPckg(info);
   128 	test(theInternalDrive.Caps(infoPckg)==KErrNone);
   131 	test(theInternalDrive.Caps(infoPckg)==KErrNone);