author | sl@SLION-WIN7.fritz.box |
Fri, 15 Jun 2012 03:10:57 +0200 | |
changeset 0 | bde4ae8d615e |
permissions | -rw-r--r-- |
sl@0 | 1 |
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
sl@0 | 2 |
// All rights reserved. |
sl@0 | 3 |
// This component and the accompanying materials are made available |
sl@0 | 4 |
// under the terms of "Eclipse Public License v1.0" |
sl@0 | 5 |
// which accompanies this distribution, and is available |
sl@0 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
sl@0 | 7 |
// |
sl@0 | 8 |
// Initial Contributors: |
sl@0 | 9 |
// Nokia Corporation - initial contribution. |
sl@0 | 10 |
// |
sl@0 | 11 |
// Contributors: |
sl@0 | 12 |
// |
sl@0 | 13 |
// Description: |
sl@0 | 14 |
// This contains Flogger Unit Test Case 002.xx |
sl@0 | 15 |
|
sl@0 | 16 |
// EPOC includes |
sl@0 | 17 |
#include <e32base.h> |
sl@0 | 18 |
|
sl@0 | 19 |
// Test system includes |
sl@0 | 20 |
#include "teststepcomsdbg.h" |
sl@0 | 21 |
#include "step_002_xx.h" |
sl@0 | 22 |
|
sl@0 | 23 |
#include <comms-infras/commsdebugutility.h> |
sl@0 | 24 |
|
sl@0 | 25 |
|
sl@0 | 26 |
/** |
sl@0 | 27 |
* Function Name : CFloggerTest002_01 |
sl@0 | 28 |
* Input parameters : None |
sl@0 | 29 |
* Output parameters : None |
sl@0 | 30 |
* Description : This is the constructor |
sl@0 | 31 |
*/ |
sl@0 | 32 |
|
sl@0 | 33 |
|
sl@0 | 34 |
CFloggerTest002_01::CFloggerTest002_01() |
sl@0 | 35 |
{ |
sl@0 | 36 |
// store the name of this test case |
sl@0 | 37 |
SetTestStepName(_L("step_002_01")); |
sl@0 | 38 |
} |
sl@0 | 39 |
|
sl@0 | 40 |
|
sl@0 | 41 |
/** |
sl@0 | 42 |
* Function Name :~ CFloggerTest002_01 |
sl@0 | 43 |
* Input parameters : None |
sl@0 | 44 |
* Output parameters : None |
sl@0 | 45 |
* Description : This is the Destructor |
sl@0 | 46 |
*/ |
sl@0 | 47 |
|
sl@0 | 48 |
|
sl@0 | 49 |
CFloggerTest002_01::~CFloggerTest002_01() |
sl@0 | 50 |
{ |
sl@0 | 51 |
|
sl@0 | 52 |
} |
sl@0 | 53 |
|
sl@0 | 54 |
|
sl@0 | 55 |
/** |
sl@0 | 56 |
* Function Name : doTestStepL |
sl@0 | 57 |
* Input parameters : None |
sl@0 | 58 |
* Output parameters : TVerdict |
sl@0 | 59 |
* Description : This function returns weather the test case 002_01 has |
sl@0 | 60 |
* passed or failed |
sl@0 | 61 |
*/ |
sl@0 | 62 |
|
sl@0 | 63 |
|
sl@0 | 64 |
TVerdict CFloggerTest002_01::doTestStepL( ) |
sl@0 | 65 |
{ |
sl@0 | 66 |
if ( executeStepL() == KErrNone ) |
sl@0 | 67 |
SetTestStepResult(EPass); |
sl@0 | 68 |
else |
sl@0 | 69 |
SetTestStepResult(EFail); |
sl@0 | 70 |
|
sl@0 | 71 |
return TestStepResult(); |
sl@0 | 72 |
} |
sl@0 | 73 |
|
sl@0 | 74 |
|
sl@0 | 75 |
/** |
sl@0 | 76 |
* Function Name : executeStepL |
sl@0 | 77 |
* Input parameters : None |
sl@0 | 78 |
* Output parameters : TInt |
sl@0 | 79 |
* Description : This function connects to the file logger |
sl@0 | 80 |
and return the result |
sl@0 | 81 |
*/ |
sl@0 | 82 |
|
sl@0 | 83 |
|
sl@0 | 84 |
TInt CFloggerTest002_01::executeStepL( ) |
sl@0 | 85 |
{ |
sl@0 | 86 |
INFO_PRINTF1(_L("Step 002.01 called ")); |
sl@0 | 87 |
|
sl@0 | 88 |
RFileLogger theFlogger; |
sl@0 | 89 |
TPtrC8 ptrSubSystem; |
sl@0 | 90 |
TPtrC8 ptrComponent; |
sl@0 | 91 |
ptrSubSystem.Set(_L8("SubSystem")); |
sl@0 | 92 |
ptrComponent.Set(_L8("Component")); |
sl@0 | 93 |
|
sl@0 | 94 |
TInt result = theFlogger.Connect(); |
sl@0 | 95 |
CleanupClosePushL(theFlogger); |
sl@0 | 96 |
theFlogger.SetLogTags(ptrSubSystem, ptrComponent); |
sl@0 | 97 |
CleanupStack::PopAndDestroy(); //logger |
sl@0 | 98 |
return result; |
sl@0 | 99 |
} |
sl@0 | 100 |
TInt CFloggerTest002_01::executeStepL(TBool) |
sl@0 | 101 |
{ |
sl@0 | 102 |
return KErrGeneral; |
sl@0 | 103 |
} |
sl@0 | 104 |
|
sl@0 | 105 |
|
sl@0 | 106 |
/* |
sl@0 | 107 |
* Function Name : CFloggerTest002_02 |
sl@0 | 108 |
* Input parameters : None |
sl@0 | 109 |
* Output parameters : None |
sl@0 | 110 |
* Description : This is the constructor |
sl@0 | 111 |
*/ |
sl@0 | 112 |
|
sl@0 | 113 |
|
sl@0 | 114 |
CFloggerTest002_02::CFloggerTest002_02() |
sl@0 | 115 |
{ |
sl@0 | 116 |
// store the name of this test case |
sl@0 | 117 |
SetTestStepName(_L("step_002_02")); |
sl@0 | 118 |
} |
sl@0 | 119 |
|
sl@0 | 120 |
|
sl@0 | 121 |
/** |
sl@0 | 122 |
* Function Name :~ CFloggerTest002_02 |
sl@0 | 123 |
* Input parameters : None |
sl@0 | 124 |
* Output parameters : None |
sl@0 | 125 |
* Description : This is the Destructor |
sl@0 | 126 |
*/ |
sl@0 | 127 |
|
sl@0 | 128 |
CFloggerTest002_02::~CFloggerTest002_02() |
sl@0 | 129 |
{ |
sl@0 | 130 |
} |
sl@0 | 131 |
|
sl@0 | 132 |
|
sl@0 | 133 |
|
sl@0 | 134 |
/** |
sl@0 | 135 |
* Function Name : doTestStepL |
sl@0 | 136 |
* Input parameters : None |
sl@0 | 137 |
* Output parameters : TVerdict |
sl@0 | 138 |
* Description : This function is responsible for doing the heap test analysis |
sl@0 | 139 |
|
sl@0 | 140 |
*/ |
sl@0 | 141 |
|
sl@0 | 142 |
|
sl@0 | 143 |
TVerdict CFloggerTest002_02::doTestStepL( ) |
sl@0 | 144 |
{ |
sl@0 | 145 |
SetTestStepResult(EPass); |
sl@0 | 146 |
|
sl@0 | 147 |
INFO_PRINTF1(_L("Step 002.02 called ")); |
sl@0 | 148 |
|
sl@0 | 149 |
CFloggerTest002_01* step002_01 = new CFloggerTest002_01; |
sl@0 | 150 |
CleanupStack::PushL(step002_01); |
sl@0 | 151 |
doTestStepWithHeapFailureL( *step002_01, 1, 10, KErrNone); |
sl@0 | 152 |
|
sl@0 | 153 |
if ( step002_01->TestStepResult() == EFail ) |
sl@0 | 154 |
SetTestStepResult(EFail); |
sl@0 | 155 |
|
sl@0 | 156 |
|
sl@0 | 157 |
CleanupStack::PopAndDestroy(step002_01); |
sl@0 | 158 |
return TestStepResult(); |
sl@0 | 159 |
} |
sl@0 | 160 |