os/kernelhwsrv/kerneltest/f32test/server/t_fatcharsetconv_aux.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// f32test\server\T_FatCharSetConv_Aux.h
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#ifndef T_FATCHARSETCONV_AUX_H
sl@0
    19
#define T_FATCHARSETCONV_AUX_H
sl@0
    20
sl@0
    21
#include <f32file.h>
sl@0
    22
#include <e32test.h>
sl@0
    23
#include <hal.h>
sl@0
    24
#include "t_server.h"
sl@0
    25
#include "fat_utils.h"
sl@0
    26
sl@0
    27
using namespace Fat_Test_Utils;
sl@0
    28
class TTestLogFailureData;
sl@0
    29
extern TTestLogFailureData gLogFailureData;
sl@0
    30
extern RRawDisk TheDisk;
sl@0
    31
extern TFatBootSector gBootSector;
sl@0
    32
extern TBool gIOTesting;
sl@0
    33
extern RFs TheFs;
sl@0
    34
extern RFile TheFile;
sl@0
    35
extern RDir TheDir;
sl@0
    36
extern TFileName gSessionPath;
sl@0
    37
extern TInt gAllocFailOff;
sl@0
    38
extern TInt gAllocFailOn;
sl@0
    39
extern TChar gDriveToTest;
sl@0
    40
extern TFileName gFileName;
sl@0
    41
extern TBool gAutoTest;
sl@0
    42
sl@0
    43
sl@0
    44
enum TTCType
sl@0
    45
	{ 
sl@0
    46
	EUnitaryTest,
sl@0
    47
	EBinaryTest,
sl@0
    48
	ESymbianFATSpecific
sl@0
    49
	};
sl@0
    50
sl@0
    51
extern TTCType gTCType;
sl@0
    52
extern TUint gTCId;
sl@0
    53
sl@0
    54
// function declarations
sl@0
    55
class TTestSwitches;
sl@0
    56
class TTestParamAll;
sl@0
    57
struct TTestCaseUnitaryBasic;
sl@0
    58
sl@0
    59
// Constants
sl@0
    60
const TInt KFileName350=350;
sl@0
    61
const TInt KFileName50=50;
sl@0
    62
const TInt KFileName20=20;
sl@0
    63
sl@0
    64
// Literals
sl@0
    65
// Code Pages
sl@0
    66
_LIT(KTestLocale, "t_tlocl_cp932.dll");
sl@0
    67
sl@0
    68
//Log file specific
sl@0
    69
_LIT(KLogFileName,"C:\\Failure");
sl@0
    70
_LIT(KExeLogFileName,"C:\\ExecutionFailure");
sl@0
    71
_LIT(KVerLogFileName,"C:\\VerificationFailure");
sl@0
    72
_LIT(KExtension,".txt");
sl@0
    73
_LIT(KComma,",");
sl@0
    74
_LIT(KUnderScore,"_");
sl@0
    75
_LIT(KNewLine,"\n");
sl@0
    76
sl@0
    77
// FileSystem specific
sl@0
    78
_LIT(KFAT,"Fat");
sl@0
    79
_LIT(KWin32,"Win32");
sl@0
    80
sl@0
    81
// test case type
sl@0
    82
_LIT(KUnitary,"Unitary");
sl@0
    83
_LIT(KBinary,"Binary");
sl@0
    84
_LIT(KSymbianFATSpecific,"SymbianFATSpecific");
sl@0
    85
sl@0
    86
// test case phases
sl@0
    87
_LIT(KExecution,"Execution");
sl@0
    88
_LIT(KVerification,"Verification");
sl@0
    89
sl@0
    90
// os names
sl@0
    91
_LIT(KWindows,"Windows");
sl@0
    92
_LIT(KSymbian,"Symbian");
sl@0
    93
_LIT(KNone,"None");
sl@0
    94
sl@0
    95
// log file header
sl@0
    96
_LIT(KLogFileHeader,"IOT,TestCase,FailedDuring,Id,Path,FileSystem,ExeOsName,ExeDrive,VerOsName,VerDrive,API,Line,FunctionName,File");
sl@0
    97
sl@0
    98
// general purpose
sl@0
    99
_LIT(KYes,"Yes");
sl@0
   100
_LIT(KNo,"No");
sl@0
   101
sl@0
   102
// function names
sl@0
   103
_LIT(KDoAllBasicUnitaryTestsL,"DoAllBasicUnitaryTestsL");
sl@0
   104
_LIT(KDoAllBasicBinaryTestsL,"DoAllBasicBinaryTestsL");
sl@0
   105
_LIT(KTestLeadingE5Handling,"TestLeadingE5Handling");
sl@0
   106
_LIT(KTestFileLengthMax,"TestFileLengthMax");
sl@0
   107
_LIT(KTestFileLengthExceedMax,"TestFileLengthExceedMax");
sl@0
   108
_LIT(KTestVFATCase1,"TestVFATCase1");
sl@0
   109
_LIT(KTestVFATCase2,"TestVFATCase2");
sl@0
   110
_LIT(KTestVFATCase3,"TestVFATCase3");
sl@0
   111
_LIT(KTestIllegalCharsWithDll,"TestIllegalCharsWithDll");
sl@0
   112
