|
1 // Copyright (c) 1996-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 // |
|
15 |
|
16 //! @file f32test\concur\t_cfssoak.h |
|
17 |
|
18 #ifndef __T_CFSSOAK_H__ |
|
19 #define __T_CFSSOAK_H__ |
|
20 |
|
21 #include <f32file.h> |
|
22 #include <e32test.h> |
|
23 #include "t_server.h" |
|
24 #include "t_tdebug.h" |
|
25 |
|
26 class TSoakStats |
|
27 /// Collect and print statistics. |
|
28 { |
|
29 public: |
|
30 TSoakStats() : iTotal(0), iFail(0), iThis(0), iThisF(0) {} |
|
31 static void Print(); |
|
32 void Print(const TDesC& aTitle); |
|
33 void Inc(); |
|
34 void Fail(); |
|
35 |
|
36 public: |
|
37 TInt iTotal; |
|
38 TInt iFail; |
|
39 TInt iThis; |
|
40 TInt iThisF; |
|
41 }; |
|
42 |
|
43 class TSoakReadOnly |
|
44 /// Tests for reading and scanning drives and directories. |
|
45 { |
|
46 public: |
|
47 TSoakReadOnly(); |
|
48 TSoakReadOnly(TInt aDrive); |
|
49 ~TSoakReadOnly(); |
|
50 TInt ReadFile(const TDesC& aName, TInt aSize); |
|
51 TInt ScanDirs(TInt aDrive, TInt aReadInterval); |
|
52 TInt ScanDirFunc(CDirScan* aScanner, TInt aDrive, TInt aReadInterval); |
|
53 TInt ScanDrives(TBool aScanDirs, TInt aReadInterval); |
|
54 void ExcludeDrive(TInt aDrive); |
|
55 |
|
56 public: |
|
57 TSoakStats iDrives; ///< Statistics of number of drives scanned. |
|
58 TSoakStats iDirs; ///< Statistics of number of directories scanned. |
|
59 TSoakStats iFiles; ///< Statistics of number of files found. |
|
60 TSoakStats iReads; ///< statistics of number of files read. |
|
61 |
|
62 private: |
|
63 TInt64 iSeed; |
|
64 TInt iDrive; |
|
65 RFs iFs; |
|
66 }; |
|
67 |
|
68 class TSoakFill |
|
69 /// Tests filling and cleaning a drive. |
|
70 { |
|
71 public: |
|
72 TSoakFill(); |
|
73 TInt SetDrive(TInt aDrive); |
|
74 TInt FillDrive(); |
|
75 TInt CleanDrive(); |
|
76 TInt Fill(TFileName& aName, TInt aNfiles=0); |
|
77 |
|
78 private: |
|
79 TInt64 iSeed; |
|
80 TInt64 iFree; |
|
81 TInt iDrive; |
|
82 TInt iDrvCh; |
|
83 RFs iFs; |
|
84 TFileName iName; |
|
85 TVolumeInfo iInfo; |
|
86 }; |
|
87 |
|
88 const TInt KSoakNumBuf = 10; ///< Number of buffers to be written. |
|
89 const TInt KSoakBufLen = 0x100; ///< Length of each buffer. |
|
90 |
|
91 class TSoakRemote |
|
92 /// Tests on a 'remote' (special delaying) filesystem. |
|
93 { |
|
94 public: |
|
95 TSoakRemote(TInt aDrive); |
|
96 void Remount(TBool aSync); |
|
97 TInt TestSession(); |
|
98 TInt TestSubSession(); |
|
99 TInt TestMount(); |
|
100 |
|
101 private: |
|
102 void Setup(); |
|
103 |
|
104 private: |
|
105 TInt iDrive; |
|
106 TInt iDrvCh; |
|
107 TBool iSync; |
|
108 RFs iFs; |
|
109 RFile iFile; |
|
110 RTimer iTimer; |
|
111 TFileName iName; |
|
112 TBuf8<KSoakBufLen> iBuff[KSoakNumBuf]; |
|
113 TRequestStatus iStat[KSoakNumBuf]; |
|
114 }; |
|
115 |
|
116 struct TExtension |
|
117 { |
|
118 TFullName iName; |
|
119 TBool iExists; |
|
120 }; |
|
121 |
|
122 |
|
123 #endif |