lowlevellibsandfws/pluginfw/Test_Bed/ComponentInfoTest/ComponentInfoTest.cpp
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 1997-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 // Set of implementations to test the CComponentInfo class using the test bed.
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "ComponentInfoUnitTest.h"
       
    19 #include "ComponentTester.h"
       
    20 
       
    21 // ______________________________________________________________________________
       
    22 //
       
    23 /**
       
    24 	@internalComponent
       
    25 	
       
    26 	Comments : Test the CComponentInfo class.
       
    27  */
       
    28 class CComponentInfo_ComponentTest : public CComponentTester
       
    29 	{
       
    30 public:
       
    31 	/**
       
    32 		@fn				NewLC(CDataLogger& aDataLogger,
       
    33 							 MComponentTestObserver& aObserver)
       
    34 		Intended Usage	: Standard two-phase construction which leaves nothing on the
       
    35 						cleanup stack.
       
    36 		Error Condition	: Leaves with the error code.
       
    37 		@leave  		KErrNoMemory
       
    38 		@since			7.0
       
    39 		@param			aDataLogger The output logging object.
       
    40 		@param			aObserver The observer of this component test.
       
    41 		@return			CComponentInfo_ComponentTest* The constructed object.
       
    42 		@pre 			None.
       
    43 		@post			CComponentInfo_ComponentTest is fully constructed and initialised.
       
    44 	*/
       
    45 	static CComponentInfo_ComponentTest* NewLC(CDataLogger& aDataLogger, 
       
    46 							MComponentTestObserver& aObserver);
       
    47 
       
    48 private:
       
    49 	/**
       
    50 		@fn				CComponentInfo_ComponentTest(CDataLogger& aDataLogger,
       
    51 											MComponentTestObserver& aObserver)
       
    52 		Intended Usage	: Standard constructor method.
       
    53 		Error Condition	: None.
       
    54 		@since			7.0
       
    55 		@param			aDataLogger The logging object.
       
    56 		@param			aObserver The observer of this component test.
       
    57 		@pre 			None.
       
    58 		@post			CComponentInfo_ComponentTest is fully constructed.
       
    59 	*/
       
    60 	inline CComponentInfo_ComponentTest(CDataLogger& aDataLogger,
       
    61 												MComponentTestObserver& aObserver);
       
    62 	/**
       
    63 		@fn				void ConstructL()
       
    64 		Intended Usage	: Second phase of safe two phase construction, 
       
    65 						to complete the object initialisation.
       
    66 		Error Condition	: Leaves with an error code.
       
    67 		@leave  		KErrNoMemory.
       
    68 		@since			7.0
       
    69 		@return			None 
       
    70 		@pre 			CComponentInfo_ComponentTest is fully constructed.
       
    71 		@post			CComponentInfo_ComponentTest is fully initialised.
       
    72 	*/
       
    73 	inline void ConstructL();
       
    74 
       
    75 	};	// CComponentInfo_ComponentTest
       
    76 
       
    77 // ______________________________________________________________________________
       
    78 //
       
    79 inline CComponentInfo_ComponentTest* CComponentInfo_ComponentTest::NewLC(CDataLogger& aDataLogger, MComponentTestObserver& aObserver)
       
    80 	{
       
    81 	CComponentInfo_ComponentTest* self = new (ELeave) CComponentInfo_ComponentTest(aDataLogger, aObserver);
       
    82 	CleanupStack::PushL(self);
       
    83 	self->ConstructL();
       
    84 	return self;
       
    85 	}
       
    86 
       
    87 inline CComponentInfo_ComponentTest::CComponentInfo_ComponentTest(CDataLogger& aDataLogger,
       
    88 									MComponentTestObserver& aObserver)
       
    89 : CComponentTester(aDataLogger, aObserver)
       
    90 	{
       
    91 	// Do nothing here.
       
    92 	}
       
    93 
       
    94 /**
       
    95 @SYMTestCaseID          SYSLIB-ECOM-CT-0774
       
    96 @SYMTestCaseDesc	    Tests for implementations of CComponentInfo class 
       
    97 @SYMTestPriority 	    High
       
    98 @SYMTestActions  	    Component tests for CComponentInfo class
       
    99 @SYMTestExpectedResults Test must not fail CComponentInfo class
       
   100 @SYMREQ                 REQ0000
       
   101 */
       
   102 inline void CComponentInfo_ComponentTest::ConstructL()
       
   103 	{
       
   104 	// Perform base class initialization
       
   105 	ComponentTesterConstructL();
       
   106 
       
   107 	AddUnitTestL(CComponentInfo_CreateAndDestroy_UnitTest::NewL(iDataLogger, *this));
       
   108 	AddUnitTestL(CComponentInfo_RetrieveTestNames_UnitTest::NewL(iDataLogger, *this));
       
   109 	}
       
   110 
       
   111 // ______________________________________________________________________________
       
   112 //
       
   113 EXPORT_C CComponentTester* NewComponentTestLC(CDataLogger& aDataLogger,
       
   114 									MComponentTestObserver&	aComponentTestObserver)
       
   115 	{
       
   116 	return CComponentInfo_ComponentTest::NewLC(aDataLogger, aComponentTestObserver);
       
   117 	}
       
   118 
       
   119 // ___________________________________________________________________________
       
   120 //
       
   121 // This section of the module simply includes the exported test harness template which 
       
   122 // makes this a "whole" CPP file with a E32Main entry point below. The test MMP 
       
   123 // project file can then produce a EXE for the test project instead of a DLL.
       
   124 
       
   125 #include <ecom/test_bed/testharnesstemplate.h>
       
   126 
       
   127 GLDEF_C TInt E32Main()
       
   128     {
       
   129 	return E32Main_TestHarness(NewComponentTestLC);
       
   130 	}
       
   131