|
1 // Copyright (c) 2001-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 // Demonstrates a simple set of derived class implementations to |
|
15 // test the TFilterConfigurationIterator class using the test bed. |
|
16 // It may be used as a basis to develop a full test bed dll. |
|
17 // For support and comment please contact the authors. |
|
18 // |
|
19 // |
|
20 |
|
21 /** |
|
22 @file FilterConfigurationIteratorTest.cpp |
|
23 */ |
|
24 #include "FilterConfigurationIteratorUnitTest.h" |
|
25 #include "ComponentTester.h" |
|
26 |
|
27 // ______________________________________________________________________________ |
|
28 // |
|
29 /** |
|
30 @internal |
|
31 @class CFilterConfigurationIterator_ComponentTest |
|
32 @Depends TFilterConfigurationIterator & CComponentTester |
|
33 |
|
34 Comments : Test the TFilterConfigurationIterator class. |
|
35 */ |
|
36 class CFilterConfigurationIterator_ComponentTest : public CComponentTester |
|
37 { |
|
38 public: |
|
39 /** |
|
40 @fn NewLC(CDataLogger& aDataLogger, |
|
41 MComponentTestObserver& aObserver) |
|
42 Intended Usage : Standard two-phase construction which leaves nothing on the |
|
43 cleanup stack. |
|
44 Error Condition : Leaves with the error code. |
|
45 @exceptions KErrNoMemory |
|
46 @since 7.0 |
|
47 @param aDataLogger The output logging object. |
|
48 @param aObserver The observer of this component test. |
|
49 @return CFilterConfigurationIterator_ComponentTest* The constructed object. |
|
50 @pre None. |
|
51 @post CFilterConfigurationIterator_ComponentTest is fully constructed. |
|
52 */ |
|
53 static CFilterConfigurationIterator_ComponentTest* NewLC(CDataLogger& aDataLogger, |
|
54 MComponentTestObserver& aObserver); |
|
55 |
|
56 private: |
|
57 /** |
|
58 @fn CFilterConfigurationIterator_ComponentTest(CDataLogger& aDataLogger, |
|
59 MComponentTestObserver& aObserver) |
|
60 Intended Usage : Standard c'tor method. |
|
61 Error Condition : None. |
|
62 @since 7.0 |
|
63 @param aDataLogger The logging object. |
|
64 @param aObserver The observer of this component test. |
|
65 @pre None. |
|
66 @post CFilterConfigurationIterator_ComponentTest is fully constructed. |
|
67 */ |
|
68 inline CFilterConfigurationIterator_ComponentTest(CDataLogger& aDataLogger, |
|
69 MComponentTestObserver& aObserver); |
|
70 /** |
|
71 @fn void ConstructL() |
|
72 Intended Usage : Second phase of safe two phase construction, |
|
73 to complete the object initialisation. |
|
74 Error Condition : Leaves with an error code. |
|
75 @exception KErrNoMemory. |
|
76 @since 7.0 |
|
77 @return None |
|
78 @pre CFilterConfigurationIterator_ComponentTest is fully constructed. |
|
79 @post CFilterConfigurationIterator_ComponentTest is fully initialized. |
|
80 */ |
|
81 inline void ConstructL(); |
|
82 |
|
83 }; // CFilterConfigurationIterator_ComponentTest |
|
84 |
|
85 // ______________________________________________________________________________ |
|
86 // |
|
87 inline CFilterConfigurationIterator_ComponentTest* CFilterConfigurationIterator_ComponentTest::NewLC(CDataLogger& aDataLogger, MComponentTestObserver& aObserver) |
|
88 { |
|
89 CFilterConfigurationIterator_ComponentTest* self = new (ELeave) CFilterConfigurationIterator_ComponentTest(aDataLogger, aObserver); |
|
90 CleanupStack::PushL(self); |
|
91 self->ConstructL(); |
|
92 return self; |
|
93 } |
|
94 |
|
95 inline CFilterConfigurationIterator_ComponentTest::CFilterConfigurationIterator_ComponentTest(CDataLogger& aDataLogger, |
|
96 MComponentTestObserver& aObserver) |
|
97 : CComponentTester(aDataLogger, aObserver) |
|
98 { |
|
99 // Do nothing here. |
|
100 } |
|
101 |
|
102 inline void CFilterConfigurationIterator_ComponentTest::ConstructL() |
|
103 { |
|
104 // Perform base class initialization |
|
105 ComponentTesterConstructL(); |
|
106 |
|
107 AddUnitTestL(CFilterConfigurationIterator_CreateAndDestroy_UnitTest::NewL(iDataLogger, *this)); |
|
108 AddUnitTestL(CFilterConfigurationIterator_SuccessfulAtStart_UnitTest::NewL(iDataLogger, *this)); |
|
109 AddUnitTestL(CFilterConfigurationIterator_UnsuccessfulAtStart_UnitTest::NewL(iDataLogger, *this)); |
|
110 AddUnitTestL(CFilterConfigurationIterator_UnsuccessfulFindByDataType_UnitTest::NewL(iDataLogger, *this)); |
|
111 AddUnitTestL(CFilterConfigurationIterator_ProtocolList_DEFECT_EXT5BEGTY_UnitTest::NewL(iDataLogger, *this)); |
|
112 } |
|
113 |
|
114 // ______________________________________________________________________________ |
|
115 // |
|
116 EXPORT_C CComponentTester* NewComponentTestLC(CDataLogger& aDataLogger, |
|
117 MComponentTestObserver& aComponentTestObserver) |
|
118 { |
|
119 return CFilterConfigurationIterator_ComponentTest::NewLC(aDataLogger, aComponentTestObserver); |
|
120 } |
|
121 |
|
122 // ___________________________________________________________________________ |
|
123 // |
|
124 // This section of the module simply includes the exported test harness template which |
|
125 // makes this a "whole" CPP file with a E32Main entry point below. The test MMP |
|
126 // project file can then produce a EXE for the test project instead of a DLL. |
|
127 |
|
128 #include "ECom\Test_Bed\TestHarnessTemplate.h" |
|
129 |
|
130 GLDEF_C TInt E32Main() |
|
131 { |
|
132 return E32Main_TestHarness(NewComponentTestLC); |
|
133 } |
|
134 |