Update contrib.
1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // f32test\server\t_dirs.cpp
22 #include "f32_test_utils.h"
24 using namespace F32_Test_Utils;
27 RTest test(_L("T_DIRS"));
30 TBool gTestedZ = EFalse;
35 // Make a directory with lots of entries
41 test.Next(_L("Create a directory with 55 entries"));
42 TFileName sessionPath;
43 TInt r=TheFs.SessionPath(sessionPath);
45 r=TheFs.MkDir(_L("\\F32-TST\\"));
46 test((r==KErrNone)||(r==KErrAlreadyExists));
47 r=TheFs.MkDir(_L("\\F32-TST\\TDIRS\\"));
48 test((r==KErrNone)||(r==KErrAlreadyExists));
50 for (TInt i=0;i<maxEntry;i++)
52 TFileName baseName=_L("\\F32-TST\\TDIRS\\FILE");
53 baseName.AppendNum(i);
54 r=f.Replace(TheFs,baseName,EFileRead);
56 r=f.Write(_L8("Hello World"));
60 test.Next(_L("Test all entries have been created successfully."));
61 for (TInt j=0;j<=maxEntry;j++)
63 TFileName baseName=_L("\\F32-TST\\TDIRS\\FILE");
64 baseName.AppendNum(j);
65 TInt r=f.Open(TheFs,baseName,EFileRead);
68 test(r==KErrNotFound && j==maxEntry);
74 test(data==_L8("Hello World"));
81 // List all directory entries
85 test.Printf(_L("List all entries in directory %S\n"),&gSessionPath);
88 TInt r=d.Open(TheFs,gSessionPath,KEntryAttMaskSupported);
92 while ((r=d.Read(e))==KErrNone)
95 test.Printf(_L("%- 20S <DIR>\n"),&e.iName);
97 test.Printf(_L("%- 20S %+ 8d\n"),&e.iName,e.iSize);
101 test.Printf(_L("Error %d\n"),r);
104 test.Printf(_L("Error %d\n"),r);
109 // Check you cannot open a directory on a file
113 test.Next(_L("Open files and directories on Z:"));
117 TInt r=d.Open(TheFs,PlatSec::ConfigSetting(PlatSec::EPlatSecEnforceSysBin)?_L("\\Sys\\Bin\\ESHELL.EXE\\*"):_L("\\System\\Bin\\ESHELL.EXE\\*"),KEntryAttMaskSupported);
118 test(r==KErrPathNotFound);
120 r=d.Open(TheFs,PlatSec::ConfigSetting(PlatSec::EPlatSecEnforceSysBin)?_L("\\Sys\\Bin\\ESHELL.EXE"):_L("\\System\\Bin\\ESHELL.EXE"),KEntryAttMaskSupported);
126 test.Printf(_L("Error: EShell.EXE not found\n"));
132 test(entry.iName.FindF(_L("ESHELL.EXE"))>=0);
138 r=d.Open(TheFs,_L("\\*.XQP"),KEntryAttMaskSupported);
144 r=d.Open(TheFs,PlatSec::ConfigSetting(PlatSec::EPlatSecEnforceSysBin)?_L("\\Sys\\Bin\\"):_L("\\System\\Bin\\"),KEntryAttMaskSupported);
150 test.Printf(_L("No files found\n"));
156 test.Printf(_L("First Entry = %S\n"),&entry.iName);
159 test.Printf(_L("Second Entry = %S\n"),&entry.iName);
163 r=d.Open(TheFs,_L("\\*"),KEntryAttMaskSupported);
166 r=d.Open(TheFs,PlatSec::ConfigSetting(PlatSec::EPlatSecEnforceSysBin)?_L("\\Sys\\Bin\\*"):_L("\\System\\Bin\\*"),KEntryAttMaskSupported);
173 // Check you cannot open a directory on a file
177 test.Next(_L("Open files and directories"));
180 TInt r=f.Replace(TheFs,_L("\\F32-TST\\TDIRS\\TESTFILEORISITA.DIR"),EFileWrite);
182 r=f.Write(_L8("TESTDATATESTDATATESTDATATESTDATATESTDATATESTDATATESTDATATESTDATATESTDATATESTDATATESTDATATESTDATA"));
184 r=TheFs.Delete(_L("\\F32-TST\\TDIRS\\TESTFILEORISITA.DIR"));
188 r=d.Open(TheFs,_L("\\F32-TST\\TDIRS\\TESTFILEORISITA.DIR\\*"),KEntryAttMaskSupported);
189 test(r==KErrPathNotFound);
190 r=d.Open(TheFs,_L("\\F32-TST\\TDIRS\\*.XQP"),KEntryAttMaskSupported);
195 r=d.Open(TheFs,_L("\\F32-TST\\TDIRS\\TESTFILEORISITA.DIR"),KEntryAttMaskSupported);
199 test(entry.iName.FindF(_L("TESTFILEORISITA.DIR"))>=0);
203 r=d.Open(TheFs,_L("\\"),KEntryAttMaskSupported);
206 r=d.Open(TheFs,_L("\\F32-TST\\"),KEntryAttMaskSupported);
209 r=d.Open(TheFs,_L("\\*"),KEntryAttMaskSupported);
212 r=d.Open(TheFs,_L("\\F32-TST\\*"),KEntryAttMaskSupported);
216 // create a small file on the root
217 test(f.Replace(TheFs, _L("\\TEST.FILE"), EFileWrite) == KErrNone);
218 test(f.Write(_L8("1234567890987654321234567890")) == KErrNone);
220 // try some directory operations on the file
221 test(TheFs.RmDir(_L("\\TEST.FILE\\")) == KErrPathNotFound);
222 test(TheFs.RmDir(_L("\\TEST.FILE\\ZZZ\\")) == KErrPathNotFound);
223 test(TheFs.MkDir(_L("\\TEST.FILE\\ZZZ\\")) == KErrPathNotFound);
225 TheFs.Delete(_L("\\TEST.FILE"));
228 r=TheFs.MkDir(_L("\\F32-TST\\EMPTY\\"));
229 test(r==KErrNone || r==KErrAlreadyExists);
230 r=d.Open(TheFs,_L("\\F32-TST\\EMPTY\\*"),KEntryAttMaskSupported);
232 // r=TheFs.RmDir(_L("\\F32-TST\\EMPTY\\"));
235 // r=TheFs.RmDir(_L("\\F32-TST\\EMPTY\\"));
236 // test(r==KErrInUse);
241 r=TheFs.RmDir(_L("\\F32-TST\\EMPTY\\"));
246 static void CreateSortNoneTestDirectoryStructure()
251 // Delete the directory to be tested if it already exists as a result of this
252 // test being run previously. It's necessary remove it and then recreate it
253 // because a later test relies on the time of file/directory creation to be
254 // the time this function was run...
256 CFileMan* fMan=CFileMan::NewL(TheFs);
258 TInt r=fMan->RmDir(_L("\\F32-TST\\TDIRS\\SORT_NONE\\"));
259 test((r==KErrNone)||(r==KErrPathNotFound));
262 gTimeNow.HomeTime(); // Set global TTime gTimeNow to time now - for later tests
263 r=TheFs.MkDirAll(_L("\\F32-TST\\TDIRS\\SORT_NONE\\"));
264 test(r==KErrNone || r==KErrAlreadyExists);
265 MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\file1.txt"));
266 r=TheFs.MkDir(_L("\\F32-TST\\TDIRS\\SORT_NONE\\FILE_DIR1.APP\\"));
267 test(r==KErrNone || r==KErrAlreadyExists);
268 MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\file1.app"));
269 r=TheFs.MkDir(_L("\\F32-TST\\TDIRS\\SORT_NONE\\FILE_DIR2.TXT\\"));
270 test(r==KErrNone || r==KErrAlreadyExists);
271 MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\file2.txt"));
272 r=TheFs.MkDir(_L("\\F32-TST\\TDIRS\\SORT_NONE\\FILE_DIR3.APP\\"));
273 test(r==KErrNone || r==KErrAlreadyExists);
274 MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\ZZZZ"));
275 MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\AAAA"));
276 MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\WWWW"));
277 MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\file2.app"));
278 MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\file3.txt"));
279 MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\file3.app"));
280 MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\NOEXT1"));
281 MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\NOEXT2"));
282 MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\EXTMISSING"));
291 test.Next(_L("Test ESortNone"));
292 CreateSortNoneTestDirectoryStructure();
297 // GetDir OOM failure passes 'callback' test from client side but not server side
299 TheFs.SetAllocFailure(gAllocFailOff);
301 TInt r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*"),KEntryAttMaskSupported,ESortNone,dir);
303 TInt count=dir->Count();
305 r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*"),KEntryAttMaskSupported,ESortByName,dirSorted);
307 test(dirSorted->Count()==15);
311 r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*.txt"),KEntryAttNormal,ESortNone,dir);
313 test(dir->Count()==3);
315 r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*.app"),KEntryAttNormal,ESortNone,dir);
317 test(dir->Count()==3);
319 r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*.app"),KEntryAttNormal|KEntryAttDir,ESortNone,dir);
321 test(dir->Count()==5);
323 r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*.app"),KEntryAttNormal|KEntryAttDir,ESortNone|EDirsFirst,dir);
325 test(dir->Count()==5);
327 r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*.app"),KEntryAttNormal|KEntryAttDir,ESortNone|EDirsLast,dir);
329 test(dir->Count()==5);
332 TheFs.SetAllocFailure(gAllocFailOn);
337 // Test return values
341 test.Next(_L("Test return values"));
343 TInt r=dir.Open(TheFs,_L("\\DoesNotExist\\*"),KEntryAttMaskSupported);
344 test(r==KErrPathNotFound);
345 r=dir.Open(TheFs,_L("\\"),KEntryAttMaskSupported);
353 // Test that "*.*" matches all files/directories
357 test.Next(_L("Test *.* matches all files"));
359 TInt r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*.*"),KEntryAttNormal|KEntryAttDir,ESortByName|EDirsLast,dirList);
361 TInt count=dirList->Count();
363 TEntry entry=(*dirList)[0];
364 test(entry.iName.FindF(_L("AAAA"))>=0);
366 test(entry.iName.FindF(_L("EXTMISSING"))>=0);
368 test(entry.iName.FindF(_L("FILE1.APP"))>=0);
370 test(entry.iName.FindF(_L("FILE1.TXT"))>=0);
372 test(entry.iName.FindF(_L("FILE2.APP"))>=0);
374 test(entry.iName.FindF(_L("FILE2.TXT"))>=0);
376 test(entry.iName.FindF(_L("FILE3.APP"))>=0);
378 test(entry.iName.FindF(_L("FILE3.TXT"))>=0);
380 test(entry.iName.FindF(_L("NOEXT1"))>=0);
382 test(entry.iName.FindF(_L("NOEXT2"))>=0);
383 entry=(*dirList)[10];
384 test(entry.iName.FindF(_L("WWWW"))>=0);
385 entry=(*dirList)[11];
386 test(entry.iName.FindF(_L("ZZZZ"))>=0);
387 entry=(*dirList)[12];
388 test(entry.iName.FindF(_L("FILE_DIR1.APP"))>=0);
389 entry=(*dirList)[13];
390 test(entry.iName.FindF(_L("FILE_DIR2.TXT"))>=0);
391 entry=(*dirList)[14];
392 test(entry.iName.FindF(_L("FILE_DIR3.APP"))>=0);
396 r=dir.Open(TheFs,_L("\\f32-tst\\tdirs\\sort_none\\*.*"),KEntryAttNormal|KEntryAttDir);
401 TInt64 maxOK=1000000;
405 for (TInt i=0; i<15; i++)
409 time=entry.iModified;
410 difference=time.Int64()-gTimeNow.Int64();
411 test(difference<maxOK);
418 TheFs.SetAllocFailure(gAllocFailOn);
424 // Fill up the root directory
427 test.Next(_L("Fill up the root directory"));
429 if(!Is_Fat12(TheFs, gDriveNum) && !Is_Fat16(TheFs, gDriveNum))
431 test.Printf(_L("Skipping. Applicable for FAT12/16 only!\n"));
435 TInt r = FormatDrive(TheFs, gDriveNum, ETrue);
438 TBuf<32> baseName=_L("\\RD");
444 TParsePtrC parser(gSessionPath);
448 fileName=parser.Drive();
451 TInt r=f.Replace(TheFs,fileName,EFileWrite);
463 test.Printf(_L("CreateFile : %d : %S\r"),count,&fileName);
465 test.Printf(_L("\n"));
470 fileName=parser.Drive();
473 TInt r=TheFs.Delete(fileName);
475 test.Printf(_L("DeleteFile : %d : %S\r"),count,&fileName);
478 test.Printf(_L("\n"));
480 test.Next(_L("Long filenames in root"));
481 TFileName longFileName;
482 longFileName.SetLength(254);
483 // Mem::Fill((TUint8*)longFileName.Ptr(),254,'A');
484 Mem::Fill((TUint8*)longFileName.Ptr(),254*sizeof(TText),'A');
485 longFileName[0]='\\';
486 longFileName[253]='\\';
487 r=TheFs.MkDir(longFileName);
490 r=TheFs.GetDir(longFileName,KEntryAttMaskSupported,ESortByName,dirList);
492 count=dirList->Count();
496 r=TheFs.Parse(longFileName,parse);
499 r=TheFs.Entry(longFileName,entry);
501 r=TheFs.SetSessionPath(longFileName);
503 r=TheFs.GetDir(longFileName,KEntryAttMaskSupported,ESortByName,dirList);
505 count=dirList->Count();
508 r=TheFs.Parse(longFileName,_L("*"),parse);
509 test(r==KErrBadName);
510 r=f.Open(TheFs,_L("asdf.asdf"),0);
511 test(r==KErrBadName);
512 r=TheFs.Entry(longFileName,entry);
514 r=TheFs.RmDir(longFileName);
524 test.Next(_L("Open dir and change drives"));
525 MakeDir(_L("C:\\MOON\\"));
527 TInt r=dir.Open(TheFs,_L("C:\\MOON\\"),0);
530 r=TheFs.GetDriveName(11,driveName);
532 TEntryArray entryArray;
533 r=dir.Read(entryArray);
535 test(entryArray.Count()==0);
537 r=TheFs.RmDir(_L("C:\\MOON\\"));
540 test.Next(_L("MkDir all on nonexistent drive"));
541 r=TheFs.MkDirAll(_L("L:\\MOON"));
542 test((r==KErrNotReady)||(r==KErrPathNotFound));
545 static void CleanupL()
551 test.Next(_L("Delete test directory"));
552 CFileMan* fMan=CFileMan::NewL(TheFs);
553 TInt r=fMan->RmDir(gSessionPath);
555 r=fMan->Delete(_L("\\Filluptherootdir*"));
556 test(r==KErrNone || r==KErrNotFound);
562 // Test directories with trailing dots (ref. DEF047684)
566 test.Next(_L("Testing directory names with trailing dots"));
568 r=TheFs.MkDir(_L("\\test9..\\"));
569 test(r==KErrBadName);
570 r=TheFs.MkDir(_L("\\test9\\"));
571 test((r==KErrNone)||(r==KErrAlreadyExists));
572 r=TheFs.Rename(_L("\\test9\\"),_L("\\test9..\\"));
573 test(r==KErrBadName);
574 r= TheFs.RmDir(_L("\\test9\\"));
576 r=TheFs.MkDir(_L("\\t.\\"));
577 test(r==KErrBadName);
582 // Path and File names for sorting by name
584 // The correctly sorted directory listing should be:
590 _LIT(KSortByNamePath, "\\F32-TST\\TDIRS\\SORT_NAME\\");
591 _LIT(KFileBS, "bs.doc");
592 _LIT(KFileBB, "bb.doc");
593 _LIT(KFileB, "b.doc");
594 _LIT(KSortAll, "*.*");
595 _LIT(KPrintFileName, "%S\n");
598 static void DeleteTestDirectoryStructure(const TDesC& aPath)
600 // Delete the directory to be tested if it already exists as a result of this
601 // test being run previously.
605 CFileMan* fMan=CFileMan::NewL(TheFs);
607 TInt r=fMan->RmDir(aPath);
608 test((r==KErrNone)||(r==KErrPathNotFound));
613 static void CreateTestDirectoryStructure(const TDesC& aPath, const TDesC** aFileArray, TInt aNumFiles)
618 DeleteTestDirectoryStructure(aPath);
620 gTimeNow.HomeTime(); // Set global TTime gTimeNow to time now - for later tests
621 TInt r=TheFs.MkDirAll(aPath);
622 test(r==KErrNone || r==KErrAlreadyExists);
625 for (TInt i = 0; i < aNumFiles; i++)
628 fileName.Append(*aFileArray[i]);
634 static void TestSortByName()
636 // Test that sorting by name works for different length filenames.
639 const TDesC* theFiles[] = {&KFileBS, &KFileBB, &KFileB};
640 TInt numFiles = sizeof(theFiles)/sizeof(theFiles[0]);
641 CreateTestDirectoryStructure(KSortByNamePath, theFiles, numFiles);
643 test.Next(_L("Test ESortByName"));
645 TBuf<128> sortSpec(KSortByNamePath);
646 sortSpec.Append(KSortAll);
647 TInt r=TheFs.GetDir(sortSpec, KEntryAttNormal | KEntryAttDir, ESortByName | EDirsLast, dirList);
649 TInt count=dirList->Count();
650 test(count==numFiles);
654 for (i = 0; i < count; i++)
656 test.Printf(KPrintFileName, &(*dirList)[i].iName);
659 TEntry entry=(*dirList)[0];
660 test(entry.iName.FindF(KFileB)>=0);
662 test(entry.iName.FindF(KFileBB)>=0);
664 test(entry.iName.FindF(KFileBS)>=0);
669 test.Next(_L("Test ESortByName (descending)"));
672 r=TheFs.GetDir(sortSpec, KEntryAttNormal | KEntryAttDir, ESortByName | EDirsLast | EDescending, dirList);
674 count=dirList->Count();
675 test(count==numFiles);
678 for (i = 0; i < count; i++)
680 test.Printf(KPrintFileName, &(*dirList)[i].iName);
685 test(entry.iName.FindF(KFileBS)>=0);
687 test(entry.iName.FindF(KFileBB)>=0);
689 test(entry.iName.FindF(KFileB)>=0);
694 DeleteTestDirectoryStructure(KSortByNamePath);
700 // Path and File names for sorting by extension
702 // The correctly sorted directory listing should be:
712 // as we should sort by the substring after the last '.'
714 _LIT(KSortByExtPath, "\\F32-TST\\TDIRS\\SORT_EXT\\");
715 _LIT(KFile1, "sortext.aaa.b");
716 _LIT(KFile2, "sortext.bbb.a");
717 _LIT(KFile3, "sortext.ccc.c");
718 _LIT(KFile4, "sortext1.ddd.a");
719 _LIT(KFile5, "sortext.a");
720 _LIT(KFile6, "sortext.b");
721 _LIT(KFile7, "sortext.c");
724 static void TestSortByExt()
726 // Test that sorting by extension works. This includes filenames
727 // that contain multiple .'s
730 const TDesC* theFiles[] = {&KFile1, &KFile2, &KFile3, &KFile4, &KFile5, &KFile6, &KFile7};
731 TInt numFiles = sizeof(theFiles)/sizeof(theFiles[0]);
732 CreateTestDirectoryStructure(KSortByExtPath, theFiles, numFiles);
734 test.Next(_L("Test ESortByExt"));
737 TBuf<128> sortSpec(KSortByExtPath);
738 sortSpec.Append(KSortAll);
739 TInt r=TheFs.GetDir(sortSpec, KEntryAttNormal | KEntryAttDir, ESortByExt | EDirsLast, dirList);
741 TInt count=dirList->Count();
742 test(count==numFiles);
746 for (i = 0; i < count; i++)
748 test.Printf(KPrintFileName, &(*dirList)[i].iName);
753 // Verify that the files have been sorted correctly by extension
755 TEntry entry=(*dirList)[0];
756 test(entry.iName.FindF(KFile5)>=0);
758 test(entry.iName.FindF(KFile2)>=0);
760 test(entry.iName.FindF(KFile4)>=0);
762 test(entry.iName.FindF(KFile1)>=0);
764 test(entry.iName.FindF(KFile6)>=0);
766 test(entry.iName.FindF(KFile7)>=0);
768 test(entry.iName.FindF(KFile3)>=0);
773 test.Next(_L("Test ESortByExt (descending)"));
775 r=TheFs.GetDir(sortSpec, KEntryAttNormal | KEntryAttDir, ESortByExt | EDirsLast | EDescending, dirList);
777 count=dirList->Count();
778 test(count==numFiles);
781 for (i = 0; i < count; i++)
783 test.Printf(KPrintFileName, &(*dirList)[i].iName);
788 // Verify that the files have been sorted correctly by extension
789 // Note that this listing should be the reverse of that above.
792 test(entry.iName.FindF(KFile3)>=0);
794 test(entry.iName.FindF(KFile7)>=0);
796 test(entry.iName.FindF(KFile6)>=0);
798 test(entry.iName.FindF(KFile1)>=0);
800 test(entry.iName.FindF(KFile4)>=0);
802 test(entry.iName.FindF(KFile2)>=0);
804 test(entry.iName.FindF(KFile5)>=0);
809 DeleteTestDirectoryStructure(KSortByExtPath);
812 //---------------------------------------------
813 //! @SYMTestCaseID PBASE-T_DIRS-1310
815 //! @SYMREQ DEF125143
816 //! @SYMTestCaseDesc Test that directory name is handled by File Server interfaces properly.
817 //! @SYMTestActions Uses RFs::IsValidName(), RFs::MkDir(), RDir::Open(), RFs::RmDir() to test
818 //! various dir name handling.
819 //! @SYMTestExpectedResults Proper error code is returned.
820 //! @SYMTestPriority High
821 //! @SYMTestStatus Implemented
822 //---------------------------------------------
823 void TestDirNameHandling()
825 test.Next(_L("Test Dir Name Handling Interfaces"));
827 dirTest1 = _L("\\F32-TST\\TDIRS\\test1\\FILE.TXT");
829 dirTest2 = _L("\\F32-TST\\TDIRS\\test2.\\FILE.TXT");
831 dirTest3 = _L("\\F32-TST\\TDIRS\\test3. \\FILE.TXT");
833 dirTest4 = _L("\\F32-TST\\TDIRS\\test4. . \\FILE.TXT");
835 dirTest5 = _L("\\F32-TST\\TDIRS\\test5.\\FILE.TXT");
837 dirTest6 = _L("\\F32-TST\\TDIRS\\test6. .\\FILE.TXT");
839 TBool valid = TheFs.IsValidName( dirTest1 );
841 valid = TheFs.IsValidName( dirTest2 );
843 valid = TheFs.IsValidName( dirTest3 );
845 valid = TheFs.IsValidName( dirTest4 );
847 valid = TheFs.IsValidName( dirTest5 );
849 valid = TheFs.IsValidName( dirTest6 );
852 dirTest1 = _L("\\F32-TST\\TDIRS\\test1\\");
853 dirTest2 = _L("\\F32-TST\\TDIRS\\test2.\\");
854 dirTest3 = _L("\\F32-TST\\TDIRS\\test3. \\");
855 dirTest4 = _L("\\F32-TST\\TDIRS\\test4. . \\");
856 dirTest5 = _L("\\F32-TST\\TDIRS\\test5.\\");
857 dirTest6 = _L("\\F32-TST\\TDIRS\\test6. .\\");
859 TInt err = TheFs.MkDir(dirTest1);
860 test(err == KErrNone);
861 err = TheFs.MkDir(dirTest2);
862 test(err == KErrBadName);
863 err = TheFs.MkDir(dirTest3);
864 test(err == KErrBadName);
865 err = TheFs.MkDir(dirTest4);
866 test(err == KErrBadName);
867 err = TheFs.MkDir(dirTest5);
868 test(err == KErrBadName);
869 err = TheFs.MkDir(dirTest6);
870 test(err == KErrBadName);
873 err = rdir.Open(TheFs, dirTest1, 0);
875 test(err == KErrNone);
877 err = rdir.Open(TheFs, dirTest2, 0);
879 test(err == KErrBadName);
881 err = rdir.Open(TheFs, dirTest3, 0);
883 test(err == KErrBadName);
885 err = rdir.Open(TheFs, dirTest4, 0);
887 test(err == KErrBadName);
889 err = rdir.Open(TheFs, dirTest5, 0);
891 test(err == KErrBadName);
893 err = rdir.Open(TheFs, dirTest6, 0);
895 test(err == KErrBadName);
897 err = TheFs.RmDir(dirTest1);
898 test(err == KErrNone);
899 err = TheFs.RmDir(dirTest2);
900 test(err == KErrBadName);
901 err = TheFs.RmDir(dirTest3);
902 test(err == KErrBadName);
903 err = TheFs.RmDir(dirTest4);
904 test(err == KErrBadName);
905 err = TheFs.RmDir(dirTest5);
906 test(err == KErrBadName);
907 err = TheFs.RmDir(dirTest6);
908 test(err == KErrBadName);
917 //-- set up console output
918 F32_Test_Utils::SetConsole(test.Console());
920 TInt nRes=TheFs.CharToDrive(gDriveToTest, gDriveNum);
921 test(nRes==KErrNone);
923 PrintDrvInfo(TheFs, gDriveNum);
925 TurnAllocFailureOff();
926 CreateTestDirectory(_L("\\F32-TST\\TDIRS\\"));
930 TInt r=TheFs.SetSessionPath(_L("Z:\\"));
934 r=TheFs.SetSessionPath(gSessionPath);
936 test.Next(_L("Run all other tests from \\F32-TST\\TDIRS\\"));
954 TestDirNameHandling();