_LIT(KTestIllegalCharsWithoutDLL,"TestIllegalCharsWithoutDLL");
sl@0
   113
_LIT(KCheckDisk,"CheckDisk");
sl@0
   114
_LIT(KLogTestFailureData,"LogTestFailureData");
sl@0
   115
_LIT(KDataGenerationL,"DataGenerationL");
sl@0
   116
_LIT(KDeletePathAfterTest,"DeletePathAfterTest");
sl@0
   117
_LIT(KDataExecutionL,"DataExecutionL");
sl@0
   118
_LIT(KDataVerificationL,"DataVerificationL");
sl@0
   119
_LIT(KSearchTestCaseByArrayIdx,"SearchTestCaseByArrayIdx");
sl@0
   120
_LIT(KScanTestDrive,"ScanTestDrive");
sl@0
   121
_LIT(KTestCompatibility,"TestCompatibility");
sl@0
   122
sl@0
   123
// api names
sl@0
   124
_LIT(KGetShortName,"EGetShortName");
sl@0
   125
_LIT(KGetShortNameWithDLL,"EGetShortNameWithDLL");
sl@0
   126
_LIT(KGetShortNameWithoutDLL,"EGetShortNameWithoutDLL");
sl@0
   127
_LIT(KCreateFile,"ECreateFile");
sl@0
   128
_LIT(KIsValidName,"EIsValidName");
sl@0
   129
_LIT(KRenameFile,"ERenameFile");
sl@0
   130
_LIT(KReadFileSection,"EReadFileSection");
sl@0
   131
_LIT(KDeleteFile,"EDeleteFile");
sl@0
   132
_LIT(KOpenDir,"EOpenDir");
sl@0
   133
_LIT(KReadDir,"EReadDir");
sl@0
   134
_LIT(KRemoveDir,"ERemoveDir");
sl@0
   135
_LIT(KIsFileInRom,"EIsFileInRom");
sl@0
   136
_LIT(KReplaceFile,"EReplaceFile");
sl@0
   137
_LIT(KOperateOnFileNames,"EOperateOnFileNames");
sl@0
   138
_LIT(KFileModify,"EFileModify");
sl@0
   139
_LIT(KFileAttributes,"EFileAttributes");
sl@0
   140
_LIT(KRFsEntry,"ERFsEntry)");
sl@0
   141
_LIT(KRFsReplace,"ERFsReplace");
sl@0
   142
_LIT(KRFsRename,"ERFsRename");
sl@0
   143
_LIT(KGetDir,"EGetDir");
sl@0
   144
_LIT(KWriteToFile,"EWriteToFile");
sl@0
   145
_LIT(KReadFromFile,"EReadFromFile");
sl@0
   146
_LIT(KMkDir,"EMkDir");
sl@0
   147
_LIT(KMkDirAll,"EMkDirAll");
sl@0
   148
_LIT(KFileTemp,"EFileTemp");
sl@0
   149
_LIT(KLongShortConversion,"ELongShortConversion");
sl@0
   150
sl@0
   151
#ifdef LOG_FAILURE_DATA
sl@0
   152
#define testAndLog(flag)													\
sl@0
   153
	{																		\
sl@0
   154
	if(flag == EFalse)														\
sl@0
   155
		{																	\
sl@0
   156
		TInt line = __LINE__;												\
sl@0
   157
		test.Printf(_L("\nFAILURE on LINE: %d"),line);						\
sl@0
   158
		LogTestFailureData(gTCType, failedOnBuf, gTCId, tcUniquePath, line);	\
sl@0
   159
		}																	\
sl@0
   160
	}
sl@0
   161
#else
sl@0
   162
#define testAndLog(flag)													\
sl@0
   163
	{																		\
sl@0
   164
	test(flag);																\
sl@0
   165
	}
sl@0
   166
#endif
sl@0
   167
sl@0
   168
sl@0
   169
// forward declaration
sl@0
   170
struct TDirSetupFiles;
sl@0
   171
sl@0
   172
///////////////////////////////////////////////////////////////////////////////
sl@0
   173
//	Files Setup Pattern Definitions
sl@0
   174
///////////////////////////////////////////////////////////////////////////////
sl@0
   175
