cryptomgmtlibs/securitytestfw/test/testhandler_on_testexecute/step.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 12 Oct 2009 10:17:04 +0300
changeset 15 da2ae96f639b
parent 8 35751d3474b7
permissions -rw-r--r--
Revision: 200941 Kit: 200941

/*
* Copyright (c) 2003-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: 
*
*/


/**
 @file
*/
#include "step.h"
#include "testexecuteinterface.h"
#include "t_testsetup.h"

using namespace TestExecuteInterface;

_LIT(KScriptName, "scriptname");
_LIT(KLogName, "logname");

CStep::CStep(TScriptTests* aTestTypes)
    : iTestTypes(aTestTypes)
	{
	iConsole = new(ELeave) CStepConsole(this);
	}

CStep::~CStep()
    {
    delete iConsole;
    }

TVerdict CStep::doTestStepPreambleL()
	{
	return TestStepResult();
	}

TVerdict CStep::doTestStepPostambleL()
	{
	return TestStepResult();
	}

TVerdict CStep::doTestStepL()
	{
	__UHEAP_MARK;
	TPtrC script, log;
	GetStringFromConfig(ConfigSection(), KScriptName, script);
	GetStringFromConfig(ConfigSection(), KLogName, log);

	TBool result = EFalse;
	CTestSetup::CreateAndRunTestsL(iTestTypes, script, log, EFalse, iConsole, &result);
	SetTestStepResult(result ? EPass : EFail);

	__UHEAP_MARKEND;
	return TestStepResult();
	}

void CStep::Read(TRequestStatus& aStatus)
	{
	TRequestStatus* stat = &aStatus;
	User::RequestComplete(stat, KErrNone);
	}

void CStep::Write(const TDesC& aDes)
	{
	Logger().Write(aDes);
	}

void CStepConsole::Read(TRequestStatus& aStatus)
	{
	iStep->Read(aStatus);
	}

void CStepConsole::Write(const TDesC& aDes)
	{
	iStep->Write(aDes);
	}