kerneltest/f32test/filesystem/fat/b_fat32.cpp
branchRCL_3
changeset 21 e7d2d738d3c2
parent 0 a41df078684a
child 43 c1f20ce4abcf
equal deleted inserted replaced
20:597aaf25e343 21:e7d2d738d3c2
    61 static TInt gClusterCount;
    61 static TInt gClusterCount;
    62 static TInt gEndOfChain;        // for FAT12/16/32
    62 static TInt gEndOfChain;        // for FAT12/16/32
    63 
    63 
    64 const TInt KMaxFatEntries  = 2048;
    64 const TInt KMaxFatEntries  = 2048;
    65 const TInt KMaxFatSize     = KMaxFatEntries * 4;
    65 const TInt KMaxFatSize     = KMaxFatEntries * 4;
    66 const TInt KDirAttrReadOnly  = 0x01;
    66 
    67 const TInt KDirAttrHidden    = 0x02;
    67 const TUint KDirAttrReadOnly  = 0x01;
    68 const TInt KDirAttrSystem    = 0x04;
    68 const TUint KDirAttrHidden    = 0x02;
    69 const TInt KDirAttrVolumeId  = 0x08;
    69 const TUint KDirAttrSystem    = 0x04;
    70 const TInt KDirAttrDirectory = 0x10;
    70 const TUint KDirAttrVolumeId  = 0x08;
    71 const TInt KDirAttrArchive   = 0x20;
    71 const TUint KDirAttrDirectory = 0x10;
    72 const TInt KDirAttrLongName  = KDirAttrReadOnly | KDirAttrHidden | KDirAttrSystem | KDirAttrVolumeId;
    72 const TUint KDirAttrArchive   = 0x20;
    73 const TInt KDirAttrLongMask  = KDirAttrLongName | KDirAttrDirectory | KDirAttrArchive;
    73 const TUint KDirAttrLongName  = KDirAttrReadOnly | KDirAttrHidden | KDirAttrSystem | KDirAttrVolumeId;
    74 const TInt KDirLastLongEntry = 0x40;
    74 const TUint KDirAttrLongMask  = KDirAttrLongName | KDirAttrDirectory | KDirAttrArchive;
       
    75 const TUint KDirLastLongEntry = 0x40;
    75 
    76 
    76 void CreateFatEntry(const TDesC& aDir, TBool aVFatEntry, TDes *apFileName=NULL);
    77 void CreateFatEntry(const TDesC& aDir, TBool aVFatEntry, TDes *apFileName=NULL);
    77 
    78 
    78 #define Error(aMess,aErr)  PutError(__FILE__, __LINE__, aMess,aErr)
    79 #define Error(aMess,aErr)  PutError(__FILE__, __LINE__, aMess,aErr)
    79 static void PutError(const char* aFile, TInt aLine, const TDesC& aMessage,TInt anErr)
    80 static void PutError(const char* aFile, TInt aLine, const TDesC& aMessage,TInt anErr)
  1493     FormatPack();
  1494     FormatPack();
  1494 
  1495 
  1495     }
  1496     }
  1496 
  1497 
  1497 
  1498 
  1498 static  void TestMakeDir(const TDesC& aName,TInt aNewClust,TInt aParentClust)
  1499 static  void TestMakeDir(const TDesC& aName, TUint aNewClust, TUint aParentClust)
  1499 //
  1500 //
  1500 // Test make dir
  1501 // Test make dir
  1501 //
  1502 //
  1502     {
  1503     {
  1503     test.Printf(_L("Checking cluster %02d, parent %d: \"%S\"\n"), aNewClust, aParentClust, &aName);
  1504     test.Printf(_L("Checking cluster %02d, parent %d: \"%S\"\n"), aNewClust, aParentClust, &aName);
  1524     if (pE->StartCluster()!=aNewClust)
  1525     if (pE->StartCluster()!=aNewClust)
  1525         Error(_L("Bad directory start cluster"),KErrNone);
  1526         Error(_L("Bad directory start cluster"),KErrNone);
  1526     pE++;
  1527     pE++;
  1527     if (pE->Name()[0]!='.' || pE->Name()[1]!='.')
  1528     if (pE->Name()[0]!='.' || pE->Name()[1]!='.')
  1528         Error(_L("Second entry is not '..'"),KErrNone);
  1529         Error(_L("Second entry is not '..'"),KErrNone);
  1529     if (pE->StartCluster() != ((aParentClust==gRootCluster)?0:aParentClust))
  1530     if (pE->StartCluster() != ((aParentClust==(TUint)gRootCluster)?0:aParentClust))
  1530         Error(_L("Start cluster of .. is not parent directory"),KErrNone);
  1531         Error(_L("Start cluster of .. is not parent directory"),KErrNone);
  1531     }
  1532     }
  1532 
  1533 
  1533 
  1534 
  1534 
  1535