os/security/cryptomgmtlibs/securitytestfw/test/testhandler_on_testexecute/step.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.
     1 /*
     2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 /**
    20  @file
    21 */
    22 #include "step.h"
    23 #include "testexecuteinterface.h"
    24 #include "t_testsetup.h"
    25 
    26 using namespace TestExecuteInterface;
    27 
    28 _LIT(KScriptName, "scriptname");
    29 _LIT(KLogName, "logname");
    30 
    31 CStep::CStep(TScriptTests* aTestTypes)
    32     : iTestTypes(aTestTypes)
    33 	{
    34 	iConsole = new(ELeave) CStepConsole(this);
    35 	}
    36 
    37 CStep::~CStep()
    38     {
    39     delete iConsole;
    40     }
    41 
    42 TVerdict CStep::doTestStepPreambleL()
    43 	{
    44 	return TestStepResult();
    45 	}
    46 
    47 TVerdict CStep::doTestStepPostambleL()
    48 	{
    49 	return TestStepResult();
    50 	}
    51 
    52 TVerdict CStep::doTestStepL()
    53 	{
    54 	__UHEAP_MARK;
    55 	TPtrC script, log;
    56 	GetStringFromConfig(ConfigSection(), KScriptName, script);
    57 	GetStringFromConfig(ConfigSection(), KLogName, log);
    58 
    59 	TBool result = EFalse;
    60 	CTestSetup::CreateAndRunTestsL(iTestTypes, script, log, EFalse, iConsole, &result);
    61 	SetTestStepResult(result ? EPass : EFail);
    62 
    63 	__UHEAP_MARKEND;
    64 	return TestStepResult();
    65 	}
    66 
    67 void CStep::Read(TRequestStatus& aStatus)
    68 	{
    69 	TRequestStatus* stat = &aStatus;
    70 	User::RequestComplete(stat, KErrNone);
    71 	}
    72 
    73 void CStep::Write(const TDesC& aDes)
    74 	{
    75 	Logger().Write(aDes);
    76 	}
    77 
    78 void CStepConsole::Read(TRequestStatus& aStatus)
    79 	{
    80 	iStep->Read(aStatus);
    81 	}
    82 
    83 void CStepConsole::Write(const TDesC& aDes)
    84 	{
    85 	iStep->Write(aDes);
    86 	}
    87