|
1 // Copyright (c) 2002-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 // EPOC includes |
|
17 #include <e32base.h> |
|
18 |
|
19 // Test system includes |
|
20 #include <testframework.h> |
|
21 #include "TSU_MmTsthStep13.h" |
|
22 #include "TSU_MmTsthSuite13.h" |
|
23 |
|
24 // preamble |
|
25 TVerdict RTSUMmTsthStep13::OpenL() |
|
26 { |
|
27 // initialise iTestUtils for tests. if this fails, tests are |
|
28 // inconclusive (will not run) |
|
29 CLog* theLog = iSuite->LogSystem(); // use the current log |
|
30 CTestUtils* theTestUtils = NULL; |
|
31 TRAPD(err, theTestUtils = CTestUtils::NewL(theLog)); |
|
32 if(err != KErrNone) |
|
33 { |
|
34 ERR_PRINTF2(_L("CTestUtils::NewL() failed in preamble, error code %d"), err); |
|
35 return iTestStepResult = EInconclusive; |
|
36 } |
|
37 iTestUtils = theTestUtils; |
|
38 return iTestStepResult = EPass; |
|
39 } |
|
40 |
|
41 // postamble |
|
42 void RTSUMmTsthStep13::Close() |
|
43 { |
|
44 delete iTestUtils; |
|
45 } |
|
46 |
|
47 // Cleanup file system after tests. |
|
48 // NB - any file locks or read-only flags MUST be cleared |
|
49 // by the test itself before calling this method. |
|
50 // We do not intend to check return codes from this function, as |
|
51 // not all the files/directories we intend to remove will |
|
52 // necessarily exist. |
|
53 void RTSUMmTsthStep13::CleanupFileSystem() |
|
54 { |
|
55 RFs theFs; |
|
56 CFileMan* theFm = NULL; |
|
57 theFs.Connect(); |
|
58 TRAPD(err, theFm = CFileMan::NewL(theFs)); |
|
59 if(err != KErrNone) |
|
60 { |
|
61 ERR_PRINTF2(_L("Cannot create CFileMan, error code %d"), err); |
|
62 theFs.Close(); |
|
63 } |
|
64 |
|
65 theFm->RmDir(_L("c:\\TFData1\\")); |
|
66 theFm->RmDir(_L("c:\\TFData2\\")); |
|
67 theFs.Close(); |
|
68 delete theFm; |
|
69 } |