|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // f32test\bench\t_benchmain.h |
|
15 // |
|
16 // |
|
17 |
|
18 |
|
19 #include "t_select.h" |
|
20 #include <f32file.h> |
|
21 #include "f32_test_utils.h" |
|
22 |
|
23 using namespace F32_Test_Utils; |
|
24 |
|
25 #if !defined(__T_BENCHSTD_H__) |
|
26 #define __T_BENCHSTD_H__ |
|
27 |
|
28 #define FailIfError(r) \ |
|
29 { \ |
|
30 if (r != KErrNone) \ |
|
31 { \ |
|
32 test.Printf(_L("Return code == %d\n"), r); \ |
|
33 test(EFalse); \ |
|
34 } \ |
|
35 } |
|
36 |
|
37 enum TSelectedTest |
|
38 { |
|
39 ELocalDriveTest, EFindEntryTest, EFileSeekTest |
|
40 }; |
|
41 |
|
42 |
|
43 void CallTestsL(); |
|
44 void CreateTestDirectory(const TDesC& aTestPath); |
|
45 void DeleteTestDirectory(); |
|
46 void SetSessionPath(const TDesC& aPathName); |
|
47 void ReportCheckDiskFailure(TInt aRet); |
|
48 void CheckDisk(); |
|
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); |
|
57 |
|
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); |
|
62 |
|
63 |
|
64 GLREF_D RTest test; |
|
65 GLREF_D RFs TheFs; |
|
66 GLREF_D TFileName gSessionPath; |
|
67 GLREF_D TFileName gExeFileName; |
|
68 GLREF_D TInt gAllocFailOff; |
|
69 GLREF_D TInt gAllocFailOn; |
|
70 GLREF_D TInt64 gSeed; |
|
71 GLREF_D TChar gDriveToTest; |
|
72 GLREF_D TInt gFilesLimit; |
|
73 GLREF_D TInt gTypes; |
|
74 GLREF_D TInt gMode; |
|
75 GLREF_D TInt gFormat; |
|
76 GLREF_D TInt gMinutes; |
|
77 GLREF_D TInt gFileSize; |
|
78 |
|
79 GLREF_D TInt gTestHarness; |
|
80 GLREF_D TInt gTestCase; |
|
81 GLREF_D TInt gTimeUnit; |
|
82 |
|
83 const TInt KMaxFiles = 10000 ; |
|
84 const TInt KMaxTypes = 3 ; |
|
85 const TInt KOneK = 1024; |
|
86 |
|
87 |
|
88 _LIT(KDirMultipleName, "dir%d_%d\\"); |
|
89 _LIT(KCommonFile,"LAST.TXT"); |
|
90 |
|
91 #if defined(_DEBUG) |
|
92 #define SetAllocFailure(a) SetAllocFailure(a) |
|
93 #else |
|
94 #define SetAllocFailure(a) IsRomAddress(NULL) |
|
95 #endif |
|
96 |
|
97 #endif |