1 // Copyright (c) 2006-2010 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 // EventLogger - deleting EventLogger test files from C: |
|
15 // Please, ensure that t_logenvdestroy test is executed after the EventLogger component tests |
|
16 // |
|
17 // |
|
18 |
|
19 #include <e32test.h> |
|
20 #include <bautils.h> |
|
21 #include "t_logutil.h" |
|
22 |
|
23 RTest TheTest(_L("t_logenvdestroy - deleting EventLogger test files from C:")); |
|
24 |
|
25 _LIT(KCFileName1, "c:\\private\\10003a73\\CntModel.ini"); |
|
26 _LIT(KCFileName2, "c:\\private\\10003a73\\SQLite__Contacts.cdb"); |
|
27 |
|
28 /////////////////////////////////////////////////////////////////////////////////////// |
|
29 |
|
30 void DoDeleteFile(RFs& aFs, const TDesC& aFilePath) |
|
31 { |
|
32 TInt err = BaflUtils::DeleteFile(aFs, aFilePath); |
|
33 if(err != KErrNone && err != KErrNotFound) |
|
34 { |
|
35 TheTest.Printf(_L("Error %d deleting \"%S\" file.\n"), err, &aFilePath); |
|
36 } |
|
37 } |
|
38 |
|
39 void DoRun() |
|
40 { |
|
41 RFs fs; |
|
42 TInt err = fs.Connect(); |
|
43 TEST2(err, KErrNone); |
|
44 |
|
45 TheTest.Start(_L(" @SYMTestCaseID: PDS-LOGENG-CT-4049 Deleting EventLogger test files from C:")); |
|
46 |
|
47 DoDeleteFile(fs, KCFileName1); |
|
48 DoDeleteFile(fs, KCFileName2); |
|
49 |
|
50 fs.Close(); |
|
51 } |
|
52 |
|
53 TInt E32Main() |
|
54 { |
|
55 TheTest.Title(); |
|
56 |
|
57 CTrapCleanup* tc = CTrapCleanup::New(); |
|
58 |
|
59 __UHEAP_MARK; |
|
60 |
|
61 DoRun(); |
|
62 |
|
63 __UHEAP_MARKEND; |
|
64 |
|
65 TheTest.End(); |
|
66 TheTest.Close(); |
|
67 |
|
68 delete tc; |
|
69 |
|
70 User::Heap().Check(); |
|
71 return KErrNone; |
|
72 } |
|