1 /* |
|
2 * Copyright (c) 2002 - 2007 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: test functions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <e32svr.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 |
|
25 #include "testsdkscreensaver.h" |
|
26 |
|
27 // ============================ MEMBER FUNCTIONS =============================== |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // Ctestsdkscreensaver::RunMethodL |
|
31 // Run specified method. Contains also table of test mothods and their names. |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 TInt CTestSDKScreenSaver::RunMethodL( CStifItemParser& aItem ) |
|
35 { |
|
36 |
|
37 static TStifFunctionInfo const KFunctions[] = |
|
38 { |
|
39 // First string is the function name used in TestScripter script file. |
|
40 // Second is the actual implementation member function. |
|
41 ENTRY( "TestSPIDNewL", CTestSDKScreenSaver::TestSPIDNewL ), |
|
42 ENTRY( "TestSPIDListImplementationsL", |
|
43 CTestSDKScreenSaver::TestSPIDListImplementationsL), |
|
44 ENTRY( "TestSPIDDelete", CTestSDKScreenSaver::TestSPIDDelete), |
|
45 |
|
46 // [test cases entries] |
|
47 |
|
48 }; |
|
49 |
|
50 const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo ); |
|
51 |
|
52 return RunInternalL( KFunctions, count, aItem ); |
|
53 |
|
54 } |
|
55 |
|
56 // ============================ MEMBER FUNCTIONS =============================== |
|
57 // ----------------------------------------------------------------------------- |
|
58 // CTestSDKScreenSaver::TestSPIDNewL |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 TInt CTestSDKScreenSaver::TestSPIDNewL( CStifItemParser& /*aItem*/) |
|
62 { |
|
63 // Print to UI |
|
64 _LIT( KSSTestModule, "SSTestModule" ); |
|
65 _LIT( KSPIDNewL, "In SPIDNewL" ); |
|
66 TestModuleIf().Printf( 0, KSSTestModule, KSPIDNewL ); |
|
67 // Print to log file |
|
68 iLog->Log( KSPIDNewL ); |
|
69 |
|
70 const TUid pluginUid = TUid::Uid( 0x1020744D ); |
|
71 iSPIDef = CScreensaverPluginInterfaceDefinition::NewL( pluginUid ); |
|
72 |
|
73 return KErrNone; |
|
74 } |
|
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // CTestSDKScreenSaver::TestSPIDListImplementationsL |
|
78 // ----------------------------------------------------------------------------- |
|
79 // |
|
80 TInt CTestSDKScreenSaver::TestSPIDListImplementationsL( CStifItemParser& /*aItem*/) |
|
81 { |
|
82 // Print to UI |
|
83 _LIT( KSSTestModule, "SSTestModule" ); |
|
84 _LIT( KSPIDListImplementations, "In SPIDListImplementationsL" ); |
|
85 TestModuleIf().Printf( 0, KSSTestModule, KSPIDListImplementations ); |
|
86 // Print to log file |
|
87 iLog->Log( KSPIDListImplementations ); |
|
88 |
|
89 //Define RImplInfoPtrArray |
|
90 RImplInfoPtrArray iArray; |
|
91 TInt err = KErrNone; |
|
92 TRAP( err, CScreensaverPluginInterfaceDefinition::ListImplementationsL( iArray )); |
|
93 return err; |
|
94 } |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // CTestSDKScreenSaver::TestFSDNewL |
|
98 // ----------------------------------------------------------------------------- |
|
99 // |
|
100 TInt CTestSDKScreenSaver::TestSPIDDelete( CStifItemParser& /*aItem*/) |
|
101 { |
|
102 // Print to UI |
|
103 _LIT( KSSTestModule, "SSTestModule" ); |
|
104 _LIT( KSPIDDelete, "In SPIDDelete" ); |
|
105 TestModuleIf().Printf( 0, KSSTestModule, KSPIDDelete ); |
|
106 // Print to log file |
|
107 iLog->Log( KSPIDDelete ); |
|
108 |
|
109 delete iSPIDef; |
|
110 iSPIDef = NULL; |
|
111 |
|
112 return KErrNone; |
|
113 } |
|
114 |
|
115 // [End of File] |
|