kerneltest/f32test/bench/t_fsrcreatefiles.cpp
author John Imhofe
Mon, 19 Oct 2009 15:55:17 +0100
changeset 0 a41df078684a
permissions -rw-r--r--
Convert Kernelhwsrv package from SFL to EPL kernel\eka\compsupp is subject to the ARM EABI LICENSE userlibandfileserver\fatfilenameconversionplugins\unicodeTables is subject to the Unicode license kernel\eka\kernel\zlib is subject to the zlib license

// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// f32test\bench\t_fsrcreatefiles.cpp
// 
//


#include <f32file.h>
#include <e32test.h>
#include "t_benchmain.h"

GLDEF_D RTest test(_L("File Server Benchmarks, create files"));
LOCAL_D TDriveList gDriveList;

/** Creates files

	@param aSelector Configuration in case of manual execution
*/
LOCAL_C TInt TestAll(TAny* aSelector)
	{
	TInt r = 0;
	TTime startTime;
	TTime endTime;
	TTimeIntervalSeconds timeTaken;

	Validate(aSelector);
	
	gFormat = EFalse; 	// The card won't be formatted after this test execution
	
	startTime.HomeTime();
	
	TestFileCreate(aSelector);
	
	endTime.HomeTime();
	r = endTime.SecondsFrom(startTime, timeTaken);
	FailIfError(r);
	test.Printf(_L("#~TS_Timing_%d,%d=%d\n"), gTestHarness, gTestCase, timeTaken.Int());

	return KErrNone;
	}

/** Call all tests

*/
GLDEF_C void CallTestsL()
	{

	CSelectionBox* TheSelector = CSelectionBox::NewL(test.Console());
	// Each test case of the suite has an identifyer for parsing purposes of the results
	gTestHarness = 0; 	

	
	if(gMode == 0) 
		{ // Manual
		gSessionPath=_L("?:\\");
		TCallBack createFiles(TestFileCreate,TheSelector);
		TheSelector->AddDriveSelectorL(TheFs);
		TheSelector->AddLineL(_L("Create all files"),createFiles);
		TheSelector->Run();
		}
	else 
		{ // Automatic
		TestAll(TheSelector);
		}
		
	delete TheSelector;
	}