|
1 /* |
|
2 * Copyright (c) 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: This file contains testclass implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include <stiftestinterface.h> |
|
20 #include <settingserverclient.h> |
|
21 |
|
22 #include "wmunittest.h" |
|
23 |
|
24 |
|
25 // ============================ MEMBER FUNCTIONS =============================== |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // CWmUnitTest::CWmUnitTest |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 CWmUnitTest::CWmUnitTest( |
|
32 CTestModuleIf& aTestModuleIf ): |
|
33 CScriptBase( aTestModuleIf ) |
|
34 { |
|
35 } |
|
36 |
|
37 // ----------------------------------------------------------------------------- |
|
38 // CWmUnitTest::ConstructL |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 void CWmUnitTest::ConstructL() |
|
42 { |
|
43 iLog = CStifLogger::NewL( KWmUnitTestLogPath, |
|
44 KWmUnitTestLogFile, |
|
45 CStifLogger::ETxt, |
|
46 CStifLogger::EFile, |
|
47 EFalse ); |
|
48 |
|
49 SendTestClassVersion(); |
|
50 |
|
51 User::LeaveIfError( iFs.Connect() ); |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CWmUnitTest::NewL |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 CWmUnitTest* CWmUnitTest::NewL( |
|
59 CTestModuleIf& aTestModuleIf ) |
|
60 { |
|
61 CWmUnitTest* self = new (ELeave) CWmUnitTest( aTestModuleIf ); |
|
62 CleanupStack::PushL( self ); |
|
63 self->ConstructL(); |
|
64 CleanupStack::Pop( self ); |
|
65 return self; |
|
66 } |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // CWmUnitTest::~CWmUnitTest |
|
70 // ----------------------------------------------------------------------------- |
|
71 // |
|
72 CWmUnitTest::~CWmUnitTest() |
|
73 { |
|
74 // Delete logger |
|
75 delete iLog; |
|
76 // close file server |
|
77 iFs.Close(); |
|
78 } |
|
79 |
|
80 //----------------------------------------------------------------------------- |
|
81 // CWmDeploymentClientTest::SendTestClassVersion |
|
82 //----------------------------------------------------------------------------- |
|
83 // |
|
84 void CWmUnitTest::SendTestClassVersion() |
|
85 { |
|
86 TVersion moduleVersion; |
|
87 moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; |
|
88 moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; |
|
89 moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; |
|
90 |
|
91 TFileName moduleName; |
|
92 moduleName = _L("wmunittest.dll"); |
|
93 |
|
94 TBool newVersionOfMethod = ETrue; |
|
95 TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); |
|
96 } |
|
97 |
|
98 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // LibEntryL() - polymorphic Dll entry point. |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 EXPORT_C CScriptBase* LibEntryL( |
|
105 CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework |
|
106 { |
|
107 return ( CScriptBase* ) CWmUnitTest::NewL( aTestModuleIf ); |
|
108 } |
|
109 |
|
110 |
|
111 // End of File |