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 // Perform a second set of file operations as per the Test Specification |
|
15 // |
|
16 // |
|
17 |
|
18 #include "sdfileoperations2.h" |
|
19 |
|
20 /* |
|
21 Class constructor |
|
22 |
|
23 @param None |
|
24 @return None |
|
25 */ |
|
26 CBaseTestSDFileOperations2::CBaseTestSDFileOperations2() |
|
27 { |
|
28 SetTestStepName(KTestStepFileOperations2); |
|
29 } |
|
30 |
|
31 /* |
|
32 Test step |
|
33 |
|
34 @param None |
|
35 @return EPass if successful or EFail if not |
|
36 @see TVerdict |
|
37 */ |
|
38 TVerdict CBaseTestSDFileOperations2::doTestStepL() |
|
39 { |
|
40 if (TestStepResult() == EPass) |
|
41 { |
|
42 TInt r; |
|
43 TBuf<4> sessionPath; |
|
44 sessionPath.Format(_L("%c:\\"), 'A' + iDrive); |
|
45 r = iFs.SetSessionPath(sessionPath); |
|
46 if (r != KErrNone) |
|
47 { |
|
48 ERR_PRINTF3(_L("Could not set session path to %c: (r = %d)"), 'A' + iDrive, r); |
|
49 SetTestStepResult(EFail); |
|
50 return TestStepResult(); |
|
51 } |
|
52 if (SetVolumeName() != iExpectedErrorCode) |
|
53 { |
|
54 SetTestStepResult(EFail); |
|
55 return TestStepResult(); |
|
56 } |
|
57 TBuf<50> subdir; |
|
58 subdir.Format(_L("\\dir%03d\\"), iRootEntries / 2 - 1); |
|
59 if (DeleteSubDirEntries(subdir) != iExpectedErrorCode) |
|
60 { |
|
61 SetTestStepResult(EFail); |
|
62 return TestStepResult(); |
|
63 } |
|
64 subdir.Format(_L("\\dir%03d\\"), iRootEntries / 2 - 2); |
|
65 if (CreateSubDirEntries(subdir) != iExpectedErrorCode) |
|
66 { |
|
67 SetTestStepResult(EFail); |
|
68 return TestStepResult(); |
|
69 } |
|
70 if (MoveFile(_L("LONG FILE NAME"), _L("C:\\")) != iExpectedErrorCode) |
|
71 { |
|
72 SetTestStepResult(EFail); |
|
73 return TestStepResult(); |
|
74 } |
|
75 if (CopyFile(_L("C:\\file002"), _L("BACK")) != iExpectedErrorCode) |
|
76 { |
|
77 SetTestStepResult(EFail); |
|
78 return TestStepResult(); |
|
79 } |
|
80 } |
|
81 else |
|
82 { |
|
83 INFO_PRINTF1(_L("Test preamble did not complete succesfully - Test Step skipped")); |
|
84 } |
|
85 return TestStepResult(); |
|
86 } |
|