static TPtrC gDirPatterns[] = 
sl@0
   176
	{	
sl@0
   177
		
sl@0
   178
	// ******************************ALPHABETIC-CHARACTERS***************************************************
sl@0
   179
sl@0
   180
	_L("ABC(DE).TX"),				//0 MAJOR <8 ,EXT <3
sl@0
   181
	_L("ABC(DE).TXTTXT"),			//1 MAJOR <8 ,EXT >3
sl@0
   182
	_L("ABC(DE).TXT"),				//2 MAJOR <8 ,EXT =3
sl@0
   183
		
sl@0
   184
	_L("ABCDEF(GH).TX"),			//3 MAJOR >8 ,EXT <3
sl@0
   185
	_L("ABCDEF(GH).TXTTXT"),		//4 MAJOR >8 ,EXT >3
sl@0
   186
	_L("ABCDEF(GH).TXT"),			//5 MAJOR >8 ,EXT =3
sl@0
   187
			
sl@0
   188
	_L("ABC(DEF).TX"),				//6 MAJOR =8 ,EXT <3
sl@0
   189
	_L("ABC(DEF).TXTTXT"),			//7 MAJOR =8 ,EXT >3
sl@0
   190
	_L("ABC(DEF).TXT"),				//8 MAJOR =8 ,EXT =3
sl@0
   191
		
sl@0
   192
	// ******************************UNICODE-CHARACTERS*******************************************************	
sl@0
   193
sl@0
   194
	_L("\x65B0\x65B0.\x65B0"),						//9 MAJOR <8  ,EXT <3
sl@0
   195
	_L("\x65B0\x6587.\x65B0\x6587"),				//10 MAJOR <8 ,EXT 3>6
sl@0
   196
	_L("\x65B0\x65B0.\x65B0\x65B0\x65B0"),			//11 MAJOR <8 ,EXT =6
sl@0
   197
	_L("\x65B0\x65B0.\x65B0\x65B0\x65B0\x65B0"),	//12 MAJOR >8 ,EXT >6
sl@0
   198
		
sl@0
   199
	_L("\x65B0\x65B0\x65B0\x65B0.\x65B0"),						//13 MAJOR =8 ,EXT <3
sl@0
   200
	_L("\x65B0\x65B0\x65B0\x6587.\x65B0\x6587"),				//14 MAJOR =8 ,EXT 3>6
sl@0
   201
	_L("\x65B0\x65B0\x65B0\x4EF6.\x65B0\x65B0\x65B0"),			//15 MAJOR =8 ,EXT =6
sl@0
   202
	_L("\x65B0\x4EF6\x65B0\x6587.\x65B0\x4EF6\x65B0\x6587"),	//16 MAJOR =8 ,EXT >6
sl@0
   203
		
sl@0
   204
	_L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.\x65B0"),				//17 MAJOR 8<16 ,EXT <3
sl@0
   205
	_L("\x65B0\x4EF6\x65B0\x65B0\x6587.\x65B0\x6587"),				//18 MAJOR 8<16 ,EXT >3
sl@0
   206
	_L("\x65B0\x6587\x65B0\x4EF6\x65B0.\x65B0\x65B0\x65B0"),		//19 MAJOR 8<16 ,EXT =6
sl@0
   207
	_L("\x65B0\x6587\x6587\x6587\x4EF6.\x65B0\x65B0\x65B0\x65B0"),	//20 MAJOR 8<16 ,EXT >6
sl@0
   208
		
sl@0
   209
	_L("\x65B0\x4EF6\x65B0\x4EF6\x65B0\x4EF6\x65B0\x4EF6.\x4EF6"),						//21 MAJOR =16 ,EXT <3
sl@0
   210
	_L("\x4EF6\x4EF6\x65B0\x65B0\x65B0\x65B0\x65B0\x6587.\x65B0\x6587"),				//22 MAJOR =16 ,EXT 3>6
sl@0
   211
	_L("\x65B0\x65B0\x65B0\x4EF6\x65B0\x4EF6\x4EF6.\x65B0\x4EF6\x65B0"),				//23 MAJOR =16 ,EXT =6
sl@0
   212
	_L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.\x65B0\x65B0\x65B0\x65B0"),	//24 MAJOR =16 ,EXT >6
sl@0
   213
		
sl@0
   214
	_L("\x6587\x6587\x6587\x6587\x65B0\x65B0\x65B0\x65B0\x4EF6\x4EF6.\x65B0"),				//25 MAJOR >16 ,EXT <3
sl@0
   215
	_L("\x4EF6\x4EF6\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.\x65B0\x6587"),		//26 MAJOR >16 ,EXT 3>6
sl@0
   216
	_L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.\x65B0\x65B0\x65B0"),		//27 MAJOR >16 ,EXT =6
sl@0
   217
	_L("\x65B0\x65B0\x4EF6\x65B0\x65B0\x65B0\x4EF6\x65B0\x65B0.\x65B0\x65B0\x65B0\x65B0"),	//28 MAJOR >16 ,EXT >6
sl@0
   218
sl@0
   219
	// ******************************MIXED-CHARACTERS*********************************************************************
sl@0
   220
sl@0
   221
	_L("\x65B0(A).\x65B0"),							//29 MAJOR <8 ,EXT <3
sl@0
   222
	_L("\x65B0(A).A\x65B0"),						//30 MAJOR <8 ,EXT =3
sl@0
   223
	_L("\x65B0(A).A\x65B0\x6587"),					//31 MAJOR <8 ,EXT 3<6
sl@0
   224
	_L("\x65B0(A).AB\x65B0\x65B0"),					//32 MAJOR <8 ,EXT <6
sl@0
   225
	_L("\x65B0(A).AB\x65B0\x65B0\x65B0\x65B0"),		//33 MAJOR <8 ,EXT >6
sl@0
   226
							
sl@0
   227
	_L("\x65B0\x65B0(AB).\x65B0"),						//34 MAJOR =8 ,EXT <3
sl@0
   228
	_L("(AB)\x65B0\x65B0.A\x65B0"),						//35 MAJOR =8 ,EXT =3
sl@0
   229
	_L("\x65B0(AB)\x65B0.A\x65B0\x6587"),				//36 MAJOR =8 ,EXT 3<6
sl@0
   230
	_L("\x65B0(\x65B0)AB.AB\x65B0\x65B0"),				//37 MAJOR =8 ,EXT <6
sl@0
   231
	_L("\x65B0\x65B0(CD).AB\x65B0\x65B0\x65B0\x65B0"),	//38 MAJOR =8 ,EXT >6
sl@0
   232
sl@0
   233
	_L("\x65B0\x65B0\x65B0\x65B0(AB).\x65B0"),							//39 MAJOR 8<16 ,EXT <3
sl@0
   234
	_L("\x65B0\x65B0\x65B0\x65B0(AB).A\x65B0"),							//40 MAJOR 8<16 ,EXT =3
sl@0
   235
	_L("AB\x65B0\x6587\x65B0\x65B0.A\x65B0\x6587"),						//41 MAJOR 8<16 ,EXT 3<6
sl@0
   236
	_L("CD\x65B0\x6587\x65B0\x65B0.AB\x65B0\x65B0"),					//42 MAJOR 8<16 ,EXT <6
sl@0
   237
	_L("\x65B0\x6587(\x65B0\x65B0).AB\x65B0\x65B0\x65B0\x65B0"),		//43 MAJOR 8<16 ,EXT >6
sl@0
   238
sl@0
   239
	_L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0(AB).\x65B0"),						//44 MAJOR =16 ,EXT <3
sl@0
   240
	_L("(AB)\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.A\x65B0"),						//45 MAJOR =16  ,EXT =3
sl@0
   241
	_L("\x65B0\x65B0\x65B0(AB)\x65B0\x65B0\x65B0.A\x65B0\x6587"),				//46 MAJOR =16  ,EXT 3<6
sl@0
   242
	_L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0(CD).AB\x65B0\x65B0"),				//47 MAJOR =16  ,EXT <6
sl@0
   243
	_L("\x65B0\x65B0(\x65B0\x65B0)CD\x65B0\x65B0.AB\x65B0\x65B0\x65B0\x65B0"),	//48 MAJOR =16  ,EXT >6
sl@0
   244
		
sl@0
   245
	_L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0(AB).\x65B0"),						//49 MAJOR >16 ,EXT <3
sl@0
   246
	_L("(AB)\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0.A\x65B0"),						//50 MAJOR >16 ,EXT =3
sl@0
   247
	_L("\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0(CD).A\x65B0\x6587"),				//51 MAJOR >16 ,EXT 3<6
sl@0
   248
	_L("\x65B0\x65B0\x65B0(\x65B0\x65B0\x65B0)CD\x65B0\x65B0.AB\x65B0\x65B0"),				//52 MAJOR >16 ,EXT <6
sl@0
   249
	_L("CD\x65B0\x65B0(\x65B0\x65B0)\x65B0\x65B0\x65B0\x65B0.AB\x65B0\x65B0\x65B0\x65B0"),	//53 MAJOR >16 ,EXT >6
sl@0
   250
sl@0
   251
	// ****************************************************************************************************************************	
sl@0
   252
sl@0
   253
	_L("TESTDIR\\"),			//54
sl@0
   254
	_L("TESTDIR\\DIR1\\"),		//55	
sl@0
   255
	_L("TESTDIR\\DIR2\\"),		//56	
sl@0
   256
	_L("TESTDIR\\DIR3\\"),		//57
sl@0
   257
	_L("TESTDIR\\DIR4\\"),		//58	
sl@0
   258
sl@0
   259
	_L("TESTDIR_FS\\"),			//59	
sl@0
   260
	_L("TESTDIR_FS\\DIR3\\"),	//60		
sl@0
   261
	_L("TESTDIR_FS\\DIR1\\"),	//61		
sl@0
   262
	_L("TESTDIR_FS\\DIR2\\"),	//62		
sl@0
   263
sl@0
   264
	_L("TESTDIR_FS\\DIR3\\FILE03.TXT"),		//63
sl@0
   265
	_L("TESTDIR_FS\\DIR1\\FILE01.TXT"),		//64	
sl@0
   266
	_L("TESTDIR_FS\\DIR2\\FILE02.TXT"),		//65
sl@0
   267
	
sl@0
   268
	_L("TESTALPHA.TXT"), 		//66
sl@0
   269
	_L("TESTALPHA.TXTTXT"), 	//67
sl@0
   270
	
sl@0
   271
	_L("REPLACED.TXT"),		//68
sl@0
   272
	_L("REPLACED.TX"),		//69
sl@0
   273
	_L("REPLACED.TXTTXT"),	//70
sl@0
   274
	
sl@0
   275
	_L("XYZ\\"),			//71
sl@0
   276
	_L("TESTRENAME.DAT"),	//72
sl@0
   277
	
sl@0
   278
	_L("\x65B0\x65B0\x65B0\\"), 	//73
sl@0
   279
	_L("\x65B0\x6587\x4EF6\x4EF6\x6587\x65B0.\x65B0\x4EF6"),  //74
sl@0
   280
	
sl@0
   281
	_L("AB(\x65B0\x6587)CD\\"),				//75
sl@0
   282
	_L("AB\x65B0\x6587(CDEF).\x4EF6(AB)"),	//76
sl@0
   283
	
sl@0
   284
	
sl@0
   285
	_L("\x65B0\x6587\x65B0\x4EF6.TXT"),				//77
sl@0
   286
	_L("\x65B0\x6587\x65B0\x4EF6(A).TXT"),			//78
sl@0
   287
	_L("\x65B0\x6587\x65B0\x4EF6(B).TXT"),			//79
sl@0
   288
	_L("\x65B0\x6587\x65B0\x4EF6(C).TXT"),			//80
sl@0
   289
	
sl@0
   290
	_L("\x65B0.TXT"),							//81
sl@0
   291
	_L("\x65B0\x6587.TXTTXT"),					//82
sl@0
   292
	_L("\x65B0\x6587\x4EF6.TX"),				//83	
sl@0
   293
	
sl@0
   294
	_L("ABCDE.\x65B0\x65B0"),					//84
sl@0
   295
	_L("ABCDEFG.\x65B0\x65B0\x65B0"),			//85
sl@0
   296
	_L("ABCD.\x65B0T"),							//86
sl@0
   297
	_L("ABCDE.T\x65B0"),						//87
sl@0
   298
	
sl@0
   299
	_L("\x222F\x2F3A\x3C3E\x7C00.TXT"),			//88
sl@0
   300
	_L("\x235B\x245C\x255D\x265E.TXT"),			//89
sl@0
   301
sl@0
   302
	_L("\x65B0\x6587\\"),											//90
sl@0
   303
	_L("\x65B0\x6587\\\x65B0\x6587\x65B0\\"),						//91	
sl@0
   304
	_L("\x65B0\x6587\\\x65B0\x6587\x65B0\x6587\\"),					//92	
sl@0
   305
	_L("\x65B0\x6587\\\x65B0\x6587\x65B0\x6587\x65B0\\"),			//93
sl@0
   306
	_L("\x65B0\x6587\\\x65B0\x6587\x65B0\x6587\x65B0\x6587\\"),		//94	
sl@0
   307
sl@0
   308
	_L("\x65B0\x6587\x4EF6\\"),										//95	
sl@0
   309
	_L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\\"),					//96		
sl@0
   310
	_L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\x4EF6\\"),			//97		
sl@0
   311
	_L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\x4EF6\x6587\\"),		//98		
sl@0
   312
sl@0
   313
	_L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\\\x65B0\x4EF6\x65B0\x4EF6\x65B0\x4EF6\x65B0\x4EF6.\x4EF6"),						//99
sl@0
   314
	_L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\x4EF6\\\x4EF6\x4EF6\x65B0\x65B0\x65B0\x65B0\x65B0\x6587.\x65B0\x6587"),			//100	
sl@0
   315
	_L("\x65B0\x6587\x4EF6\\\x65B0\x4EF6\x65B0\x4EF6\x6587\\\x65B0\x65B0\x65B0\x4EF6\x65B0\x4EF6\x4EF6.\x65B0\x4EF6\x65B0"),	//101
sl@0
   316
	
sl@0
   317
	_L("\x65B0(A)\x6587\\"),												//102
sl@0
   318
	_L("\x65B0(A)\x6587\\\x65B0(AB)\x65B0\\"),								//103	
sl@0
   319
	_L("\x65B0(A)\x6587\\\x65B0(ABCD)\x65B0\\"),							//104	
sl@0
   320
	_L("\x65B0(A)\x6587\\\x65B0\x65B0(ABCDEF)\x65B0\x65B0\\"),				//105
sl@0
   321
	_L("\x65B0(A)\x6587\\\x65B0\x65B0\x65B0(ABGH)\x65B0\x65B0\x65B0\\"),	//106	
sl@0
   322
sl@0
   323
	_L("\x65B0\x6587(AB)\\"),										//107	
sl@0
   324
	_L("\x65B0\x6587(AB)\\\x65B0(A)\x65B0\\"),						//108		
sl@0
   325
	_L("\x65B0\x6587(AB)\\\x65B0\x4EF6(AB)\x4EF6\\"),				//109		
sl@0
   326
	_L("\x65B0\x6587(AB)\\\x65B0\x4EF6(ABCDEF)\x4EF6\x6587\\"),		//110		
sl@0
   327
sl@0
   328
	_L("\x65B0\x6587(AB)\\\x65B0(A)\x65B0\\\x65B0\x4EF6\x65B0(AB)\x4EF6\x65B0\x4EF6.\x4EF6"),							//111
sl@0
   329
	_L("\x65B0\x6587(AB)\\\x65B0\x4EF6(AB)\x4EF6\\\x4EF6\x4EF6(ABC)\x65B0\x65B0\x6587.\x65B0\x6587"),					//112	
sl@0
   330
	_L("\x65B0\x6587(AB)\\\x65B0\x4EF6(ABCDEF)\x4EF6\x6587\\\x65B0\x65B0\x65B0(CD)\x4EF6\x4EF6.\x65B0\x4EF6\x65B0"),	//113
sl@0
   331
	};
