1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/concur/t_cfssoak.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,123 @@
1.4 +// Copyright (c) 1996-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 +//
1.18 +
1.19 +//! @file f32test\concur\t_cfssoak.h
1.20 +
1.21 +#ifndef __T_CFSSOAK_H__
1.22 +#define __T_CFSSOAK_H__
1.23 +
1.24 +#include <f32file.h>
1.25 +#include <e32test.h>
1.26 +#include "t_server.h"
1.27 +#include "t_tdebug.h"
1.28 +
1.29 +class TSoakStats
1.30 +/// Collect and print statistics.
1.31 + {
1.32 +public:
1.33 + TSoakStats() : iTotal(0), iFail(0), iThis(0), iThisF(0) {}
1.34 + static void Print();
1.35 + void Print(const TDesC& aTitle);
1.36 + void Inc();
1.37 + void Fail();
1.38 +
1.39 +public:
1.40 + TInt iTotal;
1.41 + TInt iFail;
1.42 + TInt iThis;
1.43 + TInt iThisF;
1.44 + };
1.45 +
1.46 +class TSoakReadOnly
1.47 +/// Tests for reading and scanning drives and directories.
1.48 + {
1.49 +public:
1.50 + TSoakReadOnly();
1.51 + TSoakReadOnly(TInt aDrive);
1.52 + ~TSoakReadOnly();
1.53 + TInt ReadFile(const TDesC& aName, TInt aSize);
1.54 + TInt ScanDirs(TInt aDrive, TInt aReadInterval);
1.55 + TInt ScanDirFunc(CDirScan* aScanner, TInt aDrive, TInt aReadInterval);
1.56 + TInt ScanDrives(TBool aScanDirs, TInt aReadInterval);
1.57 + void ExcludeDrive(TInt aDrive);
1.58 +
1.59 +public:
1.60 + TSoakStats iDrives; ///< Statistics of number of drives scanned.
1.61 + TSoakStats iDirs; ///< Statistics of number of directories scanned.
1.62 + TSoakStats iFiles; ///< Statistics of number of files found.
1.63 + TSoakStats iReads; ///< statistics of number of files read.
1.64 +
1.65 +private:
1.66 + TInt64 iSeed;
1.67 + TInt iDrive;
1.68 + RFs iFs;
1.69 + };
1.70 +
1.71 +class TSoakFill
1.72 +/// Tests filling and cleaning a drive.
1.73 + {
1.74 +public:
1.75 + TSoakFill();
1.76 + TInt SetDrive(TInt aDrive);
1.77 + TInt FillDrive();
1.78 + TInt CleanDrive();
1.79 + TInt Fill(TFileName& aName, TInt aNfiles=0);
1.80 +
1.81 +private:
1.82 + TInt64 iSeed;
1.83 + TInt64 iFree;
1.84 + TInt iDrive;
1.85 + TInt iDrvCh;
1.86 + RFs iFs;
1.87 + TFileName iName;
1.88 + TVolumeInfo iInfo;
1.89 + };
1.90 +
1.91 +const TInt KSoakNumBuf = 10; ///< Number of buffers to be written.
1.92 +const TInt KSoakBufLen = 0x100; ///< Length of each buffer.
1.93 +
1.94 +class TSoakRemote
1.95 +/// Tests on a 'remote' (special delaying) filesystem.
1.96 + {
1.97 +public:
1.98 + TSoakRemote(TInt aDrive);
1.99 + void Remount(TBool aSync);
1.100 + TInt TestSession();
1.101 + TInt TestSubSession();
1.102 + TInt TestMount();
1.103 +
1.104 +private:
1.105 + void Setup();
1.106 +
1.107 +private:
1.108 + TInt iDrive;
1.109 + TInt iDrvCh;
1.110 + TBool iSync;
1.111 + RFs iFs;
1.112 + RFile iFile;
1.113 + RTimer iTimer;
1.114 + TFileName iName;
1.115 + TBuf8<KSoakBufLen> iBuff[KSoakNumBuf];
1.116 + TRequestStatus iStat[KSoakNumBuf];
1.117 + };
1.118 +
1.119 +struct TExtension
1.120 + {
1.121 + TFullName iName;
1.122 + TBool iExists;
1.123 + };
1.124 +
1.125 +
1.126 +#endif