1 // Copyright (c) 2007-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 the License "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 // Run RFs::CheckDisk |
|
15 // |
|
16 // |
|
17 |
|
18 #include "sdcheckdisk.h" |
|
19 |
|
20 /* |
|
21 Class constructor |
|
22 |
|
23 @param None |
|
24 @return None |
|
25 */ |
|
26 CBaseTestSDCheckDisk::CBaseTestSDCheckDisk() |
|
27 { |
|
28 SetTestStepName(KTestStepCheckDisk); |
|
29 } |
|
30 |
|
31 /* |
|
32 Test Step Preamble |
|
33 - Initialise attribute iDrive |
|
34 - Connect to the File Server |
|
35 |
|
36 @param None |
|
37 @return EPass if successful or EFail if not |
|
38 @see TVerdict |
|
39 */ |
|
40 TVerdict CBaseTestSDCheckDisk::doTestStepPreambleL() |
|
41 { |
|
42 SetTestStepResult(EFail); |
|
43 |
|
44 if (!InitDriveLetter()) |
|
45 return TestStepResult(); |
|
46 if (!InitFileServer()) |
|
47 return TestStepResult(); |
|
48 |
|
49 SetTestStepResult(EPass); |
|
50 return TestStepResult(); |
|
51 } |
|
52 |
|
53 /* |
|
54 Test step |
|
55 |
|
56 @param None |
|
57 @return EPass if successful or EFail if not |
|
58 @see TVerdict |
|
59 */ |
|
60 TVerdict CBaseTestSDCheckDisk::doTestStepL() |
|
61 { |
|
62 if (TestStepResult() == EPass) |
|
63 { |
|
64 TInt r; |
|
65 TBuf<3> driveToTest; |
|
66 driveToTest.Format(_L("%c:\\"), 'A' + iDrive); |
|
67 r = iFs.CheckDisk(driveToTest); |
|
68 if (r != KErrNone) |
|
69 { |
|
70 ERR_PRINTF2(_L("RFs::CheckDisk returned: %d"), r); |
|
71 SetTestStepResult(EFail); |
|
72 return TestStepResult(); |
|
73 } |
|
74 INFO_PRINTF1(_L("RFs::CheckDisk returned no error")); |
|
75 } |
|
76 else |
|
77 { |
|
78 INFO_PRINTF1(_L("Test preamble did not complete succesfully - Test Step skipped")); |
|
79 } |
|
80 return TestStepResult(); |
|
81 } |
|