sl@0
   332
sl@0
   333
#define EOB 	-1			// 'End Of Block' tag
sl@0
   334
#define CON 	(EOB - 1)	// 'Continue' tag
sl@0
   335
#define LAST 	130 		// Last item's tag
sl@0
   336
//...
sl@0
   337
sl@0
   338
// Predefined dir data blocks for testing data setup:
sl@0
   339
#define ALL			{0,CON,LAST,EOB}		// Block includes all items
sl@0
   340
sl@0
   341
#define EMPTY		{EOB}					// Empty block
sl@0
   342
sl@0
   343
#define BLOCK01		{0,CON,8,EOB}
sl@0
   344
#define BLOCK02		{9,CON,12,EOB}
sl@0
   345
#define BLOCK03		{13,CON,16,EOB}
sl@0
   346
#define BLOCK04		{17,CON,20,EOB}
sl@0
   347
#define BLOCK05		{21,CON,24,EOB}
sl@0
   348
#define BLOCK06		{25,CON,28,EOB}
sl@0
   349
#define BLOCK07		{29,CON,33,EOB}
sl@0
   350
#define BLOCK08		{34,CON,38,EOB}
sl@0
   351
#define BLOCK09		{39,CON,43,EOB}
sl@0
   352
#define BLOCK10		{44,CON,48,EOB}
sl@0
   353
