First public contribution.
1 // Copyright (c) 2006-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\bench\t_benchmain.h
21 #include "f32_test_utils.h"
23 using namespace F32_Test_Utils;
25 #if !defined(__T_BENCHSTD_H__)
26 #define __T_BENCHSTD_H__
28 #define FailIfError(r) \
32 test.Printf(_L("Return code == %d\n"), r); \
39 ELocalDriveTest, EFindEntryTest, EFileSeekTest
44 void CreateTestDirectory(const TDesC& aTestPath);
45 void DeleteTestDirectory();
46 void SetSessionPath(const TDesC& aPathName);
47 void ReportCheckDiskFailure(TInt aRet);
49 void CheckEntry(const TDesC& aName,TUint anAttributes,const TTime& aModified);
50 void PrintResultTime( TInt aPosX, TInt aPosY, TInt aValue) ;
51 void PrintResult( TInt aPosX, TInt aPosY, TInt aValue);
52 void PrintHeaders(TInt aType, TPtrC16 aTitle );
53 void PrintResultS( TInt aPosX, TInt aPosY, TDes16& aValue);
54 void InitializeDrive(CSelectionBox* aSelector);
55 TInt ValidateDriveSelection(TDriveUnit aDrive,TSelectedTest aTest);
56 void FormatFat(TDriveUnit aDrive);
58 void FileNamesGeneration(TDes16& aBuffer, TInt aLong, TInt aPos,TInt ext);
59 TInt Validate(TAny* aSelector);
60 TInt CreateDirWithNFiles(TInt aN, TInt aType);
61 TInt TestFileCreate(TAny* aSelector);
66 GLREF_D TFileName gSessionPath;
67 GLREF_D TFileName gExeFileName;
68 GLREF_D TInt gAllocFailOff;
69 GLREF_D TInt gAllocFailOn;
71 GLREF_D TChar gDriveToTest;
72 GLREF_D TInt gFilesLimit;
76 GLREF_D TInt gMinutes;
77 GLREF_D TInt gFileSize;
79 GLREF_D TInt gTestHarness;
80 GLREF_D TInt gTestCase;
81 GLREF_D TInt gTimeUnit;
83 const TInt KMaxFiles = 10000 ;
84 const TInt KMaxTypes = 3 ;
85 const TInt KOneK = 1024;
88 _LIT(KDirMultipleName, "dir%d_%d\\");
89 _LIT(KCommonFile,"LAST.TXT");
92 #define SetAllocFailure(a) SetAllocFailure(a)
94 #define SetAllocFailure(a) IsRomAddress(NULL)