1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/bench/t_benchmain.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,97 @@
1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// f32test\bench\t_benchmain.h
1.18 +//
1.19 +//
1.20 +
1.21 +
1.22 +#include "t_select.h"
1.23 +#include <f32file.h>
1.24 +#include "f32_test_utils.h"
1.25 +
1.26 +using namespace F32_Test_Utils;
1.27 +
1.28 +#if !defined(__T_BENCHSTD_H__)
1.29 +#define __T_BENCHSTD_H__
1.30 +
1.31 +#define FailIfError(r) \
1.32 + { \
1.33 + if (r != KErrNone) \
1.34 + { \
1.35 + test.Printf(_L("Return code == %d\n"), r); \
1.36 + test(EFalse); \
1.37 + } \
1.38 + }
1.39 +
1.40 +enum TSelectedTest
1.41 + {
1.42 + ELocalDriveTest, EFindEntryTest, EFileSeekTest
1.43 + };
1.44 +
1.45 +
1.46 +void CallTestsL();
1.47 +void CreateTestDirectory(const TDesC& aTestPath);
1.48 +void DeleteTestDirectory();
1.49 +void SetSessionPath(const TDesC& aPathName);
1.50 +void ReportCheckDiskFailure(TInt aRet);
1.51 +void CheckDisk();
1.52 +void CheckEntry(const TDesC& aName,TUint anAttributes,const TTime& aModified);
1.53 +void PrintResultTime( TInt aPosX, TInt aPosY, TInt aValue) ;
1.54 +void PrintResult( TInt aPosX, TInt aPosY, TInt aValue);
1.55 +void PrintHeaders(TInt aType, TPtrC16 aTitle );
1.56 +void PrintResultS( TInt aPosX, TInt aPosY, TDes16& aValue);
1.57 +void InitializeDrive(CSelectionBox* aSelector);
1.58 +TInt ValidateDriveSelection(TDriveUnit aDrive,TSelectedTest aTest);
1.59 +void FormatFat(TDriveUnit aDrive);
1.60 +
1.61 +void FileNamesGeneration(TDes16& aBuffer, TInt aLong, TInt aPos,TInt ext);
1.62 +TInt Validate(TAny* aSelector);
1.63 +TInt CreateDirWithNFiles(TInt aN, TInt aType);
1.64 +TInt TestFileCreate(TAny* aSelector);
1.65 +
1.66 +
1.67 +GLREF_D RTest test;
1.68 +GLREF_D RFs TheFs;
1.69 +GLREF_D TFileName gSessionPath;
1.70 +GLREF_D TFileName gExeFileName;
1.71 +GLREF_D TInt gAllocFailOff;
1.72 +GLREF_D TInt gAllocFailOn;
1.73 +GLREF_D TInt64 gSeed;
1.74 +GLREF_D TChar gDriveToTest;
1.75 +GLREF_D TInt gFilesLimit;
1.76 +GLREF_D TInt gTypes;
1.77 +GLREF_D TInt gMode;
1.78 +GLREF_D TInt gFormat;
1.79 +GLREF_D TInt gMinutes;
1.80 +GLREF_D TInt gFileSize;
1.81 +
1.82 +GLREF_D TInt gTestHarness;
1.83 +GLREF_D TInt gTestCase;
1.84 +GLREF_D TInt gTimeUnit;
1.85 +
1.86 +const TInt KMaxFiles = 10000 ;
1.87 +const TInt KMaxTypes = 3 ;
1.88 +const TInt KOneK = 1024;
1.89 +
1.90 +
1.91 +_LIT(KDirMultipleName, "dir%d_%d\\");
1.92 +_LIT(KCommonFile,"LAST.TXT");
1.93 +
1.94 +#if defined(_DEBUG)
1.95 +#define SetAllocFailure(a) SetAllocFailure(a)
1.96 +#else
1.97 +#define SetAllocFailure(a) IsRomAddress(NULL)
1.98 +#endif
1.99 +
1.100 +#endif