#define BLOCK11		{49,CON,53,EOB}
sl@0
   354
#define BLOCK12		{54,CON,58,EOB}
sl@0
   355
#define BLOCK13		{59,CON,62,EOB}
sl@0
   356
#define BLOCK14		{63,CON,65,EOB}
sl@0
   357
#define BLOCK15		{77,CON,80,EOB}
sl@0
   358
#define BLOCK16		{81,CON,87,EOB}
sl@0
   359
#define BLOCK17		{90,CON,94,EOB}
sl@0
   360
#define BLOCK18		{95,CON,98,EOB}
sl@0
   361
#define BLOCK19		{99,CON,101,EOB}
sl@0
   362
#define BLOCK20		{102,CON,106,EOB}
sl@0
   363
#define BLOCK21		{107,CON,110,EOB}
sl@0
   364
#define BLOCK22		{111,CON,113,EOB}
sl@0
   365
sl@0
   366
sl@0
   367
sl@0
   368
sl@0
   369
///////////////////////////////////////////////////////////////////////////////
sl@0
   370
//	Data structures for building test case parameters
sl@0
   371
///////////////////////////////////////////////////////////////////////////////
sl@0
   372
enum TTestingAPI
sl@0
   373
	{ 
sl@0
   374
	EGetShortName,
sl@0
   375
	EGetShortNameWithDLL,
sl@0
   376
	EGetShortNameWithoutDLL,
sl@0
   377
	ECreateFile,
sl@0
   378
	EIsValidName,
sl@0
   379
	ERenameFile,
sl@0
   380
	EReadFileSection,
sl@0
   381
	EDeleteFile,
sl@0
   382
	EOpenDir,
sl@0
   383
	EReadDir,
sl@0
   384
	ERemoveDir,
sl@0
   385
	EIsFileInRom,
sl@0
   386
	EReplaceFile,
sl@0
   387
	EOperateOnFileNames,
sl@0
   388
	EFileModify,
sl@0
   389
	EFileAttributes,
sl@0
   390
	ERFsEntry,
sl@0
   391
	ERFsReplace,
sl@0
   392
	ERFsRename,
sl@0
   393
	EGetDir,
sl@0
   394
	EWriteToFile,
sl@0
   395
	EReadFromFile,
sl@0
   396
	EMkDir,
sl@0
   397
	EMkDirAll,
sl@0
   398
	EFileTemp,
sl@0
   399
	ELongShortConversion,
sl@0
   400
	};
