os/security/cryptomgmtlibs/securitytestfw/test/testhandler_on_testexecute/step.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptomgmtlibs/securitytestfw/test/testhandler_on_testexecute/step.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,87 @@
     1.4 +/*
     1.5 +* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +/**
    1.23 + @file
    1.24 +*/
    1.25 +#include "step.h"
    1.26 +#include "testexecuteinterface.h"
    1.27 +#include "t_testsetup.h"
    1.28 +
    1.29 +using namespace TestExecuteInterface;
    1.30 +
    1.31 +_LIT(KScriptName, "scriptname");
    1.32 +_LIT(KLogName, "logname");
    1.33 +
    1.34 +CStep::CStep(TScriptTests* aTestTypes)
    1.35 +    : iTestTypes(aTestTypes)
    1.36 +	{
    1.37 +	iConsole = new(ELeave) CStepConsole(this);
    1.38 +	}
    1.39 +
    1.40 +CStep::~CStep()
    1.41 +    {
    1.42 +    delete iConsole;
    1.43 +    }
    1.44 +
    1.45 +TVerdict CStep::doTestStepPreambleL()
    1.46 +	{
    1.47 +	return TestStepResult();
    1.48 +	}
    1.49 +
    1.50 +TVerdict CStep::doTestStepPostambleL()
    1.51 +	{
    1.52 +	return TestStepResult();
    1.53 +	}
    1.54 +
    1.55 +TVerdict CStep::doTestStepL()
    1.56 +	{
    1.57 +	__UHEAP_MARK;
    1.58 +	TPtrC script, log;
    1.59 +	GetStringFromConfig(ConfigSection(), KScriptName, script);
    1.60 +	GetStringFromConfig(ConfigSection(), KLogName, log);
    1.61 +
    1.62 +	TBool result = EFalse;
    1.63 +	CTestSetup::CreateAndRunTestsL(iTestTypes, script, log, EFalse, iConsole, &result);
    1.64 +	SetTestStepResult(result ? EPass : EFail);
    1.65 +
    1.66 +	__UHEAP_MARKEND;
    1.67 +	return TestStepResult();
    1.68 +	}
    1.69 +
    1.70 +void CStep::Read(TRequestStatus& aStatus)
    1.71 +	{
    1.72 +	TRequestStatus* stat = &aStatus;
    1.73 +	User::RequestComplete(stat, KErrNone);
    1.74 +	}
    1.75 +
    1.76 +void CStep::Write(const TDesC& aDes)
    1.77 +	{
    1.78 +	Logger().Write(aDes);
    1.79 +	}
    1.80 +
    1.81 +void CStepConsole::Read(TRequestStatus& aStatus)
    1.82 +	{
    1.83 +	iStep->Read(aStatus);
    1.84 +	}
    1.85 +
    1.86 +void CStepConsole::Write(const TDesC& aDes)
    1.87 +	{
    1.88 +	iStep->Write(aDes);
    1.89 +	}
    1.90 +