kerneltest/e32test/pccd/t_atadrv.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
equal deleted inserted replaced
256:c1f20ce4abcf 257:3e88ff8f41d5
    35 const TInt KShortFormatInBytes=(KShortFormatInSectors<<KAtaSectorShift);
    35 const TInt KShortFormatInBytes=(KShortFormatInSectors<<KAtaSectorShift);
    36 const TInt KLongFormatInSectors=KSectBufSizeInSectors+1;	// 4.5K - exceeds driver local buffer size
    36 const TInt KLongFormatInSectors=KSectBufSizeInSectors+1;	// 4.5K - exceeds driver local buffer size
    37 const TInt KLongFormatInBytes=(KLongFormatInSectors<<KAtaSectorShift);
    37 const TInt KLongFormatInBytes=(KLongFormatInSectors<<KAtaSectorShift);
    38 
    38 
    39 const TInt KHeapSize=0x4000;
    39 const TInt KHeapSize=0x4000;
    40 
       
    41 #undef USE_IDLE_CURRENT
       
    42 #ifdef USE_IDLE_CURRENT
       
    43 const TInt KAtaIdleCurrentInMilliAmps=1; 
    40 const TInt KAtaIdleCurrentInMilliAmps=1; 
    44 #endif
       
    45 
       
    46 
    41 
    47 #define PDD_NAME _L("MEDATA")
    42 #define PDD_NAME _L("MEDATA")
    48 
    43 
    49 LOCAL_D RTest test(_L("T_ATADRV"));
    44 LOCAL_D RTest test(_L("T_ATADRV"));
    50 LOCAL_D RTest nTest(_L("This thread doesn't disconnect"));
    45 LOCAL_D RTest nTest(_L("This thread doesn't disconnect"));
   266 	test(info.iType==EMediaHardDisk);
   261 	test(info.iType==EMediaHardDisk);
   267 	test(info.iConnectionBusType==EConnectionBusInternal);
   262 	test(info.iConnectionBusType==EConnectionBusInternal);
   268 	test(info.iDriveAtt==(TUint)(KDriveAttLocal|KDriveAttRemovable));
   263 	test(info.iDriveAtt==(TUint)(KDriveAttLocal|KDriveAttRemovable));
   269 	test(info.iMediaAtt==KMediaAttFormattable);
   264 	test(info.iMediaAtt==KMediaAttFormattable);
   270 	test(info.iFileSystemId==KDriveFileSysFAT);
   265 	test(info.iFileSystemId==KDriveFileSysFAT);
   271 #undef USE_IDLE_CURRENT
   266 //	TSupplyInfoV1Buf supply2;
   272 #ifdef USE_IDLE_CURRENT
   267 //	test(UserHal::SupplyInfo(supply2)==KErrNone);
   273 	TSupplyInfoV1Buf supply2;
   268 //	if (mediaChangeSupported)
   274 	test(UserHal::SupplyInfo(supply2)==KErrNone);
   269 //		test(supply2().iCurrentConsumptionMilliAmps==supply1().iCurrentConsumptionMilliAmps+KAtaIdleCurrentInMilliAmps); // Snowball idle current is zero
   275 	if (mediaChangeSupported)
       
   276 		test(supply2().iCurrentConsumptionMilliAmps==supply1().iCurrentConsumptionMilliAmps+KAtaIdleCurrentInMilliAmps); // Snowball idle current is zero
       
   277 #endif
       
   278 
   270 
   279 	b.Format(_L("ATA drive: Sector RdWr(%d)"),KAtaSectorSize);
   271 	b.Format(_L("ATA drive: Sector RdWr(%d)"),KAtaSectorSize);
   280 	test.Next(b);
   272 	test.Next(b);
   281 	TInt len;
   273 	TInt len;
   282 	wrBuf.SetLength(KAtaSectorSize);
   274 	wrBuf.SetLength(KAtaSectorSize);
   456 	__KHEAP_MARK;
   448 	__KHEAP_MARK;
   457 
   449 
   458 	test.Next(_L("ATA drive: Caps following media change"));
   450 	test.Next(_L("ATA drive: Caps following media change"));
   459 	test(theAtaDrive.Caps(infoPckg)==KErrNone);
   451 	test(theAtaDrive.Caps(infoPckg)==KErrNone);
   460 	test(info.iType==EMediaHardDisk);
   452 	test(info.iType==EMediaHardDisk);
   461 #undef USE_IDLE_CURRENT
   453 //	test(UserHal::SupplyInfo(supply2)==KErrNone);
   462 #ifdef USE_IDLE_CURRENT
   454 //	test(supply2().iCurrentConsumptionMilliAmps==supply1().iCurrentConsumptionMilliAmps+KAtaIdleCurrentInMilliAmps);
   463 	test(UserHal::SupplyInfo(supply2)==KErrNone);
       
   464 	test(supply2().iCurrentConsumptionMilliAmps==supply1().iCurrentConsumptionMilliAmps+KAtaIdleCurrentInMilliAmps);
       
   465 #endif
       
   466 
   455 
   467 	test.Next(_L("ATA drive: Caps while OOM"));
   456 	test.Next(_L("ATA drive: Caps while OOM"));
   468 	TInt err=KErrNoMemory;
   457 	TInt err=KErrNoMemory;
   469 	test.Printf(_L("Mount returns:"));
   458 	test.Printf(_L("Mount returns:"));
   470 	for (TInt j=1; err!=KErrNone && j<16; j++)
   459 	for (TInt j=1; err!=KErrNone && j<16; j++)