kerneltest/e32test/demandpaging/t_tbus_datapaging.cpp
changeset 149 d9f1e5bfe28c
parent 31 56f325a607ea
equal deleted inserted replaced
135:5e441a173c63 149:d9f1e5bfe28c
    77 											return = function;
    77 											return = function;
    78 											
    78 											
    79 
    79 
    80 LOCAL_D RFs TheFs;
    80 LOCAL_D RFs TheFs;
    81 TInt gFsDriveNumber	= -1;
    81 TInt gFsDriveNumber	= -1;
       
    82 TBool gMediaIsRam = EFalse;
    82 	
    83 	
    83 RTest test(_L("T_TBUS_DATAPAGING"));
    84 RTest test(_L("T_TBUS_DATAPAGING"));
    84 _LIT(KChunkName, "t_datapaging chunk");
    85 _LIT(KChunkName, "t_datapaging chunk");
    85 
    86 
    86 const TUint KDriveAttMask = KDriveAttLocal | KDriveAttRom | KDriveAttRemote;
    87 const TUint KDriveAttMask = KDriveAttLocal | KDriveAttRom | KDriveAttRemote;
   696 
   697 
   697 		if (r != KErrNone )
   698 		if (r != KErrNone )
   698 			continue;
   699 			continue;
   699 
   700 
   700 		TPtrC mediaType = GetMediaType(di.iType);
   701 		TPtrC mediaType = GetMediaType(di.iType);
       
   702 		if (di.iType == EMediaRam)
       
   703 			gMediaIsRam = ETrue;
       
   704 
   701 		test.Printf(_L("Drive %C Type %S DriveAtt 0x%x MediaAtt 0x%x FileSysId %S SerialNum %S\n"), 
   705 		test.Printf(_L("Drive %C Type %S DriveAtt 0x%x MediaAtt 0x%x FileSysId %S SerialNum %S\n"), 
   702 			'A' + n, &mediaType, di.iDriveAtt, di.iMediaAtt, &fsName, &GetSerialNumber(serialNum));
   706 			'A' + n, &mediaType, di.iDriveAtt, di.iMediaAtt, &fsName, &GetSerialNumber(serialNum));
   703 
   707 
   704 		di.iDriveAtt&= KDriveAttMask;
   708 		di.iDriveAtt&= KDriveAttMask;
   705 		di.iMediaAtt&= KMediaAttMask;
   709 		di.iMediaAtt&= KMediaAttMask;
   792 	test.Next(_L("Chunk created, declare variables"));
   796 	test.Next(_L("Chunk created, declare variables"));
   793 	
   797 	
   794 	__DECLARE_VAR_IN_CHUNK(TBusLocalDrive, &drive)
   798 	__DECLARE_VAR_IN_CHUNK(TBusLocalDrive, &drive)
   795 	TInt driveSize = TestDriveConnectAndCaps(drive, fatDriveNumber);
   799 	TInt driveSize = TestDriveConnectAndCaps(drive, fatDriveNumber);
   796 	
   800 	
   797 	TestDriveSizeRelatedMethods(drive, 0x00001000, driveSize);
   801 	if (!gMediaIsRam) // If media is RAM then the tests are invalid
       
   802 		TestDriveSizeRelatedMethods(drive, 0x00001000, driveSize);
   798 	
   803 	
   799 	TestWriteReadRelatedMethods(drive);
   804 	TestWriteReadRelatedMethods(drive);
   800 	
   805 	
   801 	TestFormatRelatedMethods(drive, driveSize);
   806 	if (!gMediaIsRam)
       
   807 		TestFormatRelatedMethods(drive, driveSize);
   802 	
   808 	
   803 	if(callPasswordRelated)
   809 	if(callPasswordRelated)
   804 		{
   810 		{
   805 		TestPasswordRelatedMethods(drive);	
   811 		TestPasswordRelatedMethods(drive);	
   806 		}
   812 		}