sl@0: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // This contains Flogger Unit Test Case 002.xx sl@0: sl@0: // EPOC includes sl@0: #include sl@0: sl@0: // Test system includes sl@0: #include "teststepcomsdbg.h" sl@0: #include "step_002_xx.h" sl@0: sl@0: #include sl@0: sl@0: sl@0: /** sl@0: * Function Name : CFloggerTest002_01 sl@0: * Input parameters : None sl@0: * Output parameters : None sl@0: * Description : This is the constructor sl@0: */ sl@0: sl@0: sl@0: CFloggerTest002_01::CFloggerTest002_01() sl@0: { sl@0: // store the name of this test case sl@0: SetTestStepName(_L("step_002_01")); sl@0: } sl@0: sl@0: sl@0: /** sl@0: * Function Name :~ CFloggerTest002_01 sl@0: * Input parameters : None sl@0: * Output parameters : None sl@0: * Description : This is the Destructor sl@0: */ sl@0: sl@0: sl@0: CFloggerTest002_01::~CFloggerTest002_01() sl@0: { sl@0: sl@0: } sl@0: sl@0: sl@0: /** sl@0: * Function Name : doTestStepL sl@0: * Input parameters : None sl@0: * Output parameters : TVerdict sl@0: * Description : This function returns weather the test case 002_01 has sl@0: * passed or failed sl@0: */ sl@0: sl@0: sl@0: TVerdict CFloggerTest002_01::doTestStepL( ) sl@0: { sl@0: if ( executeStepL() == KErrNone ) sl@0: SetTestStepResult(EPass); sl@0: else sl@0: SetTestStepResult(EFail); sl@0: sl@0: return TestStepResult(); sl@0: } sl@0: sl@0: sl@0: /** sl@0: * Function Name : executeStepL sl@0: * Input parameters : None sl@0: * Output parameters : TInt sl@0: * Description : This function connects to the file logger sl@0: and return the result sl@0: */ sl@0: sl@0: sl@0: TInt CFloggerTest002_01::executeStepL( ) sl@0: { sl@0: INFO_PRINTF1(_L("Step 002.01 called ")); sl@0: sl@0: RFileLogger theFlogger; sl@0: TPtrC8 ptrSubSystem; sl@0: TPtrC8 ptrComponent; sl@0: ptrSubSystem.Set(_L8("SubSystem")); sl@0: ptrComponent.Set(_L8("Component")); sl@0: sl@0: TInt result = theFlogger.Connect(); sl@0: CleanupClosePushL(theFlogger); sl@0: theFlogger.SetLogTags(ptrSubSystem, ptrComponent); sl@0: CleanupStack::PopAndDestroy(); //logger sl@0: return result; sl@0: } sl@0: TInt CFloggerTest002_01::executeStepL(TBool) sl@0: { sl@0: return KErrGeneral; sl@0: } sl@0: sl@0: sl@0: /* sl@0: * Function Name : CFloggerTest002_02 sl@0: * Input parameters : None sl@0: * Output parameters : None sl@0: * Description : This is the constructor sl@0: */ sl@0: sl@0: sl@0: CFloggerTest002_02::CFloggerTest002_02() sl@0: { sl@0: // store the name of this test case sl@0: SetTestStepName(_L("step_002_02")); sl@0: } sl@0: sl@0: sl@0: /** sl@0: * Function Name :~ CFloggerTest002_02 sl@0: * Input parameters : None sl@0: * Output parameters : None sl@0: * Description : This is the Destructor sl@0: */ sl@0: sl@0: CFloggerTest002_02::~CFloggerTest002_02() sl@0: { sl@0: } sl@0: sl@0: sl@0: sl@0: /** sl@0: * Function Name : doTestStepL sl@0: * Input parameters : None sl@0: * Output parameters : TVerdict sl@0: * Description : This function is responsible for doing the heap test analysis sl@0: sl@0: */ sl@0: sl@0: sl@0: TVerdict CFloggerTest002_02::doTestStepL( ) sl@0: { sl@0: SetTestStepResult(EPass); sl@0: sl@0: INFO_PRINTF1(_L("Step 002.02 called ")); sl@0: sl@0: CFloggerTest002_01* step002_01 = new CFloggerTest002_01; sl@0: CleanupStack::PushL(step002_01); sl@0: doTestStepWithHeapFailureL( *step002_01, 1, 10, KErrNone); sl@0: sl@0: if ( step002_01->TestStepResult() == EFail ) sl@0: SetTestStepResult(EFail); sl@0: sl@0: sl@0: CleanupStack::PopAndDestroy(step002_01); sl@0: return TestStepResult(); sl@0: } sl@0: