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