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 // Test the CDiscoverer class using the test bed.
18 #include "DiscovererUnitTest.h"
19 #include "ComponentTester.h"
21 // ______________________________________________________________________________
26 Comments : Test the CDiscoverer class.
28 class CDiscoverer_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 CDiscoverer_CreateAndDestroy_UnitTest* The constructed object.
43 @post CDiscoverer_ComponentTest is fully constructed.
45 static CDiscoverer_ComponentTest* NewLC(CDataLogger& aDataLogger,
46 MComponentTestObserver& aObserver);
50 @fn CDiscoverer_ComponentTest(CDataLogger& aDataLogger,
51 MComponentTestObserver& aObserver)
52 Intended Usage : Standard c'tor method.
53 Error Condition : None.
55 @param aDataLogger The logging object.
56 @param aObserver The observer of this component test.
58 @post CDiscoverer_ComponentTest is fully constructed.
60 inline CDiscoverer_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 CDiscoverer_ComponentTest is fully constructed.
71 @post CDiscoverer_ComponentTest is fully initialised.
73 inline void ConstructL();
75 }; // CDiscoverer_ComponentTest
77 // ______________________________________________________________________________
79 inline CDiscoverer_ComponentTest* CDiscoverer_ComponentTest::NewLC(CDataLogger& aDataLogger, MComponentTestObserver& aObserver)
81 CDiscoverer_ComponentTest* self = new (ELeave) CDiscoverer_ComponentTest(aDataLogger, aObserver);
82 CleanupStack::PushL(self);
87 inline CDiscoverer_ComponentTest::CDiscoverer_ComponentTest(CDataLogger& aDataLogger,
88 MComponentTestObserver& aObserver)
89 : CComponentTester(aDataLogger, aObserver)
94 inline void CDiscoverer_ComponentTest::ConstructL()
96 ComponentTesterConstructL();
97 AddUnitTestL(CDiscoverer_CreateAndDestroy_UnitTest::NewL(iDataLogger, *this));
98 AddUnitTestL(CDiscoverer_UnmountDrive_UnitTest::NewL(iDataLogger, *this));
99 AddUnitTestL(CDiscoverer_MountDrive_UnitTest::NewL(iDataLogger, *this));
100 AddUnitTestL(CDiscoverer_IsValidEntryL_UnitTest::NewL(iDataLogger, *this));
101 AddUnitTestL(CDiscoverer_ProcessEntryL_UnitTest::NewL(iDataLogger, *this));
102 AddUnitTestL(CDiscoverer_ScanDirectory_UnitTest::NewL(iDataLogger, *this));
103 AddUnitTestL(CDiscoverer_ScanDirectoryCancel_UnitTest::NewL(iDataLogger, *this));
104 AddUnitTestL(CDiscoverer_ScanDirectoryIncrement_UnitTest::NewL(iDataLogger, *this));
106 AddUnitTestL(CDiscoverer_CompleteNotificationProcessing_UnitTest::NewL(iDataLogger, *this));
107 AddUnitTestL(CDiscoverer_Notification_UnitTest::NewL(iDataLogger, *this));
108 AddUnitTestL(CDiscoverer_SuspendResume_UnitTest::NewL(iDataLogger, *this));
111 // ______________________________________________________________________________
113 EXPORT_C CComponentTester* NewComponentTestLC(CDataLogger& aDataLogger,
114 MComponentTestObserver& aComponentTestObserver)
116 return CDiscoverer_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);