os/persistentdata/traceservices/commsdebugutility/TE_commsdebugutility/src/step_002_xx.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/traceservices/commsdebugutility/TE_commsdebugutility/src/step_002_xx.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,160 @@
     1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// This contains Flogger Unit Test Case 002.xx
    1.18 +
    1.19 +// EPOC includes
    1.20 +#include <e32base.h>
    1.21 +
    1.22 +// Test system includes
    1.23 +#include "teststepcomsdbg.h"
    1.24 +#include "step_002_xx.h"
    1.25 +
    1.26 +#include <comms-infras/commsdebugutility.h>
    1.27 +
    1.28 +
    1.29 +/**
    1.30 +* Function  Name	: CFloggerTest002_01
    1.31 +* Input parameters	: None
    1.32 +* Output parameters	: None
    1.33 +* Description		: This is the constructor
    1.34 +*/
    1.35 +
    1.36 +
    1.37 +CFloggerTest002_01::CFloggerTest002_01()
    1.38 +	{
    1.39 +	// store the name of this test case
    1.40 +	SetTestStepName(_L("step_002_01"));
    1.41 +	}
    1.42 +
    1.43 +
    1.44 +/**
    1.45 +* Function  Name	:~ CFloggerTest002_01
    1.46 +* Input parameters	: None
    1.47 +* Output parameters : None
    1.48 +* Description		: This is the Destructor
    1.49 +*/
    1.50 +
    1.51 +
    1.52 +CFloggerTest002_01::~CFloggerTest002_01()
    1.53 +	{	
    1.54 +			
    1.55 +	}
    1.56 +
    1.57 +
    1.58 +/**
    1.59 +* Function  Name	: doTestStepL
    1.60 +* Input parameters	: None
    1.61 +* Output parameters : TVerdict 
    1.62 +* Description		: This function returns weather the test case 002_01 has 
    1.63 +*					  passed or failed
    1.64 +*/
    1.65 +
    1.66 +
    1.67 +TVerdict CFloggerTest002_01::doTestStepL( )
    1.68 +	{
    1.69 +	if ( executeStepL() == KErrNone  )
    1.70 +		SetTestStepResult(EPass);
    1.71 +	else
    1.72 +		SetTestStepResult(EFail);
    1.73 +	
    1.74 +	return TestStepResult();
    1.75 +	}
    1.76 +
    1.77 +
    1.78 +/**
    1.79 +* Function  Name		: executeStepL
    1.80 +* Input parameters		: None
    1.81 +* Output parameters		: TInt 
    1.82 +* Description 			: This function connects to the file logger
    1.83 +						  and return the result
    1.84 +*/
    1.85 +
    1.86 +
    1.87 +TInt CFloggerTest002_01::executeStepL( )
    1.88 +	{
    1.89 +	INFO_PRINTF1(_L("Step 002.01 called "));
    1.90 +
    1.91 +	RFileLogger theFlogger;
    1.92 +	TPtrC8 ptrSubSystem;
    1.93 +	TPtrC8 ptrComponent;
    1.94 +	ptrSubSystem.Set(_L8("SubSystem"));
    1.95 +	ptrComponent.Set(_L8("Component"));
    1.96 +
    1.97 +	TInt result = theFlogger.Connect();
    1.98 +	CleanupClosePushL(theFlogger);
    1.99 +	theFlogger.SetLogTags(ptrSubSystem, ptrComponent);
   1.100 +	CleanupStack::PopAndDestroy();	//logger
   1.101 +	return result;
   1.102 +	}
   1.103 +TInt CFloggerTest002_01::executeStepL(TBool)
   1.104 +	{
   1.105 +	return KErrGeneral;
   1.106 +	}
   1.107 +
   1.108 +
   1.109 +/*
   1.110 +* Function  Name	: CFloggerTest002_02
   1.111 +* Input parameters	: None
   1.112 +* Output parameters : None
   1.113 +* Description		: This is the constructor
   1.114 +*/
   1.115 +
   1.116 +
   1.117 +CFloggerTest002_02::CFloggerTest002_02()
   1.118 +	{
   1.119 +	// store the name of this test case
   1.120 +	SetTestStepName(_L("step_002_02"));
   1.121 +	}
   1.122 +
   1.123 +
   1.124 +/**
   1.125 +* Function  Name	:~ CFloggerTest002_02
   1.126 +* Input parameters	: None
   1.127 +* Output parameters : None
   1.128 +* Description		: This is the Destructor
   1.129 +*/
   1.130 +
   1.131 +CFloggerTest002_02::~CFloggerTest002_02()
   1.132 +	{
   1.133 +	}
   1.134 +
   1.135 +
   1.136 +
   1.137 +/**
   1.138 +* Function  Name	: doTestStepL
   1.139 +* Input parameters	: None
   1.140 +* Output parameters : TVerdict 
   1.141 +* Description		: This function is responsible for doing the heap test analysis 
   1.142 +
   1.143 +*/
   1.144 +
   1.145 +
   1.146 +TVerdict CFloggerTest002_02::doTestStepL( )
   1.147 +	{
   1.148 +	SetTestStepResult(EPass);
   1.149 +
   1.150 +	INFO_PRINTF1(_L("Step 002.02 called "));
   1.151 +
   1.152 +	CFloggerTest002_01* step002_01 = new CFloggerTest002_01;
   1.153 +	CleanupStack::PushL(step002_01);
   1.154 +	doTestStepWithHeapFailureL( *step002_01, 1, 10, KErrNone);
   1.155 +
   1.156 +	if ( step002_01->TestStepResult() == EFail )
   1.157 +		SetTestStepResult(EFail);
   1.158 +
   1.159 +
   1.160 +	CleanupStack::PopAndDestroy(step002_01);
   1.161 +	return TestStepResult();
   1.162 +	}
   1.163 +