mmtestenv/mmtestfwunittest/src/tsu_mmtsth01/TSU_MmTsthStep01.cpp
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 // EPOC includes
       
    17 #include <e32base.h>
       
    18 
       
    19 // Test system includes
       
    20 #include <testframework.h>
       
    21 #include "script.h"
       
    22 #include "parseline.h"
       
    23 
       
    24 #include "TSU_MmTsthStep01.h"
       
    25 #include "TSU_MmTsthSuite01.h"
       
    26 
       
    27 // preamble
       
    28 TVerdict RTSUMmTsthStep01::OpenL()
       
    29 	{
       
    30 	// initialise iParseLine and associated objects for tests. if this fails, tests are
       
    31 	// inconclusive (will not run)
       
    32 	// initialise a CParseLine
       
    33 	iLogClient  = iSuite->LogSystem();
       
    34 	TInt64 theGuardTimer (-1);
       
    35 
       
    36 	TRAPD(err, iTestUtils  = CTestUtils::NewL(iLogClient));
       
    37 	if(err != KErrNone)
       
    38 	{
       
    39 		ERR_PRINTF2(_L("Could not initialise CTestUtils, error code %d"), err);
       
    40 		return iTestStepResult = EInconclusive;
       
    41 	}
       
    42 
       
    43 	// NB : CScript does not have a NewL()
       
    44 	TRAPD(err2, iTestScript = CScript::NewLC(iTestUtils, iLogClient, theGuardTimer, KNullDesC);
       
    45 				CleanupStack::Pop(iTestScript) );
       
    46 	if(err2 != KErrNone)
       
    47 	{
       
    48 		ERR_PRINTF2(_L("Could not initialise CScript, error code %d"), err2);
       
    49 		delete iTestUtils;
       
    50 		return iTestStepResult = EInconclusive;
       
    51 	}
       
    52 
       
    53 	TRAPD(err3, iParseLine = CParseLine::NewL(iTestScript, iTestUtils, iLogClient, theGuardTimer, KNullDesC));
       
    54 	if(err3 != KErrNone)
       
    55 	{
       
    56 		ERR_PRINTF2(_L("Could not initialise CParseLine, error code %d"), err3);
       
    57 		delete iTestUtils;
       
    58 		delete iTestScript;
       
    59 		return iTestStepResult = EInconclusive;
       
    60 	}
       
    61 
       
    62 	return iTestStepResult = EPass;
       
    63 	}
       
    64 
       
    65 // postamble
       
    66 void RTSUMmTsthStep01::Close()
       
    67 	{
       
    68 	delete iParseLine;
       
    69 	delete iTestScript;
       
    70 	delete iTestUtils;
       
    71 	}