datacommsserver/esockserver/test/te_mecunittest/src/mecunitteststepbase.cpp
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 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 // mecunitteststepbase.cpp
       
    16 //
       
    17 
       
    18 /**
       
    19 @file
       
    20 */
       
    21 
       
    22 
       
    23 #include "mecunitteststepbase.h"
       
    24 #include <comms-infras/ss_rmetaextensioncontainer.h>
       
    25 
       
    26 CMecUnitTestStepBase::~CMecUnitTestStepBase()
       
    27     {
       
    28     }
       
    29 
       
    30 
       
    31 
       
    32 TVerdict CMecUnitTestStepBase::doTestStepL()
       
    33     {
       
    34     SetTestStepResult(EFail);
       
    35 
       
    36     TVerdict testResult = EFail;
       
    37 	TRAPD(err, testResult = RunTestStepL());
       
    38 	if (err == KErrNone)
       
    39 	    {
       
    40     	SetTestStepResult(testResult);
       
    41 	    }
       
    42 	else
       
    43 	    {
       
    44 	    ERR_PRINTF2(_L("Test step failed with Leave(%d)"), err);
       
    45 	    }
       
    46 	
       
    47 	return TestStepResult();
       
    48     }
       
    49 
       
    50 
       
    51 void CMecUnitTestStepBase::CreateAndAppendExtensionL(ESock::RMetaExtensionContainer& aMec, TUint32 aExtensionType, TUint32 aVersion)
       
    52 	{
       
    53 	Meta::SMetaData* ext = NULL;
       
    54 	
       
    55 	switch (aExtensionType)
       
    56 		{
       
    57 		case TTestExtension1::ETypeId:
       
    58 			ext = new(ELeave)TTestExtension1(aVersion);
       
    59 			break;
       
    60 
       
    61 		case TTestExtension2::ETypeId:
       
    62 			ext = new(ELeave)TTestExtension2(aVersion);
       
    63 			break;
       
    64 			
       
    65 		case TTestExtension3::ETypeId:
       
    66 			ext = new(ELeave)TTestExtension3(aVersion);
       
    67 			break;
       
    68 			
       
    69 		default:
       
    70 			User::Leave(KErrArgument);
       
    71 		}
       
    72 	
       
    73 	CleanupStack::PushL(ext);
       
    74 	aMec.AppendExtensionL(ext);
       
    75 	CleanupStack::Pop(ext);
       
    76 	}
       
    77 
       
    78 
       
    79