os/kernelhwsrv/kerneltest/f32test/bench/t_fsrcreatefiles.cpp
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) 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_fsrcreatefiles.cpp
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
sl@0
    19
#include <f32file.h>
sl@0
    20
#include <e32test.h>
sl@0
    21
#include "t_benchmain.h"
sl@0
    22
sl@0
    23
GLDEF_D RTest test(_L("File Server Benchmarks, create files"));
sl@0
    24
LOCAL_D TDriveList gDriveList;
sl@0
    25
sl@0
    26
/** Creates files
sl@0
    27
sl@0
    28
	@param aSelector Configuration in case of manual execution
sl@0
    29
*/
sl@0
    30
LOCAL_C TInt TestAll(TAny* aSelector)
sl@0
    31
	{
sl@0
    32
	TInt r = 0;
sl@0
    33
	TTime startTime;
sl@0
    34
	TTime endTime;
sl@0
    35
	TTimeIntervalSeconds timeTaken;
sl@0
    36
sl@0
    37
	Validate(aSelector);
sl@0
    38
	
sl@0
    39
	gFormat = EFalse; 	// The card won't be formatted after this test execution
sl@0
    40
	
sl@0
    41
	startTime.HomeTime();
sl@0
    42
	
sl@0
    43
	TestFileCreate(aSelector);
sl@0
    44
	
sl@0
    45
	endTime.HomeTime();
sl@0
    46
	r = endTime.SecondsFrom(startTime, timeTaken);
sl@0
    47
	FailIfError(r);
sl@0
    48
	test.Printf(_L("#~TS_Timing_%d,%d=%d\n"), gTestHarness, gTestCase, timeTaken.Int());
sl@0
    49
sl@0
    50
	return KErrNone;
sl@0
    51
	}
sl@0
    52
sl@0
    53
/** Call all tests
sl@0
    54
sl@0
    55
*/
sl@0
    56
GLDEF_C void CallTestsL()
sl@0
    57
	{
sl@0
    58
sl@0
    59
	CSelectionBox* TheSelector = CSelectionBox::NewL(test.Console());
sl@0
    60
	// Each test case of the suite has an identifyer for parsing purposes of the results
sl@0
    61
	gTestHarness = 0; 	
sl@0
    62
sl@0
    63
	
sl@0
    64
	if(gMode == 0) 
sl@0
    65
		{ // Manual
sl@0
    66
		gSessionPath=_L("?:\\");
sl@0
    67
		TCallBack createFiles(TestFileCreate,TheSelector);
sl@0
    68
		TheSelector->AddDriveSelectorL(TheFs);
sl@0
    69
		TheSelector->AddLineL(_L("Create all files"),createFiles);
sl@0
    70
		TheSelector->Run();
sl@0
    71
		}
sl@0
    72
	else 
sl@0
    73
		{ // Automatic
sl@0
    74
		TestAll(TheSelector);
sl@0
    75
		}
sl@0
    76
		
sl@0
    77
	delete TheSelector;
sl@0
    78
	}