sl@0
   401
sl@0
   402
struct TDirSetupFiles
sl@0
   403
	{
sl@0
   404
	TInt iAddingBlock[25];
sl@0
   405
	TInt iDeductBlock[25];
sl@0
   406
	};
sl@0
   407
// Basic Testing Parameters
sl@0
   408
struct TTestParamBasic
sl@0
   409
	{
sl@0
   410
	TUint 			iTestCaseID;
sl@0
   411
	TTestingAPI		iAPI;
sl@0
   412
	TUint 			iSwitch;
sl@0
   413
	TInt			iSyncReturn;
sl@0
   414
	TInt			iAsyncReturn;
sl@0
   415
	TInt			iAsyncStatus;
sl@0
   416
	};
sl@0
   417
	
sl@0
   418
sl@0
   419
// Basic Presettings Parameters
sl@0
   420
struct TTestParamBasicPrs
sl@0
   421
	{
sl@0
   422
	TChar* 			iDrvChar;
sl@0
   423
	TText16*		iCmdPath;		
sl@0
   424
	TText16*		iPrsPath;
sl@0
   425
	TDirSetupFiles 	iPrsFiles;
sl@0
   426
	TText16*		iCmpPath;
sl@0
   427
	TDirSetupFiles 	iCmpFiles;
sl@0
   428
	
sl@0
   429
	};
sl@0
   430
sl@0
   431
// Presettings with file open mode
sl@0
   432
struct TTestParamPrsFileOpen
sl@0
   433
	{
sl@0
   434
	TTestParamBasicPrs 	iBasicPrs;
sl@0
   435
	TBool				iFileOpen;
sl@0
   436
	};
