os/kernelhwsrv/kerneltest/f32test/concur/t_cfssoak.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
//! @file f32test\concur\t_cfssoak.h
sl@0
    17
sl@0
    18
#ifndef __T_CFSSOAK_H__
sl@0
    19
#define __T_CFSSOAK_H__
sl@0
    20
sl@0
    21
#include <f32file.h>
sl@0
    22
#include <e32test.h>
sl@0
    23
#include "t_server.h"
sl@0
    24
#include "t_tdebug.h"
sl@0
    25
sl@0
    26
class TSoakStats
sl@0
    27
/// Collect and print statistics.
sl@0
    28
	{
sl@0
    29
public:
sl@0
    30
	TSoakStats() : iTotal(0), iFail(0), iThis(0), iThisF(0) {}
sl@0
    31
	static void Print();
sl@0
    32
	void Print(const TDesC& aTitle);
sl@0
    33
	void Inc();
sl@0
    34
	void Fail();
sl@0
    35
sl@0
    36
public:
sl@0
    37
	TInt iTotal;
sl@0
    38
	TInt iFail;
sl@0
    39
	TInt iThis;
sl@0
    40
	TInt iThisF;
sl@0
    41
	};
sl@0
    42
sl@0
    43
class TSoakReadOnly
sl@0
    44
/// Tests for reading and scanning drives and directories.
sl@0
    45
	{
sl@0
    46
public:
sl@0
    47
	TSoakReadOnly();
sl@0
    48
	TSoakReadOnly(TInt aDrive);
sl@0
    49
	~TSoakReadOnly();
sl@0
    50
	TInt ReadFile(const TDesC& aName, TInt aSize);
sl@0
    51
	TInt ScanDirs(TInt aDrive, TInt aReadInterval);
sl@0
    52
	TInt ScanDirFunc(CDirScan* aScanner, TInt aDrive, TInt aReadInterval);
sl@0
    53
	TInt ScanDrives(TBool aScanDirs, TInt aReadInterval);
sl@0
    54
	void ExcludeDrive(TInt aDrive);
sl@0
    55
sl@0
    56
public:
sl@0
    57
	TSoakStats iDrives;	///< Statistics of number of drives scanned.
sl@0
    58
	TSoakStats iDirs;	///< Statistics of number of directories scanned.
sl@0
    59
	TSoakStats iFiles;	///< Statistics of number of files found.
sl@0
    60
	TSoakStats iReads;	///< statistics of number of files read.
sl@0
    61
	
sl@0
    62
private:
sl@0
    63
	TInt64 iSeed;
sl@0
    64
	TInt   iDrive;
sl@0
    65
	RFs    iFs;
sl@0
    66
	};
sl@0
    67
sl@0
    68
class TSoakFill
sl@0
    69
/// Tests filling and cleaning a drive.
sl@0
    70
	{
sl@0
    71
public:
sl@0
    72
	TSoakFill();
sl@0
    73
	TInt SetDrive(TInt aDrive);
sl@0
    74
	TInt FillDrive();
sl@0
    75
	TInt CleanDrive();
sl@0
    76
	TInt Fill(TFileName& aName, TInt aNfiles=0);
sl@0
    77
sl@0
    78
private:
sl@0
    79
	TInt64      iSeed;
sl@0
    80
	TInt64      iFree;
sl@0
    81
	TInt        iDrive;
sl@0
    82
	TInt        iDrvCh;
sl@0
    83
	RFs         iFs;
sl@0
    84
	TFileName   iName;
sl@0
    85
	TVolumeInfo iInfo;
sl@0
    86
	};
sl@0
    87
sl@0
    88
const TInt KSoakNumBuf = 10;	///< Number of buffers to be written.
sl@0
    89
const TInt KSoakBufLen = 0x100;	///< Length of each buffer.
sl@0
    90
sl@0
    91
class TSoakRemote
sl@0
    92
/// Tests on a 'remote' (special delaying) filesystem.
sl@0
    93
	{
sl@0
    94
public:
sl@0
    95
	TSoakRemote(TInt aDrive);
sl@0
    96
	void Remount(TBool aSync);
sl@0
    97
	TInt TestSession();
sl@0
    98
	TInt TestSubSession();
sl@0
    99
	TInt TestMount();
sl@0
   100
sl@0
   101
private:
sl@0
   102
	void Setup();
sl@0
   103
sl@0
   104
private:
sl@0
   105
	TInt      iDrive;
sl@0
   106
	TInt      iDrvCh;
sl@0
   107
	TBool	  iSync;
sl@0
   108
	RFs		  iFs;
sl@0
   109
	RFile     iFile;
sl@0
   110
	RTimer    iTimer;
sl@0
   111
	TFileName iName;
sl@0
   112
	TBuf8<KSoakBufLen> iBuff[KSoakNumBuf];
sl@0
   113
	TRequestStatus     iStat[KSoakNumBuf];
sl@0
   114
	};
sl@0
   115
sl@0
   116
struct TExtension
sl@0
   117
	{
sl@0
   118
	TFullName iName;
sl@0
   119
	TBool iExists;
sl@0
   120
	};
sl@0
   121
sl@0
   122
sl@0
   123
#endif