sl@0: // Copyright (c) 2008-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\cfileman\t_cfileman_aux.h sl@0: // sl@0: // sl@0: sl@0: #ifndef T_CFILEMAN_AUX_H sl@0: #define T_CFILEMAN_AUX_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "t_server.h" sl@0: 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: sl@0: struct TDirSetupFiles; sl@0: 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: sl@0: void PrintDir(const TDesC& aPath, const TChar& aDrv); sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: // Files Setup Pattern Definitions sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: static TPtrC gDirPatterns[] = sl@0: { sl@0: _L("FILE1.TXT"), // 0 sl@0: _L("FILE2.TXT"), // 1 sl@0: _L("FILE01.TXT"), // 2 sl@0: _L("FILE02.TXT"), // 3 sl@0: _L("FILE.TXT"), // 4 sl@0: _L("OTHER.TXT"), // 5 sl@0: _L("FILE.DAT"), // 6 sl@0: _L("FILE"), // 7 sl@0: sl@0: _L("DIR1\\"), // 8 sl@0: sl@0: _L("DIR1\\FILE1.TXT"), // 9 sl@0: _L("DIR1\\FILE2.TXT"), // 10 sl@0: _L("DIR1\\FILE01.TXT"), // 11 sl@0: _L("DIR1\\FILE02.TXT"), // 12 sl@0: _L("DIR1\\FILE.TXT"), // 13 sl@0: _L("DIR1\\OTHER.TXT"), // 14 sl@0: _L("DIR1\\FILE.DAT"), // 15 sl@0: _L("DIR1\\FILE"), // 16 sl@0: sl@0: _L("DIR2\\"), // 17 sl@0: sl@0: _L("DIR2\\FILE1.TXT"), // 18 sl@0: _L("DIR2\\FILE2.TXT"), // 19 sl@0: _L("DIR2\\FILE01.TXT"), // 20 sl@0: _L("DIR2\\FILE02.TXT"), // 21 sl@0: _L("DIR2\\FILE.TXT"), // 22 sl@0: _L("DIR2\\OTHER.TXT"), // 23 sl@0: _L("DIR2\\FILE.DAT"), // 24 sl@0: _L("DIR2\\FILE"), // 25 sl@0: sl@0: sl@0: _L("DIR1\\DIR11\\"), // 26 sl@0: sl@0: _L("DIR1\\DIR11\\FILE1.TXT"), // 27 sl@0: _L("DIR1\\DIR11\\FILE2.TXT"), // 28 sl@0: _L("DIR1\\DIR11\\FILE01.TXT"), // 29 sl@0: _L("DIR1\\DIR11\\FILE02.TXT"), // 30 sl@0: _L("DIR1\\DIR11\\FILE.TXT"), // 31 sl@0: _L("DIR1\\DIR11\\OTHER.TXT"), // 32 sl@0: _L("DIR1\\DIR11\\FILE.DAT"), // 33 sl@0: _L("DIR1\\DIR11\\FILE"), // 34 sl@0: sl@0: sl@0: _L("DIR1\\DIR12\\"), // 35 sl@0: sl@0: _L("DIR1\\DIR12\\FILE1.TXT"), // 36 sl@0: _L("DIR1\\DIR12\\FILE2.TXT"), // 37 sl@0: _L("DIR1\\DIR12\\FILE01.TXT"), // 38 sl@0: _L("DIR1\\DIR12\\FILE02.TXT"), // 39 sl@0: _L("DIR1\\DIR12\\FILE.TXT"), // 40 sl@0: _L("DIR1\\DIR12\\OTHER.TXT"), // 41 sl@0: _L("DIR1\\DIR12\\FILE.DAT"), // 42 sl@0: _L("DIR1\\DIR12\\FILE"), // 43 sl@0: sl@0: //Special sl@0: _L("RENAMED.TXT"), //44 sl@0: _L("RENAMED1.TXT"), //45 sl@0: _L("RENAMED2.TXT"), //46 sl@0: _L("RENAMED01.TXT"), //47 sl@0: _L("RENAMED02.TXT"), //48 sl@0: _L("RENAMED.DAT"), //49 sl@0: _L("RENAMED"), //50 sl@0: sl@0: _L("FILE1.REN"), //51 sl@0: _L("FILE2.REN"), //52 sl@0: _L("FILE01.REN"), //53 sl@0: _L("FILE02.REN"), //54 sl@0: _L("FILE.REN"), //55 sl@0: _L("OTHER.REN"), //56 sl@0: _L("RENAMED.REN"), //57 sl@0: _L("RENAMED1.REN"), //58 sl@0: _L("RENAMED2.REN"), //59 sl@0: _L("RENAMED01.REN"), //60 sl@0: _L("RENAMED02.REN"), //61 sl@0: _L("abcEtxt"), //62 sl@0: _L("DIR1\\RENAMED.TXT"), //63 sl@0: _L("DIR1\\RENAMED1.TXT"), //64 sl@0: _L("DIR1\\RENAMED2.TXT"), //65 sl@0: _L("DIR1\\RENAMED01.TXT"), //66 sl@0: _L("DIR1\\RENAMED02.TXT"), //67 sl@0: _L("DIR1\\DIR11\\RENAMED.TXT"), //68 sl@0: _L("DIR1\\DIR11\\RENAMED1.TXT"), //69 sl@0: _L("DIR1\\DIR11\\RENAMED2.TXT"), //70 sl@0: _L("DIR1\\DIR11\\RENAMED01.TXT"), //71 sl@0: _L("DIR1\\DIR11\\RENAMED02.TXT"), //72 sl@0: _L("DIR1\\DIR12\\RENAMED.TXT"), //73 sl@0: _L("DIR1\\DIR12\\RENAMED1.TXT"), //74 sl@0: _L("DIR1\\DIR12\\RENAMED2.TXT"), //75 sl@0: _L("DIR1\\DIR12\\RENAMED01.TXT"), //76 sl@0: _L("DIR1\\DIR12\\RENAMED02.TXT"), //77 sl@0: _L("DIR2\\RENAMED.TXT"), //78 sl@0: _L("DIR2\\RENAMED1.TXT"), //79 sl@0: _L("DIR2\\RENAMED2.TXT"), //80 sl@0: _L("DIR2\\RENAMED01.TXT"), //81 sl@0: _L("DIR2\\RENAMED02.TXT"), //82 sl@0: _L("DIR1\\FILE1.REN"), //83 sl@0: _L("DIR1\\FILE2.REN"), //84 sl@0: _L("DIR1\\FILE01.REN"), //85 sl@0: _L("DIR1\\FILE02.REN"), //86 sl@0: _L("DIR1\\FILE.REN"), //87 sl@0: _L("DIR1\\OTHER.REN"), //88 sl@0: _L("DIR1\\RENAMED.REN"), //89 sl@0: _L("DIR1\\RENAMED1.REN"), //90 sl@0: _L("DIR1\\RENAMED2.REN"), //91 sl@0: _L("DIR1\\RENAMED01.REN"), //92 sl@0: _L("DIR1\\RENAMED02.REN"), //93 sl@0: _L("DIR1\\DIR11\\FILE1.REN"), //94 sl@0: _L("DIR1\\DIR11\\FILE2.REN"), //95 sl@0: _L("DIR1\\DIR11\\FILE01.REN"), //96 sl@0: _L("DIR1\\DIR11\\FILE02.REN"), //97 sl@0: _L("DIR1\\DIR11\\FILE.REN"), //98 sl@0: _L("DIR1\\DIR11\\OTHER.REN"), //99 sl@0: _L("DIR1\\DIR11\\RENAMED.REN"), //100 sl@0: _L("DIR1\\DIR11\\RENAMED1.REN"), //101 sl@0: _L("DIR1\\DIR11\\RENAMED2.REN"), //102 sl@0: _L("DIR1\\DIR11\\RENAMED01.REN"), //103 sl@0: _L("DIR1\\DIR11\\RENAMED02.REN"), //104 sl@0: _L("DIR1\\DIR12\\FILE1.REN"), //105 sl@0: _L("DIR1\\DIR12\\FILE2.REN"), //106 sl@0: _L("DIR1\\DIR12\\FILE01.REN"), //107 sl@0: _L("DIR1\\DIR12\\FILE02.REN"), //108 sl@0: _L("DIR1\\DIR12\\FILE.REN"), //109 sl@0: _L("DIR1\\DIR12\\OTHER.REN"), //110 sl@0: _L("DIR1\\DIR12\\RENAMED.REN"), //111 sl@0: _L("DIR1\\DIR12\\RENAMED1.REN"), //112 sl@0: _L("DIR1\\DIR12\\RENAMED2.REN"), //113 sl@0: _L("DIR1\\DIR12\\RENAMED01.REN"), //114 sl@0: _L("DIR1\\DIR12\\RENAMED02.REN"), //115 sl@0: _L("DIR2\\FILE1.REN"), //116 sl@0: _L("DIR2\\FILE2.REN"), //117 sl@0: _L("DIR2\\FILE01.REN"), //118 sl@0: _L("DIR2\\FILE02.REN"), //119 sl@0: _L("DIR2\\FILE.REN"), //120 sl@0: _L("DIR2\\OTHER.REN"), //121 sl@0: _L("DIR2\\RENAMED.REN"), //122 sl@0: _L("DIR2\\RENAMED1.REN"), //123 sl@0: _L("DIR2\\RENAMED2.REN"), //124 sl@0: _L("DIR2\\RENAMED01.REN"), //125 sl@0: _L("DIR2\\RENAMED02.REN"), //126 sl@0: _L("DIR1\\RENAMED.DAT"), //127 sl@0: _L("DIR1\\DIR11\\RENAMED.DAT"), //128 sl@0: _L("DIR1\\DIR12\\RENAMED.DAT"), //129 sl@0: _L("DIR2\\RENAMED.DAT"), //130 sl@0: 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,7,EOB} sl@0: #define BLOCK02 {0,CON,4,EOB} sl@0: #define BLOCK03 {0,CON,5,EOB} sl@0: #define BLOCK04 {0,CON,7,9,CON,16,18,CON,25,27,CON,34,36,CON,43,EOB}// Src\\* sl@0: #define BLOCK05 {0,CON,4,9,CON,13,18,CON,22,27,CON,31,36,CON,40,EOB}// Src\\FILE*.TXT sl@0: #define BLOCK06 {0,1,9,10,18,19,27,28,36,37,EOB}// Src\\FILE?.TXT sl@0: #define BLOCK07 {0,CON,5,9,CON,14,18,CON,23,27,CON,32,36,CON,41,EOB}//Src\\*.TXT sl@0: #define BLOCK08 {4,6,13,15,22,24,31,33,40,42,55,EOB}//Src\\FILE.* sl@0: #define BLOCK09 {8,CON,16,26,CON,43,EOB} sl@0: #define BLOCK10 {26,CON,34,EOB} sl@0: #define BLOCK11 {9,CON,16,26,CON,43,EOB} sl@0: #define BLOCK12 {9,CON,16,EOB} sl@0: #define BLOCK13 {0,CON,3,EOB} sl@0: #define BLOCK14 {0,1,EOB} sl@0: #define BLOCK15 {0,1,8,9,10,17,18,19,26,27,28,35,36,37,EOB} sl@0: #define BLOCK16 {5,8,14,17,23,26,32,35,41,EOB} sl@0: #define BLOCK17 {3,8,12,17,21,26,30,35,39,EOB} sl@0: #define BLOCK18 {8,CON,16,EOB} sl@0: #define BLOCK19 {51,CON,61,EOB} sl@0: #define BLOCK20 {0,CON,5,44,CON,48,EOB} sl@0: #define BLOCK21 {0,CON,25,35,CON,61,EOB} sl@0: #define BLOCK22 {9,CON,63,EOB} sl@0: #define BLOCK23 {63,CON,71} sl@0: #define BLOCK24 {0,CON,7,44,CON,62,EOB} sl@0: #define BLOCK25 {0,CON,7,9,CON,16,18,CON,25,27,CON,34,36,CON,62,EOB} sl@0: #define BLOCK26 {0,CON,5,9,CON,14,18,CON,23,27,CON,32,36,CON,41,44,CON,48,EOB} sl@0: #define BLOCK27 {4,6,13,15,22,24,31,33,40,42,55,EOB} sl@0: #define BLOCK28 {8,CON,43,EOB} sl@0: #define BLOCK29 {0,CON,5,44,CON,48,EOB} sl@0: #define BLOCK30 {44,8,63,17,68,26,73,35,78,EOB} sl@0: #define BLOCK31 {44,CON,48,63,CON,82,EOB} sl@0: #define BLOCK32 {51,CON,61,83,CON,126,EOB} sl@0: #define BLOCK33 {44,49,57,89,100,111,122,127,CON,130,EOB} sl@0: #define BLOCK36 {0,CON,5,9,CON,14,18,CON,23,27,CON,32,36,CON,41,44,CON,48,63,CON,82,EOB} sl@0: #define BLOCK37 {4,6,13,15,22,24,31,33,40,42,55,87,98,109,120,EOB} sl@0: #define BLOCK39 {8,CON,16,26,CON,43,63,CON,77,83,CON,115,127,CON,129,EOB} sl@0: #define BLOCK45 {51,CON,61,83,CON,126,EOB} sl@0: #define BLOCK46 {44,49,57,63,68,73,78,89,100,111,122,127,128,129,130,EOB} sl@0: #define BLOCK47 {44,49,55,57,63,68,73,78,87,89,98,100,109,111,120,122,127,128,129,130,EOB} sl@0: sl@0: #define BLOCK34 {0,CON,5,9,CON,14,18,CON,23,27,CON,32,36,CON,41,44,CON,48,63,CON,82,EOB} sl@0: #define BLOCK35 {4,6,13,15,22,24,31,33,40,42,55,87,98,109,120,EOB} sl@0: #define BLOCK40 {44,49,57,63,68,73,78,89,100,111,122,127,CON,130,EOB} sl@0: #define BLOCK41 {8,CON,16,26,CON,43,63,CON,77,83,CON,115,127,CON,129,EOB} sl@0: #define BLOCK42 {0,CON,7,44,CON,49,51,CON,61,EOB} sl@0: #define BLOCK43 {9,CON,16,26,CON,43,63,CON,77,83,CON,115,127,CON,129,EOB} sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: // Data structures for building test case parameters sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: enum TTestingAPI sl@0: { sl@0: ECFMDelete, sl@0: ECFMMove, sl@0: ECFMRmDir, sl@0: ECFMCopy, sl@0: ECFMRename, sl@0: ECFMCopyHandle, sl@0: ECFMAttribs, 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: // 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: // 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 TTestCaseUnitaryFileOpen sl@0: { sl@0: TTestParamBasic iBasic; sl@0: TTestParamPrsFileOpen iSrcPrsFO; sl@0: }; sl@0: sl@0: struct TTestCaseBinaryFileOpen sl@0: { sl@0: TTestParamBasic iBasic; sl@0: TTestParamPrsFileOpen iSrcPrsFO; sl@0: TTestParamPrsFileOpen iTrgPrsFO; 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: TUint iSwitch; sl@0: TInt iSyncReturn; sl@0: TInt iAsyncReturn; sl@0: TInt iAsyncStatus; sl@0: sl@0: TUint iSetAttribs; sl@0: TUint iClearAttribs; sl@0: TTime iSetModified; sl@0: sl@0: TChar* iSrcDrvChar; sl@0: TPtrC iSrcCmdPath; sl@0: sl@0: TPtrC iSrcPrsPath; sl@0: TDirSetupFiles iSrcPrsFiles; sl@0: TUint iSrcPrsAttribs; sl@0: TTime iSrcPrsTime; sl@0: TBool iSrcPrsFileOpen; sl@0: sl@0: TPtrC iSrcCmpPath; sl@0: TDirSetupFiles iSrcCmpFiles; sl@0: TUint iSrcCmpAttribs; sl@0: TTime iSrcCmpTime; sl@0: TBool iSrcCmpFileOpen; sl@0: sl@0: TChar* iTrgDrvChar; sl@0: TPtrC iTrgCmdPath; sl@0: sl@0: TPtrC iTrgPrsPath; sl@0: TDirSetupFiles iTrgPrsFiles; sl@0: TUint iTrgPrsAttribs; sl@0: TTime iTrgPrsTime; sl@0: TBool iTrgPrsFileOpen; sl@0: sl@0: TPtrC iTrgCmpPath; sl@0: TDirSetupFiles iTrgCmpFiles; sl@0: TUint iTrgCmpAttribs; sl@0: TTime iTrgCmpTime; sl@0: TBool iTrgCmpFileOpen; sl@0: }; sl@0: #endif /*T_CFILEMAN_AUX_H*/