sl@0
   437
sl@0
   438
// Presettings with file attribs and modified time
sl@0
   439
struct TTestParamPrsAttribsTime
sl@0
   440
	{
sl@0
   441
	TTestParamBasicPrs 	iBasicPrs;
sl@0
   442
	TUint				iAttribsSet;
sl@0
   443
	TTime				iTime;
sl@0
   444
	};
sl@0
   445
sl@0
   446
sl@0
   447
///////////////////////////////////////////////////////////
sl@0
   448
//	Test case data structures
sl@0
   449
///////////////////////////////////////////////////////////
sl@0
   450
struct TTestCaseUnitaryBasic
sl@0
   451
	{
sl@0
   452
	TTestParamBasic 	iBasic;
sl@0
   453
	TTestParamBasicPrs 	iSrcPrsBasic;
sl@0
   454
	};
sl@0
   455
sl@0
   456
struct TTestCaseBinaryBasic
sl@0
   457
	{
sl@0
   458
	TTestParamBasic 	iBasic;
sl@0
   459
	TTestParamBasicPrs 	iSrcPrsBasic;
sl@0
   460
	TTestParamBasicPrs 	iTrgPrsBasic;
sl@0
   461
	};	
sl@0
   462
sl@0
   463
struct TTestCaseUnitaryAttribTime
sl@0
   464
	{
sl@0
   465
	TTestParamBasic 			iBasic;
sl@0
   466
	TUint						iSetAttribs;
sl@0
   467
	TUint						iClearAttribs;
sl@0
   468
	TTestParamPrsAttribsTime	iSrcPrsAT;
sl@0
   469
	};
sl@0
   470
sl@0
   471
struct TTestCaseBinaryAttribTime
sl@0
   472
	{
sl@0
   473
	TTestParamBasic 			iBasic;
sl@0
   474
	TTestParamPrsAttribsTime	iSrcPrsAT;
sl@0
   475
	TTestParamPrsAttribsTime	iTrgPrsAT;
sl@0
   476
	};
sl@0
   477
sl@0
   478
////////////////////////////////////////////////////////////
sl@0
   479
//	An interface between test framework and test cases
sl@0
   480
////////////////////////////////////////////////////////////
sl@0
   481
class TTestParamAll
sl@0
   482
	{
sl@0
   483
public:
sl@0
   484
	TUint 			iTestCaseID;
sl@0
   485
	TTestingAPI		iAPI;
sl@0
   486
	TFileName		iAPIName;
sl@0
   487
	TUint 			iSwitch;
sl@0
   488
	TInt			iSyncReturn;
sl@0
   489
	TInt			iAsyncReturn;
sl@0
   490
	TInt			iAsyncStatus;
sl@0
   491
sl@0
   492
	TBool			iIsWithDLL;
sl@0
   493
	
sl@0
   494
	TUint			iSetAttribs;
sl@0
   495
	TUint			iClearAttribs;
sl@0
   496
	TTime			iSetModified;
sl@0
   497
sl@0
   498
	TChar* 			iSrcDrvChar;
sl@0
   499
sl@0
   500
	TFileName		iSrcCmdPath;
sl@0
   501
	TFileName		iSrcPrsPath;
sl@0
   502
	TFileName		iTrgCmdPath;
sl@0
   503
sl@0
   504
	TDirSetupFiles 	iSrcPrsFiles;
sl@0
   505
	TUint			iSrcPrsAttribs;
sl@0
   506
	TTime			iSrcPrsTime;
sl@0
   507
	TBool			iSrcPrsFileOpen;
sl@0
   508
sl@0
   509
sl@0
   510
	TChar* 			iTrgDrvChar;
sl@0
   511
sl@0
   512
	};
sl@0
   513
sl@0
   514
class TTestSwitches
sl@0
   515
	{
sl@0
   516
public:
sl@0
   517
	
sl@0
   518
	TBool 		iExeOnSymbian;
sl@0
   519
	TBool		iVerOnSymbian;
sl@0
   520
	TBool		iExeOnWindows;
sl@0
   521
	TBool		iVerOnWindows;
sl@0
   522
	TChar		iExeDriveChar;
sl@0
   523
	TChar		iVerDriveChar;
sl@0
   524
	TInt		iExeDriveNum;
sl@0
   525
	TInt		iVerDriveNum;
sl@0
   526
	TBuf<20>	iMountedFSName;
sl@0
   527
	};
sl@0
   528
sl@0
   529
class TTestLogFailureData
sl@0
   530
	{
sl@0
   531
public:
sl@0
   532
sl@0
   533
	TFileName		iTCTypeName; // unitary/binary/Special
sl@0
   534
	TFileName		iTCFailureOn; // test phase data execution/data verification
sl@0
   535
	TUint 			iTCId;
sl@0
   536
	TFileName 		iTCUniquePath; // complete path with DLL/without DLL with Synch/Asynch etc
sl@0
   537
	TBuf<20>		iFSName;
sl@0
   538
	TFileName		iExeOsName; // OS name
sl@0
   539
	TFileName		iVerOsName; // OS name
sl@0
   540
	TChar			iExeDrive;
sl@0
   541
	TChar			iVerDrive;
sl@0
   542
	TFileName		iAPIName;
sl@0
   543
	TInt			iLineNum;
sl@0
   544
	TFileName		iFuncName;
sl@0
   545
	TBuf8<50>		iFileName;
sl@0
   546
	};
