messagingfw/msgtestfw/Framework/inc/CMtfTestCaseNamePair.h
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 /**
       
     2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22 */
       
    23 
       
    24 
       
    25 #ifndef __CMTF_TEST_CASE_NAME_PAIR_H__
       
    26 #define __CMTF_TEST_CASE_NAME_PAIR_H__
       
    27 
       
    28 #include <e32base.h>
       
    29 class CMtfTestServer;
       
    30 class CMtfTestCase;
       
    31 
       
    32 typedef CMtfTestCase* (*TestCaseNewL)(const CMtfTestServer&);
       
    33 
       
    34 /** Represents a pair consisting of a test case name and a function pointer.
       
    35 Used by the framework to maintain a mapping between test case names and functions that
       
    36 can be used to create an instance of the corresponding test case. */
       
    37 class CMtfTestCaseNamePair : public CBase
       
    38 {
       
    39 public:
       
    40 	static CMtfTestCaseNamePair* NewL(const TDesC& aCaseName, 
       
    41 			TestCaseNewL aFunctionPointer);
       
    42 	virtual ~CMtfTestCaseNamePair();
       
    43 	const TDesC& Name() const;
       
    44 	
       
    45 	/** Creates a new test case object. The specific derived test case class instance is
       
    46 	created. */
       
    47 	CMtfTestCase* CreateTestCaseL(const CMtfTestServer& aTestServer) const;
       
    48 		
       
    49 private:
       
    50 	void ConstructL(const TDesC& aStepName, TestCaseNewL aFunctionPointer);
       
    51 	
       
    52 private:
       
    53 	HBufC*					iName;
       
    54 	TestCaseNewL			iFunctionPointer;
       
    55 };
       
    56 
       
    57 
       
    58 
       
    59 #endif