os/kernelhwsrv/kerneltest/f32test/bench/t_benchmain.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2006-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
// f32test\bench\t_benchmain.h
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
sl@0
    19
#include "t_select.h"
sl@0
    20
#include <f32file.h>
sl@0
    21
#include "f32_test_utils.h" 
sl@0
    22
sl@0
    23
using namespace F32_Test_Utils;
sl@0
    24
sl@0
    25
#if !defined(__T_BENCHSTD_H__)
sl@0
    26
#define __T_BENCHSTD_H__
sl@0
    27
sl@0
    28
#define FailIfError(r) \
sl@0
    29
	{ \
sl@0
    30
	if (r != KErrNone) \
sl@0
    31
		{ \
sl@0
    32
		test.Printf(_L("Return code == %d\n"), r); \
sl@0
    33
		test(EFalse); \
sl@0
    34
		} \
sl@0
    35
	}
sl@0
    36
sl@0
    37
enum TSelectedTest
sl@0
    38
    {
sl@0
    39
	ELocalDriveTest, EFindEntryTest, EFileSeekTest
sl@0
    40
	};
sl@0
    41
sl@0
    42
	
sl@0
    43
void CallTestsL();
sl@0
    44
void CreateTestDirectory(const TDesC& aTestPath);
sl@0
    45
void DeleteTestDirectory();
sl@0
    46
void SetSessionPath(const TDesC& aPathName);
sl@0
    47
void ReportCheckDiskFailure(TInt aRet);
sl@0
    48
void CheckDisk();
sl@0
    49
void CheckEntry(const TDesC& aName,TUint anAttributes,const TTime& aModified);
sl@0
    50
void PrintResultTime( TInt aPosX, TInt aPosY, TInt aValue) ;
sl@0
    51
void PrintResult( TInt aPosX, TInt aPosY, TInt aValue);
sl@0
    52
void PrintHeaders(TInt aType, TPtrC16 aTitle ); 
sl@0
    53
void PrintResultS( TInt aPosX, TInt aPosY, TDes16& aValue); 
sl@0
    54
void InitializeDrive(CSelectionBox* aSelector);
sl@0
    55
TInt ValidateDriveSelection(TDriveUnit aDrive,TSelectedTest aTest);
sl@0
    56
void FormatFat(TDriveUnit aDrive);
sl@0
    57
sl@0
    58
void FileNamesGeneration(TDes16& aBuffer, TInt aLong, TInt aPos,TInt ext);
sl@0
    59
TInt Validate(TAny* aSelector);
sl@0
    60
TInt CreateDirWithNFiles(TInt aN, TInt aType);
sl@0
    61
TInt TestFileCreate(TAny* aSelector);
sl@0
    62
sl@0
    63
sl@0
    64
GLREF_D RTest test;
sl@0
    65
GLREF_D RFs TheFs;
sl@0
    66
GLREF_D TFileName gSessionPath;
sl@0
    67
GLREF_D TFileName gExeFileName;
sl@0
    68
GLREF_D TInt gAllocFailOff;
sl@0
    69
GLREF_D TInt gAllocFailOn;
sl@0
    70
GLREF_D TInt64 gSeed;
sl@0
    71
GLREF_D TChar gDriveToTest;
sl@0
    72
GLREF_D TInt gFilesLimit; 	
sl@0
    73
GLREF_D TInt gTypes;  		
sl@0
    74
GLREF_D TInt gMode; 	
sl@0
    75
GLREF_D TInt gFormat; 
sl@0
    76
GLREF_D TInt gMinutes; 	
sl@0
    77
GLREF_D TInt gFileSize; 
sl@0
    78
sl@0
    79
GLREF_D TInt gTestHarness;
sl@0
    80
GLREF_D TInt gTestCase;	
sl@0
    81
GLREF_D TInt gTimeUnit;
sl@0
    82
sl@0
    83
const TInt KMaxFiles  = 10000 ; 
sl@0
    84
const TInt KMaxTypes  = 3 ; 
sl@0
    85
const TInt KOneK = 1024;
sl@0
    86
sl@0
    87
sl@0
    88
_LIT(KDirMultipleName, "dir%d_%d\\");
sl@0
    89
_LIT(KCommonFile,"LAST.TXT");
sl@0
    90
sl@0
    91
#if defined(_DEBUG)
sl@0
    92
#define SetAllocFailure(a) SetAllocFailure(a)
sl@0
    93
#else
sl@0
    94
#define SetAllocFailure(a) IsRomAddress(NULL)
sl@0
    95
#endif
sl@0
    96
sl@0
    97
#endif