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 - 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 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> |
|
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
24 |
#include <StifTestInterface.h> |
19 | 25 |
#include "tcal_delete.h" |
26 |
#include "cal_delete.h" |
|
27 |
#include "calendarservice.h" |
|
28 |
||
29 |
||
30 |
// EXTERNAL DATA STRUCTURES |
|
31 |
//extern ?external_data; |
|
32 |
||
33 |
// EXTERNAL FUNCTION PROTOTYPES |
|
34 |
//extern ?external_function( ?arg_type,?arg_type ); |
|
35 |
||
36 |
// CONSTANTS |
|
37 |
//const ?type ?constant_var = ?constant; |
|
38 |
||
39 |
// MACROS |
|
40 |
//#define ?macro ?macro_def |
|
41 |
||
42 |
// LOCAL CONSTANTS AND MACROS |
|
43 |
//const ?type ?constant_var = ?constant; |
|
44 |
//#define ?macro_name ?macro_def |
|
45 |
||
46 |
// MODULE DATA STRUCTURES |
|
47 |
//enum ?declaration |
|
48 |
//typedef ?declaration |
|
49 |
||
50 |
// LOCAL FUNCTION PROTOTYPES |
|
51 |
//?type ?function_name( ?arg_type, ?arg_type ); |
|
52 |
||
53 |
// FORWARD DECLARATIONS |
|
54 |
//class ?FORWARD_CLASSNAME; |
|
55 |
||
56 |
// ============================= LOCAL FUNCTIONS =============================== |
|
57 |
||
58 |
// ----------------------------------------------------------------------------- |
|
59 |
// ?function_name ?description. |
|
60 |
// ?description |
|
61 |
// Returns: ?value_1: ?description |
|
62 |
// ?value_n: ?description_line1 |
|
63 |
// ?description_line2 |
|
64 |
// ----------------------------------------------------------------------------- |
|
65 |
// |
|
66 |
/* |
|
67 |
?type ?function_name( |
|
68 |
?arg_type arg, // ?description |
|
69 |
?arg_type arg) // ?description |
|
70 |
{ |
|
71 |
||
72 |
?code // ?comment |
|
73 |
||
74 |
// ?comment |
|
75 |
?code |
|
76 |
} |
|
77 |
*/ |
|
78 |
||
79 |
// ============================ MEMBER FUNCTIONS =============================== |
|
80 |
||
81 |
// ----------------------------------------------------------------------------- |
|
82 |
// Ctcal_delete::Delete |
|
83 |
// Delete here all resources allocated and opened from test methods. |
|
84 |
// Called from destructor. |
|
85 |
// ----------------------------------------------------------------------------- |
|
86 |
// |
|
87 |
void Ctcal_delete::Delete() |
|
88 |
{ |
|
89 |
||
90 |
} |
|
91 |
||
92 |
// ----------------------------------------------------------------------------- |
|
93 |
// Ctcal_delete::RunMethodL |
|
94 |
// Run specified method. Contains also table of test mothods and their names. |
|
95 |
// ----------------------------------------------------------------------------- |
|
96 |
// |
|
97 |
TInt Ctcal_delete::RunMethodL( |
|
98 |
CStifItemParser& aItem ) |
|
99 |
{ |
|
100 |
||
101 |
static TStifFunctionInfo const KFunctions[] = |
|
102 |
{ |
|
103 |
// Copy this line for every implemented function. |
|
104 |
// First string is the function name used in TestScripter script file. |
|
105 |
// Second is the actual implementation member function. |
|
106 |
ENTRY( "DeleteCalEntryByGid", Ctcal_delete::DeleteCalEntryByGid ), |
|
107 |
ENTRY( "DeleteUsingGUidAsync", Ctcal_delete::DeleteUsingGUidAsync ), |
|
108 |
ENTRY( "DeleteCalEntryByLuid", Ctcal_delete::DeleteCalEntryByLuid ), |
|
109 |
ENTRY( "DeleteUsingLUidAsync", Ctcal_delete::DeleteUsingLUidAsync ), |
|
110 |
ENTRY( "DeleteCalEntryByTmRg", Ctcal_delete::DeleteCalEntryByTmRg ), |
|
111 |
ENTRY( "DeleteUsingTmRgAsync", Ctcal_delete::DeleteUsingTmRgAsync ), |
|
112 |
ENTRY( "DeleteCalEntryByGidLuidTm", Ctcal_delete::DeleteCalEntryByGidLuidTm ), |
|
113 |
ENTRY( "DeleteUsingGUidLuidTmAsync", Ctcal_delete::DeleteUsingGUidLuidTmAsync ), |
|
114 |
ENTRY( "DeleteCalEntryByInvalidGuidLuid", Ctcal_delete::DeleteCalEntryByInvalidGuidLuid ), |
|
115 |
ENTRY( "DeleteUsingInvalidGUidAsync", Ctcal_delete::DeleteUsingInvalidGUidAsync ), |
|
116 |
ENTRY( "DeleteUsingInvalidLUidAsync", Ctcal_delete::DeleteUsingInvalidLUidAsync ), |
|
117 |
ENTRY( "DeleteCalEntryByDefaultCal", Ctcal_delete::DeleteCalEntryByDefaultCal ), |
|
118 |
||
119 |
||
120 |
//ADD NEW ENTRY HERE |
|
121 |
||
122 |
}; |
|
123 |
||
124 |
const TInt count = sizeof( KFunctions ) / |
|
125 |
sizeof( TStifFunctionInfo ); |
|
126 |
||
127 |
return RunInternalL( KFunctions, count, aItem ); |
|
128 |
||
129 |
} |
|
130 |
||
131 |
_LIT(KTestCal1File ,"C:calfile1"); |
|
132 |
_LIT(KTestCal2File ,"C:calfile2"); |
|
133 |
_LIT(KTestRep ,"invalid"); |
|
134 |
||
135 |
// ----------------------------------------------------------------------------- |
|
136 |
// Ctcal_delete::DeleteCalEntryByGid |
|
137 |
// Method to delete calendar entry by Guid- Sync. |
|
138 |
// (other items were commented in a header). |
|
139 |
// ----------------------------------------------------------------------------- |
|
140 |
// |
|
141 |
TInt Ctcal_delete::DeleteCalEntryByGid( CStifItemParser& /*aItem*/ ) |
|
142 |
{ |
|
143 |
||
144 |
TInt result = KErrNone; |
|
145 |
__UHEAP_MARK; |
|
146 |
CCalDelTestCases *calDelTest = CCalDelTestCases::NewL(result); |
|
147 |
||
148 |
CleanupStack::PushL( calDelTest ); |
|
149 |
||
150 |
result = calDelTest->TestDeleteUsingGUidL(); |
|
151 |
||
152 |
CleanupStack::PopAndDestroy( calDelTest ); |
|
153 |
__UHEAP_MARKEND; |
|
154 |
return result; |
|
155 |
||
156 |
} |
|
157 |
||
158 |
//----------------------------------------------------------------------------- |
|
159 |
// Ctcal_delete::DeleteUsingGUidAsync |
|
160 |
// Method to delete calendar entry by Guid- ASync. |
|
161 |
// (other items were commented in a header). |
|
162 |
// ----------------------------------------------------------------------------- |
|
163 |
// |
|
164 |
TInt Ctcal_delete::DeleteUsingGUidAsync(CStifItemParser & /*aItem*/ ) |
|
165 |
{ |
|
166 |
TInt result = KErrNone; |
|
167 |
__UHEAP_MARK; |
|
168 |
//removeCalendarFileL(); |
|
169 |
||
170 |
CCalDelTestCases *calDelTest = CCalDelTestCases::NewL(result); |
|
171 |
||
172 |
CleanupStack::PushL( calDelTest ); |
|
173 |
||
174 |
calDelTest->TestDeleteUsingGUidAsyncL(); |
|
175 |
||
176 |
CleanupStack::PopAndDestroy( calDelTest ); |
|
177 |
||
178 |
// removeCalendarFileL(); |
|
179 |
__UHEAP_MARKEND; |
|
180 |
return result; |
|
181 |
} |
|
182 |
||
183 |
// ----------------------------------------------------------------------------- |
|
184 |
// Ctcal_delete::DeleteCalEntryByLuid |
|
185 |
// Method to delete calendar entry by Luid- Sync. |
|
186 |
// (other items were commented in a header). |
|
187 |
// ----------------------------------------------------------------------------- |
|
188 |
// |
|
189 |
TInt Ctcal_delete::DeleteCalEntryByLuid( CStifItemParser& /*aItem*/ ) |
|
190 |
{ |
|
191 |
||
192 |
TInt result = KErrNone; |
|
193 |
__UHEAP_MARK; |
|
194 |
CCalDelTestCases *calDelTest = CCalDelTestCases::NewL(result); |
|
195 |
||
196 |
CleanupStack::PushL( calDelTest ); |
|
197 |
||
198 |
result = calDelTest->TestDeleteUsingLocalUidL(); |
|
199 |
||
200 |
CleanupStack::PopAndDestroy( calDelTest ); |
|
201 |
__UHEAP_MARKEND; |
|
202 |
return result; |
|
203 |
||
204 |
} |
|
205 |
||
206 |
//----------------------------------------------------------------------------- |
|
207 |
// Ctcal_delete::DeleteUsingLUidAsync |
|
208 |
// Method to delete calendar entry by Guid- ASync. |
|
209 |
// (other items were commented in a header). |
|
210 |
// ----------------------------------------------------------------------------- |
|
211 |
// |
|
212 |
TInt Ctcal_delete::DeleteUsingLUidAsync(CStifItemParser & /*aItem*/ ) |
|
213 |
{ |
|
214 |
TInt result = KErrNone; |
|
215 |
__UHEAP_MARK; |
|
216 |
//removeCalendarFileL(); |
|
217 |
||
218 |
CCalDelTestCases *calDelTest = CCalDelTestCases::NewL(result); |
|
219 |
||
220 |
CleanupStack::PushL( calDelTest ); |
|
221 |
||
222 |
calDelTest->TestDeleteUsingLocalUidAsyncL(); |
|
223 |
||
224 |
CleanupStack::PopAndDestroy( calDelTest ); |
|
225 |
||
226 |
// removeCalendarFileL(); |
|
227 |
// delete calDelTest; |
|
228 |
||
229 |
__UHEAP_MARKEND; |
|
230 |
return result; |
|
231 |
} |
|
232 |
||
233 |
// ----------------------------------------------------------------------------- |
|
234 |
// Ctcal_delete::DeleteCalEntryByTmRg |
|
235 |
// Method to delete calendar entry by Time range- Sync. |
|
236 |
// (other items were commented in a header). |
|
237 |
// ----------------------------------------------------------------------------- |
|
238 |
// |
|
239 |
TInt Ctcal_delete::DeleteCalEntryByTmRg( CStifItemParser& /*aItem*/ ) |
|
240 |
{ |
|
241 |
||
242 |
TInt result = KErrNone; |
|
243 |
__UHEAP_MARK; |
|
244 |
CCalDelTestCases *calDelTest = CCalDelTestCases::NewL(result); |
|
245 |
||
246 |
CleanupStack::PushL( calDelTest ); |
|
247 |
||
248 |
result = calDelTest->TestDeleteTmRgL(); |
|
249 |
||
250 |
CleanupStack::PopAndDestroy( calDelTest ); |
|
251 |
||
252 |
// delete calDelTest; |
|
253 |
||
254 |
__UHEAP_MARKEND; |
|
255 |
return result; |
|
256 |
||
257 |
} |
|
258 |
||
259 |
//----------------------------------------------------------------------------- |
|
260 |
// Ctcal_delete::DeleteUsingTmRgAsync |
|
261 |
// Method to delete calendar entry by Time range- AsSync. |
|
262 |
// (other items were commented in a header). |
|
263 |
// ----------------------------------------------------------------------------- |
|
264 |
// |
|
265 |
TInt Ctcal_delete::DeleteUsingTmRgAsync(CStifItemParser & /*aItem*/ ) |
|
266 |
{ |
|
267 |
TInt result = KErrNone; |
|
268 |
__UHEAP_MARK; |
|
269 |
//removeCalendarFileL(); |
|
270 |
||
271 |
CCalDelTestCases *calDelTest = CCalDelTestCases::NewL(result); |
|
272 |
||
273 |
CleanupStack::PushL( calDelTest ); |
|
274 |
||
275 |
calDelTest->TestDeleteTmRgAsyncL(); |
|
276 |
||
277 |
CleanupStack::PopAndDestroy( calDelTest ); |
|
278 |
||
279 |
// removeCalendarFileL(); |
|
280 |
// delete calDelTest; |
|
281 |
||
282 |
__UHEAP_MARKEND; |
|
283 |
return result; |
|
284 |
} |
|
285 |
||
286 |
// ----------------------------------------------------------------------------- |
|
287 |
// Ctcal_delete::DeleteCalEntryByGidLuidTm |
|
288 |
// Method to delete calendar entry by Guid+Luid+Tm- Sync. |
|
289 |
// (other items were commented in a header). |
|
290 |
// ----------------------------------------------------------------------------- |
|
291 |
// |
|
292 |
TInt Ctcal_delete::DeleteCalEntryByGidLuidTm( CStifItemParser& /*aItem*/ ) |
|
293 |
{ |
|
294 |
||
295 |
TInt result = KErrNone; |
|
296 |
__UHEAP_MARK; |
|
297 |
CCalDelTestCases *calDelTest = CCalDelTestCases::NewL(result); |
|
298 |
||
299 |
CleanupStack::PushL( calDelTest ); |
|
300 |
||
301 |
result = calDelTest->TestDeleteGuidTmRgLocalUidL(); |
|
302 |
||
303 |
CleanupStack::PopAndDestroy( calDelTest ); |
|
304 |
// delete calDelTest; |
|
305 |
||
306 |
__UHEAP_MARKEND; |
|
307 |
return result; |
|
308 |
||
309 |
} |
|
310 |
||
311 |
//----------------------------------------------------------------------------- |
|
312 |
// Ctcal_delete::DeleteUsingGUidLuidTmAsync |
|
313 |
// Method to delete calendar entry by Guid+Luid+Tm- ASync. |
|
314 |
// (other items were commented in a header). |
|
315 |
// ----------------------------------------------------------------------------- |
|
316 |
// |
|
317 |
TInt Ctcal_delete::DeleteUsingGUidLuidTmAsync(CStifItemParser & /*aItem*/ ) |
|
318 |
{ |
|
319 |
TInt result = KErrNone; |
|
320 |
__UHEAP_MARK; |
|
321 |
//removeCalendarFileL(); |
|
322 |
||
323 |
CCalDelTestCases *calDelTest = CCalDelTestCases::NewL(result); |
|
324 |
||
325 |
CleanupStack::PushL( calDelTest ); |
|
326 |
||
327 |
calDelTest->TestDeleteGuidTmRgLocalUidAsyncL(); |
|
328 |
||
329 |
CleanupStack::PopAndDestroy( calDelTest ); |
|
330 |
||
331 |
// removeCalendarFileL(); |
|
332 |
// delete calDelTest; |
|
333 |
||
334 |
||
335 |
__UHEAP_MARKEND; |
|
336 |
return result; |
|
337 |
} |
|
338 |
||
339 |
||
340 |
// ----------------------------------------------------------------------------- |
|
341 |
// Ctcal_delete::DeleteCalEntryByInvalidGuidLuid |
|
342 |
// Method to delete calendar entry by Invalid guid+Luid- Sync. |
|
343 |
// (other items were commented in a header). |
|
344 |
// ----------------------------------------------------------------------------- |
|
345 |
// |
|
346 |
TInt Ctcal_delete::DeleteCalEntryByInvalidGuidLuid( CStifItemParser& /*aItem*/ ) |
|
347 |
{ |
|
348 |
||
349 |
TInt result = KErrNone; |
|
350 |
__UHEAP_MARK; |
|
351 |
CCalDelTestCases *calDelTest = CCalDelTestCases::NewL(result); |
|
352 |
||
353 |
// CleanupStack::PushL( calDelTest ); |
|
354 |
||
355 |
result = calDelTest->TestDeleteInvalidGUidLuidL(); |
|
356 |
||
357 |
// CleanupStack::PopAndDestroy( calDelTest ); |
|
358 |
||
359 |
delete calDelTest; |
|
360 |
||
361 |
__UHEAP_MARKEND; |
|
362 |
return result; |
|
363 |
||
364 |
} |
|
365 |
||
366 |
//----------------------------------------------------------------------------- |
|
367 |
// Ctcal_delete::DeleteUsingInvalidGUidAsync |
|
368 |
// Method to delete calendar entry by invalid Guid- ASync. |
|
369 |
// (other items were commented in a header). |
|
370 |
// ----------------------------------------------------------------------------- |
|
371 |
// |
|
372 |
TInt Ctcal_delete::DeleteUsingInvalidGUidAsync(CStifItemParser & /*aItem*/ ) |
|
373 |
{ |
|
374 |
TInt result = KErrNone; |
|
375 |
__UHEAP_MARK; |
|
376 |
//removeCalendarFileL(); |
|
377 |
||
378 |
CCalDelTestCases *calDelTest = CCalDelTestCases::NewL(result); |
|
379 |
||
380 |
// CleanupStack::PushL( calDelTest ); |
|
381 |
||
382 |
calDelTest->TestDeleteInvalidGUidAsyncL(); |
|
383 |
||
384 |
if(result == -1) |
|
385 |
result = KErrNone; |
|
386 |
||
387 |
// CleanupStack::PopAndDestroy( calDelTest ); |
|
388 |
||
389 |
// removeCalendarFileL(); |
|
390 |
||
391 |
delete calDelTest; |
|
392 |
__UHEAP_MARKEND; |
|
393 |
return result; |
|
394 |
} |
|
395 |
||
396 |
//----------------------------------------------------------------------------- |
|
397 |
// Ctcal_delete::DeleteUsingInvalidLUidAsync |
|
398 |
// Method to delete calendar entry by invalid Guid- ASync. |
|
399 |
// (other items were commented in a header). |
|
400 |
// ----------------------------------------------------------------------------- |
|
401 |
// |
|
402 |
TInt Ctcal_delete::DeleteUsingInvalidLUidAsync(CStifItemParser & /*aItem*/ ) |
|
403 |
{ |
|
404 |
TInt result = KErrNone; |
|
405 |
__UHEAP_MARK; |
|
406 |
//removeCalendarFileL(); |
|
407 |
||
408 |
CCalDelTestCases *calDelTest = CCalDelTestCases::NewL(result); |
|
409 |
||
410 |
// CleanupStack::PushL( calDelTest ); |
|
411 |
||
412 |
calDelTest->TestDeleteInvalidLUidAsyncL(); |
|
413 |
||
414 |
//CleanupStack::PopAndDestroy( calDelTest ); |
|
415 |
||
416 |
// removeCalendarFileL(); |
|
417 |
||
418 |
delete calDelTest; |
|
419 |
||
420 |
__UHEAP_MARKEND; |
|
421 |
return result; |
|
422 |
} |
|
423 |
// ----------------------------------------------------------------------------- |
|
424 |
// Ctcal_delete::DeleteCalEntryByDefaultCal |
|
425 |
// Method to delete calendar entry in default calendar- Sync. |
|
426 |
// (other items were commented in a header). |
|
427 |
// ----------------------------------------------------------------------------- |
|
428 |
// |
|
429 |
TInt Ctcal_delete::DeleteCalEntryByDefaultCal( CStifItemParser& /*aItem*/ ) |
|
430 |
{ |
|
431 |
||
432 |
TInt result = KErrNone; |
|
433 |
__UHEAP_MARK; |
|
434 |
CCalDelTestCases *calDelTest = CCalDelTestCases::NewL(result); |
|
435 |
||
436 |
CleanupStack::PushL( calDelTest ); |
|
437 |
||
438 |
result = calDelTest->TestDeleteByDefCalL(); |
|
439 |
||
440 |
CleanupStack::PopAndDestroy( calDelTest ); |
|
441 |
__UHEAP_MARKEND; |
|
442 |
return result; |
|
443 |
||
444 |
} |
|
445 |
||
446 |
||
447 |
||
448 |
||
449 |
// ----------------------------------------------------------------------------- |
|
450 |
// Ctcal_delete::?member_function |
|
451 |
// ?implementation_description |
|
452 |
// (other items were commented in a header). |
|
453 |
// ----------------------------------------------------------------------------- |
|
454 |
// |
|
455 |
/* |
|
456 |
TInt Ctcal_delete::?member_function( |
|
457 |
CItemParser& aItem ) |
|
458 |
{ |
|
459 |
||
460 |
?code |
|
461 |
||
462 |
} |
|
463 |
*/ |
|
464 |
||
465 |
// ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
466 |
// None |
|
467 |
||
468 |
// End of File |