sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // f32test\server\T_FatCharSetConv_Aux.h sl@0: // sl@0: // sl@0: sl@0: #ifndef T_FATCHARSETCONV_AUX_H sl@0: #define T_FATCHARSETCONV_AUX_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "t_server.h" sl@0: #include "fat_utils.h" sl@0: sl@0: using namespace Fat_Test_Utils; sl@0: class TTestLogFailureData; sl@0: extern TTestLogFailureData gLogFailureData; sl@0: extern RRawDisk TheDisk; sl@0: extern TFatBootSector gBootSector; sl@0: extern TBool gIOTesting; sl@0: extern RFs TheFs; sl@0: extern RFile TheFile; sl@0: extern RDir TheDir; sl@0: extern TFileName gSessionPath; sl@0: extern TInt gAllocFailOff; sl@0: extern TInt gAllocFailOn; sl@0: extern TChar gDriveToTest; sl@0: extern TFileName gFileName; sl@0: extern TBool gAutoTest; sl@0: sl@0: sl@0: enum TTCType sl@0: { sl@0: EUnitaryTest, sl@0: EBinaryTest, sl@0: ESymbianFATSpecific sl@0: }; sl@0: sl@0: extern TTCType gTCType; sl@0: extern TUint gTCId; sl@0: sl@0: // function declarations sl@0: class TTestSwitches; sl@0: class TTestParamAll; sl@0: struct TTestCaseUnitaryBasic; sl@0: sl@0: // Constants sl@0: const TInt KFileName350=350; sl@0: const TInt KFileName50=50; sl@0: const TInt KFileName20=20; sl@0: sl@0: // Literals sl@0: // Code Pages sl@0: _LIT(KTestLocale, "t_tlocl_cp932.dll"); sl@0: sl@0: //Log file specific sl@0: _LIT(KLogFileName,"C:\\Failure"); sl@0: _LIT(KExeLogFileName,"C:\\ExecutionFailure"); sl@0: _LIT(KVerLogFileName,"C:\\VerificationFailure"); sl@0: _LIT(KExtension,".txt"); sl@0: _LIT(KComma,","); sl@0: _LIT(KUnderScore,"_"); sl@0: _LIT(KNewLine,"\n"); sl@0: sl@0: // FileSystem specific sl@0: _LIT(KFAT,"Fat"); sl@0: _LIT(KWin32,"Win32"); sl@0: sl@0: // test case type sl@0: _LIT(KUnitary,"Unitary"); sl@0: _LIT(KBinary,"Binary"); sl@0: _LIT(KSymbianFATSpecific,"SymbianFATSpecific"); sl@0: sl@0: // test case phases sl@0: _LIT(KExecution,"Execution"); sl@0: _LIT(KVerification,"Verification"); sl@0: sl@0: // os names sl@0: _LIT(KWindows,"Windows"); sl@0: _LIT(KSymbian,"Symbian"); sl@0: _LIT(KNone,"None"); sl@0: sl@0: // log file header sl@0: _LIT(KLogFileHeader,"IOT,TestCase,FailedDuring,Id,Path,FileSystem,ExeOsName,ExeDrive,VerOsName,VerDrive,API,Line,FunctionName,File"); sl@0: sl@0: // general purpose sl@0: _LIT(KYes,"Yes"); sl@0: _LIT(KNo,"No"); sl@0: sl@0: // function names sl@0: _LIT(KDoAllBasicUnitaryTestsL,"DoAllBasicUnitaryTestsL"); sl@0: _LIT(KDoAllBasicBinaryTestsL,"DoAllBasicBinaryTestsL"); sl@0: _LIT(KTestLeadingE5Handling,"TestLeadingE5Handling"); sl@0: _LIT(KTestFileLengthMax,"TestFileLengthMax"); sl@0: _LIT(KTestFileLengthExceedMax,"TestFileLengthExceedMax"); sl@0: _LIT(KTestVFATCase1,"TestVFATCase1"); sl@0: _LIT(KTestVFATCase2,"TestVFATCase2"); sl@0: _LIT(KTestVFATCase3,"TestVFATCase3"); sl@0: _LIT(KTestIllegalCharsWithDll,"TestIllegalCharsWithDll"); sl@0: _LIT(KTestIllegalCharsWithoutDLL,"TestIllegalCharsWithoutDLL"); sl@0: _LIT(KCheckDisk,"CheckDisk"); sl@0: _LIT(KLogTestFailureData,"LogTestFailureData"); sl@0: _LIT(KDataGenerationL,"DataGenerationL"); sl@0: _LIT(KDeletePathAfterTest,"DeletePathAfterTest"); sl@0: _LIT(KDataExecutionL,"DataExecutionL"); sl@0: _LIT(KDataVerificationL,"DataVerificationL"); sl@0: _LIT(KSearchTestCaseByArrayIdx,"SearchTestCaseByArrayIdx"); sl@0: _LIT(KScanTestDrive,"ScanTestDrive"); sl@0: _LIT(KTestCompatibility,"TestCompatibility"); sl@0: sl@0: // api names sl@0: _LIT(KGetShortName,"EGetShortName"); sl@0: _LIT(KGetShortNameWithDLL,"EGetShortNameWithDLL"); sl@0: _LIT(KGetShortNameWithoutDLL,"EGetShortNameWithoutDLL"); sl@0: _LIT(KCreateFile,"ECreateFile"); sl@0: _LIT(KIsValidName,"EIsValidName"); sl@0: _LIT(KRenameFile,"ERenameFile"); sl@0: _LIT(KReadFileSection,"EReadFileSection"); sl@0: _LIT(KDeleteFile,"EDeleteFile"); sl@0: _LIT(KOpenDir,"EOpenDir"); sl@0: _LIT(KReadDir,"EReadDir"); sl@0: _LIT(KRemoveDir,"ERemoveDir"); sl@0: _LIT(KIsFileInRom,"EIsFileInRom"); sl@0: _LIT(KReplaceFile,"EReplaceFile"); sl@0: _LIT(KOperateOnFileNames,"EOperateOnFileNames"); sl@0: _LIT(KFileModify,"EFileModify"); sl@0: _LIT(KFileAttributes,"EFileAttributes"); sl@0: _LIT(KRFsEntry,"ERFsEntry)"); sl@0: _LIT(KRFsReplace,"ERFsReplace"); sl@0: _LIT(KRFsRename,"ERFsRename"); sl@0: _LIT(KGetDir,"EGetDir"); sl@0: _LIT(KWriteToFile,"EWriteToFile"); sl@0: _LIT(KReadFromFile,"EReadFromFile"); sl@0: _LIT(KMkDir,"EMkDir"); sl@0: _LIT(KMkDirAll,"EMkDirAll"); sl@0: _LIT(KFileTemp,"EFileTemp"); sl@0: _LIT(KLongShortConversion,"ELongShortConversion"); sl@0: sl@0: #ifdef LOG_FAILURE_DATA sl@0: #define testAndLog(flag) \ sl@0: { \ sl@0: if(flag == EFalse) \ sl@0: { \ sl@0: TInt line = __LINE__; \ sl@0: test.Printf(_L("\nFAILURE on LINE: %d"),line); \ sl@0: LogTestFailureData(gTCType, failedOnBuf, gTCId, tcUniquePath, line); \ sl@0: } \ sl@0: } sl@0: #else sl@0: #define testAndLog(flag) \ sl@0: { \ sl@0: test(flag); \ sl@0: } sl@0: #endif sl@0: sl@0: sl@0: // forward declaration sl@0: struct TDirSetupFiles; sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: // Files Setup Pattern Definitions sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: static TPtrC gDirPatterns[] = sl@0: { sl@0: sl@0: // ******************************ALPHABETIC-CHARACTERS*************************************************** sl@0: sl@0: _L("ABC(DE).TX"), //0 MAJOR <8 ,EXT <3 sl@0: _L("ABC(DE).TXTTXT"), //1 MAJOR <8 ,EXT >3 sl@0: _L("ABC(DE).TXT"), //2 MAJOR <8 ,EXT =3 sl@0: sl@0: _L("ABCDEF(GH).TX"), //3 MAJOR >8 ,EXT <3 sl@0: _L("ABCDEF(GH).TXTTXT"), //4 MAJOR >8 ,EXT >3 sl@0: _L("ABCDEF(GH).TXT"), //5 MAJOR >8 ,EXT =3 sl@0: sl@0: _L("ABC(DEF).TX"), //6 MAJOR =8 ,EXT <3 sl@0: _L("ABC(DEF).TXTTXT"), //7 MAJOR =8 ,EXT >3 sl@0: _L("ABC(DEF).TXT"), //8 MAJOR =8 ,EXT =3 sl@0: sl@0: // ******************************UNICODE-CHARACTERS******************************************************* sl@0: sl@0: _L("\x65B0\x65B0.\x65B0"), //9 MAJOR <8 ,EXT <3 sl@0: _L("\x65B0\x6587.\x65B0\x6587"), //10 MAJOR <8 ,EXT 3>6 sl@0: _L("\x65B0\x65B0.\x65B0\x65B0\x65B0"), //11 MAJOR <8 ,EXT =6 sl@0: _L("\x65B0\x65B0.\x65B0\x65B0\x65B0\x65B0"), //12 MAJOR >8 ,EXT >6 sl@0: sl@0: _L("\x65B0\x65B0\x65B0\x65B0.\x65B0"), //13 MAJOR =8 ,EXT <3 sl@0: _L("\x65B0\x65B0\x65B0\x6587.\x65B0\x6587"), //14 MAJOR =8 ,EXT 3>6 sl@0: _L("\x65B0\x65B0\x65B0\x4EF6.\x65B0\x65B0\x65B0"), //15 MAJOR =8 ,EXT =6 sl@0: _L("\x65B0\x4EF6\x65B0\x6587.\x65B0\x4EF6\x65B0\x6587"), //16 MAJOR =8 ,EXT >6 sl@0: sl@0: _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.\x65B0"), //17 MAJOR 8<16 ,EXT <3 sl@0: _L("\x65B0\x4EF6\x65B0\x65B0\x6587.\x65B0\x6587"), //18 MAJOR 8<16 ,EXT >3 sl@0: _L("\x65B0\x6587\x65B0\x4EF6\x65B0.\x65B0\x65B0\x65B0"), //19 MAJOR 8<16 ,EXT =6 sl@0: _L("\x65B0\x6587\x6587\x6587\x4EF6.\x65B0\x65B0\x65B0\x65B0"), //20 MAJOR 8<16 ,EXT >6 sl@0: sl@0: _L("\x65B0\x4EF6\x65B0\x4EF6\x65B0\x4EF6\x65B0\x4EF6.\x4EF6"), //21 MAJOR =16 ,EXT <3 sl@0: _L("\x4EF6\x4EF6\x65B0\x65B0\x65B0\x65B0\x65B0\x6587.\x65B0\x6587"), //22 MAJOR =16 ,EXT 3>6 sl@0: _L("\x65B0\x65B0\x65B0\x4EF6\x65B0\x4EF6\x4EF6.\x65B0\x4EF6\x65B0"), //23 MAJOR =16 ,EXT =6 sl@0: _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.\x65B0\x65B0\x65B0\x65B0"), //24 MAJOR =16 ,EXT >6 sl@0: sl@0: _L("\x6587\x6587\x6587\x6587\x65B0\x65B0\x65B0\x65B0\x4EF6\x4EF6.\x65B0"), //25 MAJOR >16 ,EXT <3 sl@0: _L("\x4EF6\x4EF6\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.\x65B0\x6587"), //26 MAJOR >16 ,EXT 3>6 sl@0: _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.\x65B0\x65B0\x65B0"), //27 MAJOR >16 ,EXT =6 sl@0: _L("\x65B0\x65B0\x4EF6\x65B0\x65B0\x65B0\x4EF6\x65B0\x65B0.\x65B0\x65B0\x65B0\x65B0"), //28 MAJOR >16 ,EXT >6 sl@0: sl@0: // ******************************MIXED-CHARACTERS********************************************************************* sl@0: sl@0: _L("\x65B0(A).\x65B0"), //29 MAJOR <8 ,EXT <3 sl@0: _L("\x65B0(A).A\x65B0"), //30 MAJOR <8 ,EXT =3 sl@0: _L("\x65B0(A).A\x65B0\x6587"), //31 MAJOR <8 ,EXT 3<6 sl@0: _L("\x65B0(A).AB\x65B0\x65B0"), //32 MAJOR <8 ,EXT <6 sl@0: _L("\x65B0(A).AB\x65B0\x65B0\x65B0\x65B0"), //33 MAJOR <8 ,EXT >6 sl@0: sl@0: _L("\x65B0\x65B0(AB).\x65B0"), //34 MAJOR =8 ,EXT <3 sl@0: _L("(AB)\x65B0\x65B0.A\x65B0"), //35 MAJOR =8 ,EXT =3 sl@0: _L("\x65B0(AB)\x65B0.A\x65B0\x6587"), //36 MAJOR =8 ,EXT 3<6 sl@0: _L("\x65B0(\x65B0)AB.AB\x65B0\x65B0"), //37 MAJOR =8 ,EXT <6 sl@0: _L("\x65B0\x65B0(CD).AB\x65B0\x65B0\x65B0\x65B0"), //38 MAJOR =8 ,EXT >6 sl@0: sl@0: _L("\x65B0\x65B0\x65B0\x65B0(AB).\x65B0"), //39 MAJOR 8<16 ,EXT <3 sl@0: _L("\x65B0\x65B0\x65B0\x65B0(AB).A\x65B0"), //40 MAJOR 8<16 ,EXT =3 sl@0: _L("AB\x65B0\x6587\x65B0\x65B0.A\x65B0\x6587"), //41 MAJOR 8<16 ,EXT 3<6 sl@0: _L("CD\x65B0\x6587\x65B0\x65B0.AB\x65B0\x65B0"), //42 MAJOR 8<16 ,EXT <6 sl@0: _L("\x65B0\x6587(\x65B0\x65B0).AB\x65B0\x65B0\x65B0\x65B0"), //43 MAJOR 8<16 ,EXT >6 sl@0: sl@0: _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0(AB).\x65B0"), //44 MAJOR =16 ,EXT <3 sl@0: _L("(AB)\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.A\x65B0"), //45 MAJOR =16 ,EXT =3 sl@0: _L("\x65B0\x65B0\x65B0(AB)\x65B0\x65B0\x65B0.A\x65B0\x6587"), //46 MAJOR =16 ,EXT 3<6 sl@0: _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0(CD).AB\x65B0\x65B0"), //47 MAJOR =16 ,EXT <6 sl@0: _L("\x65B0\x65B0(\x65B0\x65B0)CD\x65B0\x65B0.AB\x65B0\x65B0\x65B0\x65B0"), //48 MAJOR =16 ,EXT >6 sl@0: sl@0: _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0(AB).\x65B0"), //49 MAJOR >16 ,EXT <3 sl@0: _L("(AB)\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.A\x65B0"), //50 MAJOR >16 ,EXT =3 sl@0: _L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0(CD).A\x65B0\x6587"), //51 MAJOR >16 ,EXT 3<6 sl@0: _L("\x65B0\x65B0\x65B0(\x65B0\x65B0\x65B0)CD\x65B0\x65B0.AB\x65B0\x65B0"), //52 MAJOR >16 ,EXT <6 sl@0: _L("CD\x65B0\x65B0(\x65B0\x65B0)\x65B0\x65B0\x65B0\x65B0.AB\x65B0\x65B0\x65B0\x65B0"), //53 MAJOR >16 ,EXT >6 sl@0: sl@0: // **************************************************************************************************************************** sl@0: sl@0: _L("TESTDIR\\"), //54 sl@0: _L("TESTDIR\\DIR1\\"), //55 sl@0: _L("TESTDIR\\DIR2\\"), //56 sl@0: _L("TESTDIR\\DIR3\\"), //57 sl@0: _L("TESTDIR\\DIR4\\"), //58 sl@0: sl@0: _L("TESTDIR_FS\\"), //59 sl@0: _L("TESTDIR_FS\\DIR3\\"), //60 sl@0: _L("TESTDIR_FS\\DIR1\\"), //61 sl@0: _L("TESTDIR_FS\\DIR2\\"), //62 sl@0: sl@0: _L("TESTDIR_FS\\DIR3\\FILE03.TXT"), //63 sl@0: _L("TESTDIR_FS\\DIR1\\FILE01.TXT"), //64 sl@0: _L("TESTDIR_FS\\DIR2\\FILE02.TXT"), //65 sl@0: sl@0: _L("TESTALPHA.TXT"), //66 sl@0: _L("TESTALPHA.TXTTXT"), //67 sl@0: sl@0: _L("REPLACED.TXT"), //68 sl@0: _L("REPLACED.TX"), //69 sl@0: _L("REPLACED.TXTTXT"), //70 sl@0: sl@0: _L("XYZ\\"), //71 sl@0: _L("TESTRENAME.DAT"), //72 sl@0: sl@0: _L("\x65B0\x65B0\x65B0\\"), //73 sl@0: _L("\x65B0\x6587\x4EF6\x4EF6\x6587\x65B0.\x65B0\x4EF6"), //74 sl@0: sl@0: _L("AB(\x65B0\x6587)CD\\"), //75 sl@0: _L("AB\x65B0\x6587(CDEF).\x4EF6(AB)"), //76 sl@0: sl@0: sl@0: _L("\x65B0\x6587\x65B0\x4EF6.TXT"), //77 sl@0: _L("\x65B0\x6587\x65B0\x4EF6(A).TXT"), //78 sl@0: _L("\x65B0\x6587\x65B0\x4EF6(B).TXT"), //79 sl@0: _L("\x65B0\x6587\x65B0\x4EF6(C).TXT"), //80 sl@0: sl@0: _L("\x65B0.TXT"), //81 sl@0: _L("\x65B0\x6587.TXTTXT"), //82 sl@0: _L("\x65B0\x6587\x4EF6.TX"), //83 sl@0: sl@0: _L("ABCDE.\x65B0\x65B0"), //84 sl@0: _L("ABCDEFG.\x65B0\x65B0\x65B0"), //85 sl@0: _L("ABCD.\x65B0T"), //86 sl@0: _L("ABCDE.T\x65B0"), //87 sl@0: sl@0: _L("\x222F\x2F3A\x3C3E\x7C00.TXT"), //88 sl@0: _L("\x235B\x245C\x255D\x265E.TXT"), //89 sl@0: sl@0: _L("\x65B0\x6587\\"), //90 sl@0: _L("\x65B0\x6587\\\x65B0\x6587\x65B0\\"), //91 sl@0: _L("\x65B0\x6587\\\x65B0\x6587\x65B0\x6587\\"), //92 sl@0: _L("\x65B0\x6587\\\x65B0\x6587\x65B0\x6587\x65B0\\"), //93 sl@0: _L("\x65B0\x6587\\\x65B0\x6587\x65B0\x6587\x65B0\x6587\\"), //94 sl@0: sl@0: _L("\x65B0\x6587\x4EF6\\"), //95 sl@0: _L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\\"), //96 sl@0: _L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\x4EF6\\"), //97 sl@0: _L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\x4EF6\x6587\\"), //98 sl@0: sl@0: _L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\\\x65B0\x4EF6\x65B0\x4EF6\x65B0\x4EF6\x65B0\x4EF6.\x4EF6"), //99 sl@0: _L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\x4EF6\\\x4EF6\x4EF6\x65B0\x65B0\x65B0\x65B0\x65B0\x6587.\x65B0\x6587"), //100 sl@0: _L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\x4EF6\x6587\\\x65B0\x65B0\x65B0\x4EF6\x65B0\x4EF6\x4EF6.\x65B0\x4EF6\x65B0"), //101 sl@0: sl@0: _L("\x65B0(A)\x6587\\"), //102 sl@0: _L("\x65B0(A)\x6587\\\x65B0(AB)\x65B0\\"), //103 sl@0: _L("\x65B0(A)\x6587\\\x65B0(ABCD)\x65B0\\"), //104 sl@0: _L("\x65B0(A)\x6587\\\x65B0\x65B0(ABCDEF)\x65B0\x65B0\\"), //105 sl@0: _L("\x65B0(A)\x6587\\\x65B0\x65B0\x65B0(ABGH)\x65B0\x65B0\x65B0\\"), //106 sl@0: sl@0: _L("\x65B0\x6587(AB)\\"), //107 sl@0: _L("\x65B0\x6587(AB)\\\x65B0(A)\x65B0\\"), //108 sl@0: _L("\x65B0\x6587(AB)\\\x65B0\x4EF6(AB)\x4EF6\\"), //109 sl@0: _L("\x65B0\x6587(AB)\\\x65B0\x4EF6(ABCDEF)\x4EF6\x6587\\"), //110 sl@0: sl@0: _L("\x65B0\x6587(AB)\\\x65B0(A)\x65B0\\\x65B0\x4EF6\x65B0(AB)\x4EF6\x65B0\x4EF6.\x4EF6"), //111 sl@0: _L("\x65B0\x6587(AB)\\\x65B0\x4EF6(AB)\x4EF6\\\x4EF6\x4EF6(ABC)\x65B0\x65B0\x6587.\x65B0\x6587"), //112 sl@0: _L("\x65B0\x6587(AB)\\\x65B0\x4EF6(ABCDEF)\x4EF6\x6587\\\x65B0\x65B0\x65B0(CD)\x4EF6\x4EF6.\x65B0\x4EF6\x65B0"), //113 sl@0: }; sl@0: sl@0: #define EOB -1 // 'End Of Block' tag sl@0: #define CON (EOB - 1) // 'Continue' tag sl@0: #define LAST 130 // Last item's tag sl@0: //... sl@0: sl@0: // Predefined dir data blocks for testing data setup: sl@0: #define ALL {0,CON,LAST,EOB} // Block includes all items sl@0: sl@0: #define EMPTY {EOB} // Empty block sl@0: sl@0: #define BLOCK01 {0,CON,8,EOB} sl@0: #define BLOCK02 {9,CON,12,EOB} sl@0: #define BLOCK03 {13,CON,16,EOB} sl@0: #define BLOCK04 {17,CON,20,EOB} sl@0: #define BLOCK05 {21,CON,24,EOB} sl@0: #define BLOCK06 {25,CON,28,EOB} sl@0: #define BLOCK07 {29,CON,33,EOB} sl@0: #define BLOCK08 {34,CON,38,EOB} sl@0: #define BLOCK09 {39,CON,43,EOB} sl@0: #define BLOCK10 {44,CON,48,EOB} sl@0: #define BLOCK11 {49,CON,53,EOB} sl@0: #define BLOCK12 {54,CON,58,EOB} sl@0: #define BLOCK13 {59,CON,62,EOB} sl@0: #define BLOCK14 {63,CON,65,EOB} sl@0: #define BLOCK15 {77,CON,80,EOB} sl@0: #define BLOCK16 {81,CON,87,EOB} sl@0: #define BLOCK17 {90,CON,94,EOB} sl@0: #define BLOCK18 {95,CON,98,EOB} sl@0: #define BLOCK19 {99,CON,101,EOB} sl@0: #define BLOCK20 {102,CON,106,EOB} sl@0: #define BLOCK21 {107,CON,110,EOB} sl@0: #define BLOCK22 {111,CON,113,EOB} sl@0: sl@0: sl@0: sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: // Data structures for building test case parameters sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: enum TTestingAPI sl@0: { sl@0: EGetShortName, sl@0: EGetShortNameWithDLL, sl@0: EGetShortNameWithoutDLL, sl@0: ECreateFile, sl@0: EIsValidName, sl@0: ERenameFile, sl@0: EReadFileSection, sl@0: EDeleteFile, sl@0: EOpenDir, sl@0: EReadDir, sl@0: ERemoveDir, sl@0: EIsFileInRom, sl@0: EReplaceFile, sl@0: EOperateOnFileNames, sl@0: EFileModify, sl@0: EFileAttributes, sl@0: ERFsEntry, sl@0: ERFsReplace, sl@0: ERFsRename, sl@0: EGetDir, sl@0: EWriteToFile, sl@0: EReadFromFile, sl@0: EMkDir, sl@0: EMkDirAll, sl@0: EFileTemp, sl@0: ELongShortConversion, sl@0: }; sl@0: sl@0: struct TDirSetupFiles sl@0: { sl@0: TInt iAddingBlock[25]; sl@0: TInt iDeductBlock[25]; sl@0: }; sl@0: // Basic Testing Parameters sl@0: struct TTestParamBasic sl@0: { sl@0: TUint iTestCaseID; sl@0: TTestingAPI iAPI; sl@0: TUint iSwitch; sl@0: TInt iSyncReturn; sl@0: TInt iAsyncReturn; sl@0: TInt iAsyncStatus; sl@0: }; sl@0: sl@0: sl@0: // Basic Presettings Parameters sl@0: struct TTestParamBasicPrs sl@0: { sl@0: TChar* iDrvChar; sl@0: TText16* iCmdPath; sl@0: TText16* iPrsPath; sl@0: TDirSetupFiles iPrsFiles; sl@0: TText16* iCmpPath; sl@0: TDirSetupFiles iCmpFiles; sl@0: sl@0: }; sl@0: sl@0: // Presettings with file open mode sl@0: struct TTestParamPrsFileOpen sl@0: { sl@0: TTestParamBasicPrs iBasicPrs; sl@0: TBool iFileOpen; sl@0: }; sl@0: sl@0: // Presettings with file attribs and modified time sl@0: struct TTestParamPrsAttribsTime sl@0: { sl@0: TTestParamBasicPrs iBasicPrs; sl@0: TUint iAttribsSet; sl@0: TTime iTime; sl@0: }; sl@0: sl@0: sl@0: /////////////////////////////////////////////////////////// sl@0: // Test case data structures sl@0: /////////////////////////////////////////////////////////// sl@0: struct TTestCaseUnitaryBasic sl@0: { sl@0: TTestParamBasic iBasic; sl@0: TTestParamBasicPrs iSrcPrsBasic; sl@0: }; sl@0: sl@0: struct TTestCaseBinaryBasic sl@0: { sl@0: TTestParamBasic iBasic; sl@0: TTestParamBasicPrs iSrcPrsBasic; sl@0: TTestParamBasicPrs iTrgPrsBasic; sl@0: }; sl@0: sl@0: struct TTestCaseUnitaryAttribTime sl@0: { sl@0: TTestParamBasic iBasic; sl@0: TUint iSetAttribs; sl@0: TUint iClearAttribs; sl@0: TTestParamPrsAttribsTime iSrcPrsAT; sl@0: }; sl@0: sl@0: struct TTestCaseBinaryAttribTime sl@0: { sl@0: TTestParamBasic iBasic; sl@0: TTestParamPrsAttribsTime iSrcPrsAT; sl@0: TTestParamPrsAttribsTime iTrgPrsAT; sl@0: }; sl@0: sl@0: //////////////////////////////////////////////////////////// sl@0: // An interface between test framework and test cases sl@0: //////////////////////////////////////////////////////////// sl@0: class TTestParamAll sl@0: { sl@0: public: sl@0: TUint iTestCaseID; sl@0: TTestingAPI iAPI; sl@0: TFileName iAPIName; sl@0: TUint iSwitch; sl@0: TInt iSyncReturn; sl@0: TInt iAsyncReturn; sl@0: TInt iAsyncStatus; sl@0: sl@0: TBool iIsWithDLL; sl@0: sl@0: TUint iSetAttribs; sl@0: TUint iClearAttribs; sl@0: TTime iSetModified; sl@0: sl@0: TChar* iSrcDrvChar; sl@0: sl@0: TFileName iSrcCmdPath; sl@0: TFileName iSrcPrsPath; sl@0: TFileName iTrgCmdPath; sl@0: sl@0: TDirSetupFiles iSrcPrsFiles; sl@0: TUint iSrcPrsAttribs; sl@0: TTime iSrcPrsTime; sl@0: TBool iSrcPrsFileOpen; sl@0: sl@0: sl@0: TChar* iTrgDrvChar; sl@0: sl@0: }; sl@0: sl@0: class TTestSwitches sl@0: { sl@0: public: sl@0: sl@0: TBool iExeOnSymbian; sl@0: TBool iVerOnSymbian; sl@0: TBool iExeOnWindows; sl@0: TBool iVerOnWindows; sl@0: TChar iExeDriveChar; sl@0: TChar iVerDriveChar; sl@0: TInt iExeDriveNum; sl@0: TInt iVerDriveNum; sl@0: TBuf<20> iMountedFSName; sl@0: }; sl@0: sl@0: class TTestLogFailureData sl@0: { sl@0: public: sl@0: sl@0: TFileName iTCTypeName; // unitary/binary/Special sl@0: TFileName iTCFailureOn; // test phase data execution/data verification sl@0: TUint iTCId; sl@0: TFileName iTCUniquePath; // complete path with DLL/without DLL with Synch/Asynch etc sl@0: TBuf<20> iFSName; sl@0: TFileName iExeOsName; // OS name sl@0: TFileName iVerOsName; // OS name sl@0: TChar iExeDrive; sl@0: TChar iVerDrive; sl@0: TFileName iAPIName; sl@0: TInt iLineNum; sl@0: TFileName iFuncName; sl@0: TBuf8<50> iFileName; sl@0: }; sl@0: sl@0: sl@0: void LogTestFailureData(TTCType tcType, TFileName failedOn, TUint tcId, TFileName tcUniquePath,TInt line); sl@0: void ClearTCLogData(); sl@0: void InitLogData(); sl@0: void CheckDisk(); sl@0: void GetBootInfo(); sl@0: void ReadBootSector(TFatBootSector& aBootSector); sl@0: void QuickFormat(); sl@0: TInt SearchTestCaseByArrayIdx(TUint aIdx, const TTestCaseUnitaryBasic aBasicBinaryTestCaseGroup[], TTestParamAll& aTestCaseFound, TBool aIsWithDLL); sl@0: TInt SearchTestCaseByArrayIdx(TUint aIdx, const TTestCaseBinaryBasic aBasicBinaryTestCaseGroup[], TTestParamAll& aTestCaseFound, TBool aIsWithDLL); sl@0: void Help(); sl@0: void ClearSwitches(TTestSwitches& aSwitches); sl@0: void ParseCommandArguments(TTestSwitches& aSwitches); sl@0: void InitialiseL(); sl@0: void RmDir(const TDesC& aDirName); sl@0: void Cleanup(); sl@0: void ParsingDirDataBlock(const TInt aDataBlock[], RArray& aDirDataArray); sl@0: void CheckIfIOTesting(TTestSwitches& aSwitches); sl@0: /*template sl@0: TInt controlIo(RFs &fs, TInt drv, TInt fkn, C &c);*/ sl@0: void MakeFile(const TDesC& aFileName,const TUidType& aUidType,const TDesC8& aFileContents); sl@0: void MakeFile(const TDesC& aFileName,const TDesC8& aFileContents); sl@0: void MakeFile(const TDesC& aFileName,TInt anAttributes); sl@0: void MakeFile(const TDesC& aFileName); sl@0: TInt CurrentDrive(TChar aDriveChar); sl@0: TInt CurrentDrive(); sl@0: void CreateTestDirectory(const TDesC& aSessionPath); sl@0: void ReportCheckDiskFailure(TInt aRet); sl@0: void MakeDir(const TDesC& aDirName); sl@0: void Format(TInt aDrive); sl@0: sl@0: //Function declarations sl@0: void RmDir(const TDesC& aDirName); sl@0: TBool CompareL(const TDesC& aDir1,const TDesC& aDir2); sl@0: void SetupDirectories(TBool aCreateFiles, TFileName* aDestOtherDrive); sl@0: void InitialiseL(); sl@0: void Cleanup(); sl@0: void CleanupFileHandles(); sl@0: void ParsingDirDataBlock(TInt aDataBlock[], RArray& aFinalDirDataArray); sl@0: void SetupDir(TDesC& aPath, TDirSetupFiles aDirSetupData); sl@0: void SetupDirFiles(const TDesC& aPath, const TDirSetupFiles& aDirFiles); sl@0: void PrintDir(const TDesC& aPath, const TChar& aDrv); sl@0: void DoSymbianSpecificCases(); sl@0: inline TBool isFAT(const TDesC& aFSName) sl@0: { sl@0: return (aFSName.Compare(KFAT) == 0); sl@0: } sl@0: inline TBool isWin32(const TDesC& aFSName) sl@0: { sl@0: return (aFSName.Compare(KWin32) == 0); sl@0: } sl@0: sl@0: //functions that are required by both the .cpp files. sl@0: GLREF_C void TestLeadingE5Handling(); sl@0: GLREF_C void TestFileLengthMax(); sl@0: GLREF_C void TestFileLengthExceedMax(); sl@0: GLREF_C void TestIllegalCharsWithoutDLL(); sl@0: GLREF_C void TestIllegalCharsWithDll(); sl@0: GLREF_C void TestVFATCase1(); sl@0: GLREF_C void TestVFATCase2(); sl@0: GLREF_C void TestVFATCase3(); sl@0: sl@0: GLREF_C void GetBootInfo(); sl@0: GLREF_C void QuickFormat(); sl@0: GLREF_C void ReadBootSector(TFatBootSector& aBootSector); sl@0: sl@0: sl@0: sl@0: #endif /*T_FATCHARSETCONV_AUX_H*/