diff -r 2d65c2f76d7b -r 4a8fed1c0ef6 kerneltest/f32test/server/t_rename.cpp --- a/kerneltest/f32test/server/t_rename.cpp Tue Feb 02 01:24:03 2010 +0200 +++ b/kerneltest/f32test/server/t_rename.cpp Sat Feb 20 00:10:51 2010 +0200 @@ -15,6 +15,7 @@ // // +#define __E32TEST_EXTENSION__ #include #include #include "t_server.h" @@ -397,6 +398,83 @@ } +//------------------------------------------------------------------- +/** + Create a directory; create many files in it (the directory will become more that 1 cluster) + Then rename every file in this directory to a new name. +*/ +void TestRenameManyFilesInTheSameDir() +{ + test.Next(_L("TestRenameManyFilesInTheSameDir")); + + if(Is_Win32(TheFs, gDriveNum)) + { + test.Printf(_L("Skipping on WINS drive\n")); + return; + } + + _LIT(KDir, "\\dir1\\"); + _LIT(KFile, "filename_long-"); + + //-- the number of files is chosen the way to have the directory file at least 2 clusters long (on FAT) + //-- "filename_long-XXX" will correspond to 2 VFAT entries in the directory; max. cluster size of FAT is 32K + //-- 2*32*600 = 38400 > 32K + const TInt KNumFiles = 600; + + TName fName; + TInt i; + TInt nRes; + + //-- quick format the drive + nRes = FormatDrive(TheFs, gDriveNum, ETrue); + test_KErrNone(nRes); + + MakeDir(KDir); + + //-- create a number of files in a single directory, it shall be larger than 1 cluster. + for(i=0; i