sl@0
   547
sl@0
   548
sl@0
   549
void LogTestFailureData(TTCType tcType, TFileName failedOn, TUint tcId, TFileName tcUniquePath,TInt line);
sl@0
   550
void ClearTCLogData();
sl@0
   551
void InitLogData();
sl@0
   552
void CheckDisk();
sl@0
   553
void GetBootInfo();
sl@0
   554
void ReadBootSector(TFatBootSector& aBootSector);
sl@0
   555
void QuickFormat();
sl@0
   556
TInt SearchTestCaseByArrayIdx(TUint aIdx, const TTestCaseUnitaryBasic aBasicBinaryTestCaseGroup[], TTestParamAll& aTestCaseFound, TBool aIsWithDLL);
sl@0
   557
TInt SearchTestCaseByArrayIdx(TUint aIdx, const TTestCaseBinaryBasic aBasicBinaryTestCaseGroup[], TTestParamAll& aTestCaseFound, TBool aIsWithDLL);
sl@0
   558
void Help();
sl@0
   559
void ClearSwitches(TTestSwitches& aSwitches);
sl@0
   560
void ParseCommandArguments(TTestSwitches& aSwitches);
sl@0
   561
void InitialiseL();
sl@0
   562
void RmDir(const TDesC& aDirName);
sl@0
   563
void Cleanup();
sl@0
   564
void ParsingDirDataBlock(const TInt aDataBlock[], RArray<TInt>& aDirDataArray);
sl@0
   565
void CheckIfIOTesting(TTestSwitches& aSwitches);
sl@0
   566
/*template <class C>
sl@0
   567
TInt controlIo(RFs &fs, TInt drv, TInt fkn, C &c);*/
sl@0
   568
void MakeFile(const TDesC& aFileName,const TUidType& aUidType,const TDesC8& aFileContents);
sl@0
   569
void MakeFile(const TDesC& aFileName,const TDesC8& aFileContents);
sl@0
   570
void MakeFile(const TDesC& aFileName,TInt anAttributes);
sl@0
   571
void MakeFile(const TDesC& aFileName);
sl@0
   572
TInt CurrentDrive(TChar aDriveChar);
sl@0
   573
TInt CurrentDrive();
sl@0
   574
void CreateTestDirectory(const TDesC& aSessionPath);
sl@0
   575
void ReportCheckDiskFailure(TInt aRet);
sl@0
   576
void MakeDir(const TDesC& aDirName);
sl@0
   577
void Format(TInt aDrive);
sl@0
   578
sl@0
   579
//Function declarations
sl@0
   580
void RmDir(const TDesC& aDirName);
sl@0
   581
TBool CompareL(const TDesC& aDir1,const TDesC& aDir2);
sl@0
   582
void SetupDirectories(TBool aCreateFiles, TFileName* aDestOtherDrive);
sl@0
   583
void InitialiseL();
sl@0
   584
void Cleanup();
sl@0
   585
void CleanupFileHandles();
sl@0
   586
void ParsingDirDataBlock(TInt aDataBlock[], RArray<TInt>& aFinalDirDataArray);
sl@0
   587
void SetupDir(TDesC& aPath, TDirSetupFiles aDirSetupData);
sl@0
   588
void SetupDirFiles(const TDesC& aPath, const TDirSetupFiles& aDirFiles);
sl@0
   589
void PrintDir(const TDesC& aPath, const TChar& aDrv);
sl@0
   590
void DoSymbianSpecificCases();
sl@0
   591
inline TBool isFAT(const TDesC& aFSName)
sl@0
   592
	{
sl@0
   593
	return (aFSName.Compare(KFAT) == 0);
sl@0
   594
	}
sl@0
   595
inline TBool isWin32(const TDesC& aFSName)
sl@0
   596
	{
sl@0
   597
	return (aFSName.Compare(KWin32) == 0);
sl@0
   598
	}
sl@0
   599
sl@0
   600
//functions that are required by both the .cpp files.
sl@0
   601
GLREF_C void TestLeadingE5Handling();
sl@0
   602
GLREF_C void TestFileLengthMax();
sl@0
   603
GLREF_C void TestFileLengthExceedMax();
sl@0
   604
GLREF_C void TestIllegalCharsWithoutDLL();
sl@0
   605
GLREF_C void TestIllegalCharsWithDll();
sl@0
   606
GLREF_C void TestVFATCase1();
sl@0
   607
GLREF_C void TestVFATCase2();
sl@0
   608
GLREF_C void TestVFATCase3();
sl@0
   609
sl@0
   610
GLREF_C void GetBootInfo();
sl@0
   611
GLREF_C void QuickFormat();
sl@0
   612
GLREF_C void ReadBootSector(TFatBootSector& aBootSector);
sl@0
   613
sl@0
   614
sl@0
   615
sl@0
   616
#endif /*T_FATCHARSETCONV_AUX_H*/