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