os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/ComponentInfoTest/ComponentInfoTest.cpp
Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Set of implementations to test the CComponentInfo class using the test bed.
18 #include "ComponentInfoUnitTest.h"
19 #include "ComponentTester.h"
21 // ______________________________________________________________________________
26 Comments : Test the CComponentInfo class.
28 class CComponentInfo_ComponentTest : public CComponentTester
32 @fn NewLC(CDataLogger& aDataLogger,
33 MComponentTestObserver& aObserver)
34 Intended Usage : Standard two-phase construction which leaves nothing on the
36 Error Condition : Leaves with the error code.
39 @param aDataLogger The output logging object.
40 @param aObserver The observer of this component test.
41 @return CComponentInfo_ComponentTest* The constructed object.
43 @post CComponentInfo_ComponentTest is fully constructed and initialised.
45 static CComponentInfo_ComponentTest* NewLC(CDataLogger& aDataLogger,
46 MComponentTestObserver& aObserver);
50 @fn CComponentInfo_ComponentTest(CDataLogger& aDataLogger,
51 MComponentTestObserver& aObserver)
52 Intended Usage : Standard constructor method.
53 Error Condition : None.
55 @param aDataLogger The logging object.
56 @param aObserver The observer of this component test.
58 @post CComponentInfo_ComponentTest is fully constructed.
60 inline CComponentInfo_ComponentTest(CDataLogger& aDataLogger,
61 MComponentTestObserver& aObserver);
64 Intended Usage : Second phase of safe two phase construction,
65 to complete the object initialisation.
66 Error Condition : Leaves with an error code.
70 @pre CComponentInfo_ComponentTest is fully constructed.
71 @post CComponentInfo_ComponentTest is fully initialised.
73 inline void ConstructL();
75 }; // CComponentInfo_ComponentTest
77 // ______________________________________________________________________________
79 inline CComponentInfo_ComponentTest* CComponentInfo_ComponentTest::NewLC(CDataLogger& aDataLogger, MComponentTestObserver& aObserver)
81 CComponentInfo_ComponentTest* self = new (ELeave) CComponentInfo_ComponentTest(aDataLogger, aObserver);
82 CleanupStack::PushL(self);
87 inline CComponentInfo_ComponentTest::CComponentInfo_ComponentTest(CDataLogger& aDataLogger,
88 MComponentTestObserver& aObserver)
89 : CComponentTester(aDataLogger, aObserver)
95 @SYMTestCaseID SYSLIB-ECOM-CT-0774
96 @SYMTestCaseDesc Tests for implementations of CComponentInfo class
98 @SYMTestActions Component tests for CComponentInfo class
99 @SYMTestExpectedResults Test must not fail CComponentInfo class
102 inline void CComponentInfo_ComponentTest::ConstructL()
104 // Perform base class initialization
105 ComponentTesterConstructL();
107 AddUnitTestL(CComponentInfo_CreateAndDestroy_UnitTest::NewL(iDataLogger, *this));
108 AddUnitTestL(CComponentInfo_RetrieveTestNames_UnitTest::NewL(iDataLogger, *this));
111 // ______________________________________________________________________________
113 EXPORT_C CComponentTester* NewComponentTestLC(CDataLogger& aDataLogger,
114 MComponentTestObserver& aComponentTestObserver)
116 return CComponentInfo_ComponentTest::NewLC(aDataLogger, aComponentTestObserver);
119 // ___________________________________________________________________________
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.
125 #include <ecom/test_bed/testharnesstemplate.h>
127 GLDEF_C TInt E32Main()
129 return E32Main_TestHarness(NewComponentTestLC);