|
1 // Copyright (c) 2006-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "TestCalIndexFileDeleteDbStep.h" |
|
17 #include <fbs.h> |
|
18 #include <e32math.h> |
|
19 #include <calcategory.h> |
|
20 #include <caldataexchange.h> |
|
21 #include <caldataformat.h> |
|
22 #include <calsession.h> |
|
23 #include <s32file.h> |
|
24 #include "caltestlib.h" |
|
25 |
|
26 |
|
27 CTestCalIndexFileDeleteDbStep::~CTestCalIndexFileDeleteDbStep() |
|
28 /** |
|
29 * Destructor |
|
30 */ |
|
31 { |
|
32 } |
|
33 |
|
34 CTestCalIndexFileDeleteDbStep::CTestCalIndexFileDeleteDbStep() |
|
35 /** |
|
36 * Constructor |
|
37 */ |
|
38 { |
|
39 SetTestStepName(KTestCalIndexFileDeleteDbStep); |
|
40 } |
|
41 |
|
42 TVerdict CTestCalIndexFileDeleteDbStep::doTestStepPostambleL() |
|
43 { |
|
44 return TestStepResult(); |
|
45 } |
|
46 |
|
47 TVerdict CTestCalIndexFileDeleteDbStep::doTestStepL() |
|
48 { |
|
49 // this method assumes a pass. Checks that fail will stop |
|
50 // the test step |
|
51 |
|
52 SetUpCalDirL(); |
|
53 |
|
54 AddCalendarFileL(); |
|
55 AddIndexFileL(); |
|
56 |
|
57 DeleteDbL(); |
|
58 |
|
59 if (CheckCalendarFilePresentL() || CheckIndexFilePresentL()) |
|
60 { |
|
61 SetTestStepResult(EFail); |
|
62 return EFail; |
|
63 } |
|
64 |
|
65 return EPass; |
|
66 } |
|
67 |
|
68 |
|
69 void CTestCalIndexFileDeleteDbStep::DeleteDbL() |
|
70 { |
|
71 TFileName calName; |
|
72 MakeCalendarFileName(calName); |
|
73 iSession = CCalSession::NewL(); |
|
74 |
|
75 iSession->DeleteCalFileL(calName); |
|
76 |
|
77 delete iSession; |
|
78 iSession = NULL; |
|
79 } |
|
80 |