kerneltest/f32test/server/t_file.cpp
changeset 200 73ea206103e6
parent 109 b3a1d9898418
child 259 57b9594f5772
equal deleted inserted replaced
152:657f875b013e 200:73ea206103e6
  1173 	// Check the generated shortname of the original file
  1173 	// Check the generated shortname of the original file
  1174 	TBuf<12> shortName;
  1174 	TBuf<12> shortName;
  1175 	err = TheFs.GetShortName(KOrigFileName, shortName);
  1175 	err = TheFs.GetShortName(KOrigFileName, shortName);
  1176 	test_KErrNone(err);
  1176 	test_KErrNone(err);
  1177 
  1177 
  1178 	// Validate the generated shorname against the original filename.
  1178 	// Validate the generated shortname against the original filename.
  1179 	if (Is_Win32(TheFs, gDriveNum))
  1179 	if(!IsTestingLFFS())
  1180 		{
       
  1181 		test(shortName==_L("2222~1.JAR"));
       
  1182 		}
       
  1183 	else if(!IsTestingLFFS())
       
  1184 		{
  1180 		{
  1185 		// LFFS short names not the same as VFAT ones
  1181 		// LFFS short names not the same as VFAT ones
  1186 		test(shortName==_L("2222~1.JAR"));
  1182 		test(shortName==_L("2222~1.JAR"));
  1187 		}
  1183 		}
  1188 
  1184 
  1775 static void TestMaxLengthFilenames()
  1771 static void TestMaxLengthFilenames()
  1776 //
  1772 //
  1777 // Test max length filenames can be created/deleted
  1773 // Test max length filenames can be created/deleted
  1778 //
  1774 //
  1779 	{
  1775 	{
  1780 
  1776 	if(Is_SimulatedSystemDrive(TheFs, gDriveNum))
  1781 #if defined(__WINS__)
  1777 		{
  1782 	if (gSessionPath[0]=='C')
  1778 		test.Printf(_L("Skipping TestMaxLengthFilenames() on PlatSim/Emulator drive %C:\n"), gSessionPath[0]);
  1783 		return;
  1779 		return;
  1784 #endif
  1780 		}
  1785 
  1781 
  1786 	test.Next(_L("Test max length filenames"));
  1782 	test.Next(_L("Test max length filenames"));
  1787 	TFileName bigName;
  1783 	TFileName bigName;
  1788 	CreateLongName(bigName,gSeed,255);
  1784 	CreateLongName(bigName,gSeed,255);
  1789 	bigName[0]='\\';
  1785 	bigName[0]='\\';
  3038     //-- FAT Supports short file names
  3034     //-- FAT Supports short file names
  3039     if(Is_Fat(TheFs, gDriveNum))
  3035     if(Is_Fat(TheFs, gDriveNum))
  3040         gShortFileNamesSupported = ETrue;
  3036         gShortFileNamesSupported = ETrue;
  3041     
  3037     
  3042     if(Is_Win32(TheFs, gDriveNum)) 
  3038     if(Is_Win32(TheFs, gDriveNum)) 
  3043     {//-- find out if this is NTFS and if it supports short names (this feature can be switched OFF)
  3039     	{//-- find out if this is NTFS and if it supports short names (this feature can be switched OFF)
  3044         
  3040         
  3045         _LIT(KLongFN, "\\this is a long file name");
  3041         _LIT(KLongFN, "\\this is a long file name");
  3046         nRes = CreateEmptyFile(TheFs, KLongFN, 10);   
  3042         nRes = CreateEmptyFile(TheFs, KLongFN, 10);   
  3047         test_KErrNone(nRes);
  3043         test_KErrNone(nRes);
  3048 
  3044 
  3052         
  3048         
  3053         nRes = TheFs.Delete(KLongFN);
  3049         nRes = TheFs.Delete(KLongFN);
  3054         test_KErrNone(nRes);
  3050         test_KErrNone(nRes);
  3055 
  3051 
  3056         DeleteTestDirectory();
  3052         DeleteTestDirectory();
  3057     }
  3053     	}
  3058     else
  3054     else
  3059     {
  3055     	{
  3060         nRes = FormatDrive(TheFs, gDriveNum, ETrue);
  3056         nRes = FormatDrive(TheFs, gDriveNum, ETrue);
  3061         test_KErrNone(nRes);
  3057         test_KErrNone(nRes);
  3062     }
  3058     	}
  3063 
  3059 
  3064 	CreateTestDirectory(_L("\\F32-TST\\TFILE\\"));
  3060 	CreateTestDirectory(_L("\\F32-TST\\TFILE\\"));
  3065 
  3061 
  3066 	testFileRename();
  3062 	testFileRename();
  3067 	testSetSize();
  3063 	testSetSize();