author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 24 Nov 2009 08:56:33 +0200 | |
changeset 33 | 50974a8b132e |
parent 19 | 989d2f495d90 |
permissions | -rw-r--r-- |
19 | 1 |
/* |
2 |
* Copyright (c) 2002 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 the License "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: ?Description |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
||
21 |
// INCLUDE FILES |
|
22 |
#include <e32svr.h> |
|
23 |
#include <StifParser.h> |
|
24 |
//#include <SAPI_TEST\testprg.h> |
|
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
25 |
#include <StifTestInterface.h> |
19 | 26 |
|
27 |
#include <badesca.h> |
|
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
28 |
#include<liwservicehandler.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
29 |
#include<liwcommon.h> |
19 | 30 |
|
31 |
||
32 |
#include "tcalendarchangenotifytest.h" |
|
33 |
||
34 |
#include "startconsolealarmserver.h" |
|
35 |
||
36 |
TInt doImportTestDirect(TInt x); |
|
37 |
void* doImportTestCBindingAsync1( void* /*x*/); |
|
38 |
TInt doImportTestCBinding(); |
|
39 |
||
40 |
_LIT(KCalNameImportTestDirect, "ImportTothisatProvider"); |
|
41 |
||
42 |
// ============================ MEMBER FUNCTIONS =============================== |
|
43 |
||
44 |
// ----------------------------------------------------------------------------- |
|
45 |
// CTChangeStatusTest::Delete |
|
46 |
// Delete here all resources allocated and opened from test methods. |
|
47 |
// Called from destructor. |
|
48 |
// ----------------------------------------------------------------------------- |
|
49 |
// |
|
50 |
void CTCalendarChangeNotifyTest::Delete() |
|
51 |
{ |
|
52 |
||
53 |
} |
|
54 |
||
55 |
// ----------------------------------------------------------------------------- |
|
56 |
// CTChangeStatusTest::RunMethodL |
|
57 |
// Run specified method. Contains also table of test mothods and their names. |
|
58 |
// ----------------------------------------------------------------------------- |
|
59 |
// |
|
60 |
TInt CTCalendarChangeNotifyTest::RunMethodL( |
|
61 |
CStifItemParser& aItem ) |
|
62 |
{ |
|
63 |
||
64 |
static TStifFunctionInfo const KFunctions[] = |
|
65 |
{ |
|
66 |
// Copy this line for every implemented function. |
|
67 |
// First string is the function name used in TestScripter script file. |
|
68 |
// Second is the actual implementation member function. |
|
69 |
//TRY( "SendMessage", CTDeleteMessageTest::SendMessage ), |
|
70 |
||
71 |
ENTRY( "NotifyAdd", CTCalendarChangeNotifyTest::NotifyAdd), |
|
72 |
ENTRY( "NotifyAddPosBased", CTCalendarChangeNotifyTest::NotifyAddPosBased), |
|
73 |
ENTRY( "NotifyDelete", CTCalendarChangeNotifyTest::NotifyDelete), |
|
74 |
ENTRY( "NotifyDeletePosBased", CTCalendarChangeNotifyTest::NotifyDeletePosBased), |
|
75 |
ENTRY( "NotifyUpdate", CTCalendarChangeNotifyTest::NotifyUpdate), |
|
76 |
ENTRY( "NotifyUpdatePosBased", CTCalendarChangeNotifyTest::NotifyUpdatePosBased), |
|
77 |
ENTRY( "NotifyAddLocalUid", CTCalendarChangeNotifyTest::NotifyAddLocalUid), |
|
78 |
ENTRY( "NotifyDeleteLocalUid", CTCalendarChangeNotifyTest::NotifyDeleteLocalUid), |
|
79 |
ENTRY( "NotifyUpdateLocalUid", CTCalendarChangeNotifyTest::NotifyUpdateLocalUid), |
|
80 |
ENTRY( "TestCancelPosBased", CTCalendarChangeNotifyTest::TestCancelPosBased), |
|
81 |
ENTRY( "TestCancelInvalid", CTCalendarChangeNotifyTest::TestCancelInvalid), |
|
82 |
ENTRY( "TestCancelMultiple", CTCalendarChangeNotifyTest::TestCancelMultiple), |
|
83 |
ENTRY( "TestAsyncWithNoCancel", CTCalendarChangeNotifyTest::TestAsyncWithNoCancel), |
|
84 |
}; |
|
85 |
||
86 |
||
87 |
||
88 |
||
89 |
const TInt count = sizeof( KFunctions ) / |
|
90 |
sizeof( TStifFunctionInfo ); |
|
91 |
||
92 |
return RunInternalL( KFunctions, count, aItem ); |
|
93 |
||
94 |
} |
|
95 |
||
96 |
TInt ReqNotification( TInt aChangeType, TBool aLocalUid, TBool aPosBased = EFalse ); |
|
97 |
TInt ReqNotificationCancel( TInt aChangeType, TBool aLocalUid, TBool aPosBased = EFalse, TBool aInvalidId = EFalse, TBool aMultiCancel = EFalse); |
|
98 |
TInt ReqNotificationWithoutWaitSch( TInt aChangeType, TBool aLocalUid, TBool aPosBased ); |
|
99 |
||
100 |
||
101 |
TInt CTCalendarChangeNotifyTest::NotifyAdd(CStifItemParser& /*aItem*/) |
|
102 |
{ |
|
103 |
TInt result = KErrNone; |
|
104 |
__UHEAP_MARK; |
|
105 |
||
106 |
result = ReqNotification(1, EFalse); |
|
107 |
||
108 |
__UHEAP_MARKEND; |
|
109 |
return result; |
|
110 |
||
111 |
} |
|
112 |
||
113 |
||
114 |
TInt CTCalendarChangeNotifyTest::NotifyAddPosBased(CStifItemParser& /*aItem*/) |
|
115 |
{ |
|
116 |
TInt result = KErrNone; |
|
117 |
__UHEAP_MARK; |
|
118 |
||
119 |
result = ReqNotification(1, EFalse, ETrue ); |
|
120 |
||
121 |
__UHEAP_MARKEND; |
|
122 |
return result; |
|
123 |
||
124 |
} |
|
125 |
||
126 |
||
127 |
TInt CTCalendarChangeNotifyTest::NotifyDelete(CStifItemParser& /*aItem*/) |
|
128 |
{ |
|
129 |
TInt result = KErrNone; |
|
130 |
__UHEAP_MARK; |
|
131 |
||
132 |
result = ReqNotification(2, EFalse); |
|
133 |
||
134 |
__UHEAP_MARKEND; |
|
135 |
return result; |
|
136 |
} |
|
137 |
||
138 |
TInt CTCalendarChangeNotifyTest::NotifyDeletePosBased(CStifItemParser& /*aItem*/) |
|
139 |
{ |
|
140 |
TInt result = KErrNone; |
|
141 |
__UHEAP_MARK; |
|
142 |
||
143 |
result = ReqNotification(2, EFalse, ETrue); |
|
144 |
||
145 |
__UHEAP_MARKEND; |
|
146 |
return result; |
|
147 |
} |
|
148 |
||
149 |
TInt CTCalendarChangeNotifyTest::NotifyUpdate(CStifItemParser& /*aItem*/) |
|
150 |
{ |
|
151 |
TInt result = KErrNone; |
|
152 |
__UHEAP_MARK; |
|
153 |
||
154 |
result = ReqNotification(3, EFalse); |
|
155 |
||
156 |
__UHEAP_MARKEND; |
|
157 |
return result; |
|
158 |
} |
|
159 |
||
160 |
TInt CTCalendarChangeNotifyTest::NotifyUpdatePosBased(CStifItemParser& /*aItem*/) |
|
161 |
{ |
|
162 |
TInt result = KErrNone; |
|
163 |
__UHEAP_MARK; |
|
164 |
||
165 |
result = ReqNotification(3, EFalse, ETrue); |
|
166 |
||
167 |
__UHEAP_MARKEND; |
|
168 |
return result; |
|
169 |
} |
|
170 |
||
171 |
TInt CTCalendarChangeNotifyTest::NotifyAddLocalUid(CStifItemParser& /*aItem*/) |
|
172 |
{ |
|
173 |
TInt result = KErrNone; |
|
174 |
__UHEAP_MARK; |
|
175 |
||
176 |
result = ReqNotification(1, ETrue); |
|
177 |
||
178 |
__UHEAP_MARKEND; |
|
179 |
return result; |
|
180 |
||
181 |
} |
|
182 |
||
183 |
TInt CTCalendarChangeNotifyTest::NotifyDeleteLocalUid(CStifItemParser& /*aItem*/) |
|
184 |
{ |
|
185 |
TInt result = KErrNone; |
|
186 |
__UHEAP_MARK; |
|
187 |
||
188 |
result = ReqNotification(2, ETrue); |
|
189 |
||
190 |
__UHEAP_MARKEND; |
|
191 |
return result; |
|
192 |
} |
|
193 |
||
194 |
TInt CTCalendarChangeNotifyTest::NotifyUpdateLocalUid(CStifItemParser& /*aItem*/) |
|
195 |
{ |
|
196 |
TInt result = KErrNone; |
|
197 |
__UHEAP_MARK; |
|
198 |
||
199 |
result = ReqNotification(3, ETrue); |
|
200 |
||
201 |
__UHEAP_MARKEND; |
|
202 |
return result; |
|
203 |
} |
|
204 |
||
205 |
TInt CTCalendarChangeNotifyTest::TestCancelPosBased(CStifItemParser& /*aItem*/) |
|
206 |
{ |
|
207 |
TInt result = KErrNone; |
|
208 |
__UHEAP_MARK; |
|
209 |
||
210 |
result = ReqNotificationCancel(3, ETrue, ETrue); |
|
211 |
||
212 |
__UHEAP_MARKEND; |
|
213 |
return result; |
|
214 |
} |
|
215 |
||
216 |
TInt CTCalendarChangeNotifyTest::TestCancelInvalid(CStifItemParser& /*aItem*/) |
|
217 |
{ |
|
218 |
TInt result = KErrNone; |
|
219 |
__UHEAP_MARK; |
|
220 |
||
221 |
result = ReqNotificationCancel( 3, ETrue, EFalse, ETrue ); |
|
222 |
||
223 |
__UHEAP_MARKEND; |
|
224 |
return result; |
|
225 |
} |
|
226 |
||
227 |
TInt CTCalendarChangeNotifyTest::TestCancelMultiple(CStifItemParser& /*aItem*/) |
|
228 |
{ |
|
229 |
TInt result = KErrNone; |
|
230 |
__UHEAP_MARK; |
|
231 |
||
232 |
result = ReqNotificationCancel(3, ETrue, EFalse, EFalse, ETrue ); |
|
233 |
||
234 |
__UHEAP_MARKEND; |
|
235 |
return result; |
|
236 |
} |
|
237 |
||
238 |
TInt CTCalendarChangeNotifyTest::TestAsyncWithNoCancel(CStifItemParser& /*aItem*/) |
|
239 |
{ |
|
240 |
TInt result = KErrNone; |
|
241 |
__UHEAP_MARK; |
|
242 |
||
243 |
result = ReqNotificationWithoutWaitSch(3, ETrue, EFalse ); |
|
244 |
||
245 |
__UHEAP_MARKEND; |
|
246 |
return result; |
|
247 |
} |
|
248 |