author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 31 Aug 2010 16:34:26 +0300 | |
branch | RCL_3 |
changeset 43 | c1f20ce4abcf |
parent 42 | a179b74831c9 |
child 44 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1996-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 |
// |
|
15 |
||
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
16 |
#define __E32TEST_EXTENSION__ |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
17 |
|
0 | 18 |
#include <f32file.h> |
19 |
#include <e32test.h> |
|
20 |
#include <hal.h> |
|
21 |
#include "t_server.h" |
|
22 |
#include "t_chlffs.h" |
|
23 |
||
24 |
GLDEF_D RTest test(_L("T_FMAN")); |
|
25 |
||
26 |
LOCAL_D CFileMan* gFileMan=NULL; |
|
27 |
LOCAL_D TBool gAsynch=EFalse; |
|
28 |
LOCAL_D TRequestStatus gStat; |
|
29 |
LOCAL_D TBool testingInvalidPathLengths; |
|
30 |
||
31 |
class CFileManObserver : public CBase, public MFileManObserver |
|
32 |
{ |
|
33 |
public: |
|
34 |
CFileManObserver(CFileMan* aFileMan); |
|
35 |
TControl NotifyFileManEnded(); |
|
36 |
private: |
|
37 |
CFileMan* iFileMan; |
|
38 |
}; |
|
39 |
||
40 |
LOCAL_D CFileManObserver* gObserver; |
|
41 |
||
42 |
CFileManObserver::CFileManObserver(CFileMan* aFileMan) |
|
43 |
// |
|
44 |
// Constructor |
|
45 |
// |
|
46 |
{ |
|
47 |
__DECLARE_NAME(_S("CFileManObserver")); |
|
48 |
iFileMan=aFileMan; |
|
49 |
} |
|
50 |
||
51 |
MFileManObserver::TControl CFileManObserver::NotifyFileManEnded() |
|
52 |
// |
|
53 |
// Called back after each FMan tick |
|
54 |
// |
|
55 |
{ |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
56 |
(void) MFileManObserver::NotifyFileManEnded(); |
0 | 57 |
TInt lastError=iFileMan->GetLastError(); |
58 |
if (lastError!=KErrNone && lastError!=KErrBadName) |
|
59 |
{ |
|
60 |
TFileName fileName=iFileMan->CurrentEntry().iName; |
|
61 |
if (gAsynch==EFalse) |
|
62 |
test.Printf(_L("CurrentEntry is %S\n"),&fileName); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
63 |
test_Equal(KErrAlreadyExists, lastError); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
64 |
test_Value(KErrNotFound, fileName.MatchF(_L("PIPE1.PLP"))!=KErrNotFound || fileName.MatchF(_L("FOUR"))!=KErrNotFound || fileName.MatchF(_L("File*.TXT"))!=KErrNotFound || fileName.MatchF(_L("ah"))!=KErrNotFound || fileName.MatchF(_L("a"))!=KErrNotFound); |
0 | 65 |
} |
66 |
return(MFileManObserver::EContinue); |
|
67 |
} |
|
68 |
||
69 |
LOCAL_C void WaitForSuccess() |
|
70 |
// |
|
71 |
// Wait for gStat to complete with KErrNone |
|
72 |
// |
|
73 |
{ |
|
74 |
User::WaitForRequest(gStat); |
|
75 |
test(gStat==KErrNone); |
|
76 |
} |
|
77 |
||
78 |
LOCAL_C void WaitForResult(TInt aResult) |
|
79 |
// |
|
80 |
// Wait for gStat to complete with aResult |
|
81 |
// |
|
82 |
{ |
|
83 |
User::WaitForRequest(gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
84 |
test_Value(aResult, gStat==aResult); |
0 | 85 |
} |
86 |
||
87 |
LOCAL_C void TestResult(TInt aReturnVal, TInt aExpectedAsynchReturnStatus=KErrNone, TInt aExpectedSynchReturn=KErrNone) |
|
88 |
// |
|
89 |
// Test the result, wait for an asynchronous call |
|
90 |
// |
|
91 |
{ |
|
92 |
if (!gAsynch) |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
93 |
{ |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
94 |
test_Equal(aExpectedAsynchReturnStatus, aReturnVal); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
95 |
} |
0 | 96 |
else |
97 |
{ |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
98 |
test_Equal(aExpectedSynchReturn, aReturnVal); |
0 | 99 |
WaitForResult(aExpectedAsynchReturnStatus); |
100 |
} |
|
101 |
} |
|
102 |
||
103 |
LOCAL_C void RmDir(const TDesC& aDirName) |
|
104 |
// |
|
105 |
// Remove a directory |
|
106 |
// |
|
107 |
{ |
|
108 |
gFileMan->Attribs(aDirName, 0, KEntryAttReadOnly, 0, CFileMan::ERecurse); |
|
109 |
TInt r=gFileMan->RmDir(aDirName); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
110 |
test_Value(r, r==KErrNone || r==KErrNotFound || r==KErrPathNotFound); |
0 | 111 |
} |
112 |
||
113 |
LOCAL_C void Compare(const TDesC& aDir1,const TDesC& aDir2) |
|
114 |
// |
|
115 |
// Test that the contents of two directories are identical |
|
116 |
// |
|
117 |
{ |
|
118 |
CDirScan* scanDir1=CDirScan::NewL(TheFs); |
|
119 |
scanDir1->SetScanDataL(aDir1,KEntryAttMaskSupported,ESortByName); |
|
120 |
CDirScan* scanDir2=CDirScan::NewL(TheFs); |
|
121 |
scanDir2->SetScanDataL(aDir2,KEntryAttMaskSupported,ESortByName); |
|
122 |
||
123 |
FOREVER |
|
124 |
{ |
|
125 |
CDir* entryList1; |
|
126 |
CDir* entryList2; |
|
127 |
||
128 |
scanDir1->NextL(entryList1); |
|
129 |
scanDir2->NextL(entryList2); |
|
130 |
||
131 |
if (entryList1==NULL || entryList2==NULL) |
|
132 |
{ |
|
133 |
test(entryList1==NULL && entryList2==NULL); |
|
134 |
break; |
|
135 |
} |
|
136 |
||
137 |
TFileName abbPath1=scanDir1->AbbreviatedPath(); |
|
138 |
TFileName abbPath2=scanDir2->AbbreviatedPath(); |
|
139 |
test(abbPath1==abbPath2); |
|
140 |
||
141 |
TInt count1=entryList1->Count(); |
|
142 |
TInt count2=entryList2->Count(); |
|
143 |
test(count1==count2); |
|
144 |
||
145 |
while(count1--) |
|
146 |
{ |
|
147 |
TEntry entry1=(*entryList1)[count1]; |
|
148 |
TEntry entry2=(*entryList2)[count1]; |
|
149 |
test(entry1.iName==entry2.iName); |
|
150 |
test(entry1.iAtt==entry2.iAtt); |
|
151 |
} |
|
152 |
||
153 |
delete entryList1; |
|
154 |
delete entryList2; |
|
155 |
} |
|
156 |
||
157 |
delete scanDir1; |
|
158 |
delete scanDir2; |
|
159 |
} |
|
160 |
||
161 |
LOCAL_C void SetupDirectories(TBool aCreateFiles, TFileName* aDestOtherDrive) |
|
162 |
// |
|
163 |
// Set up a directory structure and files to test copying/moving across drives |
|
164 |
// |
|
165 |
{ |
|
166 |
TInt err = KErrNone; |
|
167 |
||
168 |
TFileName sourceName = _L("\\F32-TST\\TFMAN\\source\\"); |
|
169 |
TFileName sourceNameSubDir = _L("\\F32-TST\\TFMAN\\source\\subdir\\"); |
|
170 |
TFileName sourceCompare = _L("\\F32-TST\\TFMAN\\compare\\"); |
|
171 |
TFileName sourceCompareSubDir = _L("\\F32-TST\\TFMAN\\compare\\subdir\\"); |
|
172 |
TFileName destSameDrive = _L("\\F32-TST\\TFMAN\\dest\\"); // Target destination on the same drive |
|
173 |
||
174 |
if(aDestOtherDrive) |
|
175 |
{ |
|
176 |
#if !defined(__WINS__) |
|
177 |
*aDestOtherDrive = gSessionPath[0] == 'C' ? _L("D:\\F32-TST\\TFMAN\\dest\\") : _L("C:\\F32-TST\\TFMAN\\dest\\"); |
|
178 |
#else |
|
179 |
*aDestOtherDrive = gSessionPath[0] == 'C' ? _L("Y:\\F32-TST\\TFMAN\\dest\\") : _L("C:\\F32-TST\\TFMAN\\dest\\"); |
|
180 |
#endif |
|
181 |
err = TheFs.MkDirAll(*aDestOtherDrive); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
182 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists); |
0 | 183 |
} |
184 |
||
185 |
err = TheFs.MkDirAll(sourceName); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
186 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists); |
0 | 187 |
|
188 |
err = TheFs.MkDirAll(sourceCompare); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
189 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists); |
0 | 190 |
|
191 |
err = TheFs.MkDirAll(destSameDrive); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
192 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists); |
0 | 193 |
|
194 |
if(aCreateFiles) |
|
195 |
{ |
|
196 |
err = TheFs.MkDirAll(sourceNameSubDir); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
197 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists); |
0 | 198 |
|
199 |
err = TheFs.MkDirAll(sourceCompareSubDir); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
200 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists); |
0 | 201 |
|
202 |
for(TInt i=0; i<5; i++) |
|
203 |
{ |
|
204 |
// Create a test file to be copied |
|
205 |
TFileName name = sourceName; |
|
206 |
name.Append(_L("File")); |
|
207 |
name.AppendNum(i); |
|
208 |
name.Append(_L(".TXT")); |
|
209 |
||
210 |
RFile file; |
|
211 |
err = file.Create(TheFs,name,EFileRead|EFileWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
212 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists); |
0 | 213 |
file.Close(); |
214 |
||
215 |
// ...and another to compare against |
|
216 |
name = sourceCompare; |
|
217 |
name.Append(_L("File")); |
|
218 |
name.AppendNum(i); |
|
219 |
name.Append(_L(".TXT")); |
|
220 |
||
221 |
err = file.Create(TheFs,name,EFileRead|EFileWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
222 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists); |
0 | 223 |
file.Close(); |
224 |
} |
|
225 |
} |
|
226 |
} |
|
227 |
||
228 |
TBool CheckIfShortPathsAreSupported() |
|
229 |
{ |
|
230 |
TBool ret = EFalse; |
|
231 |
TBuf<1+8+3+1+4> buf; |
|
232 |
_LIT(KTestFile, "\\longname1\\file"); |
|
233 |
RmDir(_L("\\longname1\\")); |
|
234 |
MakeFile(KTestFile); |
|
235 |
TInt err = TheFs.GetShortName(_L("\\longname1\\"), buf); |
|
236 |
if(err == KErrNone) |
|
237 |
{ |
|
238 |
buf.Insert(0, _L("\\")); |
|
239 |
buf.Append(_L("\\file")); |
|
240 |
err = TheFs.Delete(buf); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
241 |
test_KErrNone(err); |
0 | 242 |
ret = ETrue; |
243 |
} |
|
244 |
RmDir(_L("\\longname1\\")); |
|
245 |
return ret; |
|
246 |
} |
|
247 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
248 |
LOCAL_C void TestDelete() |
0 | 249 |
// |
250 |
// Test files are deleted |
|
251 |
// |
|
252 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
253 |
test.Next(_L("Test delete - Set up files and start deleting")); |
0 | 254 |
|
255 |
MakeDir(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\EMPTY\\")); |
|
256 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT")); |
|
257 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE2.TXT")); |
|
258 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE3.TXT")); |
|
259 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\FILE4.TXT")); |
|
260 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\EXE1.BIN")); |
|
261 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\EXE2.BIN")); |
|
262 |
||
263 |
TInt r; |
|
264 |
// absolute path for code warrior two more than wins (\epoc32\winscw\c vs \epoc32\wins\c) |
|
265 |
#if defined(__WINSCW__) |
|
266 |
_LIT(KLongName1,"\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffd"); |
|
267 |
#else |
|
268 |
_LIT(KLongName1,"\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa"); |
|
269 |
#endif |
|
270 |
||
271 |
_LIT(KInvalidLongName,"\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdffdsa23asdffdsa24asdffdsa25asdffdsa"); |
|
272 |
_LIT(KInvalidLongPath, "\\F32-TST\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\0495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\middle.gif"); |
|
273 |
if (testingInvalidPathLengths) |
|
274 |
// Create a path of greater 256 characters by renaming a directory and check it can be |
|
275 |
// manipulated (tests fix to F32) |
|
276 |
{ |
|
277 |
// One long directory name - makes paths invalid |
|
278 |
MakeDir(_L("\\TEST\\LONG\\NAME\\ABCDE")); |
|
279 |
MakeDir(_L("\\TEST\\LONG\\NAME\\ABCDE\\DIRECTORY1DIRECTORY2DIRECTORY3DIRECTORY4\\")); |
|
280 |
MakeFile(_L("\\TEST\\LONG\\NAME\\ABCDE\\ELEPHANT01ELEPHANT02ELEPHANT03ELEPHANT04")); |
|
281 |
MakeFile(_L("\\TEST\\LONG\\NAME\\ABCDE\\FILEFILE01FILEFILE02FILEFILE03FILEFILE04")); |
|
282 |
TFileName name1(KLongName1); |
|
283 |
r=gFileMan->Rename(_L("\\TEST\\LONG"),name1,CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
284 |
test_KErrNone(r); |
0 | 285 |
// Two long directory names - makes paths invalid |
286 |
MakeDir(_L("\\TEST\\LONG\\NAME\\FGHIJ")); |
|
287 |
MakeDir(_L("\\TEST\\LONG\\NAME\\FGHIJ\\DIRECTORY1DIRECTORY2DIRECTORY3DIRECTORY4\\")); |
|
288 |
MakeFile(_L("\\TEST\\LONG\\NAME\\FGHIJ\\ELEPHANT01ELEPHANT02ELEPHANT03ELEPHANT04")); |
|
289 |
MakeFile(_L("\\TEST\\LONG\\NAME\\FGHIJ\\FILEFILE01FILEFILE02FILEFILE03FILEFILE04")); |
|
290 |
||
291 |
// Testing invalid long file name (i.e. >256) |
|
292 |
r=gFileMan->Rename(_L("\\TEST\\LONG"),KInvalidLongName,CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
293 |
test_Equal(KErrBadName, r); |
0 | 294 |
|
295 |
// Testing invalid long path (i.e. >256) |
|
296 |
r=gFileMan->Rename(_L("\\TEST\\LONG"),KInvalidLongPath,CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
297 |
test_Equal(KErrBadName, r); |
0 | 298 |
|
299 |
r=gFileMan->Rename(_L("\\TEST\\LONG"),_L("\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as\\fdsa21asdffds"),CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
300 |
test_KErrNone(r); |
0 | 301 |
} |
302 |
||
303 |
//testing invalid source path at the beginning: |
|
304 |
if (!gAsynch) |
|
305 |
{ |
|
306 |
r=gFileMan->Delete(_L(":C\\F32-TST\\TFMAN\\DELDIR\\*.TXT")); |
|
307 |
} |
|
308 |
else |
|
309 |
{ |
|
310 |
r=gFileMan->Delete(_L(":C\\F32-TST\\TFMAN\\DELDIR\\*.TXT"),0,gStat); |
|
311 |
} |
|
312 |
TestResult(r,KErrBadName,KErrBadName); |
|
313 |
||
314 |
//testing invalid source path at the middle: |
|
315 |
if (!gAsynch) |
|
316 |
{ |
|
317 |
r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\:DELDIR\\*.TXT")); |
|
318 |
} |
|
319 |
else |
|
320 |
{ |
|
321 |
r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\:DELDIR\\*.TXT"),0,gStat); |
|
322 |
} |
|
323 |
TestResult(r,KErrBadName,KErrNone); |
|
324 |
||
325 |
//testing invalid source path at the end: |
|
326 |
if (!gAsynch) |
|
327 |
{ |
|
328 |
r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\DELDIR\\:*.TXT")); |
|
329 |
} |
|
330 |
else |
|
331 |
{ |
|
332 |
r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\DELDIR\\:*.TXT"),0,gStat); |
|
333 |
} |
|
334 |
TestResult(r,KErrBadName,KErrNone); |
|
335 |
||
336 |
if (!gAsynch) |
|
337 |
{ |
|
338 |
r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\DELDIR\\*.TXT")); |
|
339 |
TestResult(r); |
|
340 |
if (testingInvalidPathLengths) |
|
341 |
{ |
|
342 |
TFileName name1(KLongName1); |
|
343 |
name1+=_L("\\NAME\\ABCDE\\*.*"); |
|
344 |
r=gFileMan->Delete(name1); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
345 |
test_KErrNone(r); |
0 | 346 |
|
347 |
r=gFileMan->Delete(_L("\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as\\fdsa21asdffds\\NAME\\FGHIJ\\*.*")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
348 |
test_KErrNone(r); |
0 | 349 |
} |
350 |
} |
|
351 |
else |
|
352 |
{ |
|
353 |
gFileMan->Delete(_L("\\F32-TST\\TFMAN\\DELDIR\\*.TXT"),0,gStat); |
|
354 |
WaitForSuccess(); |
|
355 |
if (testingInvalidPathLengths) |
|
356 |
{ |
|
357 |
TFileName name1(KLongName1); |
|
358 |
name1+=_L("\\NAME\\ABCDE\\*.*"); |
|
359 |
r=gFileMan->Delete(name1,0,gStat); |
|
360 |
WaitForSuccess(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
361 |
test_KErrNone(r); |
0 | 362 |
|
363 |
r=gFileMan->Delete(_L("\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as\\fdsa21asdffds\\NAME\\FGHIJ\\*.*"),0,gStat); |
|
364 |
WaitForSuccess(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
365 |
test_KErrNone(r); |
0 | 366 |
} |
367 |
} |
|
368 |
||
369 |
test.Next(_L("Check files are deleted")); |
|
370 |
RmDir(_L("\\F32-TST\\TFMAN\\After\\")); |
|
371 |
MakeDir(_L("\\F32-TST\\TFMAN\\AFTER\\DELDIR\\DELTEST\\EMPTY\\")); |
|
372 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\DELDIR\\DELTEST\\EXE1.BIN")); |
|
373 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\DELDIR\\DELTEST\\FILE4.TXT")); |
|
374 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\DELDIR\\EXE2.BIN")); |
|
375 |
Compare(_L("\\F32-TST\\TFMAN\\DELDIR\\*"),_L("\\F32-TST\\TFMAN\\AFTER\\DELDIR\\*")); |
|
376 |
||
377 |
if (testingInvalidPathLengths) |
|
378 |
{ |
|
379 |
r=gFileMan->RmDir(_L("\\TEST\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
380 |
test_KErrNone(r); |
0 | 381 |
} |
382 |
||
383 |
/** |
|
384 |
Test wild card matching in short file names |
|
385 |
Note this test is only run on FAT file systems as 'short file names' are only |
|
386 |
supported by FAT. |
|
387 |
DEF130113: TTG:<Wild card characters cannot be handled in the short file names> |
|
388 |
*/ |
|
389 |
TInt theDrive; |
|
390 |
r=TheFs.CharToDrive(gDriveToTest,theDrive); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
391 |
test_KErrNone(r); |
0 | 392 |
TFSName f; |
393 |
r = TheFs.FileSystemName(f, theDrive); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
394 |
test_Value(r, r == KErrNone || r == KErrNotFound); |
0 | 395 |
if (f.FindF(_L("Fat")) == 0 ) |
396 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
397 |
test.Next(_L("Test wild card matching in short file names")); |
0 | 398 |
MakeFile(_L("abcdefghi.txt")); |
399 |
TInt err = gFileMan->Delete(_L("ABCDEF~*")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
400 |
test_KErrNone(err); |
0 | 401 |
MakeFile(_L("abcdefghi.txt")); |
402 |
err = gFileMan->Delete(_L("ABCDEF~*.TXT")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
403 |
test_KErrNone(err); |
0 | 404 |
MakeFile(_L("abcdefghi.txt")); |
405 |
err = gFileMan->Delete(_L("ABCDEF~*.?XT")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
406 |
test_KErrNone(err); |
0 | 407 |
MakeFile(_L("abcdefghi.txt")); |
408 |
err = gFileMan->Delete(_L("ABCDEF~1.*")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
409 |
test_KErrNone(err); |
0 | 410 |
} |
411 |
} |
|
412 |
||
413 |
LOCAL_C void TestCopy() |
|
414 |
// |
|
415 |
// Test copy |
|
416 |
// |
|
417 |
{ |
|
418 |
test.Next(_L("Test copy")); |
|
419 |
RmDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\*")); |
|
420 |
||
421 |
MakeDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
422 |
MakeDir(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\EMPTY\\")); |
|
423 |
MakeFile(_L("\\F32-TST\\TFMAN\\NewDir\\ABC.DEF")); |
|
424 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT")); |
|
425 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE2.TXT")); |
|
426 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE3.TXT")); |
|
427 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\FILE4.TXT")); |
|
428 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\EXE1.BIN")); |
|
429 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\EXE2.BIN")); |
|
430 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\RUMBA1.TXT")); |
|
431 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\RUMBA2.TXT")); |
|
432 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\RUMBA3.TXT")); |
|
433 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\RUMBA4.TXT")); |
|
434 |
||
435 |
test.Next(_L("Test copy files to the same directory")); |
|
436 |
TInt r; |
|
437 |
||
438 |
if (testingInvalidPathLengths) |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
439 |
// Create a path of greater than 256 characters by renaming a directory and |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
440 |
// check it can be manipulated (tests fix to F32) |
0 | 441 |
{ |
442 |
MakeDir(_L("\\START\\LONG\\")); |
|
443 |
MakeDir(_L("\\FINISH\\")); |
|
444 |
MakeFile(_L("\\START\\LONG\\ABCDEFGH01ABCDEFGH01ABCDEFGH01ABCDEFGH01.txt")); |
|
445 |
MakeFile(_L("\\START\\LONG\\ELEPHANT01ELEPHANT02ELEPHANT03ELEPHANT04.txt")); |
|
446 |
MakeFile(_L("\\START\\LONG\\DINOSAUR01DINOSAUR02DINOSAUR03DINOSAUR04.txt")); |
|
447 |
MakeFile(_L("\\START\\LONG\\FILEFILE01FILEFILE02FILEFILE03FILEFILE04.txt")); |
|
448 |
r=gFileMan->Rename(_L("\\START\\LONG"),_L("\\START\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff"),CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
449 |
test_KErrNone(r); |
0 | 450 |
MakeDir(_L("\\START\\ASDFFDSA\\")); |
451 |
} |
|
452 |
||
453 |
//testing invalid source path at the beginning: |
|
454 |
if (!gAsynch) |
|
455 |
{ |
|
456 |
r=gFileMan->Copy(_L(":C:\\F32-TST\\TFMAN\\DELDIR\\file?.txt"),_L("\\F32-TST\\TFMAN\\DELDIR\\rumba?.txt"),0); |
|
457 |
} |
|
458 |
else |
|
459 |
{ |
|
460 |
r=gFileMan->Copy(_L(":C:\\F32-TST\\TFMAN\\DELDIR\\file?.txt"),_L("\\F32-TST\\TFMAN\\DELDIR\\rumba?.txt"),0,gStat); |
|
461 |
} |
|
462 |
TestResult(r,KErrBadName,KErrBadName); |
|
463 |
||
464 |
//testing invalid target path at the beginning: |
|
465 |
||
466 |
if (!gAsynch) |
|
467 |
{ |
|
468 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\file?.txt"),_L(":C:\\F32-TST\\TFMAN\\DELDIR\\rumba?.txt"),0); |
|
469 |
} |
|
470 |
else |
|
471 |
{ |
|
472 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\file?.txt"),_L(":C:\\F32-TST\\TFMAN\\DELDIR\\rumba?.txt"),0,gStat); |
|
473 |
} |
|
474 |
TestResult(r,KErrBadName,KErrBadName); |
|
475 |
||
476 |
//testing invalid source path at the middle: |
|
477 |
if (!gAsynch) |
|
478 |
{ |
|
479 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\:DELDIR\\file?.txt"),_L("\\F32-TST\\TFMAN\\DELDIR\\rumba?.txt"),0); |
|
480 |
} |
|
481 |
else |
|
482 |
{ |
|
483 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\:DELDIR\\file?.txt"),_L("\\F32-TST\\TFMAN\\DELDIR\\rumba?.txt"),0,gStat); |
|
484 |
} |
|
485 |
TestResult(r,KErrBadName,KErrNone); |
|
486 |
||
487 |
//testing invalid target path at the middle: |
|
488 |
if (!gAsynch) |
|
489 |
{ |
|
490 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\file?.txt"),_L("\\F32-TST\\TFMAN\\:DELDIR\\rumba?.txt"),0); |
|
491 |
} |
|
492 |
else |
|
493 |
{ |
|
494 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\file?.txt"),_L("\\F32-TST\\TFMAN\\:DELDIR\\rumba?.txt"),0,gStat); |
|
495 |
} |
|
496 |
TestResult(r,KErrBadName,KErrNone); |
|
497 |
||
498 |
//testing invalid source path at the end: |
|
499 |
if (!gAsynch) |
|
500 |
{ |
|
501 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\:file?.txt"),_L("\\F32-TST\\TFMAN\\:DELDIR\\rumba?.txt"),0); |
|
502 |
} |
|
503 |
else |
|
504 |
{ |
|
505 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\:file?.txt"),_L("\\F32-TST\\TFMAN\\:DELDIR\\rumba?.txt"),0,gStat); |
|
506 |
} |
|
507 |
TestResult(r,KErrBadName,KErrNone); |
|
508 |
||
509 |
//testing invalid target path at the end: |
|
510 |
if (!gAsynch) |
|
511 |
{ |
|
512 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\file?.txt"),_L("\\F32-TST\\TFMAN\\:DELDIR\\:rumba?.txt"),0); |
|
513 |
} |
|
514 |
else |
|
515 |
{ |
|
516 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\file?.txt"),_L("\\F32-TST\\TFMAN\\:DELDIR\\:rumba?.txt"),0,gStat); |
|
517 |
} |
|
518 |
TestResult(r,KErrBadName,KErrNone); |
|
519 |
||
520 |
if (!gAsynch) |
|
521 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\file?.txt"),_L("\\F32-TST\\TFMAN\\DELDIR\\rumba?.txt"),0); |
|
522 |
else |
|
523 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\file?.txt"),_L("\\F32-TST\\TFMAN\\DELDIR\\rumba?.txt"),0,gStat); |
|
524 |
TestResult(r,KErrAlreadyExists); |
|
525 |
||
526 |
if (!gAsynch) |
|
527 |
r = gFileMan->Delete(_L("\\F32-TST\\TFMAN\\DELDIR\\rumba.txt"),0); |
|
528 |
else |
|
529 |
r = gFileMan->Delete(_L("\\F32-TST\\TFMAN\\DELDIR\\rumba.txt"),0,gStat); |
|
530 |
TestResult(r,KErrNone); |
|
531 |
||
532 |
if (!gAsynch) |
|
533 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.txt"),_L("\\F32-TST\\TFMAN\\DELDIR\\file1.txt"),0); |
|
534 |
else |
|
535 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.txt"),_L("\\F32-TST\\TFMAN\\DELDIR\\file1.txt"),0,gStat); |
|
536 |
TestResult(r,KErrAlreadyExists); |
|
537 |
||
538 |
if (!gAsynch) |
|
539 |
{ |
|
540 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\*.TXT"),_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
541 |
test_KErrNone(r); |
0 | 542 |
if (testingInvalidPathLengths) |
543 |
{ |
|
544 |
test.Next(_L("Test invalid length paths")); |
|
545 |
r=gFileMan->Copy(_L("\\START\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff\\*.*"),_L("\\FINISH\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
546 |
test_KErrNone(r); |
0 | 547 |
r=gFileMan->RmDir(_L("\\START\\")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
548 |
test_KErrNone(r); |
0 | 549 |
r=gFileMan->RmDir(_L("\\FINISH\\")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
550 |
test_KErrNone(r); |
0 | 551 |
} |
552 |
} |
|
553 |
else |
|
554 |
{ |
|
555 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\*.TXT"),_L("\\F32-TST\\TFMAN\\COPYDIR\\"),0,gStat); |
|
556 |
WaitForSuccess(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
557 |
test_KErrNone(r); |
0 | 558 |
if (testingInvalidPathLengths) |
559 |
{ |
|
560 |
test.Next(_L("Test invalid length paths (Asynch)")); |
|
561 |
r=gFileMan->Copy(_L("\\START\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff\\*.*"),_L("\\FINISH\\"),0,gStat); |
|
562 |
WaitForSuccess(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
563 |
test_KErrNone(r); |
0 | 564 |
r=gFileMan->RmDir(_L("\\START\\"),gStat); |
565 |
WaitForSuccess(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
566 |
test_KErrNone(r); |
0 | 567 |
r=gFileMan->RmDir(_L("\\FINISH\\"),gStat); |
568 |
WaitForSuccess(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
569 |
test_KErrNone(r); |
0 | 570 |
} |
571 |
} |
|
572 |
||
573 |
if (!gAsynch) |
|
574 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\NewDir\\*.*"),_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
575 |
else |
|
576 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\NewDir\\*.*"),_L("\\F32-TST\\TFMAN\\COPYDIR\\"),0,gStat); |
|
577 |
TestResult(r); |
|
578 |
||
579 |
test.Next(_L("Check files have been copied")); |
|
580 |
RmDir(_L("\\F32-TST\\TFMAN\\after\\")); |
|
581 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\FILE1.TXT")); |
|
582 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\FILE2.TXT")); |
|
583 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\FILE3.TXT")); |
|
584 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\RUMBA1.TXT")); |
|
585 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\RUMBA2.TXT")); |
|
586 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\RUMBA3.TXT")); |
|
587 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\RUMBA4.TXT")); |
|
588 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\ABC.DEF")); |
|
589 |
Compare(_L("\\F32-TST\\TFMAN\\AFTER\\*"),_L("\\F32-TST\\TFMAN\\COPYDIR\\*")); |
|
590 |
||
591 |
TFileName fn = _L("Z:\\TEST\\T_FSRV.CPP"); |
|
592 |
fn[0] = gExeFileName[0]; |
|
593 |
if (!gAsynch) |
|
594 |
r=gFileMan->Copy(fn,_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
595 |
else |
|
596 |
r=gFileMan->Copy(fn,_L("\\F32-TST\\TFMAN\\COPYDIR\\"),0,gStat); |
|
597 |
TestResult(KErrNone); |
|
598 |
||
599 |
TEntry entry; |
|
600 |
r=TheFs.Entry(_L("\\F32-TST\\TFMAN\\COPYDIR\\T_FSRV.CPP"),entry); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
601 |
test_KErrNone(r); |
0 | 602 |
test(entry.iName.MatchF(_L("T_FSRV.CPP"))!=KErrNotFound); |
603 |
#if defined (__WINS__) |
|
42
a179b74831c9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
20
diff
changeset
|
604 |
test_Equal(KEntryAttArchive | KEntryAttReadOnly, entry.iAtt); |
0 | 605 |
#else |
606 |
if (!IsTestingLFFS()) |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
607 |
{ |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
608 |
test_Equal(KEntryAttReadOnly, entry.iAtt); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
609 |
} |
0 | 610 |
else |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
611 |
{ |
0 | 612 |
test(entry.iAtt&KEntryAttReadOnly); // ??? |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
613 |
} |
0 | 614 |
#endif |
615 |
r=TheFs.SetAtt(_L("\\F32-TST\\TFMAN\\COPYDIR\\T_FSRV.CPP"),0,KEntryAttReadOnly); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
616 |
test_KErrNone(r); |
0 | 617 |
|
618 |
r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\AFTER\\RUMBA?.TXT")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
619 |
test_KErrNone(r); |
0 | 620 |
r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\DELDIR\\RUMBA?.TXT")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
621 |
test_KErrNone(r); |
0 | 622 |
} |
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
623 |
|
0 | 624 |
LOCAL_C void TestDEF121663_Setup(TFileName& aSrcPath) |
625 |
{ |
|
626 |
RmDir(aSrcPath); |
|
627 |
MakeDir(aSrcPath); |
|
628 |
||
629 |
for(TInt index=0; index<10; index++) |
|
630 |
{ |
|
631 |
TFileName fileName; |
|
632 |
fileName.Copy(aSrcPath); |
|
633 |
fileName.Append(_L("FILE_"));fileName.AppendNum(index);fileName.Append(_L(".TXT")); |
|
634 |
MakeFile(fileName, _L8("Some Data")); |
|
635 |
} |
|
636 |
} |
|
637 |
||
638 |
LOCAL_C void TestDEF121663() |
|
639 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
640 |
test.Next(_L("Test moving directory to its subdirectory (DEF121663)")); |
0 | 641 |
|
642 |
gFileMan->SetObserver(NULL); |
|
643 |
TInt err = 0; |
|
644 |
TFileName srcPath = _L("C:\\TestDEF121663\\"); |
|
645 |
||
646 |
TestDEF121663_Setup(srcPath); |
|
647 |
if(!gAsynch) |
|
648 |
{ |
|
649 |
err = gFileMan->Move(_L("C:\\TestDEF121663"),_L("C:\\TestDEF121663\\TestDEF121663"),CFileMan::EOverWrite); |
|
650 |
} |
|
651 |
else |
|
652 |
{ |
|
653 |
err = gFileMan->Move(_L("C:\\TestDEF121663"),_L("C:\\TestDEF121663\\TestDEF121663"),CFileMan::EOverWrite, gStat); |
|
654 |
} |
|
655 |
TestResult(err,KErrInUse,KErrInUse); |
|
656 |
||
657 |
TestDEF121663_Setup(srcPath); |
|
658 |
if(!gAsynch) |
|
659 |
{ |
|
660 |
err = gFileMan->Move(_L("C:\\TestDEF121663\\"),_L("C:\\TestDEF121663\\TestDEF121663\\"),CFileMan::EOverWrite); |
|
661 |
} |
|
662 |
else |
|
663 |
{ |
|
664 |
err = gFileMan->Move(_L("C:\\TestDEF121663\\"),_L("C:\\TestDEF121663\\TestDEF121663\\"),CFileMan::EOverWrite, gStat); |
|
665 |
} |
|
666 |
TestResult(err,KErrPathNotFound); |
|
667 |
||
668 |
TestDEF121663_Setup(srcPath); |
|
669 |
if(!gAsynch) |
|
670 |
{ |
|
671 |
err = gFileMan->Move(_L("C:\\TestDEF121663\\"),_L("C:\\TestDEF121663\\TestDEF121663"),CFileMan::EOverWrite); |
|
672 |
} |
|
673 |
else |
|
674 |
{ |
|
675 |
err = gFileMan->Move(_L("C:\\TestDEF121663\\"),_L("C:\\TestDEF121663\\TestDEF121663"),CFileMan::EOverWrite, gStat); |
|
676 |
} |
|
677 |
TestResult(err,KErrPathNotFound); |
|
678 |
||
679 |
TestDEF121663_Setup(srcPath); |
|
680 |
if(!gAsynch) |
|
681 |
{ |
|
682 |
err = gFileMan->Move(_L("C:\\TestDEF121663"),_L("C:\\TestDEF121663\\TestDEF121663\\"),CFileMan::ERecurse|CFileMan::EOverWrite); |
|
683 |
} |
|
684 |
else |
|
685 |
{ |
|
686 |
err = gFileMan->Move(_L("C:\\TestDEF121663"),_L("C:\\TestDEF121663\\TestDEF121663\\"),CFileMan::ERecurse|CFileMan::EOverWrite, gStat); |
|
687 |
} |
|
688 |
TestResult(err,KErrInUse,KErrInUse); |
|
689 |
||
690 |
TestDEF121663_Setup(srcPath); |
|
691 |
if(!gAsynch) |
|
692 |
{ |
|
693 |
err = gFileMan->Move(_L("C:\\TestDEF121663"),_L("C:\\TestDEF121663\\TestDEF121663"),CFileMan::ERecurse); |
|
694 |
} |
|
695 |
else |
|
696 |
{ |
|
697 |
err = gFileMan->Move(_L("C:\\TestDEF121663"),_L("C:\\TestDEF121663\\TestDEF121663"),CFileMan::ERecurse, gStat); |
|
698 |
} |
|
699 |
TestResult(err,KErrInUse,KErrInUse); |
|
700 |
||
701 |
gFileMan->SetObserver(gObserver); |
|
702 |
// remove previous dirs |
|
703 |
RmDir(_L("C:\\TestDEF121663\\")); |
|
704 |
} |
|
705 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
706 |
// Test moving directories where source and target have matching subdirectory structures |
0 | 707 |
LOCAL_C void TestDEF123575() |
708 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
709 |
test.Next(_L("Test moving directories with matching subdirectory structures (DEF123575)")); |
0 | 710 |
TFileName srcPath; |
711 |
TFileName destPath; |
|
712 |
TInt err; |
|
713 |
//setup the initial directory structure |
|
714 |
srcPath = _L("\\F32-TST\\DEF123575\\SRCDIR\\CommonDIR\\temp\\temp1.1\\"); |
|
715 |
destPath = _L("\\F32-TST\\DEF123575\\DSTDIR\\CommonDIR\\temp\\temp1.1\\"); |
|
716 |
MakeDir(srcPath); |
|
717 |
MakeDir(destPath); |
|
718 |
MakeFile(_L("\\F32-TST\\DEF123575\\SRCDIR\\CommonDIR\\temp\\temp1.1\\FILE1.TXT")); |
|
719 |
||
720 |
srcPath = _L("\\F32-TST\\DEF123575\\SRCDIR\\CommonDIR"); |
|
721 |
destPath = _L("\\F32-TST\\DEF123575\\DSTDIR\\"); |
|
722 |
if(!gAsynch) |
|
723 |
{ |
|
724 |
err = gFileMan->Move(srcPath,destPath,CFileMan::EOverWrite); |
|
725 |
} |
|
726 |
else |
|
727 |
{ |
|
728 |
err = gFileMan->Move(srcPath,destPath,CFileMan::EOverWrite, gStat); |
|
729 |
} |
|
730 |
TestResult(err,KErrNone,KErrNone); |
|
731 |
||
732 |
//test that source directory is empty after move |
|
733 |
MakeDir(_L("\\F32-TST\\DEF123575\\AFTER\\")); |
|
734 |
Compare(_L("\\F32-TST\\DEF123575\\SRCDIR\\*"),_L("\\F32-TST\\DEF123575\\AFTER\\*")); |
|
735 |
//test that the files have been moved to the destination directory |
|
736 |
MakeDir(_L("\\F32-TST\\DEF123575\\AFTER\\CommonDIR\\temp\\temp1.1\\")); |
|
737 |
MakeFile(_L("\\F32-TST\\DEF123575\\AFTER\\CommonDIR\\temp\\temp1.1\\FILE1.TXT")); |
|
738 |
Compare(_L("\\F32-TST\\DEF123575\\DSTDIR\\*"),_L("\\F32-TST\\DEF123575\\AFTER\\*")); |
|
739 |
||
740 |
//delete the entire directory structure |
|
741 |
RmDir(_L("\\F32-TST\\DEF123575\\*")); |
|
742 |
} |
|
743 |
||
744 |
LOCAL_C void TestDEF125570() |
|
745 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
746 |
test.Next(_L("Test move when trg has at least one of the src dirs (DEF125570)")); |
0 | 747 |
gFileMan->SetObserver(NULL); |
748 |
TInt err = KErrNone; |
|
749 |
TFileName srcPath = _L("C:\\TestDEF125570\\src\\"); |
|
750 |
TFileName trgPath = _L("C:\\TestDEF125570\\trg\\"); |
|
751 |
||
752 |
// remove previous dirs |
|
753 |
RmDir(srcPath); |
|
754 |
RmDir(trgPath); |
|
755 |
||
756 |
//create src |
|
757 |
MakeDir(_L("C:\\TestDEF125570\\src\\DIR1\\")); |
|
758 |
MakeFile(_L("C:\\TestDEF125570\\src\\DIR1\\File1.txt"),_L8("FILE PATH : C:\\TestDEF125570\\SRC\\DIR1\\File1.txt")); |
|
759 |
MakeFile(_L("C:\\TestDEF125570\\src\\DIR1\\File2.txt"),_L8("FILE PATH : C:\\TestDEF125570\\SRC\\DIR1\\File2.txt")); |
|
760 |
MakeDir(_L("C:\\TestDEF125570\\src\\DIR1\\DIR11\\")); |
|
761 |
MakeFile(_L("C:\\TestDEF125570\\src\\DIR1\\DIR11\\File1.txt"),_L8("FILE PATH : C:\\TestDEF125570\\SRC\\DIR1\\DIR11\\File1.txt")); |
|
762 |
MakeFile(_L("C:\\TestDEF125570\\src\\DIR1\\DIR11\\File2.txt"),_L8("FILE PATH : C:\\TestDEF125570\\SRC\\DIR1\\DIR11\\File2.txt")); |
|
763 |
MakeDir(_L("C:\\TestDEF125570\\src\\DIR2\\")); |
|
764 |
MakeFile(_L("C:\\TestDEF125570\\src\\DIR2\\File1.txt"),_L8("FILE PATH : C:\\TestDEF125570\\SRC\\DIR2\\File1.txt")); |
|
765 |
MakeFile(_L("C:\\TestDEF125570\\src\\DIR2\\File2.txt"),_L8("FILE PATH : C:\\TestDEF125570\\SRC\\DIR2\\File2.txt")); |
|
766 |
MakeDir(_L("C:\\TestDEF125570\\src\\DIR2\\DIR12\\")); |
|
767 |
MakeFile(_L("C:\\TestDEF125570\\src\\DIR2\\DIR12\\File1.txt"),_L8("FILE PATH : C:\\TestDEF125570\\SRC\\DIR2\\DIR12\\File1.txt")); |
|
768 |
MakeFile(_L("C:\\TestDEF125570\\src\\DIR2\\DIR12\\File2.txt"),_L8("FILE PATH : C:\\TestDEF125570\\SRC\\DIR2\\DIR12\\File2.txt")); |
|
769 |
||
770 |
//trg has at least one of the src subfolders |
|
771 |
MakeDir(_L("C:\\TestDEF125570\\trg\\DIR2\\")); |
|
772 |
MakeFile(_L("C:\\TestDEF125570\\trg\\DIR2\\File1.txt"),_L8("FILE PATH : C:\\TestDEF125570\\TRG\\DIR2\\File1.txt")); |
|
773 |
MakeFile(_L("C:\\TestDEF125570\\trg\\DIR2\\File2.txt"),_L8("FILE PATH : C:\\TestDEF125570\\TRG\\DIR2\\File2.txt")); |
|
774 |
||
775 |
if(!gAsynch) |
|
776 |
err = gFileMan->Move(srcPath, trgPath, CFileMan::ERecurse|CFileMan::EOverWrite); |
|
777 |
else |
|
778 |
err = gFileMan->Move(srcPath, trgPath, CFileMan::ERecurse|CFileMan::EOverWrite, gStat); |
|
779 |
TestResult(err); |
|
780 |
gFileMan->SetObserver(gObserver); |
|
781 |
// remove previous dirs |
|
782 |
RmDir(_L("C:\\TestDEF125570\\")); |
|
783 |
} |
|
784 |
||
785 |
LOCAL_C void TestDEF130404() |
|
786 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
787 |
test.Printf(_L("Test move when the src doesn't fully exist (DEF130404)")); |
0 | 788 |
|
789 |
TInt r = 0; |
|
790 |
TFileName trgPath; |
|
791 |
trgPath.Format(_L("%c:\\TestDEF130404\\Trg\\"), (TUint8)gDriveToTest); |
|
792 |
TFileName srcPath; |
|
793 |
srcPath.Format(_L("C:\\TestDEF130404\\Src\\DIR1\\"), (TUint8)gDriveToTest); |
|
794 |
||
795 |
// clean up before testing |
|
796 |
RmDir(srcPath); |
|
797 |
RmDir(trgPath); |
|
798 |
||
799 |
MakeDir(srcPath); |
|
800 |
srcPath.Append(_L("NODIR\\*.*")); |
|
801 |
MakeDir(trgPath); |
|
802 |
||
803 |
if(!gAsynch) |
|
804 |
r = gFileMan->Move(srcPath, trgPath, 0); |
|
805 |
else |
|
806 |
r = gFileMan->Move(srcPath, trgPath, 0, gStat); |
|
807 |
TestResult(r,KErrPathNotFound); |
|
808 |
||
809 |
// clean up before leaving |
|
810 |
trgPath.Format(_L("%c:\\TestDEF130404\\"), (TUint8)gDriveToTest); |
|
811 |
RmDir(trgPath); |
|
812 |
RmDir(_L("C:\\TestDEF130404\\")); |
|
813 |
} |
|
814 |
||
815 |
||
816 |
/** |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
817 |
This is to test that moving files to overwrite folders with the same names |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
818 |
and moving folders (directories) to overwrite files with the same names |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
819 |
across drives return proper error codes |
0 | 820 |
*/ |
821 |
void TestPDEF137716() |
|
822 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
823 |
// Do not run tests if we cannot move across different drives |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
824 |
if (gSessionPath[0]=='C') |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
825 |
return; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
826 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
827 |
// Move FILE to overwrite FOLDER -------------------------------------------------------- |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
828 |
test.Next(_L("Test moving files to overwrite folders with the same names")); |
0 | 829 |
gFileMan->SetObserver(NULL); |
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
830 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
831 |
_LIT(KFixedTargetTestFolder, "\\PDEF137716\\"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
832 |
_LIT(KFileToDirTargetCreatePath, "\\PDEF137716\\FileToDir_Target\\ITEM\\"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
833 |
_LIT(KFileToDirTargetNameWild, "\\PDEF137716\\FileToDir_Target\\"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
834 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
835 |
_LIT(KFixedSourceTestFolder, "C:\\PDEF137716\\"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
836 |
_LIT(KFileToDirSourceName, "C:\\PDEF137716\\FileToDir_Source\\ITEM"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
837 |
_LIT(KFileToDirSourceNameWild, "C:\\PDEF137716\\FileToDir_Source\\"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
838 |
|
0 | 839 |
RmDir(KFixedTargetTestFolder); |
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
840 |
RmDir(KFixedSourceTestFolder); |
0 | 841 |
MakeDir(KFileToDirTargetCreatePath); |
842 |
MakeFile(KFileToDirSourceName); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
843 |
TInt err = KErrNone; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
844 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
845 |
if(!gAsynch) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
846 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
847 |
err = gFileMan->Move(KFileToDirSourceName, KFileToDirTargetNameWild, 0); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
848 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
849 |
else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
850 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
851 |
err = gFileMan->Move(KFileToDirSourceName, KFileToDirTargetNameWild, 0, gStat); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
852 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
853 |
TestResult(err,KErrAccessDenied); |
0 | 854 |
|
855 |
RmDir(KFixedTargetTestFolder); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
856 |
RmDir(KFixedSourceTestFolder); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
857 |
MakeDir(KFileToDirTargetCreatePath); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
858 |
MakeFile(KFileToDirSourceName); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
859 |
if(!gAsynch) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
860 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
861 |
err = gFileMan->Move(KFileToDirSourceName, KFileToDirTargetNameWild, CFileMan::EOverWrite); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
862 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
863 |
else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
864 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
865 |
err = gFileMan->Move(KFileToDirSourceName, KFileToDirTargetNameWild, CFileMan::EOverWrite, gStat); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
866 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
867 |
TestResult(err,KErrAccessDenied); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
868 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
869 |
RmDir(KFixedTargetTestFolder); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
870 |
RmDir(KFixedSourceTestFolder); |
0 | 871 |
MakeDir(KFileToDirTargetCreatePath); |
872 |
MakeFile(KFileToDirSourceName); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
873 |
if(!gAsynch) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
874 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
875 |
err = gFileMan->Move(KFileToDirSourceNameWild, KFileToDirTargetNameWild, 0); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
876 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
877 |
else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
878 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
879 |
err = gFileMan->Move(KFileToDirSourceNameWild, KFileToDirTargetNameWild, 0, gStat); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
880 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
881 |
TestResult(err,KErrAccessDenied); |
0 | 882 |
|
883 |
RmDir(KFixedTargetTestFolder); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
884 |
RmDir(KFixedSourceTestFolder); |
0 | 885 |
MakeDir(KFileToDirTargetCreatePath); |
886 |
MakeFile(KFileToDirSourceName); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
887 |
if(!gAsynch) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
888 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
889 |
err = gFileMan->Move(KFileToDirSourceNameWild, KFileToDirTargetNameWild, CFileMan::EOverWrite); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
890 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
891 |
else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
892 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
893 |
err = gFileMan->Move(KFileToDirSourceNameWild, KFileToDirTargetNameWild, CFileMan::EOverWrite, gStat); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
894 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
895 |
TestResult(err,KErrAccessDenied); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
896 |
|
0 | 897 |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
898 |
// Move FOLDER to overwrite FILE -------------------------------------------------------- |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
899 |
test.Next(_L("Test moving folders to overwrite files with the same names")); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
900 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
901 |
_LIT(KDirToFileTargetName, "\\PDEF137716\\DirToFile_Target\\ITEM"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
902 |
_LIT(KDirToFileTargetNameWild, "\\PDEF137716\\DirToFile_Target\\"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
903 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
904 |
_LIT(KDirToFileSourceName, "C:\\PDEF137716\\DirToFile_Source\\ITEM"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
905 |
_LIT(KDirToFileSourceNameWild, "C:\\PDEF137716\\DirToFile_Source\\"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
906 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
907 |
_LIT(KDirToFileSourceCreatePath, "C:\\PDEF137716\\DirToFile_Source\\ITEM\\"); |
0 | 908 |
|
909 |
RmDir(KFixedTargetTestFolder); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
910 |
RmDir(KFixedSourceTestFolder); |
0 | 911 |
MakeFile(KDirToFileTargetName); |
912 |
MakeDir(KDirToFileSourceCreatePath); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
913 |
if(!gAsynch) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
914 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
915 |
err = gFileMan->Move(KDirToFileSourceName, KDirToFileTargetName, 0); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
916 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
917 |
else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
918 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
919 |
err = gFileMan->Move(KDirToFileSourceName, KDirToFileTargetName, 0, gStat); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
920 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
921 |
TestResult(err,KErrAccessDenied,KErrAccessDenied); |
0 | 922 |
|
923 |
RmDir(KFixedTargetTestFolder); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
924 |
RmDir(KFixedSourceTestFolder); |
0 | 925 |
MakeFile(KDirToFileTargetName); |
926 |
MakeDir(KDirToFileSourceCreatePath); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
927 |
if(!gAsynch) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
928 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
929 |
err = gFileMan->Move(KDirToFileSourceName, KDirToFileTargetName, CFileMan::EOverWrite); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
930 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
931 |
else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
932 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
933 |
err = gFileMan->Move(KDirToFileSourceName, KDirToFileTargetName, CFileMan::EOverWrite, gStat); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
934 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
935 |
TestResult(err,KErrAccessDenied,KErrAccessDenied); |
0 | 936 |
|
937 |
RmDir(KFixedTargetTestFolder); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
938 |
RmDir(KFixedSourceTestFolder); |
0 | 939 |
MakeFile(KDirToFileTargetName); |
940 |
MakeDir(KDirToFileSourceCreatePath); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
941 |
if(!gAsynch) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
942 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
943 |
err = gFileMan->Move(KDirToFileSourceName, KDirToFileTargetNameWild, 0); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
944 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
945 |
else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
946 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
947 |
err = gFileMan->Move(KDirToFileSourceName, KDirToFileTargetNameWild, 0, gStat); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
948 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
949 |
TestResult(err,KErrAccessDenied,KErrAccessDenied); |
0 | 950 |
|
951 |
RmDir(KFixedTargetTestFolder); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
952 |
RmDir(KFixedSourceTestFolder); |
0 | 953 |
MakeFile(KDirToFileTargetName); |
954 |
MakeDir(KDirToFileSourceCreatePath); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
955 |
if(!gAsynch) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
956 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
957 |
err = gFileMan->Move(KDirToFileSourceName, KDirToFileTargetNameWild, CFileMan::EOverWrite); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
958 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
959 |
else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
960 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
961 |
err = gFileMan->Move(KDirToFileSourceName, KDirToFileTargetNameWild, CFileMan::EOverWrite, gStat); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
962 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
963 |
TestResult(err,KErrAccessDenied,KErrAccessDenied); |
0 | 964 |
|
965 |
RmDir(KFixedTargetTestFolder); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
966 |
RmDir(KFixedSourceTestFolder); |
0 | 967 |
MakeFile(KDirToFileTargetName); |
968 |
MakeDir(KDirToFileSourceCreatePath); |
|
969 |
err = gFileMan->Move(KDirToFileSourceNameWild, KDirToFileTargetNameWild, 0); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
970 |
if(!gAsynch) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
971 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
972 |
err = gFileMan->Move(KDirToFileSourceNameWild, KDirToFileTargetNameWild, 0); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
973 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
974 |
else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
975 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
976 |
err = gFileMan->Move(KDirToFileSourceNameWild, KDirToFileTargetNameWild, 0, gStat); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
977 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
978 |
TestResult(err,KErrNotFound); |
0 | 979 |
|
980 |
RmDir(KFixedTargetTestFolder); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
981 |
RmDir(KFixedSourceTestFolder); |
0 | 982 |
MakeFile(KDirToFileTargetName); |
983 |
MakeDir(KDirToFileSourceCreatePath); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
984 |
if(!gAsynch) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
985 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
986 |
err = gFileMan->Move(KDirToFileSourceNameWild, KDirToFileTargetNameWild, CFileMan::EOverWrite); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
987 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
988 |
else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
989 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
990 |
err = gFileMan->Move(KDirToFileSourceNameWild, KDirToFileTargetNameWild, CFileMan::EOverWrite, gStat); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
991 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
992 |
TestResult(err,KErrNotFound); |
0 | 993 |
|
994 |
RmDir(KFixedTargetTestFolder); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
995 |
RmDir(KFixedSourceTestFolder); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
996 |
gFileMan->SetObserver(gObserver); |
0 | 997 |
} |
998 |
||
999 |
LOCAL_C void TestMove() |
|
1000 |
// |
|
1001 |
// Test Move |
|
1002 |
// |
|
1003 |
{ |
|
1004 |
test.Next(_L("Test move")); |
|
1005 |
RmDir(_L("\\F32-TST\\TFMAN\\MOVEDIR\\*")); |
|
1006 |
||
1007 |
MakeDir(_L("\\F32-TST\\TFMAN\\MOVEDIR\\")); |
|
1008 |
MakeDir(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\EMPTY\\")); |
|
1009 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT")); |
|
1010 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE2.TXT")); |
|
1011 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE3.TXT")); |
|
1012 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\FILE4.TXT")); |
|
1013 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\EXE1.BIN")); |
|
1014 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\EXE2.BIN")); |
|
1015 |
||
1016 |
TInt r=KErrNone; |
|
1017 |
||
1018 |
if (testingInvalidPathLengths) |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1019 |
// Create a path of greater 256 characters by renaming a directory and check it can be |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1020 |
// manipulated (tests fix to F32) |
0 | 1021 |
{ |
1022 |
MakeDir(_L("\\START\\LONG\\")); |
|
1023 |
MakeDir(_L("\\FINISH\\")); |
|
1024 |
MakeFile(_L("\\START\\LONG\\ABCDEFGH01ABCDEFGH01ABCDEFGH01ABCDEFGH01.txt")); |
|
1025 |
MakeFile(_L("\\START\\LONG\\ELEPHANT01ELEPHANT02ELEPHANT03ELEPHANT04.txt")); |
|
1026 |
MakeFile(_L("\\START\\LONG\\DINOSAUR01DINOSAUR02DINOSAUR03DINOSAUR04.txt")); |
|
1027 |
MakeFile(_L("\\START\\LONG\\FILEFILE01FILEFILE02FILEFILE03FILEFILE04.txt")); |
|
1028 |
r=gFileMan->Rename(_L("\\START\\LONG"),_L("\\START\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff"),CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1029 |
test_KErrNone(r); |
0 | 1030 |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1031 |
// Two long directory names - makes paths invalid |
0 | 1032 |
MakeDir(_L("\\TEST\\LONG\\NAME\\FGHIJ")); |
1033 |
MakeDir(_L("\\TEST\\LONG\\NAME\\FGHIJ\\DIRECTORY1DIRECTORY2DIRECTORY3DIRECTORY4\\")); |
|
1034 |
MakeFile(_L("\\TEST\\LONG\\NAME\\FGHIJ\\ELEPHANT01ELEPHANT02ELEPHANT03ELEPHANT04")); |
|
1035 |
MakeFile(_L("\\TEST\\LONG\\NAME\\FGHIJ\\FILEFILE01FILEFILE02FILEFILE03FILEFILE04")); |
|
1036 |
r=gFileMan->Rename(_L("\\TEST\\LONG"),_L("\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as\\fdsa21asdffds"),CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1037 |
test_KErrNone(r); |
0 | 1038 |
|
1039 |
MakeDir(_L("\\START\\ASDFFDSA\\")); |
|
1040 |
} |
|
1041 |
||
1042 |
//testing invalid source path at the beginning: |
|
1043 |
if (!gAsynch) |
|
1044 |
{ |
|
1045 |
r=gFileMan->Move(_L(":C:\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT"),_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT")); |
|
1046 |
} |
|
1047 |
else |
|
1048 |
{ |
|
1049 |
r=gFileMan->Move(_L(":C:\\F32-TST\\TFMAN\\DELDIR\\FILE?.TXT"),_L("\\F32-TST\\TFMAN\\DELDIR\\FILE*.TXT"),0,gStat); |
|
1050 |
} |
|
1051 |
TestResult(r,KErrBadName,KErrBadName); |
|
1052 |
||
1053 |
//testing invalid target path at the beginning: |
|
1054 |
if (!gAsynch) |
|
1055 |
{ |
|
1056 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT"),_L(":C:\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT")); |
|
1057 |
} |
|
1058 |
else |
|
1059 |
{ |
|
1060 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE?.TXT"),_L(":C:\\F32-TST\\TFMAN\\DELDIR\\FILE*.TXT"),0,gStat); |
|
1061 |
} |
|
1062 |
TestResult(r,KErrBadName,KErrBadName); |
|
1063 |
||
1064 |
//testing invalid source path at the middle: |
|
1065 |
if (!gAsynch) |
|
1066 |
{ |
|
1067 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\:DELDIR\\FILE1.TXT"),_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT")); |
|
1068 |
} |
|
1069 |
else |
|
1070 |
{ |
|
1071 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\:DELDIR\\FILE?.TXT"),_L("\\F32-TST\\TFMAN\\DELDIR\\FILE*.TXT"),0,gStat); |
|
1072 |
} |
|
1073 |
TestResult(r,KErrBadName,KErrNone); |
|
1074 |
||
1075 |
//testing invalid target path at the middle: |
|
1076 |
if (!gAsynch) |
|
1077 |
{ |
|
1078 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT"),_L("\\F32-TST\\TFMAN\\:DELDIR\\FILE1.TXT")); |
|
1079 |
} |
|
1080 |
else |
|
1081 |
{ |
|
1082 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE?.TXT"),_L("\\F32-TST\\TFMAN\\:DELDIR\\FILE*.TXT"),0,gStat); |
|
1083 |
} |
|
1084 |
TestResult(r,KErrBadName,KErrNone); |
|
1085 |
||
1086 |
//testing invalid source path at the end: |
|
1087 |
if (!gAsynch) |
|
1088 |
{ |
|
1089 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\:FILE1.TXT"),_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT")); |
|
1090 |
} |
|
1091 |
else |
|
1092 |
{ |
|
1093 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\:FILE?.TXT"),_L("\\F32-TST\\TFMAN\\DELDIR\\FILE*.TXT"),0,gStat); |
|
1094 |
} |
|
1095 |
TestResult(r,KErrBadName,KErrNone); |
|
1096 |
||
1097 |
//testing invalid target path at the end: |
|
1098 |
if (!gAsynch) |
|
1099 |
{ |
|
1100 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT"),_L("\\F32-TST\\TFMAN\\DELDIR\\:FILE1.TXT")); |
|
1101 |
} |
|
1102 |
else |
|
1103 |
{ |
|
1104 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE?.TXT"),_L("\\F32-TST\\TFMAN\\DELDIR\\:FILE*.TXT"),0,gStat); |
|
1105 |
} |
|
1106 |
TestResult(r,KErrBadName,KErrNone); |
|
1107 |
||
1108 |
||
1109 |
if (!gAsynch) |
|
1110 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE?.TXT"),_L("\\F32-TST\\TFMAN\\DELDIR\\FILE*.TXT")); |
|
1111 |
else |
|
1112 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE?.TXT"),_L("\\F32-TST\\TFMAN\\DELDIR\\FILE*.TXT"),0,gStat); |
|
1113 |
TestResult(r,KErrNone); |
|
1114 |
||
1115 |
if ((!gAsynch)&&(testingInvalidPathLengths)) |
|
1116 |
{ |
|
1117 |
r=gFileMan->Move(_L("\\START\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff\\*.*"),_L("\\FINISH\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1118 |
test_KErrNone(r); |
0 | 1119 |
|
1120 |
r=gFileMan->Move(_L("\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as\\fdsa21asdffds\\*.*"),_L("\\FINISH\\"), CFileMan::EOverWrite | CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1121 |
test_KErrNone(r); |
0 | 1122 |
|
1123 |
r=gFileMan->RmDir(_L("\\START\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1124 |
test_KErrNone(r); |
0 | 1125 |
r=gFileMan->RmDir(_L("\\FINISH\\")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1126 |
test_KErrNone(r); |
0 | 1127 |
} |
1128 |
if ((gAsynch)&&(testingInvalidPathLengths)) |
|
1129 |
{ |
|
1130 |
r=gFileMan->Move(_L("\\START\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff\\*.*"),_L("\\FINISH\\"),CFileMan::EOverWrite,gStat); |
|
1131 |
User::WaitForRequest(gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1132 |
test_KErrNone(r); |
0 | 1133 |
r=gFileMan->Move(_L("\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as\\fdsa21asdffds\\*.*"),_L("\\FINISH\\"), CFileMan::EOverWrite | CFileMan::ERecurse,gStat); |
1134 |
User::WaitForRequest(gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1135 |
test_KErrNone(r); |
0 | 1136 |
r=gFileMan->RmDir(_L("\\START\\"),gStat); |
1137 |
WaitForSuccess(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1138 |
test_KErrNone(r); |
0 | 1139 |
r=gFileMan->RmDir(_L("\\FINISH\\"),gStat); |
1140 |
WaitForSuccess(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1141 |
test_KErrNone(r); |
0 | 1142 |
} |
1143 |
||
1144 |
if (!gAsynch) |
|
1145 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT"),_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT")); |
|
1146 |
else |
|
1147 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT"),_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT"),0,gStat); |
|
1148 |
TestResult(r,KErrNone); |
|
1149 |
||
1150 |
if (!gAsynch) |
|
1151 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\*.TXT"),_L("\\F32-TST\\TFMAN\\MOVEDIR\\")); |
|
1152 |
else |
|
1153 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\*.TXT"),_L("\\F32-TST\\TFMAN\\MOVEDIR\\"),0,gStat); |
|
1154 |
TestResult(r); |
|
1155 |
||
1156 |
if (!gAsynch) |
|
1157 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\*.TXT"),_L("\\F32-TST\\TFMAN\\MoveDIR.\\FILE*.TXT")); |
|
1158 |
else |
|
1159 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\*.TXT"),_L("\\F32-TST\\TFMAN\\MoveDIR\\FILE*.TXT"),0,gStat); |
|
1160 |
TestResult(r,KErrNotFound); |
|
1161 |
||
1162 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT")); |
|
1163 |
if (!gAsynch) |
|
1164 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT"),_L("\\F32-TST\\TFMAN\\MoveDIR\\FILE1.TXT"),0); |
|
1165 |
else |
|
1166 |
r=gFileMan->Move(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT"),_L("\\F32-TST\\TFMAN\\MoveDIR\\FILE1.TXT"),0,gStat); |
|
1167 |
TestResult(r,KErrAlreadyExists); |
|
1168 |
r=TheFs.Delete(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1169 |
test_KErrNone(r); |
0 | 1170 |
|
1171 |
test.Next(_L("Check files have been moved")); |
|
1172 |
RmDir(_L("\\F32-TST\\TFMAN\\AFTER\\*")); |
|
1173 |
MakeDir(_L("\\F32-TST\\TFMAN\\AFTER\\DELTEST\\EMPTY\\")); |
|
1174 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\DELTEST\\FILE4.TXT")); |
|
1175 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\DELTEST\\EXE1.BIN")); |
|
1176 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\EXE2.BIN")); |
|
1177 |
Compare(_L("\\F32-TST\\TFMAN\\AFTER\\*"),_L("\\F32-TST\\TFMAN\\DELDIR\\*")); |
|
1178 |
||
1179 |
RmDir(_L("\\F32-TST\\TFMAN\\AFTER\\*")); |
|
1180 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\FILE1.TXT")); |
|
1181 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\FILE2.TXT")); |
|
1182 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\FILE3.TXT")); |
|
1183 |
Compare(_L("\\F32-TST\\TFMAN\\AFTER\\*"),_L("\\F32-TST\\TFMAN\\MOVEDIR\\*")); |
|
1184 |
||
1185 |
if (testingInvalidPathLengths) |
|
1186 |
{ |
|
1187 |
r=gFileMan->RmDir(_L("\\TEST\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1188 |
test_KErrNone(r); |
0 | 1189 |
} |
1190 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1191 |
TestDEF121663(); // Test moving directory to its subdirectory |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1192 |
TestDEF123575(); // Test moving directories where src and trg have matching subdirectory structures |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1193 |
TestDEF125570(); // Test move when trg has at least one of the src dirs |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1194 |
TestDEF130404(); // Test move when the src doesn't fully exist |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1195 |
if (!IsTestingLFFS()) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1196 |
TestPDEF137716(); // Test moving files to overwrite folders that have the same names |
0 | 1197 |
} |
1198 |
||
1199 |
LOCAL_C void TestSimultaneous() |
|
1200 |
// |
|
1201 |
// Create and run two CFileMen simultaneously |
|
1202 |
// |
|
1203 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1204 |
test.Next(_L("Test create and run two CFileMans simultaneously")); |
0 | 1205 |
RmDir(_L("\\F32-TST\\TFMAN\\fman2\\")); |
1206 |
||
1207 |
MakeDir(_L("\\F32-TST\\TFMAN\\FMAN1\\")); |
|
1208 |
MakeDir(_L("\\F32-TST\\TFMAN\\FMAN2\\")); |
|
1209 |
MakeFile(_L("\\F32-TST\\TFMAN\\FMAN1\\ROD.TXT")); |
|
1210 |
MakeFile(_L("\\F32-TST\\TFMAN\\FMAN1\\JANE.TXT")); |
|
1211 |
MakeFile(_L("\\F32-TST\\TFMAN\\FMAN1\\FREDDY.TXT")); |
|
1212 |
MakeFile(_L("\\F32-TST\\TFMAN\\FMAN2\\BORIS.TXT")); |
|
1213 |
MakeFile(_L("\\F32-TST\\TFMAN\\FMAN2\\FREDRICK.TXT")); |
|
1214 |
MakeFile(_L("\\F32-TST\\TFMAN\\FMAN2\\PETER.TXT")); |
|
1215 |
||
1216 |
CFileMan* fman=CFileMan::NewL(TheFs); |
|
1217 |
TRequestStatus stat1; |
|
1218 |
TInt r=fman->Delete(_L("\\F32-TST\\TFMAN\\FMAN1\\*.*"),0,stat1); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1219 |
test_KErrNone(r); |
0 | 1220 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\FMAN2\\*.TXT"),_L("\\F32-TST\\TFMAN\\FMAN2\\*.EXT"),0,gStat); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1221 |
test_KErrNone(r); |
0 | 1222 |
FOREVER |
1223 |
{ |
|
1224 |
if (stat1!=KRequestPending && gStat!=KRequestPending) |
|
1225 |
break; |
|
1226 |
User::WaitForAnyRequest(); |
|
1227 |
} |
|
1228 |
test(stat1==KErrNone && gStat==KErrNone); |
|
1229 |
delete fman; |
|
1230 |
||
1231 |
test.Next(_L("Check all files")); |
|
1232 |
RmDir(_L("\\F32-TST\\TFMAN\\AFTER\\*")); |
|
1233 |
||
1234 |
MakeDir(_L("\\F32-TST\\TFMAN\\AFTER\\")); |
|
1235 |
Compare(_L("\\F32-TST\\TFMAN\\After\\*"),_L("\\F32-TST\\TFMAN\\FMAN1\\*")); |
|
1236 |
||
1237 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\BORIS.EXT")); |
|
1238 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\FREDRICK.EXT")); |
|
1239 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\PETER.EXT")); |
|
1240 |
Compare(_L("\\F32-TST\\TFMAN\\After\\*"),_L("\\F32-TST\\TFMAN\\FMAN2\\*")); |
|
1241 |
} |
|
1242 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1243 |
// Test wildcards are replaced with letters from the matched file (CFileMan::CreateTargetNameFromSource) |
0 | 1244 |
LOCAL_C void TestDEF092084() |
1245 |
{ |
|
1246 |
if(gAsynch) |
|
1247 |
{ |
|
1248 |
return; |
|
1249 |
} |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1250 |
test.Next(_L("Test wildcards are replaced with letters from the matched file (DEF092084)")); |
0 | 1251 |
MakeDir(_L("\\DEF092084")); |
1252 |
MakeFile(_L("\\DEF092084\\FILE1.TXT")); |
|
1253 |
||
1254 |
TInt r = gFileMan->Rename(_L("\\DEF092084\\*.TXT"),_L("\\DEF092084\\*.DDB"), CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1255 |
test_KErrNone(r); |
0 | 1256 |
CheckFileExists(_L("\\DEF092084\\FILE1.DDB"), KErrNone); |
1257 |
||
1258 |
r = gFileMan->Rename(_L("\\DEF092084\\?*.DD?"),_L("\\DEF092084\\?*.TXT"), CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1259 |
test_KErrNone(r); |
0 | 1260 |
CheckFileExists(_L("\\DEF092084\\FILE1.TXT"), KErrNone); |
1261 |
||
1262 |
RmDir(_L("\\DEF092084\\")); |
|
1263 |
} |
|
1264 |
||
1265 |
//--------------------------------------------- |
|
1266 |
//! @SYMTestCaseID PBASE-T_FMAN-0542 |
|
1267 |
//! @SYMTestType UT |
|
1268 |
//! @SYMREQ INC109754 |
|
1269 |
//! @SYMTestCaseDesc 1. Tests that CFileMan::Rename() does not incorrectly remove empty source directory |
|
1270 |
//! @SYMTestActions Renames the only file from source directory to target directory, then check if |
|
1271 |
//! the empty source directory still exists. |
|
1272 |
//! 2. Tests the trailing backslash ("\") is interpreted to ("\*.*"). |
|
1273 |
//! @SYMTestExpectedResults The operation completes with error code KErrNone; |
|
1274 |
//! The empty source directory still exists. |
|
1275 |
//! @SYMTestPriority High |
|
1276 |
//! @SYMTestStatus Implemented |
|
1277 |
//--------------------------------------------- |
|
1278 |
void TestINC109754() |
|
1279 |
{ |
|
1280 |
test.Next(_L("Test empty source directory should exist after contents being renamed (INC109754)")); |
|
1281 |
TInt r = KErrNone; |
|
1282 |
// Setting up comparing dir |
|
1283 |
RmDir( _L("\\F32-TST\\TFMAN\\INC109754_C\\")); |
|
1284 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC109754_C\\SRC\\")); |
|
1285 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC109754_C\\TRG\\FILE.TXT")); |
|
1286 |
||
1287 |
// Setting up testing dir |
|
1288 |
RmDir( _L("\\F32-TST\\TFMAN\\INC109754\\")); |
|
1289 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC109754\\SRC\\FILE.TXT")); |
|
1290 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC109754\\TRG\\")); |
|
1291 |
||
1292 |
// Test case 1: CFileMan::Rename(_L("C:\\SRC\\"), _L("C:\\TRG\\")); |
|
1293 |
if (!gAsynch) |
|
1294 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\INC109754\\SRC\\"),_L("\\F32-TST\\TFMAN\\INC109754\\TRG\\")); |
|
1295 |
else |
|
1296 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\INC109754\\SRC\\"),_L("\\F32-TST\\TFMAN\\INC109754\\TRG\\"),0,gStat); |
|
1297 |
TestResult(r); |
|
1298 |
Compare(_L("\\F32-TST\\TFMAN\\INC109754\\"), _L("\\F32-TST\\TFMAN\\INC109754_C\\")); |
|
1299 |
||
1300 |
// Setting up testing dir |
|
1301 |
RmDir( _L("\\F32-TST\\TFMAN\\INC109754\\")); |
|
1302 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC109754\\SRC\\FILE.TXT")); |
|
1303 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC109754\\TRG\\")); |
|
1304 |
||
1305 |
// Test case 2: CFileMan::Rename(_L("C:\\SRC\\*.*"), _L("C:\\TRG\\")); |
|
1306 |
if (!gAsynch) |
|
1307 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\INC109754\\SRC\\*.*"),_L("\\F32-TST\\TFMAN\\INC109754\\TRG\\")); |
|
1308 |
else |
|
1309 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\INC109754\\SRC\\*.*"),_L("\\F32-TST\\TFMAN\\INC109754\\TRG\\"),0,gStat); |
|
1310 |
TestResult(r); |
|
1311 |
Compare(_L("\\F32-TST\\TFMAN\\INC109754\\"), _L("\\F32-TST\\TFMAN\\INC109754_C\\")); |
|
1312 |
} |
|
1313 |
||
1314 |
||
1315 |
/* |
|
1316 |
Test code for INC111038() and executed with Cache enabled and FS_NOT_RUGGED. |
|
1317 |
*/ |
|
1318 |
LOCAL_C void TestINC111038() |
|
1319 |
{ |
|
1320 |
TInt r; |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1321 |
test.Next(_L("Test example of incorrect attribute flushing")); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1322 |
|
0 | 1323 |
_LIT(KTestFile, "\\TESTFILE.TXT"); |
1324 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1325 |
test.Printf(_L("1: Create Test File\n")); |
0 | 1326 |
RFile testFile; |
1327 |
r = testFile.Create(TheFs, KTestFile, EFileRead | EFileWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1328 |
test_KErrNone(r); |
0 | 1329 |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1330 |
test.Printf(_L("2: Populate testFile1 Data\n")); |
0 | 1331 |
r = testFile.Write(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1332 |
test_KErrNone(r); |
0 | 1333 |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1334 |
test.Printf(_L("3: Get Initial Attributes\n")); |
0 | 1335 |
TUint atts = 0; |
1336 |
r = testFile.Att(atts); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1337 |
test_KErrNone(r); |
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1338 |
test.Printf(_L(" Attributes: %08x"), atts); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1339 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1340 |
test.Printf(_L("4: Set KEntryAttHidden Attribute\n")); |
0 | 1341 |
r = testFile.SetAtt(KEntryAttHidden, 0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1342 |
test_KErrNone(r); |
0 | 1343 |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1344 |
test.Printf(_L("5: Verify KEntryAttHidden Attribute is set for testFile1\n")); |
0 | 1345 |
r = testFile.Att(atts); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1346 |
test_KErrNone(r); |
0 | 1347 |
test(atts & KEntryAttHidden); |
1348 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1349 |
test.Printf(_L("6: Read Data from beginning of file testFile1\n")); |
0 | 1350 |
TBuf8<4> data; |
1351 |
r = testFile.Read(0, data); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1352 |
test_KErrNone(r); |
0 | 1353 |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1354 |
test.Printf(_L("7: Close all the testFiles\n")); |
0 | 1355 |
testFile.Close(); |
1356 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1357 |
test.Printf(_L("8: Verify KEntryAttHidden is present\n")); |
0 | 1358 |
r = TheFs.Att(KTestFile, atts); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1359 |
test_KErrNone(r); |
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1360 |
test.Printf(_L(" Finally, attributes are : %08x\n"), atts); |
0 | 1361 |
test(atts & KEntryAttHidden); |
1362 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1363 |
test.Printf(_L("9: Delete Test File\n")); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1364 |
r = TheFs.Delete(KTestFile); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1365 |
test_Value(r, r == KErrNone || r == KErrNotFound); |
0 | 1366 |
} |
1367 |
||
1368 |
LOCAL_C void TestDEF113299() |
|
1369 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1370 |
test.Next(_L("Test invalid file rename (DEF113299)")); |
0 | 1371 |
|
1372 |
TInt err =0; |
|
1373 |
TFileName srcFileName = _L("C:\\F32-TST\\TFMAN\\DEF113299\\src\\corner.html"); |
|
1374 |
TFileName trgFileName = _L("C:\\F32-TST\\TFMAN\\DEF113299\\src\\mi?d**dle.html"); |
|
1375 |
TFileName trgInvalidFileName = _L("C:\\F32-TST\\TFMAN\\DEF113299\\src\\mi?d**dle>.html"); // Invalid filename |
|
1376 |
TFileName renamedFileName = _L("C:\\F32-TST\\TFMAN\\DEF113299\\src\\mirderdle.html"); |
|
1377 |
||
1378 |
RmDir(_L("C:\\F32-TST\\TFMAN\\DEF113299\\")); |
|
1379 |
MakeFile(srcFileName,_L8("Test Data")); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1380 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1381 |
// Renaming a file with invalid special characters should fail with error code KErrBadName(-28) |
0 | 1382 |
if (!gAsynch) |
1383 |
err = gFileMan->Rename(srcFileName,trgInvalidFileName); |
|
1384 |
else |
|
1385 |
err = gFileMan->Rename(srcFileName,trgInvalidFileName, 0, gStat); |
|
1386 |
TestResult(err,KErrBadName); |
|
1387 |
||
1388 |
if(!gAsynch) |
|
1389 |
err = gFileMan->Rename(srcFileName,trgFileName); |
|
1390 |
else |
|
1391 |
err = gFileMan->Rename(srcFileName,trgFileName, 0, gStat); |
|
1392 |
TestResult(err,KErrNone); |
|
1393 |
||
1394 |
CheckFileExists(renamedFileName,KErrNone,ETrue); |
|
1395 |
} |
|
1396 |
||
1397 |
LOCAL_C void TestRename() |
|
1398 |
// |
|
1399 |
// Test rename with wildcards |
|
1400 |
// |
|
1401 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1402 |
test.Next(_L("Test rename with wildcards")); |
0 | 1403 |
RmDir(_L("\\F32-TST\\TFMAN\\rename\\dest\\")); |
1404 |
||
1405 |
MakeDir(_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\")); |
|
1406 |
MakeDir(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\DirTest\\")); |
|
1407 |
MakeFile(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\abcDEF.TXT")); |
|
1408 |
MakeFile(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\abxx.TXT")); |
|
1409 |
MakeFile(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\HELLO.SPG")); |
|
1410 |
MakeFile(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\SHEET1.SPR")); |
|
1411 |
MakeFile(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\DirTest.TXT\\Unchanged.txt")); |
|
1412 |
||
1413 |
TInt r; |
|
1414 |
||
1415 |
if (testingInvalidPathLengths) |
|
1416 |
// Create a path of greater 256 characters by renaming a directory and check it can be |
|
1417 |
// manipulated (tests fix to F32) |
|
1418 |
{ |
|
1419 |
MakeDir(_L("\\LONGNAME\\")); |
|
1420 |
MakeDir(_L("\\LONGNAME\\DIRECTORY1DIRECTORY2DIRECTORY3DIRECTORY4\\")); |
|
1421 |
MakeFile(_L("\\LONGNAME\\ELEPHANT01ELEPHANT02ELEPHANT03ELEPHANT04.txt")); |
|
1422 |
MakeFile(_L("\\LONGNAME\\DINOSAUR01DINOSAUR02DINOSAUR03DINOSAUR04.txt")); |
|
1423 |
MakeFile(_L("\\LONGNAME\\FILEFILE01FILEFILE02FILEFILE03FILEFILE04.bin")); |
|
1424 |
r=gFileMan->Rename(_L("\\LONGNAME"),_L("\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff"),CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1425 |
test_KErrNone(r); |
0 | 1426 |
|
1427 |
// Two long directory names - makes paths invalid |
|
1428 |
MakeDir(_L("\\TEST\\LONG\\NAME\\FGHIJ")); |
|
1429 |
MakeDir(_L("\\TEST\\LONG\\NAME\\FGHIJ\\DIRECTORY1DIRECTORY2DIRECTORY3DIRECTORY4\\")); |
|
1430 |
MakeFile(_L("\\TEST\\LONG\\NAME\\FGHIJ\\ELEPHANT01ELEPHANT02ELEPHANT03ELEPHANT.txt")); |
|
1431 |
MakeFile(_L("\\TEST\\LONG\\NAME\\FGHIJ\\FILEFILE01FILEFILE02FILEFILE03FILEFILE.txt")); |
|
1432 |
r=gFileMan->Rename(_L("\\TEST\\LONG"),_L("\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as\\fdsa21asdffds"),CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1433 |
test_KErrNone(r); |
0 | 1434 |
} |
1435 |
||
1436 |
//testing invalid source path at the beginning: |
|
1437 |
if (!gAsynch) |
|
1438 |
{ |
|
1439 |
r=gFileMan->Rename(_L("::C\\F32-TST\\TFMAN\\RENAME\\SRC\\*.TXT"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*.DDB"),CFileMan::EOverWrite); |
|
1440 |
} |
|
1441 |
else |
|
1442 |
{ |
|
1443 |
r=gFileMan->Rename(_L("::C\\F32-TST\\TFMAN\\RENAME\\SRC\\*.TXT"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*.DDB"),CFileMan::EOverWrite,gStat); |
|
1444 |
} |
|
1445 |
TestResult(r,KErrBadName,KErrBadName); |
|
1446 |
||
1447 |
//testing invalid target path at the beginning: |
|
1448 |
||
1449 |
if (!gAsynch) |
|
1450 |
{ |
|
1451 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\*.TXT"),_L("::C\\F32-TST\\TFMAN\\RENAME\\DEST\\*.DDB"),CFileMan::EOverWrite); |
|
1452 |
} |
|
1453 |
else |
|
1454 |
{ |
|
1455 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\*.TXT"),_L("::C\\F32-TST\\TFMAN\\RENAME\\DEST\\*.DDB"),CFileMan::EOverWrite,gStat); |
|
1456 |
} |
|
1457 |
TestResult(r,KErrBadName,KErrBadName); |
|
1458 |
||
1459 |
//testing invalid source path at the middle: |
|
1460 |
if (!gAsynch) |
|
1461 |
{ |
|
1462 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\:RENAME\\SRC\\*.TXT"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*.DDB"),CFileMan::EOverWrite); |
|
1463 |
} |
|
1464 |
else |
|
1465 |
{ |
|
1466 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\:RENAME\\SRC\\*.TXT"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*.DDB"),CFileMan::EOverWrite,gStat); |
|
1467 |
} |
|
1468 |
TestResult(r,KErrBadName,KErrNone); |
|
1469 |
||
1470 |
//testing invalid target path at the middle: |
|
1471 |
if (!gAsynch) |
|
1472 |
{ |
|
1473 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\*.TXT"),_L("\\F32-TST\\TFMAN\\:RENAME\\DEST\\*.DDB"),CFileMan::EOverWrite); |
|
1474 |
} |
|
1475 |
else |
|
1476 |
{ |
|
1477 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\*.TXT"),_L("\\F32-TST\\TFMAN\\:RENAME\\DEST\\*.DDB"),CFileMan::EOverWrite,gStat); |
|
1478 |
} |
|
1479 |
TestResult(r,KErrBadName,KErrNone); |
|
1480 |
||
1481 |
//testing invalid source path at the end: |
|
1482 |
if (!gAsynch) |
|
1483 |
{ |
|
1484 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\:*.TXT"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*.DDB"),CFileMan::EOverWrite); |
|
1485 |
} |
|
1486 |
else |
|
1487 |
{ |
|
1488 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\:*.TXT"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*.DDB"),CFileMan::EOverWrite,gStat); |
|
1489 |
} |
|
1490 |
TestResult(r,KErrBadName,KErrNone); |
|
1491 |
||
1492 |
//testing invalid target path at the end: |
|
1493 |
if (!gAsynch) |
|
1494 |
{ |
|
1495 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\*.TXT"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\:*.DDB"),CFileMan::EOverWrite); |
|
1496 |
} |
|
1497 |
else |
|
1498 |
{ |
|
1499 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\*.TXT"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\:*.DDB"),CFileMan::EOverWrite,gStat); |
|
1500 |
} |
|
1501 |
TestResult(r,KErrBadName,KErrNone); |
|
1502 |
||
1503 |
if (!gAsynch) |
|
1504 |
{ |
|
1505 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\*.TXT"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*.DDB"),CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1506 |
test_KErrNone(r); |
0 | 1507 |
if (testingInvalidPathLengths) |
1508 |
{ |
|
1509 |
r=gFileMan->Rename(_L("\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff\\elephant01elephant02elephant03elephant04.txt"),_L("\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff\\elephant01elephant02elephant03elephant04.bin")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1510 |
test_Equal(KErrBadName, r); |
0 | 1511 |
r=gFileMan->Rename(_L("\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff"),_L("\\Shortened"),CFileMan::EOverWrite); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1512 |
test_KErrNone(r); |
0 | 1513 |
r=gFileMan->Rename(_L("\\Shortened\\*.txt"),_L("\\Shortened\\*.cat")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1514 |
test_KErrNone(r); |
0 | 1515 |
r=gFileMan->RmDir(_L("\\Shortened\\")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1516 |
test_KErrNone(r); |
0 | 1517 |
|
1518 |
r=gFileMan->Rename(_L("\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as\\fdsa21asdffds"),_L("\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as\\NotSoShortened"),CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1519 |
test_KErrNone(r); |
0 | 1520 |
r=gFileMan->Rename(_L("\\TEST"),_L("\\OXO!")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1521 |
test_KErrNone(r); |
0 | 1522 |
r=gFileMan->Rename(_L("\\OXO!\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as"),_L("\\OXO!\\Shorter")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1523 |
test_KErrNone(r); |
0 | 1524 |
r=gFileMan->Rename(_L("\\OXO!\\Shorter\\NotSoShortened\\NAME\\FGHIJ\\*.txt"),_L("\\TEST\\Shorter\\NotSoShortened\\NAME\\FGHIJ\\*.cat")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1525 |
test_KErrNone(r); |
0 | 1526 |
r=gFileMan->RmDir(_L("\\OXO!\\")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1527 |
test_KErrNone(r); |
0 | 1528 |
|
1529 |
} |
|
1530 |
} |
|
1531 |
else |
|
1532 |
{ |
|
1533 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\*.TXT"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*.DDB"),CFileMan::EOverWrite,gStat); |
|
1534 |
WaitForSuccess(); |
|
1535 |
if (testingInvalidPathLengths) |
|
1536 |
{ |
|
1537 |
r=gFileMan->Rename(_L("\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff\\elephant01elephant02elephant03elephant04.txt"),_L("\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff\\elephant01elephant02elephant03elephant04.bin")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1538 |
test_Equal(KErrBadName, r); |
0 | 1539 |
r=gFileMan->Rename(_L("\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff"),_L("\\Shortened"),CFileMan::EOverWrite,gStat); |
1540 |
WaitForSuccess(); |
|
1541 |
r=gFileMan->Rename(_L("\\Shortened\\*.txt"),_L("\\Shortened\\*.bin"),0,gStat); |
|
1542 |
WaitForSuccess(); |
|
1543 |
r=gFileMan->RmDir(_L("\\Shortened\\"),gStat); |
|
1544 |
WaitForSuccess(); |
|
1545 |
||
1546 |
r=gFileMan->Rename(_L("\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as\\fdsa21asdffds"),_L("\\TEST\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as\\NotSoShortened"),CFileMan::EOverWrite,gStat); |
|
1547 |
WaitForSuccess(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1548 |
test_KErrNone(r); |
0 | 1549 |
r=gFileMan->Rename(_L("\\TEST"),_L("\\OXO!"),CFileMan::EOverWrite,gStat); |
1550 |
WaitForSuccess(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1551 |
test_KErrNone(r); |
0 | 1552 |
r=gFileMan->Rename(_L("\\OXO!\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20as"),_L("\\OXO!\\Shorter"),CFileMan::EOverWrite,gStat); |
1553 |
WaitForSuccess(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1554 |
test_KErrNone(r); |
0 | 1555 |
r=gFileMan->Rename(_L("\\OXO!\\Shorter\\NotSoShortened\\NAME\\FGHIJ\\*.txt"),_L("\\TEST\\Shorter\\NotSoShortened\\NAME\\FGHIJ\\*.cat"),CFileMan::EOverWrite,gStat); |
1556 |
WaitForSuccess(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1557 |
test_KErrNone(r); |
0 | 1558 |
r=gFileMan->RmDir(_L("\\OXO!\\")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1559 |
test_KErrNone(r); |
0 | 1560 |
r=gFileMan->RmDir(_L("\\TEST\\")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1561 |
test_KErrNone(r); |
0 | 1562 |
} |
1563 |
} |
|
1564 |
RmDir(_L("\\F32-TST\\TFMAN\\after\\")); |
|
1565 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\abcDEF.DDB")); |
|
1566 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\abxx.DDB")); |
|
1567 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\DirTest.DDB\\Unchanged.txt")); |
|
1568 |
Compare(_L("\\F32-TST\\TFMAN\\AFTER\\*"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*")); |
|
1569 |
||
1570 |
RmDir(_L("\\F32-TST\\TFMAN\\after\\")); |
|
1571 |
MakeDir(_L("\\F32-TST\\TFMAN\\AFTER\\DirTest\\")); |
|
1572 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\HELLO.SPG")); |
|
1573 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\SHEET1.SPR")); |
|
1574 |
Compare(_L("\\F32-TST\\TFMAN\\AFTER\\*"),_L("\\F32-TST\\TFMAN\\RENAME\\SRC\\*")); |
|
1575 |
||
1576 |
if (!gAsynch) |
|
1577 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*.DDB"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*.TXT")); |
|
1578 |
else |
|
1579 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*.DDB"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*.TXT"),0,gStat); |
|
1580 |
TestResult(r); |
|
1581 |
||
1582 |
RmDir(_L("\\F32-TST\\TFMAN\\after\\")); |
|
1583 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\abcDEF.TXT")); |
|
1584 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\abxx.TXT")); |
|
1585 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\DirTest.TXT\\Unchanged.txt")); |
|
1586 |
Compare(_L("\\F32-TST\\TFMAN\\AFTER\\*"),_L("\\F32-TST\\TFMAN\\RENAME\\DEST\\*")); |
|
1587 |
||
1588 |
test.Next(_L("Test rename case of filenames")); |
|
1589 |
MakeFile(_L("\\F32-TST\\TFMAN\\CASETEST\\FileName1")); |
|
1590 |
||
1591 |
if (!gAsynch) |
|
1592 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\CASETEST\\FileName1"),_L("\\F32-TST\\TFMAN\\CASETEST\\FILENAME1")); |
|
1593 |
else |
|
1594 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\CASETEST\\FileName1"),_L("\\F32-TST\\TFMAN\\CASETEST\\FILENAME1"),0,gStat); |
|
1595 |
TestResult(r); |
|
1596 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CASETEST\\FileName1"),KErrNone,EFalse); |
|
1597 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CASETEST\\FILENAME1"),KErrNone,ETrue); |
|
1598 |
||
1599 |
if (!gAsynch) |
|
1600 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\CASETEST\\FILENAME1"),_L("\\F32-TST\\TFMAN\\CASETEST\\FILENAME1"),CFileMan::EOverWrite); |
|
1601 |
else |
|
1602 |
r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\CASETEST\\FILENAME1"),_L("\\F32-TST\\TFMAN\\CASETEST\\FILENAME1"),CFileMan::EOverWrite,gStat); |
|
1603 |
TestResult(r); |
|
1604 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CASETEST\\FILENAME1"),KErrNone,ETrue); |
|
1605 |
||
1606 |
// Test behaviour for omitted parameters |
|
1607 |
// For this, default should be session path |
|
1608 |
TFileName sessionPath; |
|
1609 |
TInt err=TheFs.SessionPath(sessionPath); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1610 |
test_KErrNone(err); |
0 | 1611 |
|
1612 |
SetupDirectories(ETrue, NULL); |
|
1613 |
err=TheFs.SetSessionPath(_L("\\F32-TST\\TFMAN\\dest\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1614 |
test_KErrNone(err); |
0 | 1615 |
|
1616 |
err = gFileMan->Rename(_L("\\F32-TST\\TFMAN\\source"), _L("")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1617 |
test_KErrNone(err); |
0 | 1618 |
Compare(_L("\\F32-TST\\TFMAN\\compare\\*"), _L("\\F32-TST\\TFMAN\\dest\\source\\*")); |
1619 |
||
1620 |
RmDir(_L("\\F32-TST\\TFMAN\\dest\\")); |
|
1621 |
RmDir(_L("\\F32-TST\\TFMAN\\source\\")); |
|
1622 |
SetupDirectories(ETrue, NULL); |
|
1623 |
err=TheFs.SetSessionPath(_L("\\F32-TST\\TFMAN\\source\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1624 |
test_KErrNone(err); |
0 | 1625 |
|
1626 |
err = gFileMan->Rename(_L(""), _L("\\F32-TST\\TFMAN\\dest\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1627 |
test_KErrNone(err); |
0 | 1628 |
Compare(_L("\\F32-TST\\TFMAN\\compare\\*"), _L("\\F32-TST\\TFMAN\\dest\\*")); |
1629 |
||
1630 |
err=TheFs.SetSessionPath(sessionPath); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1631 |
test_KErrNone(err); |
0 | 1632 |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1633 |
TestINC109754(); // Test empty source directory should exist after contents being renamed |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1634 |
TestDEF092084(); // Test wildcards are replaced with letters from the matched file |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1635 |
TestDEF113299(); // Test invalid file rename |
0 | 1636 |
} |
1637 |
||
1638 |
LOCAL_C void TestAttribs() |
|
1639 |
// |
|
1640 |
// Test attribs |
|
1641 |
// |
|
1642 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1643 |
test.Next(_L("Test set file attributes")); |
0 | 1644 |
MakeFile(_L("\\F32-TST\\TFMAN\\ATTRIBS\\Attrib1.AT")); |
1645 |
MakeFile(_L("\\F32-TST\\TFMAN\\ATTRIBS\\Attrib2.at")); |
|
1646 |
||
1647 |
TUint legalAttMask=KEntryAttMaskSupported&~(KEntryAttDir|KEntryAttVolume); |
|
1648 |
TUint setMask=KEntryAttReadOnly; |
|
1649 |
TUint clearMask=KEntryAttHidden|KEntryAttArchive; |
|
1650 |
if (!gAsynch) |
|
1651 |
{ |
|
1652 |
TInt r=gFileMan->Attribs(_L("\\F32-TST\\TFMAN\\ATTRIBS\\AT*.AT"),setMask,clearMask,TTime(0)); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1653 |
test_KErrNone(r); |
0 | 1654 |
} |
1655 |
else |
|
1656 |
{ |
|
1657 |
TInt r=gFileMan->Attribs(_L("\\F32-TST\\TFMAN\\ATTRIBS\\AT*.AT"),setMask,clearMask,TTime(0),0,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1658 |
test_KErrNone(r); |
0 | 1659 |
WaitForSuccess(); |
1660 |
} |
|
1661 |
||
1662 |
CDirScan* scan=CDirScan::NewL(TheFs); |
|
1663 |
scan->SetScanDataL(_L("\\F32-TST\\TFMAN\\ATTRIBS\\*"),KEntryAttMaskSupported,ESortByName); |
|
1664 |
CDir* entryList; |
|
1665 |
scan->NextL(entryList); |
|
1666 |
TInt count=entryList->Count(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1667 |
test_Equal(2, count); |
0 | 1668 |
TEntry entry=(*entryList)[0]; |
1669 |
test(entry.iName.MatchF(_L("attrib1.AT"))!=KErrNotFound); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1670 |
test_Equal(KEntryAttReadOnly, entry.iAtt); |
0 | 1671 |
entry=(*entryList)[1]; |
1672 |
test(entry.iName.MatchF(_L("attrib2.AT"))!=KErrNotFound); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1673 |
test_Equal(KEntryAttReadOnly, entry.iAtt); |
0 | 1674 |
delete entryList; |
1675 |
||
1676 |
TDateTime dateTime(1990,ENovember,20,9,5,0,0); |
|
1677 |
TTime time(dateTime); // FAT loses microseconds if try to convert HomeTime() |
|
1678 |
||
1679 |
if (!gAsynch) |
|
1680 |
{ |
|
1681 |
TInt r=gFileMan->Attribs(_L("\\F32-TST\\TFMAN\\ATTRIBS\\AT*.AT"),0,legalAttMask,time); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1682 |
test_KErrNone(r); |
0 | 1683 |
} |
1684 |
else |
|
1685 |
{ |
|
1686 |
TInt r=gFileMan->Attribs(_L("\\F32-TST\\TFMAN\\ATTRIBS\\AT*.AT"),0,legalAttMask,time,0,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1687 |
test_KErrNone(r); |
0 | 1688 |
WaitForSuccess(); |
1689 |
} |
|
1690 |
||
1691 |
scan->SetScanDataL(_L("\\F32-TST\\TFMAN\\ATTRIBS\\*"),KEntryAttMaskSupported,ESortByName); |
|
1692 |
scan->NextL(entryList); |
|
1693 |
count=entryList->Count(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1694 |
test_Equal(2, count); |
0 | 1695 |
entry=(*entryList)[0]; |
1696 |
test(entry.iName.MatchF(_L("attrib1.AT"))!=KErrNotFound); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1697 |
test_Equal(0, entry.iAtt); |
0 | 1698 |
TDateTime dt=(entry.iModified).DateTime(); |
1699 |
test(dt.Year()==dateTime.Year()); |
|
1700 |
test(dt.Month()==dateTime.Month()); |
|
1701 |
test(dt.Day()==dateTime.Day()); |
|
1702 |
test(dt.Hour()==dateTime.Hour()); |
|
1703 |
test(dt.Minute()==dateTime.Minute()); |
|
1704 |
test(dt.Second()==dateTime.Second()); |
|
1705 |
test(entry.iModified==time); |
|
1706 |
entry=(*entryList)[1]; |
|
1707 |
test(entry.iName.MatchF(_L("attrib2.AT"))!=KErrNotFound); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1708 |
test_Equal(0, entry.iAtt); |
0 | 1709 |
test(entry.iModified==time); |
1710 |
delete entryList; |
|
1711 |
delete scan; |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1712 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1713 |
TestINC111038(); // Test example of incorrect attribute flushing |
0 | 1714 |
} |
1715 |
||
1716 |
LOCAL_C void TestINC091841() |
|
1717 |
{ |
|
1718 |
if(gAsynch) |
|
1719 |
{ |
|
1720 |
return; |
|
1721 |
} |
|
1722 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1723 |
test.Next(_L("Test delete long fullnames (INC091841)")); |
0 | 1724 |
MakeDir(_L("\\12345678\\Book\\12345678\\")); |
1725 |
TFileName longname; |
|
1726 |
longname.Copy(_L("\\12345678\\Book\\12345678\\12345678901234567890123456789012345678901234567890.x")); |
|
1727 |
MakeFile(longname); |
|
1728 |
TFileName oldname = longname; |
|
1729 |
TInt ret = KErrNone; |
|
1730 |
while(ret == KErrNone) |
|
1731 |
{ |
|
1732 |
oldname = longname; |
|
1733 |
longname.Append(_L("xxxxx")); |
|
1734 |
ret = TheFs.Replace(oldname, longname); |
|
1735 |
} |
|
1736 |
if(oldname.Length() >= KMaxFileName-5) // if not, it means that we won't be calling ShrinkNames !! |
|
1737 |
{ |
|
1738 |
TInt r = gFileMan->Rename(_L("\\12345678\\Book\\12345678"),_L("\\INC091841\\Book\\012-235-abcd"),0); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1739 |
test_KErrNone(r); |
0 | 1740 |
CDir* dir; |
1741 |
r = TheFs.GetDir(_L("\\INC091841\\Book\\012-235-abcd\\"), KEntryAttNormal, ESortNone, dir); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1742 |
test_KErrNone(r); |
0 | 1743 |
r = KErrNotFound; |
1744 |
TInt dirlen = sizeof("\\INC091841\\Book\\012-235-abcd\\"); |
|
1745 |
for(TInt i=0; r==KErrNotFound && i<dir->Count(); i++) |
|
1746 |
{ |
|
1747 |
if((*dir)[i].iName.Length() + dirlen > oldname.Length()) |
|
1748 |
{ |
|
1749 |
r = KErrNone; |
|
1750 |
} |
|
1751 |
} |
|
1752 |
delete dir; |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1753 |
test_KErrNone(r); |
0 | 1754 |
r = gFileMan->RmDir(_L("\\INC091841\\")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1755 |
test_KErrNone(r); |
0 | 1756 |
} |
1757 |
RmDir(_L("\\12345678\\")); |
|
1758 |
} |
|
1759 |
||
1760 |
LOCAL_C void TestRmDir() |
|
1761 |
// |
|
1762 |
// Test rmdir function |
|
1763 |
// |
|
1764 |
{ |
|
1765 |
test.Next(_L("Test rmdir function")); |
|
1766 |
||
1767 |
MakeDir(_L("\\F32-TST\\TFMAN\\RMDIR\\EMPTY\\")); |
|
1768 |
MakeFile(_L("\\F32-TST\\TFMAN\\RMDIR\\ALFRED.txt")); |
|
1769 |
MakeFile(_L("\\F32-TST\\TFMAN\\RMDIR\\RICHARD.txt")); |
|
1770 |
MakeFile(_L("\\F32-TST\\TFMAN\\RMDIR\\RMSUBDIR1\\RMSUBSUBDIR\\CHARLES.txt")); |
|
1771 |
MakeFile(_L("\\F32-TST\\TFMAN\\RMDIR\\RMSUBDIR2\\EDMUND.txt")); |
|
1772 |
MakeDir(_L("\\F32-TST\\TFMAN\\TESTDIR\\")); |
|
1773 |
MakeFile(_L("\\F32-TST\\TFMAN\\TESTDIR\\DEF123044.txt")); |
|
1774 |
||
1775 |
TInt r; |
|
1776 |
||
1777 |
if (testingInvalidPathLengths) |
|
1778 |
// Create a path of greater 256 characters by renaming a directory and check it can be |
|
1779 |
// manipulated (tests fix to F32) |
|
1780 |
{ |
|
1781 |
MakeDir(_L("\\LONGNAMETEST\\")); |
|
1782 |
MakeDir(_L("\\LONGNAMETEST\\DIRECTORY1DIRECTORY2DIRECTORY3DIRECTORY4\\")); |
|
1783 |
MakeFile(_L("\\LONGNAMETEST\\ELEPHANT01ELEPHANT02ELEPHANT03ELEPHANT04")); |
|
1784 |
MakeFile(_L("\\LONGNAMETEST\\FILEFILE01FILEFILE02FILEFILE03FILEFILE04")); |
|
1785 |
r=gFileMan->Rename(_L("\\LONGNAMETEST"),_L("\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff"),CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1786 |
test_KErrNone(r); |
0 | 1787 |
} |
1788 |
||
1789 |
//testing invalid source path at the beginning: |
|
1790 |
if (!gAsynch) |
|
1791 |
{ |
|
1792 |
r=gFileMan->RmDir(_L(":C:\\F32-TST\\TFMAN\\RMDIR\\*.AT")); |
|
1793 |
} |
|
1794 |
else |
|
1795 |
{ |
|
1796 |
r=gFileMan->RmDir(_L(":C:\\F32-TST\\TFMAN\\RMDIR\\*.AT"),gStat); |
|
1797 |
} |
|
1798 |
TestResult(r,KErrBadName,KErrBadName); |
|
1799 |
||
1800 |
//testing invalid source path at the middle: |
|
1801 |
if (!gAsynch) |
|
1802 |
{ |
|
1803 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\:RMDIR\\*.AT")); |
|
1804 |
} |
|
1805 |
else |
|
1806 |
{ |
|
1807 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\:RMDIR\\*.AT"),gStat); |
|
1808 |
} |
|
1809 |
TestResult(r,KErrBadName,KErrNone); |
|
1810 |
||
1811 |
//testing invalid source path at the end: |
|
1812 |
if (!gAsynch) |
|
1813 |
{ |
|
1814 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\TESTDIR\\:DEF.txt")); |
|
1815 |
} |
|
1816 |
else |
|
1817 |
{ |
|
1818 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\TESTDIR\\:DEF.txt"),gStat); |
|
1819 |
} |
|
1820 |
TestResult(r,KErrNone,KErrNone); |
|
1821 |
||
1822 |
if (!gAsynch) |
|
1823 |
{ |
|
1824 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\RMDIR\\*.AT")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1825 |
test_KErrNone(r); |
0 | 1826 |
if (testingInvalidPathLengths) |
1827 |
{ |
|
1828 |
r=gFileMan->RmDir(_L("\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1829 |
test_KErrNone(r); |
0 | 1830 |
} |
1831 |
} |
|
1832 |
else |
|
1833 |
{ |
|
1834 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\RMDIR\\*.AT"),gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1835 |
test_KErrNone(r); |
0 | 1836 |
WaitForSuccess(); |
1837 |
if (testingInvalidPathLengths) |
|
1838 |
{ |
|
1839 |
r=gFileMan->RmDir(_L("\\asdffdsa01asdffdsa02asdffdsa03asdffdsa04asdffdsa05asdffdsa06asdffdsa07asdffdsa08asdffdsa09asdffdsa10asdffdsa11asdffdsa12asdffdsa13asdffdsa14asdffdsa15asdffdsa16asdffdsa17asdffdsa18asdffdsa19asdffdsa20asdffdsa21asdffdsa22asdff\\"),gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1840 |
test_KErrNone(r); |
0 | 1841 |
WaitForSuccess(); |
1842 |
} |
|
1843 |
} |
|
1844 |
||
1845 |
TEntry entry; |
|
1846 |
r=TheFs.Entry(_L("\\F32-TST\\TFMAN\\RMDIR"),entry); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1847 |
test_Equal(KErrNotFound, r); |
0 | 1848 |
|
1849 |
MakeDir(_L("\\F32-TST\\TFMAN\\READONLY\\")); |
|
1850 |
r=TheFs.SetAtt(_L("\\F32-TST\\TFMAN\\READONLY\\"),KEntryAttReadOnly,0); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1851 |
test_KErrNone(r); |
0 | 1852 |
|
1853 |
if (!gAsynch) |
|
1854 |
{ |
|
1855 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\READONLY\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1856 |
test_Equal(KErrAccessDenied, r); |
0 | 1857 |
} |
1858 |
else |
|
1859 |
{ |
|
1860 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\READONLY\\"),gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1861 |
test_KErrNone(r); |
0 | 1862 |
WaitForResult(KErrAccessDenied); |
1863 |
} |
|
1864 |
||
1865 |
r=TheFs.SetAtt(_L("\\F32-TST\\TFMAN\\READONLY\\"),0,KEntryAttReadOnly); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1866 |
test_KErrNone(r); |
0 | 1867 |
|
1868 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\READONLY\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1869 |
test_KErrNone(r); |
0 | 1870 |
|
1871 |
// Test behaviour for omitted parameters |
|
1872 |
// For this, default should be session path |
|
1873 |
TFileName sessionPath; |
|
1874 |
r=TheFs.SessionPath(sessionPath); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1875 |
test_KErrNone(r); |
0 | 1876 |
|
1877 |
SetupDirectories(ETrue, NULL); |
|
1878 |
r=TheFs.SetSessionPath(_L("\\F32-TST\\TFMAN\\source\\")); |
|
1879 |
||
1880 |
// Default removal of session path |
|
1881 |
r=gFileMan->RmDir(_L("")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1882 |
test_KErrNone(r); |
0 | 1883 |
|
1884 |
r=TheFs.SetSessionPath(sessionPath); |
|
1885 |
||
1886 |
r = gFileMan->Rename(_L("\\F32-TST\\TFMAN\\source\\subdir"), _L("\\F32-TST\\TFMAN\\source\\tofail"), CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1887 |
test_Equal(KErrPathNotFound, r); |
0 | 1888 |
|
1889 |
r = gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1890 |
test_KErrNone(r); |
0 | 1891 |
MakeDir(_L("\\F32-TST\\TFMAN\\")); |
1892 |
||
1893 |
if(testingInvalidPathLengths) |
|
1894 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1895 |
TestINC091841(); // Test delete long fullnames |
0 | 1896 |
} |
1897 |
||
1898 |
//--------------------------------------------- |
|
1899 |
//! @SYMTestCaseID PBASE-T_FMAN-0316 |
|
1900 |
//! @SYMTestType UT |
|
1901 |
//! @SYMREQ DEF099820 |
|
1902 |
//! @SYMTestCaseDesc Test that CFileMan::RmDir() works when deleting a directory containing open files. |
|
1903 |
//! @SYMTestActions Open a file within a directory and try to remove the directory. |
|
1904 |
//! @SYMTestExpectedResults The operation completes with the error code KErrInUse. |
|
1905 |
//! @SYMTestPriority High |
|
1906 |
//! @SYMTestStatus Implemented |
|
1907 |
//--------------------------------------------- |
|
1908 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1909 |
test.Next(_L("Test delete directory containing open files")); |
0 | 1910 |
gFileMan->SetObserver(NULL); |
1911 |
||
1912 |
MakeDir(_L("\\F32-TST\\TFMAN\\OPENFILE\\")); |
|
1913 |
MakeFile(_L("\\F32-TST\\TFMAN\\OPENFILE\\FILE.TXT")); |
|
1914 |
||
1915 |
RFile file; |
|
1916 |
r = file.Open(TheFs,_L("\\F32-TST\\TFMAN\\OPENFILE\\FILE.TXT"), EFileRead | EFileShareExclusive); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1917 |
test_KErrNone(r); |
0 | 1918 |
|
1919 |
if (!gAsynch) |
|
1920 |
{ |
|
1921 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\OPENFILE\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1922 |
test_Equal(KErrInUse, r); |
0 | 1923 |
|
1924 |
file.Close(); |
|
1925 |
||
1926 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\OPENFILE\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1927 |
test_KErrNone(r); |
0 | 1928 |
} |
1929 |
else |
|
1930 |
{ |
|
1931 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\OPENFILE\\"), gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1932 |
test_KErrNone(r); |
0 | 1933 |
WaitForResult(KErrInUse); |
1934 |
||
1935 |
file.Close(); |
|
1936 |
||
1937 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\OPENFILE\\"), gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1938 |
test_KErrNone(r); |
0 | 1939 |
WaitForResult(KErrNone); |
1940 |
} |
|
1941 |
||
1942 |
gFileMan->SetObserver(gObserver); |
|
1943 |
} |
|
1944 |
||
1945 |
LOCAL_C void TestRecursiveCopy() |
|
1946 |
// |
|
1947 |
// Test the recursive copy function |
|
1948 |
// |
|
1949 |
{ |
|
1950 |
test.Next(_L("Test recursive copy")); |
|
1951 |
RmDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
1952 |
||
1953 |
MakeDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
1954 |
MakeDir(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\EMPTY\\")); |
|
1955 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT")); |
|
1956 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE2.TXT")); |
|
1957 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE3.TXT")); |
|
1958 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\FILE4.TXT")); |
|
1959 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\EXE1.BIN")); |
|
1960 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\EXE2.BIN")); |
|
1961 |
||
1962 |
TInt r; |
|
1963 |
if (!gAsynch) |
|
1964 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\"),_L("\\F32-TST\\TFMAN\\COPYDIR"),CFileMan::ERecurse); |
|
1965 |
else |
|
1966 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\"),_L("\\F32-TST\\TFMAN\\COPYDIR"),CFileMan::ERecurse,gStat); |
|
1967 |
TestResult(r); |
|
1968 |
||
1969 |
Compare(_L("\\F32-TST\\TFMAN\\DELDIR\\*"),_L("\\F32-TST\\TFMAN\\COPYDIR\\*")); |
|
1970 |
RmDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
1971 |
MakeDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
1972 |
||
1973 |
if (!gAsynch) |
|
1974 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\*.BIN"),_L("\\F32-TST\\TFMAN\\COPYDIR\\*.EXT"),CFileMan::ERecurse); |
|
1975 |
else |
|
1976 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\*.BIN"),_L("\\F32-TST\\TFMAN\\COPYDIR\\*.EXT"),CFileMan::ERecurse,gStat); |
|
1977 |
TestResult(KErrNone); |
|
1978 |
||
1979 |
RmDir(_L("\\F32-TST\\TFMAN\\after\\")); |
|
1980 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\DELTEST\\EXE1.EXT")); |
|
1981 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\EXE2.EXT")); |
|
1982 |
Compare(_L("\\F32-TST\\TFMAN\\AFTER\\*"),_L("\\F32-TST\\TFMAN\\COPYDIR\\*")); |
|
1983 |
||
1984 |
// Test behaviour for omitted parameters |
|
1985 |
// For this, default should be session path |
|
1986 |
TFileName sessionPath; |
|
1987 |
r=TheFs.SessionPath(sessionPath); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1988 |
test_KErrNone(r); |
0 | 1989 |
|
1990 |
RmDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
1991 |
MakeDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
1992 |
r=TheFs.SetSessionPath(_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
1993 |
||
1994 |
// Default copy to session path |
|
1995 |
if (!gAsynch) |
|
1996 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\"),_L(""),CFileMan::ERecurse); |
|
1997 |
else |
|
1998 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\"),_L(""),CFileMan::ERecurse,gStat); |
|
1999 |
TestResult(KErrNone); |
|
2000 |
Compare(_L("\\F32-TST\\TFMAN\\DELDIR\\*"),_L("\\F32-TST\\TFMAN\\COPYDIR\\*")); |
|
2001 |
||
2002 |
RmDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
2003 |
MakeDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
2004 |
r=TheFs.SetSessionPath(_L("\\F32-TST\\TFMAN\\DELDIR\\")); |
|
2005 |
||
2006 |
// Default copy from session path |
|
2007 |
if (!gAsynch) |
|
2008 |
r=gFileMan->Copy(_L(""),_L("\\F32-TST\\TFMAN\\COPYDIR\\"),CFileMan::ERecurse); |
|
2009 |
else |
|
2010 |
r=gFileMan->Copy(_L(""),_L("\\F32-TST\\TFMAN\\COPYDIR\\"),CFileMan::ERecurse,gStat); |
|
2011 |
TestResult(KErrNone); |
|
2012 |
Compare(_L("\\F32-TST\\TFMAN\\DELDIR\\*"),_L("\\F32-TST\\TFMAN\\COPYDIR\\*")); |
|
2013 |
||
2014 |
RmDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
2015 |
RmDir(_L("\\F32-TST\\TFMAN\\DELDIR\\")); |
|
2016 |
r=TheFs.SetSessionPath(sessionPath); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2017 |
test_KErrNone(r); |
0 | 2018 |
} |
2019 |
||
2020 |
LOCAL_C void TestRecursiveAttribs() |
|
2021 |
// |
|
2022 |
// Test set attribs recursively |
|
2023 |
// |
|
2024 |
{ |
|
2025 |
test.Next(_L("Test recursive attribs")); |
|
2026 |
MakeFile(_L("\\F32-TST\\TFMAN\\RECATTRIBS\\Attrib1.AT")); |
|
2027 |
MakeFile(_L("\\F32-TST\\TFMAN\\RECATTRIBS\\Attrib2.at")); |
|
2028 |
MakeFile(_L("\\F32-TST\\TFMAN\\RECATTRIBS\\SUBDIR\\ATFILE.TXT")); |
|
2029 |
||
2030 |
if (!gAsynch) |
|
2031 |
{ |
|
2032 |
TInt r=gFileMan->Attribs(_L("\\F32-TST\\TFMAN\\RECATTRIBS\\"),KEntryAttReadOnly,0,TTime(0),CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2033 |
test_KErrNone(r); |
0 | 2034 |
} |
2035 |
else |
|
2036 |
{ |
|
2037 |
TInt r=gFileMan->Attribs(_L("\\F32-TST\\TFMAN\\RECATTRIBS\\"),KEntryAttReadOnly,0,TTime(0),CFileMan::ERecurse,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2038 |
test_KErrNone(r); |
0 | 2039 |
WaitForSuccess(); |
2040 |
} |
|
2041 |
||
2042 |
CDir* entryList; |
|
2043 |
CDirScan* scan=CDirScan::NewL(TheFs); |
|
2044 |
scan->SetScanDataL(_L("\\F32-TST\\TFMAN\\RECATTRIBS\\*"),KEntryAttMaskSupported,ESortByName); |
|
2045 |
scan->NextL(entryList); |
|
2046 |
TInt count=entryList->Count(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2047 |
test_Equal(3, count); |
0 | 2048 |
TEntry entry=(*entryList)[0]; |
2049 |
test(entry.iName.MatchF(_L("ATTRIB1.AT"))!=KErrNotFound); |
|
2050 |
if (!IsTestingLFFS()) |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2051 |
{ |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2052 |
test_Equal((KEntryAttReadOnly|KEntryAttArchive), entry.iAtt); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2053 |
} |
0 | 2054 |
else |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2055 |
{ |
0 | 2056 |
test(entry.iAtt&KEntryAttReadOnly); // ??? |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2057 |
} |
0 | 2058 |
entry=(*entryList)[1]; |
2059 |
test(entry.iName.MatchF(_L("ATTRIB2.AT"))!=KErrNotFound); |
|
2060 |
if (!IsTestingLFFS()) |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2061 |
{ |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2062 |
test_Equal((KEntryAttReadOnly|KEntryAttArchive), entry.iAtt); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2063 |
} |
0 | 2064 |
else |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2065 |
{ |
0 | 2066 |
test(entry.iAtt&KEntryAttReadOnly); // ??? |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2067 |
} |
0 | 2068 |
entry=(*entryList)[2]; |
2069 |
test(entry.iName.MatchF(_L("SUBDIR"))!=KErrNotFound); |
|
2070 |
delete entryList; |
|
2071 |
||
2072 |
scan->NextL(entryList); |
|
2073 |
count=entryList->Count(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2074 |
test_Equal(1, count); |
0 | 2075 |
entry=(*entryList)[0]; |
2076 |
test(entry.iName.MatchF(_L("ATFILE.TXT"))!=KErrNotFound); |
|
2077 |
if (!IsTestingLFFS()) |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2078 |
{ |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2079 |
test_Equal((KEntryAttReadOnly|KEntryAttArchive), entry.iAtt); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2080 |
} |
0 | 2081 |
else |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2082 |
{ |
0 | 2083 |
test(entry.iAtt&KEntryAttReadOnly); // ??? |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2084 |
} |
0 | 2085 |
delete entryList; |
2086 |
||
2087 |
scan->NextL(entryList); |
|
2088 |
test(entryList==NULL); |
|
2089 |
||
2090 |
if (!gAsynch) |
|
2091 |
{ |
|
2092 |
TInt r=gFileMan->Attribs(_L("\\F32-TST\\TFMAN\\RECATTRIBS\\"),0,KEntryAttReadOnly|KEntryAttArchive,TTime(0),CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2093 |
test_KErrNone(r); |
0 | 2094 |
} |
2095 |
else |
|
2096 |
{ |
|
2097 |
TInt r=gFileMan->Attribs(_L("\\F32-TST\\TFMAN\\RECATTRIBS\\"),0,KEntryAttReadOnly|KEntryAttArchive,TTime(0),CFileMan::ERecurse,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2098 |
test_KErrNone(r); |
0 | 2099 |
WaitForSuccess(); |
2100 |
} |
|
2101 |
||
2102 |
scan->SetScanDataL(_L("\\F32-TST\\TFMAN\\RECATTRIBS\\*"),KEntryAttMaskSupported,ESortByName); |
|
2103 |
scan->NextL(entryList); |
|
2104 |
count=entryList->Count(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2105 |
test_Equal(3, count); |
0 | 2106 |
entry=(*entryList)[0]; |
2107 |
test(entry.iName.MatchF(_L("ATTRIB1.AT"))!=KErrNotFound); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2108 |
test_Equal(KEntryAttNormal, entry.iAtt); |
0 | 2109 |
entry=(*entryList)[1]; |
2110 |
test(entry.iName.MatchF(_L("ATTRIB2.AT"))!=KErrNotFound); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2111 |
test_Equal(KEntryAttNormal, entry.iAtt); |
0 | 2112 |
entry=(*entryList)[2]; |
2113 |
test(entry.iName.MatchF(_L("SUBDIR"))!=KErrNotFound); |
|
2114 |
delete entryList; |
|
2115 |
||
2116 |
scan->NextL(entryList); |
|
2117 |
count=entryList->Count(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2118 |
test_Equal(1, count); |
0 | 2119 |
entry=(*entryList)[0]; |
2120 |
test(entry.iName.MatchF(_L("ATFILE.TXT"))!=KErrNotFound); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2121 |
test_Equal(KEntryAttNormal, entry.iAtt); |
0 | 2122 |
delete entryList; |
2123 |
||
2124 |
scan->NextL(entryList); |
|
2125 |
test(entryList==NULL); |
|
2126 |
delete scan; |
|
2127 |
} |
|
2128 |
||
2129 |
LOCAL_C void TestRecursiveDelete() |
|
2130 |
// |
|
2131 |
// Test Recursive delete |
|
2132 |
// |
|
2133 |
{ |
|
2134 |
test.Next(_L("Test recursive delete")); |
|
2135 |
MakeFile(_L("\\F32-TST\\TFMAN\\RECDELETE\\FULL\\GRAPE.TXT")); |
|
2136 |
MakeFile(_L("\\F32-TST\\TFMAN\\RECDELETE\\FULL\\GRAPE.PLP")); |
|
2137 |
MakeFile(_L("\\F32-TST\\TFMAN\\RECDELETE\\GRAPE.PLP")); |
|
2138 |
MakeFile(_L("\\F32-TST\\TFMAN\\RECDELETE\\FILE1.TXT")); |
|
2139 |
||
2140 |
if (!gAsynch) |
|
2141 |
{ |
|
2142 |
TInt r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\RECDELETE\\*.PLP"),CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2143 |
test_KErrNone(r); |
0 | 2144 |
} |
2145 |
else |
|
2146 |
{ |
|
2147 |
TInt r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\RECDELETE\\*.PLP"),CFileMan::ERecurse,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2148 |
test_KErrNone(r); |
0 | 2149 |
WaitForSuccess(); |
2150 |
} |
|
2151 |
||
2152 |
RmDir(_L("\\F32-TST\\TFMAN\\after\\")); |
|
2153 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\FULL\\GRAPE.TXT")); |
|
2154 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\FILE1.TXT")); |
|
2155 |
Compare(_L("\\F32-TST\\TFMAN\\after\\*"),_L("\\F32-TST\\TFMAN\\RecDelete\\*")); |
|
2156 |
} |
|
2157 |
||
2158 |
LOCAL_C void TestINC108401() |
|
2159 |
{ |
|
2160 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2161 |
test.Next(_L("Test synchronous and asynchronous move operations (INC108401)")); |
0 | 2162 |
TInt err = 0; |
2163 |
||
2164 |
TFileName trgPath = _L("?:\\F32-TST\\"); |
|
2165 |
||
2166 |
if (gSessionPath[0]!='D'&& gSessionPath[0]!='Y') |
|
2167 |
{ |
|
2168 |
#if !defined(__WINS__) |
|
2169 |
trgPath[0] = 'D'; |
|
2170 |
#else |
|
2171 |
trgPath[0] = 'Y'; |
|
2172 |
#endif |
|
2173 |
} |
|
2174 |
else |
|
2175 |
return; |
|
2176 |
||
2177 |
TFileName trgDir = trgPath; |
|
2178 |
trgDir.Append(_L("TFMAN\\INC108401\\dest\\")); |
|
2179 |
||
2180 |
// Moving files and dirs ACROSS DRIVE. |
|
2181 |
err = 0; |
|
2182 |
MakeDir(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\subDirC\\")); |
|
2183 |
MakeDir(trgDir); |
|
2184 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\file1")); |
|
2185 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\file2"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\file2")); |
|
2186 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file1")); |
|
2187 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file2"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file2")); |
|
2188 |
// Synchronously |
|
2189 |
if (!gAsynch) |
|
2190 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), trgDir, 0); |
|
2191 |
else // Asynchronously |
|
2192 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), trgDir, 0, gStat); |
|
2193 |
test.Next(_L("Test INC108401 : ACROSS DRIVES with 0")); |
|
2194 |
TestResult(err); |
|
2195 |
// cleanup the current drive |
|
2196 |
RmDir(trgPath); |
|
2197 |
// remove the F32-TST dir on the C: drive |
|
2198 |
RmDir(_L("\\F32-TST\\TFMAN\\")); |
|
2199 |
||
2200 |
err = 0; |
|
2201 |
MakeDir(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\subDirC\\")); |
|
2202 |
MakeDir(trgDir); |
|
2203 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\file1")); |
|
2204 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\file2"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\file2")); |
|
2205 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file1")); |
|
2206 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file2"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file2")); |
|
2207 |
// Synchronously |
|
2208 |
if (!gAsynch) |
|
2209 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), trgDir, CFileMan::EOverWrite); |
|
2210 |
else // Asynchronously |
|
2211 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), trgDir, CFileMan::EOverWrite, gStat); |
|
2212 |
test.Next(_L("Test INC108401 : ACROSS DRIVES with CFileMan::EOverWrite")); |
|
2213 |
TestResult(err); |
|
2214 |
// cleanup the current drive |
|
2215 |
RmDir(trgPath); |
|
2216 |
// remove the F32-TST dir on the C: drive |
|
2217 |
RmDir(_L("\\F32-TST\\")); |
|
2218 |
||
2219 |
err = 0; |
|
2220 |
MakeDir(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\subDirC\\")); |
|
2221 |
MakeDir(trgDir); |
|
2222 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\file1")); |
|
2223 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\file2"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\file2")); |
|
2224 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file1")); |
|
2225 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file2"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file2")); |
|
2226 |
// Synchronously |
|
2227 |
if (!gAsynch) |
|
2228 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), trgDir, CFileMan::ERecurse); |
|
2229 |
else // Asynchronously |
|
2230 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), trgDir, CFileMan::ERecurse, gStat); |
|
2231 |
test.Next(_L("Test INC108401 : ACROSS DRIVES with CFileMan::ERecurse")); |
|
2232 |
TestResult(err); |
|
2233 |
// cleanup the current drive |
|
2234 |
RmDir(trgPath); |
|
2235 |
// remove the F32-TST dir on the C: drive |
|
2236 |
RmDir(_L("\\F32-TST\\")); |
|
2237 |
||
2238 |
||
2239 |
// Moving files and dirs on the SAME DRIVE. |
|
2240 |
// case for gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), _L("\\F32-TST\\TFMAN\\INC108401\\dest\\"), 0); |
|
2241 |
MakeDir(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\subDirC\\")); |
|
2242 |
MakeDir(_L("\\F32-TST\\TFMAN\\INC108401\\dest\\")); |
|
2243 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\file1")); |
|
2244 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\file2"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\file2")); |
|
2245 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file1")); |
|
2246 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file2"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file2")); |
|
2247 |
// Synchronously |
|
2248 |
if (!gAsynch) |
|
2249 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), _L("\\F32-TST\\TFMAN\\INC108401\\dest\\"), 0); |
|
2250 |
else // Asynchronously |
|
2251 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), _L("\\F32-TST\\TFMAN\\INC108401\\dest\\"), 0, gStat); |
|
2252 |
test.Next(_L("Test INC108401 : SAME DRIVE with 0")); |
|
2253 |
TestResult(err); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2254 |
// test_KErrNone(err); |
0 | 2255 |
RmDir(_L("\\F32-TST\\TFMAN\\INC108401\\")); |
2256 |
||
2257 |
// case for gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), _L("\\F32-TST\\TFMAN\\INC108401\\dest\\"), CFileMan::EOverWrite); |
|
2258 |
MakeDir(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\subDirC\\")); |
|
2259 |
MakeDir(_L("\\F32-TST\\TFMAN\\INC108401\\dest\\")); |
|
2260 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\file1")); |
|
2261 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\file2"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\file2")); |
|
2262 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file1")); |
|
2263 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file2"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file2")); |
|
2264 |
// Synchronously |
|
2265 |
if (!gAsynch) |
|
2266 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), _L("\\F32-TST\\TFMAN\\INC108401\\dest\\"), CFileMan::EOverWrite); |
|
2267 |
else // Asynchronously |
|
2268 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), _L("\\F32-TST\\TFMAN\\INC108401\\dest\\"), CFileMan::EOverWrite, gStat); |
|
2269 |
test.Next(_L("Test INC108401 : SAME DRIVE with CFileMan::EOverWrite")); |
|
2270 |
TestResult(err); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2271 |
// test_KErrNone(err); |
0 | 2272 |
RmDir(_L("\\F32-TST\\TFMAN\\INC108401\\")); |
2273 |
||
2274 |
// case for gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), _L("\\F32-TST\\TFMAN\\INC108401\\dest\\"), CFileMan::EOverWrite|CFileMan::ERecurse); |
|
2275 |
MakeDir(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\subDirC\\")); |
|
2276 |
MakeDir(_L("\\F32-TST\\TFMAN\\INC108401\\dest\\")); |
|
2277 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\file1")); |
|
2278 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\file2"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\file2")); |
|
2279 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file1")); |
|
2280 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file2"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\file2")); |
|
2281 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\file1")); |
|
2282 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\file1")); |
|
2283 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\subDirC\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\subDirC\\file1")); |
|
2284 |
MakeFile(_L("\\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\subDirC\\file1"),_L8("FILE PATH : \\F32-TST\\TFMAN\\INC108401\\src\\subDirA\\subDirB\\subDirC\\file1")); |
|
2285 |
// Synchronously |
|
2286 |
if (!gAsynch) |
|
2287 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), _L("\\F32-TST\\TFMAN\\INC108401\\dest\\"), CFileMan::ERecurse|CFileMan::EOverWrite); |
|
2288 |
else // Asynchronously |
|
2289 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC108401\\src"), _L("\\F32-TST\\TFMAN\\INC108401\\dest\\"), CFileMan::ERecurse|CFileMan::EOverWrite, gStat); |
|
2290 |
test.Next(_L("Test INC108401 : SAME DRIVES with CFileMan::ERecurse|CFileMan::EOverWrite")); |
|
2291 |
TestResult(err); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2292 |
// test_KErrNone(err); |
0 | 2293 |
RmDir(_L("\\F32-TST\\TFMAN\\INC108401\\")); |
2294 |
||
2295 |
// cleanup for the current drive |
|
2296 |
RmDir(trgPath); |
|
2297 |
RmDir(_L("\\F32-TST\\")); |
|
2298 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2299 |
test.Printf(_L("Test INC108401 : ends\n")); |
0 | 2300 |
} |
2301 |
||
2302 |
LOCAL_C void TestINC089638() |
|
2303 |
{ |
|
2304 |
if(gAsynch) |
|
2305 |
{ |
|
2306 |
return; |
|
2307 |
} |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2308 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2309 |
test.Next(_L("Test all items removed from source directory after recursive moving (INC089638)")); |
0 | 2310 |
RmDir(_L("\\INC089638\\source\\")); |
2311 |
RmDir(_L("\\INC089638\\dest\\")); |
|
2312 |
MakeFile(_L("\\INC089638\\source\\file1")); |
|
2313 |
MakeFile(_L("\\INC089638\\source\\file2")); |
|
2314 |
MakeFile(_L("\\INC089638\\source\\subdir1\\file3")); |
|
2315 |
MakeFile(_L("\\INC089638\\source\\subdir1\\file4")); |
|
2316 |
MakeFile(_L("\\INC089638\\source\\subdir2\\file5")); |
|
2317 |
MakeFile(_L("\\INC089638\\source\\subdir2\\file6")); |
|
2318 |
MakeDir(_L("\\INC089638\\dest\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2319 |
test_KErrNone(TheFs.SetAtt(_L("\\INC089638\\source\\subdir1"), KEntryAttHidden, 0)); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2320 |
test_KErrNone(TheFs.SetAtt(_L("\\INC089638\\source\\subdir2"), KEntryAttReadOnly, 0)); |
0 | 2321 |
|
2322 |
TInt r = gFileMan->Move(_L("\\INC089638\\source\\"), _L("\\INC089638\\dest\\"), CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2323 |
test_KErrNone(r); |
0 | 2324 |
r = TheFs.RmDir(_L("\\INC089638\\source\\")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2325 |
test_KErrNone(r); |
0 | 2326 |
|
2327 |
RmDir(_L("\\INC089638\\")); |
|
2328 |
} |
|
2329 |
||
2330 |
void TestINC101379() |
|
2331 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2332 |
test.Next(_L("Test moving of directory to its subdirectory recursively and not recursively (INC101379)")); |
0 | 2333 |
TInt err; |
2334 |
_LIT(KSourceDir,"\\INC101379\\dir\\"); |
|
2335 |
_LIT(KFile1, "\\INC101379\\dir\\file1.txt"); |
|
2336 |
_LIT(KFile2, "\\INC101379\\dir\\subdir\\file2.txt"); |
|
2337 |
_LIT(KFile3, "\\INC101379\\dir\\other\\file3.txt"); |
|
2338 |
MakeFile(KFile1, _L8("qwerty")); |
|
2339 |
MakeFile(KFile2, _L8("abc")); |
|
2340 |
MakeFile(KFile3, _L8("qwerty")); |
|
2341 |
TFileName dest; |
|
2342 |
dest.Copy(KSourceDir); |
|
2343 |
dest.Append(_L("subdir")); |
|
2344 |
gFileMan->SetObserver(NULL); |
|
2345 |
if (!gAsynch) |
|
2346 |
err = gFileMan->Move(KSourceDir, dest, CFileMan::ERecurse|CFileMan::EOverWrite); |
|
2347 |
else |
|
2348 |
err = gFileMan->Move(KSourceDir, dest, CFileMan::ERecurse|CFileMan::EOverWrite, gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2349 |
test_Equal(KErrInUse, err); // Recursive move prohibited |
0 | 2350 |
if (gAsynch) |
2351 |
WaitForResult(KErrInUse); |
|
2352 |
CheckFileContents(KFile1, _L8("qwerty")); |
|
2353 |
CheckFileContents(KFile2, _L8("abc")); |
|
2354 |
CheckFileContents(KFile3, _L8("qwerty")); |
|
2355 |
||
2356 |
if (!gAsynch) |
|
2357 |
err = gFileMan->Move(KSourceDir, dest, CFileMan::EOverWrite); |
|
2358 |
else |
|
2359 |
err = gFileMan->Move(KSourceDir, dest, CFileMan::EOverWrite, gStat); |
|
2360 |
TestResult(err, KErrNone); // Non-recursive move must be OK |
|
2361 |
||
2362 |
_LIT(KFile1Moved, "\\INC101379\\dir\\subdir\\file1.txt"); |
|
2363 |
CheckFileContents(KFile1Moved, _L8("qwerty")); |
|
2364 |
CheckFileContents(KFile2, _L8("abc")); |
|
2365 |
CheckFileContents(KFile3, _L8("qwerty")); |
|
2366 |
gFileMan->SetObserver(gObserver); |
|
2367 |
RmDir(KSourceDir); |
|
2368 |
RmDir(_L("\\INC101379\\")); |
|
2369 |
} |
|
2370 |
||
2371 |
void TestINC099600() // and INC101061 |
|
2372 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2373 |
// Test move files from the internal drive to an external one (INC099600) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2374 |
// Test move files with system (KEntryAttSystem) or hidden (KEntryAttHidden) attributes (INC101061) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2375 |
test.Next(_L("Test move files from internal drive to external with system and hidden attributes")); |
0 | 2376 |
_LIT(KDest,"C:\\DEST099600\\"); |
2377 |
TBuf<64> source; |
|
2378 |
source.Format(_L("%c:\\INC099600\\"), (TUint) gDriveToTest); |
|
2379 |
TBuf<64> src; |
|
2380 |
TInt r; |
|
2381 |
TBuf<64> dst; |
|
2382 |
RmDir(source); |
|
2383 |
RmDir(KDest); |
|
2384 |
||
2385 |
src = source; |
|
2386 |
src.Append('a'); |
|
2387 |
MakeFile(src); |
|
2388 |
TheFs.SetAtt(src, KEntryAttArchive, 0); |
|
2389 |
src.Append('h'); |
|
2390 |
MakeFile(src); |
|
2391 |
TheFs.SetAtt(src, KEntryAttArchive | KEntryAttHidden, 0); |
|
2392 |
src.Append('s'); |
|
2393 |
MakeFile(src); |
|
2394 |
TheFs.SetAtt(src, KEntryAttArchive | KEntryAttHidden | KEntryAttSystem, 0); |
|
2395 |
src.Append('x'); |
|
2396 |
src.Append(KPathDelimiter); |
|
2397 |
src.Append('a'); |
|
2398 |
MakeFile(src); |
|
2399 |
TheFs.SetAtt(src, KEntryAttArchive, 0); |
|
2400 |
src.Append('h'); |
|
2401 |
MakeFile(src); |
|
2402 |
TheFs.SetAtt(src, KEntryAttArchive | KEntryAttHidden, 0); |
|
2403 |
||
2404 |
dst.Copy(KDest); |
|
2405 |
dst.Append(_L("ahsx\\")); |
|
2406 |
MakeDir(dst); |
|
2407 |
||
2408 |
TEntry entry; |
|
2409 |
r = gFileMan->Move(src, KDest, 0); // ahsx\ah |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2410 |
test_KErrNone(r); |
0 | 2411 |
r = TheFs.Entry(src, entry); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2412 |
test_Equal(KErrNotFound, r); |
0 | 2413 |
|
2414 |
src.SetLength(src.Length()-1); // ahsx\a |
|
2415 |
r = gFileMan->Move(src, KDest, 0); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2416 |
test_KErrNone(r); |
0 | 2417 |
r = TheFs.Entry(src, entry); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2418 |
test_Equal(KErrNotFound, r); |
0 | 2419 |
|
2420 |
src.SetLength(src.Length()-3); // ahs |
|
2421 |
r = gFileMan->Move(src, KDest, 0); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2422 |
test_KErrNone(r); |
0 | 2423 |
r = TheFs.Entry(src, entry); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2424 |
test_Equal(KErrNotFound, r); |
0 | 2425 |
|
2426 |
src.SetLength(src.Length()-1); // ah |
|
2427 |
r = gFileMan->Move(src, KDest, 0); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2428 |
test_Equal(KErrAlreadyExists, r); |
0 | 2429 |
r = TheFs.Entry(src, entry); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2430 |
test_KErrNone(r); |
0 | 2431 |
|
2432 |
r = gFileMan->Move(src, KDest, CFileMan::EOverWrite); // ah |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2433 |
test_KErrNone(r); |
0 | 2434 |
r = TheFs.Entry(src, entry); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2435 |
test_Equal(KErrNotFound, r); |
0 | 2436 |
|
2437 |
src.SetLength(src.Length()-1); // a |
|
2438 |
r = gFileMan->Move(src, KDest, 0); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2439 |
test_Equal(KErrAlreadyExists, r); |
0 | 2440 |
r = TheFs.Entry(src, entry); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2441 |
test_KErrNone(r); |
0 | 2442 |
|
2443 |
r = gFileMan->Move(src, KDest, CFileMan::EOverWrite); // a |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2444 |
test_KErrNone(r); |
0 | 2445 |
r = TheFs.Entry(src, entry); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2446 |
test_Equal(KErrNotFound, r); |
0 | 2447 |
|
2448 |
RmDir(source); |
|
2449 |
RmDir(KDest); |
|
2450 |
} |
|
2451 |
||
2452 |
void SetupDirectoriesForCase0520() |
|
2453 |
// Setup initial directory structure for test case PBASE-T_FMAN-0520 |
|
2454 |
{ |
|
2455 |
RmDir( _L("\\F32-TST\\TFMAN\\INC106735\\")); |
|
2456 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735\\")); |
|
2457 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735\\F_ROOT.TXT"), _L8("blahblahblah")); |
|
2458 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735\\SUB\\")); |
|
2459 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735\\SUB\\F_SUB.TXT"), _L8("blahblahblah")); |
|
2460 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735\\SUB01\\")); |
|
2461 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735\\SUB01\\F_SUB01.TXT"), _L8("blahblahblah")); |
|
2462 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735\\SUB01\\SUB02\\")); |
|
2463 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735\\SUB01\\SUB02\\F_SUB02.TXT"), _L8("blahblahblah")); |
|
2464 |
} |
|
2465 |
||
2466 |
void SetupDirectoriesForCase0520Compare1() |
|
2467 |
// Comparing directory structure for recursive Move() without wildcard |
|
2468 |
{ |
|
2469 |
RmDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\")); |
|
2470 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\")); |
|
2471 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\")); |
|
2472 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\F_ROOT.TXT"), _L8("blahblahblah")); |
|
2473 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\F_SUB.TXT"), _L8("blahblahblah")); |
|
2474 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\")); |
|
2475 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\F_SUB01.TXT"), _L8("blahblahblah")); |
|
2476 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\SUB02\\")); |
|
2477 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\SUB02\\F_SUB02.TXT"), _L8("blahblahblah")); |
|
2478 |
} |
|
2479 |
||
2480 |
void SetupDirectoriesForCase0520Compare2() |
|
2481 |
// Comparing directory structure for recursive Move() with wildcard |
|
2482 |
{ |
|
2483 |
RmDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\")); |
|
2484 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\")); |
|
2485 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\")); |
|
2486 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\F_ROOT.TXT"), _L8("blahblahblah")); |
|
2487 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\F_SUB.TXT"), _L8("blahblahblah")); |
|
2488 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\SUB01\\F_SUB01.TXT"), _L8("blahblahblah")); |
|
2489 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\SUB01\\SUB02\\F_SUB02.TXT"), _L8("blahblahblah")); |
|
2490 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\")); |
|
2491 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\SUB02\\")); |
|
2492 |
} |
|
2493 |
||
2494 |
void SetupDirectoriesForCase0520Compare3() |
|
2495 |
// Comparing directory structure for recursive Copy() without wildcard |
|
2496 |
{ |
|
2497 |
RmDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\")); |
|
2498 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\")); |
|
2499 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\F_ROOT.TXT"), _L8("blahblahblah")); |
|
2500 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\")); |
|
2501 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\F_ROOT.TXT"), _L8("blahblahblah")); |
|
2502 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\F_SUB.TXT"), _L8("blahblahblah")); |
|
2503 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\")); |
|
2504 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\F_SUB01.TXT"), _L8("blahblahblah")); |
|
2505 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\SUB02\\")); |
|
2506 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\SUB02\\F_SUB02.TXT"), _L8("blahblahblah")); |
|
2507 |
} |
|
2508 |
||
2509 |
void SetupDirectoriesForCase0520Compare4() |
|
2510 |
// Comparing directory structure for recursive Copy() with wildcard |
|
2511 |
{ |
|
2512 |
RmDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\")); |
|
2513 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\")); |
|
2514 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\F_ROOT.TXT"), _L8("blahblahblah")); |
|
2515 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\")); |
|
2516 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\F_ROOT.TXT"), _L8("blahblahblah")); |
|
2517 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\F_SUB.TXT"), _L8("blahblahblah")); |
|
2518 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\SUB01\\F_SUB01.TXT"), _L8("blahblahblah")); |
|
2519 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB\\SUB01\\SUB02\\F_SUB02.TXT"), _L8("blahblahblah")); |
|
2520 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\")); |
|
2521 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\F_SUB01.TXT"), _L8("blahblahblah")); |
|
2522 |
MakeDir( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\SUB02\\")); |
|
2523 |
MakeFile( _L("\\F32-TST\\TFMAN\\INC106735_COM\\SUB01\\SUB02\\F_SUB02.TXT"), _L8("blahblahblah")); |
|
2524 |
} |
|
2525 |
||
2526 |
LOCAL_C void TestRecursiveMove() |
|
2527 |
// |
|
2528 |
// Test recursive move |
|
2529 |
// |
|
2530 |
{ |
|
2531 |
test.Next(_L("Test recursive move")); |
|
2532 |
RmDir(_L("\\F32-TST\\TFMAN\\RecMove2\\")); |
|
2533 |
||
2534 |
MakeFile(_L("\\F32-TST\\TFMAN\\RECMOVE\\FULL\\FILE2.PLP")); |
|
2535 |
MakeFile(_L("\\F32-TST\\TFMAN\\RECMOVE\\FULL\\FILE3.PLP")); |
|
2536 |
MakeFile(_L("\\F32-TST\\TFMAN\\RECMOVE\\FULL\\GRAPE.TXT")); |
|
2537 |
MakeFile(_L("\\F32-TST\\TFMAN\\RECMOVE\\GRAPE.TXT")); |
|
2538 |
MakeFile(_L("\\F32-TST\\TFMAN\\RECMOVE\\FILE1.PLP")); |
|
2539 |
||
2540 |
TInt err; |
|
2541 |
if (!gAsynch) |
|
2542 |
err=gFileMan->Move(_L("\\F32-TST\\TFMAN\\RECMOVE\\*.PLP"),_L("\\F32-TST\\TFMAN\\RECMOVE2\\"),CFileMan::ERecurse); |
|
2543 |
else |
|
2544 |
err=gFileMan->Move(_L("\\F32-TST\\TFMAN\\RECMOVE\\*.PLP"),_L("\\F32-TST\\TFMAN\\RECMOVE2\\"),CFileMan::ERecurse,gStat); |
|
2545 |
TestResult(err); |
|
2546 |
||
2547 |
RmDir(_L("\\F32-TST\\TFMAN\\after\\")); |
|
2548 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\FULL\\FILE2.PLP")); |
|
2549 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\FULL\\FILE3.PLP")); |
|
2550 |
MakeFile(_L("\\F32-TST\\TFMAN\\AFTER\\FILE1.PLP")); |
|
2551 |
Compare(_L("\\F32-TST\\TFMAN\\after\\*"),_L("\\F32-TST\\TFMAN\\RecMOve2\\*")); |
|
2552 |
||
2553 |
// |
|
2554 |
// Test moving empty directories (DEF073924) |
|
2555 |
// |
|
2556 |
test.Next(_L("Test moving empty directories")); |
|
2557 |
||
2558 |
SetupDirectories(EFalse, NULL); |
|
2559 |
||
2560 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source\\"), _L("\\F32-TST\\TFMAN\\dest\\"), CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2561 |
test_Equal(KErrNotFound, err); // Expected - directory is empty |
0 | 2562 |
|
2563 |
// Test that all directories are still present |
|
2564 |
TEntry entry; |
|
2565 |
err = TheFs.Entry(_L("\\F32-TST\\TFMAN\\source\\"), entry); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2566 |
test_KErrNone(err); |
0 | 2567 |
err = TheFs.Entry(_L("\\F32-TST\\TFMAN\\dest\\"), entry); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2568 |
test_KErrNone(err); |
0 | 2569 |
|
2570 |
SetupDirectories(EFalse, NULL); |
|
2571 |
||
2572 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source"), _L("\\F32-TST\\TFMAN\\dest\\"), CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2573 |
test_KErrNone(err); // Expected - should move (or rename) directory |
0 | 2574 |
|
2575 |
// Test directory has been moved |
|
2576 |
err = TheFs.Entry(_L("\\F32-TST\\TFMAN\\dest\\source\\"), entry); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2577 |
test_KErrNone(err); |
0 | 2578 |
err = TheFs.Entry(_L("\\F32-TST\\TFMAN\\source\\"), entry); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2579 |
test_Equal(KErrNotFound, err); |
0 | 2580 |
|
2581 |
RmDir(_L("\\F32-TST\\TFMAN\\dest\\source\\")); |
|
2582 |
||
2583 |
// |
|
2584 |
// Test moving when the source directory contains subdirectories (INC074828, INC078800) |
|
2585 |
// |
|
2586 |
test.Next(_L("Test moving a directory containing subdirectories")); |
|
2587 |
||
2588 |
SetupDirectories(ETrue, NULL); |
|
2589 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source\\"), _L("\\F32-TST\\TFMAN\\dest\\"), CFileMan::ERecurse | CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2590 |
test_KErrNone(err); |
0 | 2591 |
|
2592 |
Compare(_L("\\F32-TST\\TFMAN\\compare\\*"), _L("\\F32-TST\\TFMAN\\dest\\*")); |
|
2593 |
||
2594 |
//--------------------------------------------- |
|
2595 |
//! @SYMTestCaseID PBASE-T_FMAN-0160 |
|
2596 |
//! @SYMTestType UT |
|
2597 |
//! @SYMREQ DEF087791 |
|
2598 |
//! @SYMTestCaseDesc Test that CFileMan::Move() works when the destination paths does not exist. |
|
2599 |
//! @SYMTestActions Copy directory structures to a non-existant directory on the same drive. |
|
2600 |
//! @SYMTestExpectedResults Completes with no error, files are copied and intermediate directories are created. |
|
2601 |
//! @SYMTestPriority High |
|
2602 |
//! @SYMTestStatus Implemented |
|
2603 |
//--------------------------------------------- |
|
2604 |
test.Next(_L("Test moving when the target directory does not exist")); |
|
2605 |
||
2606 |
SetupDirectories(ETrue, NULL); |
|
2607 |
||
2608 |
RmDir(_L("\\F32-TST\\TFMAN\\dest\\")); |
|
2609 |
||
2610 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source\\"), _L("\\F32-TST\\TFMAN\\dest\\"), CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2611 |
test_KErrNone(err); |
0 | 2612 |
|
2613 |
Compare(_L("\\F32-TST\\TFMAN\\compare\\*"), _L("\\F32-TST\\TFMAN\\dest\\*")); |
|
2614 |
||
2615 |
SetupDirectories(ETrue, NULL); |
|
2616 |
||
2617 |
RmDir(_L("\\F32-TST\\TFMAN\\dest\\")); |
|
2618 |
||
2619 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source\\"), _L("\\F32-TST\\TFMAN\\dest"), CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2620 |
test_KErrNone(err); |
0 | 2621 |
|
2622 |
Compare(_L("\\F32-TST\\TFMAN\\compare\\*"), _L("\\F32-TST\\TFMAN\\dest\\*")); |
|
2623 |
||
2624 |
SetupDirectories(ETrue, NULL); |
|
2625 |
||
2626 |
RmDir(_L("\\F32-TST\\TFMAN\\dest\\")); |
|
2627 |
||
2628 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source"), _L("\\F32-TST\\TFMAN\\dest\\"), CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2629 |
test_KErrNone(err); |
0 | 2630 |
|
2631 |
MakeDir(_L("\\F32-TST\\TFMAN\\compare\\subdir\\")); |
|
2632 |
Compare(_L("\\F32-TST\\TFMAN\\compare\\*"), _L("\\F32-TST\\TFMAN\\dest\\source\\*")); |
|
2633 |
RmDir(_L("\\F32-TST\\TFMAN\\compare\\subdir\\")); |
|
2634 |
||
2635 |
SetupDirectories(ETrue, NULL); |
|
2636 |
||
2637 |
RmDir(_L("\\F32-TST\\TFMAN\\dest\\")); |
|
2638 |
||
2639 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source\\File1.TXT"), _L("\\F32-TST\\TFMAN\\dest\\"), CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2640 |
test_KErrNone(err); |
0 | 2641 |
|
2642 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\source\\File1.TXT"), KErrNotFound, ETrue); |
|
2643 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\dest\\File1.TXT"), KErrNone, ETrue); |
|
2644 |
||
2645 |
RmDir(_L("\\F32-TST\\TFMAN\\dest\\")); |
|
2646 |
RmDir(_L("\\F32-TST\\TFMAN\\source\\")); |
|
2647 |
||
2648 |
// Test behaviour for omitted parameters |
|
2649 |
// For this, default should be session path |
|
2650 |
TFileName sessionPath; |
|
2651 |
err=TheFs.SessionPath(sessionPath); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2652 |
test_KErrNone(err); |
0 | 2653 |
|
2654 |
SetupDirectories(ETrue, NULL); |
|
2655 |
err=TheFs.SetSessionPath(_L("\\F32-TST\\TFMAN\\dest\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2656 |
test_KErrNone(err); |
0 | 2657 |
|
2658 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source"), _L(""), CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2659 |
test_KErrNone(err); |
0 | 2660 |
Compare(_L("\\F32-TST\\TFMAN\\compare\\*"), _L("\\F32-TST\\TFMAN\\dest\\source\\*")); |
2661 |
||
2662 |
RmDir(_L("\\F32-TST\\TFMAN\\dest\\")); |
|
2663 |
RmDir(_L("\\F32-TST\\TFMAN\\source\\")); |
|
2664 |
SetupDirectories(ETrue, NULL); |
|
2665 |
err=TheFs.SetSessionPath(_L("\\F32-TST\\TFMAN\\source\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2666 |
test_KErrNone(err); |
0 | 2667 |
|
2668 |
err = gFileMan->Move(_L(""), _L("\\F32-TST\\TFMAN\\dest\\"), CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2669 |
test_KErrNone(err); |
0 | 2670 |
Compare(_L("\\F32-TST\\TFMAN\\compare\\*"), _L("\\F32-TST\\TFMAN\\dest\\*")); |
2671 |
||
2672 |
err=TheFs.SetSessionPath(sessionPath); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2673 |
test_KErrNone(err); |
0 | 2674 |
|
2675 |
//--------------------------------------------- |
|
2676 |
//! @SYMTestCaseID PBASE-T_FMAN-0520 |
|
2677 |
//! @SYMTestType UT |
|
2678 |
//! @SYMREQ INC106735 |
|
2679 |
//! @SYMTestCaseDesc Test that CFileMan::Move() (recursive mode) works properly when the destination |
|
2680 |
//! directory is sub-directory of the source directory. |
|
2681 |
//! (e.g. "C:SRC\\*.TXT" -> "C:\\SRC\\SUB\\") |
|
2682 |
//! @SYMTestActions Move, copy files recursively from source directory to one of its sub-directory, |
|
2683 |
//! with or without wildcards applied. |
|
2684 |
//! @SYMTestExpectedResults Completes with no error, file(s) are moved or copied properly, and no redundant |
|
2685 |
//! movings or copyings are made for files in destination directory. |
|
2686 |
//! @SYMTestPriority High |
|
2687 |
//! @SYMTestStatus Implemented |
|
2688 |
//--------------------------------------------- |
|
2689 |
test.Next(_L("Test recursive moving and copying to sub-directories")); |
|
2690 |
// Testing recursive Move() without wildcard |
|
2691 |
SetupDirectoriesForCase0520(); |
|
2692 |
SetupDirectoriesForCase0520Compare1(); |
|
2693 |
if (!gAsynch) |
|
2694 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC106735\\F_ROOT.TXT"), _L("\\F32-TST\\TFMAN\\INC106735\\SUB\\*"), CFileMan::ERecurse); |
|
2695 |
else |
|
2696 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC106735\\F_ROOT.TXT"), _L("\\F32-TST\\TFMAN\\INC106735\\SUB\\*"), CFileMan::ERecurse, gStat); |
|
2697 |
TestResult(err, KErrNone); |
|
2698 |
Compare(_L("\\F32-TST\\TFMAN\\INC106735\\"), _L("\\F32-TST\\TFMAN\\INC106735_COM\\")); |
|
2699 |
||
2700 |
// Testing recursive Move() with wildcard |
|
2701 |
SetupDirectoriesForCase0520(); |
|
2702 |
SetupDirectoriesForCase0520Compare2(); |
|
2703 |
if (!gAsynch) |
|
2704 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC106735\\*.TXT"), _L("\\F32-TST\\TFMAN\\INC106735\\SUB\\"), CFileMan::ERecurse); |
|
2705 |
else |
|
2706 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\INC106735\\*.TXT"), _L("\\F32-TST\\TFMAN\\INC106735\\SUB\\"), CFileMan::ERecurse, gStat); |
|
2707 |
TestResult(err, KErrNone); |
|
2708 |
Compare(_L("\\F32-TST\\TFMAN\\INC106735\\"), _L("\\F32-TST\\TFMAN\\INC106735_COM\\")); |
|
2709 |
||
2710 |
// Testing recursive Copy() without wildcard |
|
2711 |
SetupDirectoriesForCase0520(); |
|
2712 |
SetupDirectoriesForCase0520Compare3(); |
|
2713 |
if (!gAsynch) |
|
2714 |
err = gFileMan->Copy(_L("\\F32-TST\\TFMAN\\INC106735\\F_ROOT.TXT"), _L("\\F32-TST\\TFMAN\\INC106735\\SUB\\"), CFileMan::ERecurse); |
|
2715 |
else |
|
2716 |
err = gFileMan->Copy(_L("\\F32-TST\\TFMAN\\INC106735\\F_ROOT.TXT"), _L("\\F32-TST\\TFMAN\\INC106735\\SUB\\"), CFileMan::ERecurse, gStat); |
|
2717 |
TestResult(err, KErrNone); |
|
2718 |
Compare(_L("\\F32-TST\\TFMAN\\INC106735\\"), _L("\\F32-TST\\TFMAN\\INC106735_COM\\")); |
|
2719 |
||
2720 |
// Testing recursive Copy() with wildcard |
|
2721 |
SetupDirectoriesForCase0520(); |
|
2722 |
SetupDirectoriesForCase0520Compare4(); |
|
2723 |
if (!gAsynch) |
|
2724 |
err = gFileMan->Copy(_L("\\F32-TST\\TFMAN\\INC106735\\*.TXT"), _L("\\F32-TST\\TFMAN\\INC106735\\SUB\\"), CFileMan::ERecurse); |
|
2725 |
else |
|
2726 |
err = gFileMan->Copy(_L("\\F32-TST\\TFMAN\\INC106735\\*.TXT"), _L("\\F32-TST\\TFMAN\\INC106735\\SUB\\"), CFileMan::ERecurse, gStat); |
|
2727 |
TestResult(err, KErrNone); |
|
2728 |
Compare(_L("\\F32-TST\\TFMAN\\INC106735\\"), _L("\\F32-TST\\TFMAN\\INC106735_COM\\")); |
|
2729 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2730 |
TestINC089638(); // Test all items removed from source directory after recursive moving |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2731 |
TestINC101379(); // Test moving of directory to its subdirectory recursively and not recursively |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2732 |
TestINC099600(); // and INC101061, Test move files from internal drive to external with system |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2733 |
// and hidden attributes |
0 | 2734 |
} |
2735 |
||
2736 |
||
2737 |
// |
|
2738 |
// A complex test directory structure... |
|
2739 |
// |
|
2740 |
LOCAL_D const TInt KNumFiles = 8; |
|
2741 |
LOCAL_D const TFileName complexFile[] = |
|
2742 |
{ |
|
2743 |
_L("\\F32-TST\\TFMAN\\complex\\dir1\\file1.txt"), |
|
2744 |
_L("\\F32-TST\\TFMAN\\complex\\dir1\\file2.txt"), |
|
2745 |
_L("\\F32-TST\\TFMAN\\complex\\dir1\\subdir1\\file3.txt"), |
|
2746 |
_L("\\F32-TST\\TFMAN\\complex\\dir1\\subdir1\\file4.txt"), |
|
2747 |
_L("\\F32-TST\\TFMAN\\complex\\dir12\\dir1\\file1.txt"), |
|
2748 |
_L("\\F32-TST\\TFMAN\\complex\\dir12\\dir1\\file2.txt"), |
|
2749 |
_L("\\F32-TST\\TFMAN\\complex\\dir12\\dir1\\subdir1\\file3.txt"), |
|
2750 |
_L("\\F32-TST\\TFMAN\\complex\\dir12\\dir1\\subdir1\\file4.txt") |
|
2751 |
}; |
|
2752 |
||
2753 |
// |
|
2754 |
// The expected result of moving the directory complex\\dir1 into complex\\dir2\\ *without* EOverWrite |
|
2755 |
// |
|
2756 |
LOCAL_D const TInt KNumFilesResult1 = 8; |
|
2757 |
LOCAL_D const TFileName complexResult1[] = |
|
2758 |
{ |
|
2759 |
_L("\\F32-TST\\TFMAN\\complex_result1\\dir1\\file1.txt"), |
|
2760 |
_L("\\F32-TST\\TFMAN\\complex_result1\\dir1\\file2.txt"), |
|
2761 |
_L("\\F32-TST\\TFMAN\\complex_result1\\dir1\\subdir1\\file3.txt"), |
|
2762 |
_L("\\F32-TST\\TFMAN\\complex_result1\\dir1\\subdir1\\file4.txt"), |
|
2763 |
_L("\\F32-TST\\TFMAN\\complex_result1\\dir12\\dir1\\file1.txt"), |
|
2764 |
_L("\\F32-TST\\TFMAN\\complex_result1\\dir12\\dir1\\file2.txt"), |
|
2765 |
_L("\\F32-TST\\TFMAN\\complex_result1\\dir12\\dir1\\subdir1\\file3.txt"), |
|
2766 |
_L("\\F32-TST\\TFMAN\\complex_result1\\dir12\\dir1\\subdir1\\file4.txt") |
|
2767 |
}; |
|
2768 |
||
2769 |
// |
|
2770 |
// The expected result of moving the directory complex\\dir1 into complex\\dir2\\ *with* EOverWrite |
|
2771 |
// |
|
2772 |
LOCAL_D const TInt KNumFilesResult2 = 4; |
|
2773 |
LOCAL_D const TFileName complexResult2[] = |
|
2774 |
{ |
|
2775 |
_L("\\F32-TST\\TFMAN\\complex_result2\\dir12\\dir1\\file1.txt"), |
|
2776 |
_L("\\F32-TST\\TFMAN\\complex_result2\\dir12\\dir1\\file2.txt"), |
|
2777 |
_L("\\F32-TST\\TFMAN\\complex_result2\\dir12\\dir1\\subdir1\\file3.txt"), |
|
2778 |
_L("\\F32-TST\\TFMAN\\complex_result2\\dir12\\dir1\\subdir1\\file4.txt"), |
|
2779 |
||
2780 |
}; |
|
2781 |
||
2782 |
||
2783 |
LOCAL_C void TestRecursiveMoveAcrossDrives() |
|
2784 |
// |
|
2785 |
// Test recursive move across drives |
|
2786 |
// |
|
2787 |
{ |
|
2788 |
test.Next(_L("Test recursive move across drives")); |
|
2789 |
||
2790 |
TFileName trgDir = _L("\\F32-TST\\TFMAN\\RECMOVE2\\"); |
|
2791 |
TFileName trgSpec = _L("\\F32-TST\\TFMAN\\RECMOVE2\\*"); |
|
2792 |
||
2793 |
if (gSessionPath[0]=='C') |
|
2794 |
{ |
|
2795 |
#if !defined(__WINS__) |
|
2796 |
trgDir = _L("D:\\F32-TST\\TFMAN\\RECMOVE2\\"); |
|
2797 |
trgSpec = _L("D:\\F32-TST\\TFMAN\\RECMOVE2\\*"); |
|
2798 |
#else |
|
2799 |
trgDir = _L("Y:\\F32-TST\\TFMAN\\RECMOVE2\\"); |
|
2800 |
trgSpec = _L("Y:\\F32-TST\\TFMAN\\RECMOVE2\\*"); |
|
2801 |
#endif |
|
2802 |
} |
|
2803 |
||
2804 |
RmDir(trgDir); |
|
2805 |
||
2806 |
MakeFile(_L("C:\\F32-TST\\TFMAN\\RECMOVE\\FULL\\FILE2.PLP")); |
|
2807 |
MakeFile(_L("C:\\F32-TST\\TFMAN\\RECMOVE\\FULL\\FILE3.PLP")); |
|
2808 |
MakeFile(_L("C:\\F32-TST\\TFMAN\\RECMOVE\\FULL\\GRAPE.TXT")); |
|
2809 |
MakeFile(_L("C:\\F32-TST\\TFMAN\\RECMOVE\\GRAPE.TXT")); |
|
2810 |
MakeFile(_L("C:\\F32-TST\\TFMAN\\RECMOVE\\FILE1.PLP")); |
|
2811 |
||
2812 |
TInt err; |
|
2813 |
if (!gAsynch) |
|
2814 |
err=gFileMan->Move(_L("C:\\F32-TST\\TFMAN\\RECMOVE\\*.PLP"),trgDir,CFileMan::ERecurse); |
|
2815 |
else |
|
2816 |
err=gFileMan->Move(_L("C:\\F32-TST\\TFMAN\\RECMOVE\\*.PLP"),trgDir,CFileMan::ERecurse,gStat); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2817 |
test.Printf(_L("TestRecursiveMoveAcrossDrives(),gFileMan->Move(),err=%d\n"),err); |
0 | 2818 |
TestResult(err); |
2819 |
||
2820 |
RmDir(_L("C:\\F32-TST\\TFMAN\\after\\")); |
|
2821 |
MakeFile(_L("C:\\F32-TST\\TFMAN\\AFTER\\FULL\\FILE2.PLP")); |
|
2822 |
MakeFile(_L("C:\\F32-TST\\TFMAN\\AFTER\\FULL\\FILE3.PLP")); |
|
2823 |
MakeFile(_L("C:\\F32-TST\\TFMAN\\AFTER\\FILE1.PLP")); |
|
2824 |
Compare(_L("C:\\F32-TST\\TFMAN\\after\\*"),trgSpec); |
|
2825 |
RmDir(_L("C:\\F32-TST\\TFMAN\\AFTER\\")); |
|
2826 |
RmDir(_L("C:\\F32-TST\\TFMAN\\RECMOVE\\")); |
|
2827 |
||
2828 |
// |
|
2829 |
// Test moving empty directories (DEF073924) |
|
2830 |
// |
|
2831 |
test.Next(_L("Test moving empty directories")); |
|
2832 |
||
2833 |
TFileName destOtherDrive; |
|
2834 |
SetupDirectories(EFalse, &destOtherDrive); |
|
2835 |
||
2836 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source\\"), destOtherDrive, CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2837 |
test_Equal(KErrNotFound, err); // Expected - directory is empty |
0 | 2838 |
|
2839 |
// Test that all directories are still present |
|
2840 |
TEntry entry; |
|
2841 |
err = TheFs.Entry(_L("\\F32-TST\\TFMAN\\source\\"), entry); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2842 |
test_KErrNone(err); |
0 | 2843 |
err = TheFs.Entry(destOtherDrive, entry); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2844 |
test_KErrNone(err); |
0 | 2845 |
|
2846 |
//--------------------------------------------- |
|
2847 |
//! @SYMTestCaseID PBASE-T_FMAN-0571 |
|
2848 |
//! @SYMTestType UT |
|
2849 |
//! @SYMREQ INC108401 |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2850 |
//! @SYMTestCaseDesc This testcase tests the synchronous and asynchronous move operations |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2851 |
//! exhaustively with flags set as 0, CFileMan::EOverWrite, CFileMan::ERecurse |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2852 |
//! on the SAME and ACROSS drives without trailing slash at the end of source |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2853 |
//! dir path. |
0 | 2854 |
//! @SYMTestActions 1. Copy directory structures to another directory across drive. |
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2855 |
//! 2. Copy directory structures to another directory across drive overwriting |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2856 |
//! duplicate files. |
0 | 2857 |
//! 3. Copy directory structures to another directory across drive. |
2858 |
//! 4. Copy directory structures to another directory on same drive. |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2859 |
//! 5. Copy directory structures to another directory on same drive overwriting |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2860 |
//! duplicate files. |
0 | 2861 |
//! 6. Copy directory structures to another directory on same drive. |
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2862 |
//! @SYMTestExpectedResults 1. Completes with no error, the last directory and its contents are moved |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2863 |
//! from the src directory to the destination directory. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2864 |
//! 2. Completes with no error, the last directory and its contents are moved |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2865 |
//! from the src directory to the destination directory, duplicate files are updated. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2866 |
//! 3. Completes with no error, the last directory and its contents are moved |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2867 |
//! from the src directory to the destination directory. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2868 |
//! 4. Completes with no error, the last directory and its contents are moved |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2869 |
//! from the src directory to the destination directory. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2870 |
//! 5. Completes with no error, the last directory and its contents are moved |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2871 |
//! from the src directory to the destination directory, duplicate files are updated. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2872 |
//! 6. Completes with no error, the last directory and its contents are moved |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2873 |
//! from the src directory to the destination directory. |
0 | 2874 |
//! @SYMTestPriority High |
2875 |
//! @SYMTestStatus Implemented |
|
2876 |
//--------------------------------------------- |
|
2877 |
||
2878 |
TestINC108401(); |
|
2879 |
||
2880 |
// |
|
2881 |
// Test moving when the source directory contains subdirectories (INC074828, INC078800) |
|
2882 |
// |
|
2883 |
test.Next(_L("Test moving a directory containing subdirectories")); |
|
2884 |
||
2885 |
SetupDirectories(ETrue, &destOtherDrive); |
|
2886 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source\\"), destOtherDrive, CFileMan::ERecurse | CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2887 |
test_KErrNone(err); |
0 | 2888 |
|
2889 |
destOtherDrive.Append(_L("*")); |
|
2890 |
Compare(_L("\\F32-TST\\TFMAN\\compare\\*"), destOtherDrive); |
|
2891 |
||
2892 |
//--------------------------------------------- |
|
2893 |
//! @SYMTestCaseID PBASE-T_FMAN-0161 |
|
2894 |
//! @SYMTestType UT |
|
2895 |
//! @SYMREQ DEF087791 |
|
2896 |
//! @SYMTestCaseDesc Test that CFileMan::Move() works when the destination paths does not exist. |
|
2897 |
//! @SYMTestActions Copy directory structures to a non-existant directory on a different drive. |
|
2898 |
//! @SYMTestExpectedResults Completes with no error, files are copied and intermediate directories are created. |
|
2899 |
//! @SYMTestPriority High |
|
2900 |
//! @SYMTestStatus Implemented |
|
2901 |
//--------------------------------------------- |
|
2902 |
test.Next(_L("Test moving when the target directory does not exist")); |
|
2903 |
||
2904 |
SetupDirectories(ETrue, &destOtherDrive); |
|
2905 |
||
2906 |
RmDir(destOtherDrive); |
|
2907 |
||
2908 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source\\"), destOtherDrive, CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2909 |
test_KErrNone(err); |
0 | 2910 |
|
2911 |
Compare(_L("\\F32-TST\\TFMAN\\compare\\*"), destOtherDrive); |
|
2912 |
||
2913 |
SetupDirectories(ETrue, &destOtherDrive); |
|
2914 |
||
2915 |
RmDir(destOtherDrive); |
|
2916 |
||
2917 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source"), destOtherDrive, CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2918 |
test_KErrNone(err); |
0 | 2919 |
|
2920 |
MakeDir(_L("\\F32-TST\\TFMAN\\compare\\subdir\\")); |
|
2921 |
destOtherDrive.Append(_L("source\\")); |
|
2922 |
Compare(_L("\\F32-TST\\TFMAN\\compare\\*"), destOtherDrive); |
|
2923 |
RmDir(_L("\\F32-TST\\TFMAN\\compare\\subdir\\")); |
|
2924 |
||
2925 |
SetupDirectories(ETrue, &destOtherDrive); |
|
2926 |
||
2927 |
RmDir(destOtherDrive); |
|
2928 |
||
2929 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\source\\File1.TXT"), destOtherDrive, CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2930 |
test_KErrNone(err); |
0 | 2931 |
|
2932 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\source\\File1.TXT"), KErrNotFound, ETrue); |
|
2933 |
destOtherDrive.Append(_L("File1.TXT")); |
|
2934 |
CheckFileExists(destOtherDrive, KErrNone, ETrue); |
|
2935 |
||
2936 |
RmDir(destOtherDrive); |
|
2937 |
RmDir(_L("\\F32-TST\\TFMAN\\source\\")); |
|
2938 |
||
2939 |
// |
|
2940 |
// Test recursive move of complex directory structure into itself (INC078759) |
|
2941 |
// |
|
2942 |
||
2943 |
test.Next(_L("Test recursive move of complex directory structure")); |
|
2944 |
||
2945 |
// Set up the test directory |
|
2946 |
TInt level = 0; |
|
2947 |
for(level=0; level < KNumFiles; level++) |
|
2948 |
{ |
|
2949 |
err = TheFs.MkDirAll(complexFile[level]); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2950 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists); |
0 | 2951 |
|
2952 |
RFile file; |
|
2953 |
err = file.Create(TheFs, complexFile[level], EFileRead | EFileWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2954 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists || err == KErrBadName); |
0 | 2955 |
file.Close(); |
2956 |
} |
|
2957 |
||
2958 |
// |
|
2959 |
// Move directory 'dir1' into 'dir12' *without* overwrite flag set |
|
2960 |
// |
|
2961 |
// - This should fail, as 'dir12' already contains a directory called 'dir1' |
|
2962 |
// - No directories should be modified |
|
2963 |
// |
|
2964 |
||
2965 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\complex\\dir1"), _L("\\F32-TST\\TFMAN\\complex\\dir12\\"), CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2966 |
test_Equal(KErrAlreadyExists, err); |
0 | 2967 |
|
2968 |
for(level=0; level < KNumFilesResult1; level++) |
|
2969 |
{ |
|
2970 |
err = TheFs.MkDirAll(complexResult1[level]); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2971 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists); |
0 | 2972 |
|
2973 |
RFile file; |
|
2974 |
err = file.Create(TheFs, complexResult1[level], EFileRead | EFileWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2975 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists || err == KErrBadName); |
0 | 2976 |
file.Close(); |
2977 |
} |
|
2978 |
||
2979 |
Compare(_L("\\F32-TST\\TFMAN\\complex_result1\\*"), _L("\\F32-TST\\TFMAN\\complex\\*")); |
|
2980 |
||
2981 |
// |
|
2982 |
// Move directory 'dir1' into 'dir12' *with* overwrite flag set |
|
2983 |
// |
|
2984 |
err = gFileMan->Move(_L("\\F32-TST\\TFMAN\\complex\\dir1"), _L("\\F32-TST\\TFMAN\\complex\\dir12\\"), CFileMan::ERecurse | CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2985 |
test_KErrNone(err); |
0 | 2986 |
|
2987 |
for(level=0; level < KNumFilesResult2; level++) |
|
2988 |
{ |
|
2989 |
err = TheFs.MkDirAll(complexResult2[level]); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2990 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists); |
0 | 2991 |
|
2992 |
RFile file; |
|
2993 |
err = file.Create(TheFs, complexResult2[level], EFileRead | EFileWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
2994 |
test_Value(err, err == KErrNone || err == KErrAlreadyExists || err == KErrBadName); |
0 | 2995 |
file.Close(); |
2996 |
} |
|
2997 |
||
2998 |
Compare(_L("\\F32-TST\\TFMAN\\complex_result2\\*"), _L("\\F32-TST\\TFMAN\\complex\\*")); |
|
2999 |
||
3000 |
// ...tidy up files |
|
3001 |
for(level=0; level < KNumFiles; level++) |
|
3002 |
TheFs.Delete(complexFile[level]); |
|
3003 |
for(level=0; level < KNumFilesResult1; level++) |
|
3004 |
TheFs.Delete(complexResult1[level]); |
|
3005 |
for(level=0; level < KNumFilesResult2; level++) |
|
3006 |
TheFs.Delete(complexResult2[level]); |
|
3007 |
||
3008 |
// ...tidy up directories |
|
3009 |
for(level=0; level < KNumFiles; level++) |
|
3010 |
TheFs.RmDir(complexFile[level]); |
|
3011 |
for(level=0; level < KNumFilesResult1; level++) |
|
3012 |
TheFs.RmDir(complexResult1[level]); |
|
3013 |
for(level=0; level < KNumFilesResult2; level++) |
|
3014 |
TheFs.RmDir(complexResult2[level]); |
|
3015 |
||
3016 |
TheFs.RmDir(_L("C:\\F32-TST\\TFMAN\\")); |
|
3017 |
TheFs.RmDir(_L("C:\\F32-TST\\")); |
|
3018 |
} |
|
3019 |
||
3020 |
class CFileManCopyAllCancel : public CBase, public MFileManObserver |
|
3021 |
{ |
|
3022 |
public: |
|
3023 |
CFileManCopyAllCancel(CFileMan* aFileMan); |
|
3024 |
TControl NotifyFileManStarted(); |
|
3025 |
TControl NotifyFileManEnded(); |
|
3026 |
||
3027 |
private: |
|
3028 |
CFileMan* iFileMan; |
|
3029 |
}; |
|
3030 |
||
3031 |
||
3032 |
CFileManCopyAllCancel::CFileManCopyAllCancel(CFileMan* aFileMan) |
|
3033 |
// |
|
3034 |
// Constructor |
|
3035 |
// |
|
3036 |
{ |
|
3037 |
__DECLARE_NAME(_S("CFileManCopyAllCancel")); |
|
3038 |
iFileMan=aFileMan; |
|
3039 |
} |
|
3040 |
||
3041 |
MFileManObserver::TControl CFileManCopyAllCancel::NotifyFileManStarted() |
|
3042 |
// |
|
3043 |
// Observer for TestCopyAllCancel tests |
|
3044 |
// |
|
3045 |
{ |
|
3046 |
return(MFileManObserver::ECancel); |
|
3047 |
} |
|
3048 |
||
3049 |
MFileManObserver::TControl CFileManCopyAllCancel::NotifyFileManEnded() |
|
3050 |
// |
|
3051 |
// Observer for TestCopyAllCancel tests |
|
3052 |
// |
|
3053 |
{ |
|
3054 |
return(MFileManObserver::EContinue); |
|
3055 |
} |
|
3056 |
||
3057 |
||
3058 |
||
3059 |
LOCAL_C void TestCopyAllCancel() |
|
3060 |
// |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3061 |
// Test copy (all cancel) |
0 | 3062 |
// |
3063 |
{ |
|
3064 |
test.Next(_L("Test copy all cancel")); |
|
3065 |
||
3066 |
RmDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\*")); |
|
3067 |
CFileManCopyAllCancel* fManObserver=new(ELeave) CFileManCopyAllCancel(gFileMan); |
|
3068 |
CleanupStack::PushL(fManObserver); |
|
3069 |
gFileMan->SetObserver(fManObserver); |
|
3070 |
||
3071 |
MakeDir(_L("\\F32-TST\\TFMAN\\COPYDIR\\")); |
|
3072 |
MakeDir(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\EMPTY\\")); |
|
3073 |
MakeFile(_L("\\F32-TST\\TFMAN\\NewDir\\ABC.DEF")); |
|
3074 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.TXT")); |
|
3075 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE2.TXT")); |
|
3076 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE3.TXT")); |
|
3077 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\FILE4.TXT")); |
|
3078 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\DELTEST\\EXE1.BIN")); |
|
3079 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\EXE2.BIN")); |
|
3080 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\RUMBA1.TXT")); |
|
3081 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\RUMBA2.TXT")); |
|
3082 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\RUMBA3.TXT")); |
|
3083 |
MakeFile(_L("\\F32-TST\\TFMAN\\DELDIR\\RUMBA4.TXT")); |
|
3084 |
||
3085 |
test.Next(_L("Test cancel copy all the files ")); |
|
3086 |
TInt r; |
|
3087 |
||
3088 |
if (!gAsynch) |
|
3089 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\file?.txt"),_L("\\F32-TST\\TFMAN\\DELDIR\\rumba?.txt"),0); |
|
3090 |
else |
|
3091 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\file?.txt"),_L("\\F32-TST\\TFMAN\\DELDIR\\rumba?.txt"),0,gStat); |
|
3092 |
TestResult(r,KErrCancel); |
|
3093 |
||
3094 |
if (!gAsynch) |
|
3095 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.txt"),_L("\\F32-TST\\TFMAN\\file1.txt"),0); |
|
3096 |
else |
|
3097 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\DELDIR\\FILE1.txt"),_L("\\F32-TST\\TFMAN\\file1.txt"),0,gStat); |
|
3098 |
TestResult(r,KErrCancel); |
|
3099 |
gFileMan->SetObserver(gObserver); |
|
3100 |
CleanupStack::PopAndDestroy(); |
|
3101 |
} |
|
3102 |
||
3103 |
class CFileManObserverOverWrite : public CBase, public MFileManObserver |
|
3104 |
{ |
|
3105 |
public: |
|
3106 |
CFileManObserverOverWrite(CFileMan* aFileMan); |
|
3107 |
TControl NotifyFileManEnded(); |
|
3108 |
private: |
|
3109 |
CFileMan* iFileMan; |
|
3110 |
}; |
|
3111 |
||
3112 |
CFileManObserverOverWrite::CFileManObserverOverWrite(CFileMan* aFileMan) |
|
3113 |
// |
|
3114 |
// Constructor |
|
3115 |
// |
|
3116 |
{ |
|
3117 |
__DECLARE_NAME(_S("CFileManObserverOverWrite")); |
|
3118 |
iFileMan=aFileMan; |
|
3119 |
} |
|
3120 |
||
3121 |
||
3122 |
MFileManObserver::TControl CFileManObserverOverWrite::NotifyFileManEnded() |
|
3123 |
// |
|
3124 |
// Observer for testoverwrite tests |
|
3125 |
// |
|
3126 |
{ |
|
3127 |
TInt lastError=iFileMan->GetLastError(); |
|
3128 |
if (lastError!=KErrNone) |
|
3129 |
{ |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3130 |
test_Equal(KErrAlreadyExists, lastError); |
0 | 3131 |
if (gAsynch==EFalse) |
3132 |
{ |
|
3133 |
TFileName fileName=iFileMan->CurrentEntry().iName; |
|
3134 |
test.Printf(_L(" %S already exists\n"),&fileName); |
|
3135 |
} |
|
3136 |
} |
|
3137 |
return(MFileManObserver::EContinue); |
|
3138 |
} |
|
3139 |
||
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3140 |
class CFileManObserverBytesCopied : public CBase, public MFileManObserver |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3141 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3142 |
public: |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3143 |
CFileManObserverBytesCopied(CFileMan* aFileMan); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3144 |
TControl NotifyFileManEnded(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3145 |
TControl NotifyFileManOperation(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3146 |
TInt iBytesToBeCopied; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3147 |
private: |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3148 |
CFileMan* iFileMan; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3149 |
TInt iBytesCopied; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3150 |
}; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3151 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3152 |
CFileManObserverBytesCopied::CFileManObserverBytesCopied(CFileMan* aFileMan) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3153 |
// |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3154 |
// Constructor |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3155 |
// |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3156 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3157 |
__DECLARE_NAME(_S("CFileManObserverBytesCopied")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3158 |
iFileMan=aFileMan; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3159 |
iBytesCopied=0; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3160 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3161 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3162 |
MFileManObserver::TControl CFileManObserverBytesCopied::NotifyFileManOperation() |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3163 |
// |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3164 |
// Observer for testBytesCopied tests |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3165 |
// |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3166 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3167 |
TFileName target; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3168 |
iFileMan->GetCurrentTarget(target); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3169 |
TInt match = target.MatchF(_L("?:\\bytesTransferred")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3170 |
if(match != 0) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3171 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3172 |
RDebug::Print(_L("CFileManObserverBytesCopied::NotifyFileManOperation - target %s, match %d"),target.PtrZ(),match); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3173 |
return MFileManObserver::EAbort; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3174 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3175 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3176 |
iBytesCopied += iFileMan->BytesTransferredByCopyStep(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3177 |
return(MFileManObserver::EContinue); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3178 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3179 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3180 |
MFileManObserver::TControl CFileManObserverBytesCopied::NotifyFileManEnded() |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3181 |
// |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3182 |
// Observer for testBytesCopied tests |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3183 |
// |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3184 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3185 |
if(iBytesCopied!=iBytesToBeCopied) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3186 |
return (MFileManObserver::EAbort); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3187 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3188 |
return(MFileManObserver::EContinue); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3189 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3190 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3191 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3192 |
|
0 | 3193 |
LOCAL_C void TestOverWrite() |
3194 |
// |
|
3195 |
// Test overwrite for copy and rename |
|
3196 |
// |
|
3197 |
{ |
|
3198 |
test.Next(_L("Test overwrite option")); |
|
3199 |
RmDir(_L("\\F32-TST\\TFMAN\\OVERWRITE\\")); |
|
3200 |
CFileManObserverOverWrite* fManObserver=new(ELeave) CFileManObserverOverWrite(gFileMan); |
|
3201 |
CleanupStack::PushL(fManObserver); |
|
3202 |
gFileMan->SetObserver(fManObserver); |
|
3203 |
||
3204 |
TBuf8<128> contentsFile1=_L8("Test file one contents"); |
|
3205 |
TBuf8<128> contentsFile2=_L8("Test file two contents"); |
|
3206 |
||
3207 |
MakeFile(_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\FILE1.TXT")); |
|
3208 |
MakeFile(_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\FILE2.TXT")); |
|
3209 |
MakeFile(_L("\\F32-TST\\TFMAN\\OVERWRITE\\SRC\\FILE1.TXT"),contentsFile1); |
|
3210 |
MakeFile(_L("\\F32-TST\\TFMAN\\OVERWRITE\\SRC\\FILE2.TXT"),contentsFile2); |
|
3211 |
||
3212 |
if (!gAsynch) |
|
3213 |
{ |
|
3214 |
TInt r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\OVERWRITE\\SRC"),_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG"),0); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3215 |
test_Equal(KErrAlreadyExists, r); |
0 | 3216 |
} |
3217 |
else |
|
3218 |
{ |
|
3219 |
TInt r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\OVERWRITE\\SRC"),_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG"),0,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3220 |
test_KErrNone(r); |
0 | 3221 |
WaitForResult(KErrAlreadyExists); |
3222 |
} |
|
3223 |
||
3224 |
RFile f; |
|
3225 |
TInt r=f.Open(TheFs,_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\FILE1.TXT"),EFileRead); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3226 |
test_KErrNone(r); |
0 | 3227 |
TBuf8<128> data; |
3228 |
r=f.Read(data); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3229 |
test_KErrNone(r); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3230 |
test_Equal(0, data.Length()); |
0 | 3231 |
f.Close(); |
3232 |
||
3233 |
if (!gAsynch) |
|
3234 |
{ |
|
3235 |
TInt r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\OVERWRITE\\SRC"),_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG"),CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3236 |
test_KErrNone(r); |
0 | 3237 |
} |
3238 |
else |
|
3239 |
{ |
|
3240 |
TInt r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\OVERWRITE\\SRC"),_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG"),CFileMan::EOverWrite,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3241 |
test_KErrNone(r); |
0 | 3242 |
WaitForSuccess(); |
3243 |
} |
|
3244 |
||
3245 |
r=f.Open(TheFs,_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\FILE1.TXT"),EFileRead); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3246 |
test_KErrNone(r); |
0 | 3247 |
r=f.Read(data); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3248 |
test_KErrNone(r); |
0 | 3249 |
test(data==contentsFile1); |
3250 |
f.Close(); |
|
3251 |
||
3252 |
RmDir(_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\")); |
|
3253 |
MakeFile(_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\FILE1.TXT")); |
|
3254 |
MakeFile(_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\FILE2.TXT")); |
|
3255 |
||
3256 |
if (!gAsynch) |
|
3257 |
{ |
|
3258 |
TInt r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\OVERWRITE\\SRC\\*"),_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\*"),0); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3259 |
test_Equal(KErrAlreadyExists, r); |
0 | 3260 |
} |
3261 |
else |
|
3262 |
{ |
|
3263 |
TInt r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\OVERWRITE\\SRC\\*"),_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\*"),0,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3264 |
test_KErrNone(r); |
0 | 3265 |
WaitForResult(KErrAlreadyExists); |
3266 |
} |
|
3267 |
||
3268 |
r=f.Open(TheFs,_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\FILE2.TXT"),EFileRead); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3269 |
test_KErrNone(r); |
0 | 3270 |
r=f.Read(data); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3271 |
test_KErrNone(r); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3272 |
test_Equal(0, data.Length()); |
0 | 3273 |
f.Close(); |
3274 |
||
3275 |
if (!gAsynch) |
|
3276 |
{ |
|
3277 |
TInt r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\OVERWRITE\\SRC\\*"),_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\*"),CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3278 |
test_KErrNone(r); |
0 | 3279 |
} |
3280 |
else |
|
3281 |
{ |
|
3282 |
TInt r=gFileMan->Rename(_L("\\F32-TST\\TFMAN\\OVERWRITE\\SRC\\*"),_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\*"),CFileMan::EOverWrite,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3283 |
test_KErrNone(r); |
0 | 3284 |
WaitForSuccess(); |
3285 |
} |
|
3286 |
||
3287 |
r=f.Open(TheFs,_L("\\F32-TST\\TFMAN\\OVERWRITE\\TRG\\FILE2.TXT"),EFileRead); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3288 |
test_KErrNone(r); |
0 | 3289 |
r=f.Read(data); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3290 |
test_KErrNone(r); |
0 | 3291 |
test(data==contentsFile2); |
3292 |
f.Close(); |
|
3293 |
gFileMan->SetObserver(gObserver); |
|
3294 |
CleanupStack::PopAndDestroy(); |
|
3295 |
} |
|
3296 |
||
3297 |
LOCAL_C void TestErrorHandling() |
|
3298 |
// |
|
3299 |
// Test bad paths etc |
|
3300 |
// |
|
3301 |
{ |
|
3302 |
test.Next(_L("Test error handling")); |
|
3303 |
if (!gAsynch) |
|
3304 |
{ |
|
3305 |
TInt r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\BADPATH\\*")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3306 |
test_Equal(KErrPathNotFound, r); |
0 | 3307 |
} |
3308 |
else |
|
3309 |
{ |
|
3310 |
TInt r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\BADPATH\\*"),0,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3311 |
test_KErrNone(r); |
0 | 3312 |
WaitForResult(KErrPathNotFound); |
3313 |
} |
|
3314 |
||
3315 |
CFileMan* fMan=CFileMan::NewL(TheFs); |
|
3316 |
TInt r; |
|
3317 |
{ |
|
3318 |
for(TInt drvNum=EDriveA; drvNum<=EDriveZ; ++drvNum) |
|
3319 |
{ |
|
3320 |
TDriveInfo drvInfo; |
|
3321 |
if(KErrNone==TheFs.Drive(drvInfo, drvNum) && drvInfo.iType==EMediaNotPresent) |
|
3322 |
{ |
|
3323 |
// found a non-extant drive, test it... |
|
3324 |
_LIT(KBad,"?:\\BADPATH\\*"); |
|
3325 |
TBuf<16> bad(KBad); |
|
3326 |
bad[0] = TUint16('A'+drvNum); |
|
3327 |
TInt r=fMan->Delete(bad); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3328 |
test_Equal(KErrNotReady, r); |
0 | 3329 |
break; |
3330 |
} |
|
3331 |
} |
|
3332 |
} |
|
3333 |
delete fMan; |
|
3334 |
||
3335 |
MakeFile(_L("\\ONE\\TWO\\FILE1.TXT")); |
|
3336 |
MakeFile(_L("\\ONE\\TWO\\FOUR")); |
|
3337 |
test.Next(_L("Test cyclic copy")); |
|
3338 |
if (!gAsynch) |
|
3339 |
r=gFileMan->Copy(_L("\\ONE\\TWO\\*"),_L("\\ONE\\TWO\\THREE\\"),CFileMan::ERecurse); |
|
3340 |
else |
|
3341 |
r=gFileMan->Copy(_L("\\ONE\\TWO\\*"),_L("\\ONE\\TWO\\THREE\\"),CFileMan::ERecurse,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3342 |
test_Equal(KErrArgument, r); |
0 | 3343 |
|
3344 |
test.Next(_L("Test src name == trg name")); |
|
3345 |
if (!gAsynch) |
|
3346 |
{ |
|
3347 |
r=gFileMan->Copy(_L("\\ONE\\TWO\\FOUR"),_L("\\ONE\\TWO\\FOUR")); // default aSwitch=EOverWrite |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3348 |
test_KErrNone(r); |
0 | 3349 |
r=gFileMan->Copy(_L("\\ONE\\TWO\\FOUR"),_L("\\ONE\\TWO\\FOUR"), 0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3350 |
test_Equal(KErrAlreadyExists, r); |
0 | 3351 |
r=gFileMan->Copy(_L("\\ONE\\TWO\\FOUR"),_L("\\ONE\\TWO\\FOUR"),CFileMan::ERecurse); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3352 |
test_Equal(KErrAlreadyExists, r); |
0 | 3353 |
r=gFileMan->Copy(_L("\\ONE\\TWO\\F*R"),_L("\\ONE\\TWO\\FOUR"),CFileMan::ERecurse); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3354 |
test_Equal(KErrAlreadyExists, r); |
0 | 3355 |
} |
3356 |
else |
|
3357 |
{ |
|
3358 |
r=gFileMan->Copy(_L("\\ONE\\TWO\\*.TXT"),_L("\\ONE\\TWO\\*.TXT"),0,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3359 |
test_KErrNone(r); |
0 | 3360 |
WaitForResult(KErrAlreadyExists); |
3361 |
r=gFileMan->Copy(_L("\\ONE\\TWO\\FOUR"),_L("\\ONE\\TWO\\F*R"),CFileMan::ERecurse,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3362 |
test_KErrNone(r); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3363 |
WaitForResult(KErrNone); |
0 | 3364 |
} |
3365 |
RmDir(_L("\\ONE\\")); |
|
3366 |
||
3367 |
test.Next(_L("Test copy missing source and path")); |
|
3368 |
if (!gAsynch) |
|
3369 |
{ |
|
3370 |
r=gFileMan->Copy(_L("\\ONE\\TWO\\XXXYYY"),_L("\\ONE\\TWO\\asdfsadf")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3371 |
test_Equal(KErrPathNotFound, r); |
0 | 3372 |
r=gFileMan->Copy(_L("\\ONE\\TWO\\XXXYYY"),_L("\\ONE\\TWO\\asdfsadf"),CFileMan::ERecurse); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3373 |
test_Equal(KErrPathNotFound, r); |
0 | 3374 |
} |
3375 |
else |
|
3376 |
{ |
|
3377 |
r=gFileMan->Copy(_L("\\ONE\\TWO\\*.TXT"),_L("\\ONE\\TWO\\*.YYY"),0,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3378 |
test_KErrNone(r); |
0 | 3379 |
WaitForResult(KErrPathNotFound); |
3380 |
r=gFileMan->Copy(_L("\\ONE\\TWO\\XXXYYY"),_L("\\ONE\\TWO\\asdfsadf"),CFileMan::ERecurse,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3381 |
test_KErrNone(r); |
0 | 3382 |
WaitForResult(KErrPathNotFound); |
3383 |
} |
|
3384 |
||
3385 |
test.Next(_L("Test copy missing source")); |
|
3386 |
if (!gAsynch) |
|
3387 |
{ |
|
3388 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\*.LPQ"),_L("\\ONE\\TWO\\*.YYY")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3389 |
test_Equal(KErrNotFound, r); |
0 | 3390 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\XXXYYY"),_L("\\ONE\\TWO\\asdfsadf"),CFileMan::ERecurse); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3391 |
test_Equal(KErrNotFound, r); |
0 | 3392 |
} |
3393 |
else |
|
3394 |
{ |
|
3395 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\XXXYYY"),_L("\\ONE\\TWO\\asdfsadf"),0,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3396 |
test_KErrNone(r); |
0 | 3397 |
WaitForResult(KErrNotFound); |
3398 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\XXXYYY"),_L("\\ONE\\TWO\\asdfsadf"),CFileMan::ERecurse,gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3399 |
test_KErrNone(r); |
0 | 3400 |
WaitForResult(KErrNotFound); |
3401 |
} |
|
3402 |
||
3403 |
RmDir(_L("\\EMPTYSRC\\")); |
|
3404 |
MakeDir(_L("\\EMPTYSRC\\")); |
|
3405 |
RmDir(_L("\\EMPTYTRG\\")); |
|
3406 |
MakeDir(_L("\\EMPTYTRG\\")); |
|
3407 |
test.Next(_L("Test copy empty source directory")); |
|
3408 |
if (!gAsynch) |
|
3409 |
{ |
|
3410 |
r=gFileMan->Copy(_L("\\EMPTYSRC\\"),_L("\\EMPTYTRG\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3411 |
test_Equal(KErrNotFound, r); |
0 | 3412 |
r=gFileMan->Copy(_L("\\EMPTYSRC\\"),_L("\\EMPTYTRG\\"), CFileMan::ERecurse); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3413 |
test_Equal(KErrNotFound, r); |
0 | 3414 |
r=gFileMan->Copy(_L("\\EMPTYSRC"),_L("\\EMPTYTRG\\")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3415 |
test_Equal(KErrNotFound, r); |
0 | 3416 |
r=gFileMan->Copy(_L("\\EMPTYSRC"),_L("\\EMPTYTRG\\"), CFileMan::ERecurse); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3417 |
test_Equal(KErrNotFound, r); |
0 | 3418 |
} |
3419 |
else |
|
3420 |
{ |
|
3421 |
r=gFileMan->Copy(_L("\\EMPTYSRC\\"),_L("\\EMPTYTRG\\"), 0, gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3422 |
test_KErrNone(r); |
0 | 3423 |
WaitForResult(KErrNotFound); |
3424 |
r=gFileMan->Copy(_L("\\EMPTYSRC\\"),_L("\\EMPTYTRG\\"), CFileMan::ERecurse, gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3425 |
test_KErrNone(r); |
0 | 3426 |
WaitForResult(KErrNotFound); |
3427 |
r=gFileMan->Copy(_L("\\EMPTYSRC"),_L("\\EMPTYTRG\\"), 0, gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3428 |
test_KErrNone(r); |
0 | 3429 |
WaitForResult(KErrNotFound); |
3430 |
r=gFileMan->Copy(_L("\\EMPTYSRC"),_L("\\EMPTYTRG\\"), CFileMan::ERecurse, gStat); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3431 |
test_KErrNone(r); |
0 | 3432 |
WaitForResult(KErrNotFound); |
3433 |
} |
|
3434 |
RmDir(_L("\\EMPTYSRC\\")); |
|
3435 |
RmDir(_L("\\EMPTYTRG\\")); |
|
3436 |
||
3437 |
||
3438 |
MakeFile(_L("Dummyfile")); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3439 |
test.Next(_L("Test illegal names")); |
0 | 3440 |
r=gFileMan->Attribs(_L(":C:"),0,0,TTime(0),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3441 |
test_Equal(KErrBadName, r); |
0 | 3442 |
r=gFileMan->Copy(_L(":C:"),_L("newname"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3443 |
test_Equal(KErrBadName, r); |
0 | 3444 |
r=gFileMan->Copy(_L("Dummyfile"),_L(":C:"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3445 |
test_Equal(KErrBadName, r); |
0 | 3446 |
r=gFileMan->Delete(_L(":C:"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3447 |
test_Equal(KErrBadName, r); |
0 | 3448 |
r=gFileMan->Move(_L(":C:"),_L("newname"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3449 |
test_Equal(KErrBadName, r); |
0 | 3450 |
r=gFileMan->Move(_L("dummyFile"),_L(":C:"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3451 |
test_Equal(KErrBadName, r); |
0 | 3452 |
r=gFileMan->Rename(_L(":C:"),_L("newname"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3453 |
test_Equal(KErrBadName, r); |
0 | 3454 |
r=gFileMan->Rename(_L("DummyFile"),_L(":C:"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3455 |
test_Equal(KErrBadName, r); |
0 | 3456 |
r=gFileMan->RmDir(_L("\\:C:\\")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3457 |
test_Equal(KErrBadName, r); |
0 | 3458 |
|
3459 |
r=gFileMan->Attribs(_L("::C:"),0,0,TTime(0),0); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3460 |
test_Equal(KErrBadName, r); |
0 | 3461 |
r=gFileMan->Copy(_L("::C:"),_L("newname"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3462 |
test_Equal(KErrBadName, r); |
0 | 3463 |
r=gFileMan->Copy(_L("Dummyfile"),_L("::C:"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3464 |
test_Equal(KErrBadName, r); |
0 | 3465 |
r=gFileMan->Delete(_L("::C:"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3466 |
test_Equal(KErrBadName, r); |
0 | 3467 |
r=gFileMan->Move(_L("::C:"),_L("newname"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3468 |
test_Equal(KErrBadName, r); |
0 | 3469 |
r=gFileMan->Move(_L("dummyFile"),_L("::C:"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3470 |
test_Equal(KErrBadName, r); |
0 | 3471 |
r=gFileMan->Rename(_L("::C:"),_L("newname"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3472 |
test_Equal(KErrBadName, r); |
0 | 3473 |
r=gFileMan->Rename(_L("DummyFile"),_L("::C:"),0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3474 |
test_Equal(KErrBadName, r); |
0 | 3475 |
r=gFileMan->RmDir(_L("::C:")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3476 |
test_Equal(KErrBadName, r); |
0 | 3477 |
r=TheFs.Delete(_L("DummyFile")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3478 |
test_KErrNone(r); |
0 | 3479 |
// test copying two files with identical names that do not exist |
3480 |
_LIT(KNonExistent,"\\azzzz.txt"); |
|
3481 |
r=gFileMan->Copy(KNonExistent,KNonExistent,0); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3482 |
test_Equal(KErrNotFound, r); |
0 | 3483 |
} |
3484 |
||
3485 |
LOCAL_C void TestNameMangling() |
|
3486 |
// |
|
3487 |
// Synchronous test of name mangling |
|
3488 |
// |
|
3489 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3490 |
test.Next(_L("Test name mangling")); |
0 | 3491 |
gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\TRG\\")); |
3492 |
MakeDir(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\TRG\\")); |
|
3493 |
MakeFile(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\SRC\\abc.def")); |
|
3494 |
MakeFile(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\SRC\\abcdefghijk.def")); |
|
3495 |
MakeFile(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\SRC\\abc.defgh")); |
|
3496 |
MakeFile(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\SRC\\abcdefghijk.defgh")); |
|
3497 |
MakeFile(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\SRC\\zyx.abc.def")); |
|
3498 |
MakeFile(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\SRC\\zyx.abcdefghijk.def")); |
|
3499 |
MakeFile(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\SRC\\zyx.abc.defgh")); |
|
3500 |
MakeFile(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\SRC\\zyx.abcdefghijk.defgh")); |
|
3501 |
||
3502 |
TInt r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\SRC\\*.*"),_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\TRG\\*.*")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3503 |
test_KErrNone(r); |
0 | 3504 |
Compare(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\SRC\\*"),_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\TRG\\*")); |
3505 |
r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\NAMEMANGLER\\TRG\\*.*")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3506 |
test_KErrNone(r); |
0 | 3507 |
} |
3508 |
||
3509 |
LOCAL_C void TestLongNames() |
|
3510 |
// |
|
3511 |
// Synchronous test of name mangling |
|
3512 |
// |
|
3513 |
{ |
|
3514 |
#if defined(__WINS__) |
|
3515 |
if (gSessionPath[0]=='C') |
|
3516 |
return; |
|
3517 |
#endif |
|
3518 |
||
3519 |
gFileMan->SetObserver(NULL); |
|
3520 |
||
3521 |
// Format the current drive |
|
3522 |
Format(CurrentDrive()); |
|
3523 |
// Create Session Path |
|
3524 |
CreateTestDirectory(_L("\\F32-TST\\TFMAN\\")); |
|
3525 |
||
3526 |
// Create 2 root directories with very long names |
|
3527 |
TInt longFileLength = KMaxFileName-4; |
|
3528 |
test.Next(_L("Test methods on long names")); |
|
3529 |
TFileName longFileNameA; |
|
3530 |
longFileNameA.SetLength(longFileLength); |
|
3531 |
longFileNameA.Fill('A',longFileLength); |
|
3532 |
TFileName longRootDirNameA=_L("\\"); |
|
3533 |
longRootDirNameA+=longFileNameA; |
|
3534 |
longRootDirNameA+=_L("\\"); |
|
3535 |
TInt r=TheFs.MkDir(longRootDirNameA); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3536 |
test_Value(r, r==KErrNone || r==KErrAlreadyExists); |
0 | 3537 |
// Second folder |
3538 |
TFileName longFileNameB; |
|
3539 |
longFileNameB.SetLength(longFileLength); |
|
3540 |
longFileNameB.Fill('B',longFileLength); |
|
3541 |
TFileName longRootDirNameB=_L("\\"); |
|
3542 |
longRootDirNameB+=longFileNameB; |
|
3543 |
longRootDirNameB+=_L("\\"); |
|
3544 |
r=TheFs.MkDir(longRootDirNameB); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3545 |
test_Value(r, r==KErrNone || r==KErrAlreadyExists); |
0 | 3546 |
|
3547 |
TInt longFilePtrLength = KMaxFileName-3; // We do not want the trailing backslash |
|
3548 |
TPtrC ptrLongFileA(longRootDirNameA.Ptr(),longFilePtrLength); |
|
3549 |
TPtrC ptrLongFileB(longRootDirNameB.Ptr(),longFilePtrLength); |
|
3550 |
||
3551 |
// TInt CFileMan::Move(const TDesC& anOld,const TDesC& aNew,TUint aSwitch=EOverWrite); |
|
3552 |
// Tries to move a folder with a long name into another |
|
3553 |
// This test will return KErrGeneral because the new path will exceed the maximum length |
|
3554 |
// See KMaxFileName |
|
3555 |
r=gFileMan->Move(ptrLongFileA,ptrLongFileB); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3556 |
test_Equal(KErrGeneral, r); |
0 | 3557 |
|
3558 |
r=gFileMan->RmDir(longRootDirNameA); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3559 |
test_KErrNone(r); |
0 | 3560 |
r=gFileMan->Rename(ptrLongFileB,ptrLongFileA); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3561 |
test_KErrNone(r); |
0 | 3562 |
r=gFileMan->RmDir(longRootDirNameB); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3563 |
test_Equal(KErrPathNotFound, r); |
0 | 3564 |
r=gFileMan->RmDir(longRootDirNameA); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3565 |
test_KErrNone(r); |
0 | 3566 |
|
3567 |
TFileName longSubDirName=_L("\\Files\\"); |
|
3568 |
TPtrC longSubDirFileName(longFileNameA.Ptr(),longFilePtrLength-longSubDirName.Length()); |
|
3569 |
longSubDirName+=longSubDirFileName; |
|
3570 |
longSubDirName+=_L("\\"); |
|
3571 |
r=TheFs.MkDirAll(longSubDirName); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3572 |
test_KErrNone(r); |
0 | 3573 |
|
3574 |
CDir* dirList; |
|
3575 |
r=TheFs.GetDir(longSubDirName,KEntryAttMaskSupported,0,dirList); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3576 |
test_KErrNone(r); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3577 |
test_Equal(0, dirList->Count()); |
0 | 3578 |
delete dirList; |
3579 |
||
3580 |
TPtrC ptrLongSubDirSrc(longSubDirName.Ptr(),longSubDirName.Length()-1); |
|
3581 |
TPtrC ptrLongSubDirTrg(longRootDirNameA.Ptr(),longRootDirNameA.Length()-1); |
|
3582 |
r=gFileMan->Copy(ptrLongSubDirSrc,ptrLongSubDirTrg); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3583 |
test_KErrNone(r); |
0 | 3584 |
r=TheFs.MkDir(longRootDirNameB); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3585 |
test_KErrNone(r); |
0 | 3586 |
r=gFileMan->Move(ptrLongSubDirSrc,longRootDirNameB); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3587 |
test_Equal(KErrBadName, r); |
0 | 3588 |
r=TheFs.RmDir(longRootDirNameB); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3589 |
test_KErrNone(r); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3590 |
test_KErrNone(TheFs.RmDir(longSubDirName)); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3591 |
test_KErrNone(TheFs.RmDir(_L("\\Files\\"))); |
0 | 3592 |
gFileMan->SetObserver(gObserver); |
3593 |
} |
|
3594 |
||
3595 |
LOCAL_C void TestFileAttributes() |
|
3596 |
// |
|
3597 |
// Test file attributes are copied and new settings |
|
3598 |
// |
|
3599 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3600 |
test.Next(_L("Test file attributes are copied")); |
0 | 3601 |
gFileMan->Delete(_L("\\F32-TST\\TFMAN\\FILEATT\\TRG\\*.*")); |
3602 |
MakeDir(_L("\\F32-TST\\TFMAN\\FILEATT\\TRG\\")); |
|
3603 |
MakeFile(_L("\\F32-TST\\TFMAN\\FILEATT\\SRC\\readonly.def"),KEntryAttReadOnly); |
|
3604 |
MakeFile(_L("\\F32-TST\\TFMAN\\FILEATT\\SRC\\readonlyhidden.def"),KEntryAttReadOnly|KEntryAttHidden); |
|
3605 |
MakeFile(_L("\\F32-TST\\TFMAN\\FILEATT\\SRC\\hiddensystem.def"),KEntryAttHidden|KEntryAttSystem); |
|
3606 |
MakeFile(_L("\\F32-TST\\TFMAN\\FILEATT\\SRC\\systemarchive.def"),KEntryAttArchive|KEntryAttSystem); |
|
3607 |
||
3608 |
TInt r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\FILEATT\\SRC\\*.*"),_L("\\F32-TST\\TFMAN\\FILEATT\\TRG\\*.*")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3609 |
test_KErrNone(r); |
0 | 3610 |
Compare(_L("\\F32-TST\\TFMAN\\FILEATT\\SRC\\*.*"),_L("\\F32-TST\\TFMAN\\FILEATT\\TRG\\*")); |
3611 |
r=gFileMan->Attribs(_L("\\F32-TST\\TFMAN\\FILEATT\\SRC\\*"),0,KEntryAttReadOnly,TTime(0)); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3612 |
test_KErrNone(r); |
0 | 3613 |
r=gFileMan->Attribs(_L("\\F32-TST\\TFMAN\\FILEATT\\TRG\\*"),0,KEntryAttReadOnly,TTime(0)); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3614 |
test_KErrNone(r); |
0 | 3615 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\FILEATT\\")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3616 |
test_KErrNone(r); |
0 | 3617 |
} |
3618 |
||
3619 |
class CFileManObserverContinue : public CBase, public MFileManObserver |
|
3620 |
{ |
|
3621 |
public: |
|
3622 |
CFileManObserverContinue(CFileMan* aFileMan); |
|
3623 |
TControl NotifyFileManEnded(); |
|
3624 |
private: |
|
3625 |
CFileMan* iFileMan; |
|
3626 |
}; |
|
3627 |
||
3628 |
||
3629 |
CFileManObserverContinue::CFileManObserverContinue(CFileMan* aFileMan) |
|
3630 |
// |
|
3631 |
// Constructor |
|
3632 |
// |
|
3633 |
{ |
|
3634 |
__DECLARE_NAME(_S("CFileManObserverOverWrite")); |
|
3635 |
iFileMan=aFileMan; |
|
3636 |
} |
|
3637 |
||
3638 |
||
3639 |
MFileManObserver::TControl CFileManObserverContinue::NotifyFileManEnded() |
|
3640 |
// |
|
3641 |
// Observer for testoverwrite tests |
|
3642 |
// |
|
3643 |
{ |
|
3644 |
return(MFileManObserver::EContinue); |
|
3645 |
} |
|
3646 |
||
3647 |
LOCAL_C void TestCopyOpenFile() |
|
3648 |
// |
|
3649 |
// Copy a file while it is open |
|
3650 |
// |
|
3651 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3652 |
test.Next(_L("Test copying open files")); |
0 | 3653 |
|
3654 |
CFileManObserverContinue* fManObserver=new(ELeave) CFileManObserverContinue(gFileMan); |
|
3655 |
gFileMan->SetObserver(fManObserver); |
|
3656 |
||
3657 |
TBuf<256> contents; |
|
3658 |
TPtrC8 bufPtr; |
|
3659 |
CreateLongName(contents,gSeed,256); |
|
3660 |
bufPtr.Set((TUint8*)contents.Ptr(),contents.Size()); |
|
3661 |
||
3662 |
MakeFile(_L("\\F32-TST\\TFMAN\\FILECOPY\\asdf.asdf"),bufPtr); |
|
3663 |
RFile f; |
|
3664 |
TInt r=f.Open(TheFs,_L("\\F32-TST\\TFMAN\\FILECOPY\\asdf.asdf"),EFileRead|EFileShareReadersOnly); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3665 |
test_KErrNone(r); |
0 | 3666 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\FILECOPY\\asdf.asdf"),_L("\\F32-TST\\TFMAN\\FILECOPY\\xxxx.xxxx")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3667 |
test_KErrNone(r); |
0 | 3668 |
f.Close(); |
3669 |
r=f.Open(TheFs,_L("\\F32-TST\\TFMAN\\FILECOPY\\xxxx.xxxx"),EFileRead); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3670 |
test_KErrNone(r); |
0 | 3671 |
TBuf8<256*sizeof(TText)> temp; |
3672 |
r=f.Read(temp); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3673 |
test_KErrNone(r); |
0 | 3674 |
test(temp==bufPtr); |
3675 |
r=f.Read(temp); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3676 |
test_KErrNone(r); |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3677 |
test_Equal(0, temp.Length()); |
0 | 3678 |
f.Close(); |
3679 |
||
3680 |
r=f.Open(TheFs,_L("\\F32-TST\\TFMAN\\FILECOPY\\asdf.asdf"),EFileRead); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3681 |
test_KErrNone(r); |
0 | 3682 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\FILECOPY\\asdf.asdf"),_L("\\F32-TST\\TFMAN\\FILECOPY\\xxxx.xxxx")); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3683 |
test_Equal(KErrInUse, r); |
0 | 3684 |
f.Close(); |
3685 |
||
3686 |
gFileMan->SetObserver(gObserver); |
|
3687 |
r=gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\FILECOPY\\")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3688 |
test_KErrNone(r); |
0 | 3689 |
delete fManObserver; |
3690 |
} |
|
3691 |
||
3692 |
void TestINC101844() |
|
3693 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3694 |
test.Next(_L("Test move files and subdirs with different attributes (INC101844)")); |
0 | 3695 |
_LIT(KDest,"C:\\DEST101844\\"); |
3696 |
TBuf<64> source; |
|
3697 |
source.Format(_L("%c:\\INC101844\\"), (TUint) gDriveToTest); |
|
3698 |
TBuf<64> src; |
|
3699 |
RmDir(source); |
|
3700 |
RmDir(KDest); |
|
3701 |
MakeDir(KDest); |
|
3702 |
TInt r; |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3703 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3704 |
// Create files and subdirs with different attributes |
0 | 3705 |
src = source; |
3706 |
src.Append(_L("file1")); |
|
3707 |
MakeFile(src, _L8("blah")); |
|
3708 |
TheFs.SetAtt(src, KEntryAttReadOnly, 0); |
|
3709 |
src = source; |
|
3710 |
src.Append(_L("file2")); |
|
3711 |
MakeFile(src, _L8("blah")); |
|
3712 |
TheFs.SetAtt(src, KEntryAttHidden, 0); |
|
3713 |
src = source; |
|
3714 |
src.Append(_L("file3")); |
|
3715 |
MakeFile(src, _L8("blah")); |
|
3716 |
TheFs.SetAtt(src, KEntryAttSystem, 0); |
|
3717 |
src = source; |
|
3718 |
src.Append(_L("subdir1\\file4")); |
|
3719 |
MakeFile(src, _L8("blah")); |
|
3720 |
TheFs.SetAtt(src, KEntryAttArchive, 0); |
|
3721 |
src = source; |
|
3722 |
src.Append(_L("subdir1")); |
|
3723 |
TheFs.SetAtt(src, KEntryAttSystem | KEntryAttHidden, KEntryAttArchive); |
|
3724 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3725 |
// Move directory containing files and subdirs with different attributes |
0 | 3726 |
r = gFileMan->Move(source, KDest, 0); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3727 |
test_KErrNone(r); |
0 | 3728 |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3729 |
// Check that the files and subdirs have moved and have the correct attributes |
0 | 3730 |
TEntry entry; |
3731 |
src = KDest; |
|
3732 |
src.Append(_L("file1")); |
|
3733 |
r = TheFs.Entry(src, entry); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3734 |
test_KErrNone(r); |
0 | 3735 |
test(entry.iAtt&KEntryAttReadOnly); |
3736 |
||
3737 |
src = KDest; |
|
3738 |
src.Append(_L("file2")); |
|
3739 |
r = TheFs.Entry(src, entry); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3740 |
test_KErrNone(r); |
0 | 3741 |
test(entry.iAtt&KEntryAttHidden); |
3742 |
||
3743 |
src = KDest; |
|
3744 |
src.Append(_L("file3")); |
|
3745 |
r = TheFs.Entry(src, entry); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3746 |
test_KErrNone(r); |
0 | 3747 |
test(entry.iAtt&KEntryAttSystem); |
3748 |
||
3749 |
src = source; |
|
3750 |
src.Append(_L("subdir1\\")); |
|
3751 |
r = gFileMan->Move(src, source, 0); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3752 |
test_KErrNone(r); |
0 | 3753 |
|
3754 |
r = TheFs.RmDir(src); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3755 |
test_KErrNone(r); |
0 | 3756 |
src = source; |
3757 |
src.Append(_L("file4")); |
|
3758 |
r = TheFs.Delete(src); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3759 |
test_KErrNone(r); |
0 | 3760 |
r = TheFs.RmDir(source); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3761 |
test_KErrNone(r); |
0 | 3762 |
RmDir(KDest); |
3763 |
} |
|
3764 |
||
3765 |
LOCAL_C void TestMoveAcrossDrives() |
|
3766 |
// |
|
3767 |
// Move a file from C: to the target drive |
|
3768 |
// |
|
3769 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3770 |
test.Next(_L("Test move across drives")); |
0 | 3771 |
|
3772 |
TFileName trgDrive = _L("\\"); |
|
3773 |
TFileName trgFile = _L("\\Sketch"); |
|
3774 |
TFileName trgDir = _L("\\DRIVEMOVE\\"); |
|
3775 |
TFileName trgDirFile = _L("\\DRIVEMOVE\\Sketch"); |
|
3776 |
||
3777 |
if (gSessionPath[0]=='C') |
|
3778 |
{ |
|
3779 |
#if !defined(__WINS__) |
|
3780 |
trgDrive = _L("D:\\"); |
|
3781 |
trgFile = _L("D:\\Sketch"); |
|
3782 |
trgDir = _L("D:\\DRIVEMOVE\\"); |
|
3783 |
trgDirFile = _L("D:\\DRIVEMOVE\\Sketch"); |
|
3784 |
#else |
|
3785 |
trgDrive = _L("Y:\\"); |
|
3786 |
trgFile = _L("Y:\\Sketch"); |
|
3787 |
trgDir = _L("Y:\\DRIVEMOVE\\"); |
|
3788 |
trgDirFile = _L("Y:\\DRIVEMOVE\\Sketch"); |
|
3789 |
#endif |
|
3790 |
} |
|
3791 |
||
3792 |
RmDir(trgDir); |
|
3793 |
RmDir(_L("C:\\F32-TST\\TFMAN\\DRIVEMOVE\\")); |
|
3794 |
||
3795 |
MakeFile(_L("C:\\F32-TST\\TFMAN\\DRIVEMOVE\\Sketch")); |
|
3796 |
||
3797 |
// Move Sketch from the source to target |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3798 |
TInt r = gFileMan->Move(_L("C:\\F32-TST\\TFMAN\\DRIVEMOVE\\Sketch"),trgDrive); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3799 |
test.Printf(_L("TestMoveAcrossDrives(),gFileMan->Move(),r=%d\n"),r); |
0 | 3800 |
// Check Sketch no longer exists on source drive |
3801 |
CheckFileExists(_L("C:\\F32-TST\\TFMAN\\DRIVEMOVE\\Sketch"),KErrNotFound); |
|
3802 |
// Check Sketch exists on target drive |
|
3803 |
CheckFileExists(trgFile,KErrNone); |
|
3804 |
||
3805 |
MakeFile(_L("C:\\F32-TST\\TFMAN\\DRIVEMOVE\\Sketch")); |
|
3806 |
// Move Directory DRIVEMOVE from the source to target |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3807 |
r = gFileMan->Move(_L("C:\\F32-TST\\TFMAN\\DRIVEMOVE"),trgDrive); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3808 |
test.Printf(_L("TestMoveAcrossDrives(),gFileMan->Move(),r=%d\n"),r); |
0 | 3809 |
// Check DRIVEMOVE no longer exists on source drive |
3810 |
CheckFileExists(_L("C:\\F32-TST\\TFMAN\\DRIVEMOVE\\Sketch"),KErrPathNotFound); |
|
3811 |
// Check Sketch exists on target drive |
|
3812 |
CheckFileExists(trgDirFile,KErrNone); |
|
3813 |
||
3814 |
RmDir(trgDir); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3815 |
test_KErrNone(TheFs.Delete(trgFile)); |
0 | 3816 |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3817 |
TestINC101844(); // Test move files and subdirs with different attributes |
0 | 3818 |
} |
3819 |
||
3820 |
class CFileManObserverCopyAbort : public CBase, public MFileManObserver |
|
3821 |
{ |
|
3822 |
public: |
|
3823 |
CFileManObserverCopyAbort(CFileMan* aFileMan); |
|
3824 |
TControl NotifyFileManEnded(); |
|
3825 |
void SetAbortStep(TInt aAbortStep); |
|
3826 |
private: |
|
3827 |
CFileMan* iFileMan; |
|
3828 |
TInt iCurrentStep; |
|
3829 |
}; |
|
3830 |
||
3831 |
||
3832 |
CFileManObserverCopyAbort::CFileManObserverCopyAbort(CFileMan* aFileMan) |
|
3833 |
// |
|
3834 |
// Constructor |
|
3835 |
// |
|
3836 |
: iFileMan(aFileMan), |
|
3837 |
iCurrentStep(0) |
|
3838 |
{ |
|
3839 |
__DECLARE_NAME(_S("CFileManObserverCopyAbort")); |
|
3840 |
} |
|
3841 |
||
3842 |
||
3843 |
void CFileManObserverCopyAbort::SetAbortStep(TInt aAbortStep) |
|
3844 |
// |
|
3845 |
// Set the step at which to cancel the operation |
|
3846 |
// |
|
3847 |
{ |
|
3848 |
iCurrentStep = aAbortStep; |
|
3849 |
} |
|
3850 |
||
3851 |
||
3852 |
MFileManObserver::TControl CFileManObserverCopyAbort::NotifyFileManEnded() |
|
3853 |
// |
|
3854 |
// Observer for testoverwrite tests |
|
3855 |
// |
|
3856 |
{ |
|
3857 |
TInt lastError = iFileMan->GetLastError(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3858 |
test_KErrNone(lastError); |
0 | 3859 |
|
3860 |
TFileName srcfile; |
|
3861 |
iFileMan->GetCurrentSource(srcfile); |
|
3862 |
||
3863 |
TInt action = iFileMan->CurrentAction(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3864 |
test_Value(action, action == CFileMan::EMove || |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3865 |
action == CFileMan::EDelete || |
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
3866 |
action == CFileMan::ERmDir); |
0 | 3867 |
|
3868 |
iCurrentStep--; |
|
3869 |
return(iCurrentStep ? MFileManObserver::EContinue : MFileManObserver::EAbort); |
|
3870 |
} |
|
3871 |
||
3872 |
LOCAL_C void TestAbortedMoveAcrossDrives() |
|
3873 |
// |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3874 |
// Move a file from C: to D: or Y:, and test various cancel conditions |
0 | 3875 |
// |
3876 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3877 |
test.Next(_L("Test cancel move across drives")); |
0 | 3878 |
|
3879 |
const TInt KNumFiles = 5; |
|
3880 |
||
3881 |
TFileName trgDirRoot = _L("\\F32-TST\\TFMAN\\"); |
|
3882 |
TFileName trgDirFull = _L("\\F32-TST\\TFMAN\\CANCELMOVE\\"); |
|
3883 |
TFileName trgDirFile = _L("\\F32-TST\\TFMAN\\CANCELMOVE\\FILE"); |
|
3884 |
||
3885 |
if (gSessionPath[0]=='C') |
|
3886 |
{ |
|
3887 |
#if !defined(__WINS__) |
|
3888 |
trgDirRoot = _L("D:\\F32-TST\\TFMAN\\"); |
|
3889 |
trgDirFull = _L("D:\\F32-TST\\TFMAN\\CANCELMOVE\\"); |
|
3890 |
trgDirFile = _L("D:\\F32-TST\\TFMAN\\CANCELMOVE\\FILE"); |
|
3891 |
#else |
|
3892 |
trgDirRoot = _L("Y:\\F32-TST\\TFMAN\\"); |
|
3893 |
trgDirFull = _L("Y:\\F32-TST\\TFMAN\\CANCELMOVE\\"); |
|
3894 |
trgDirFile = _L("Y:\\F32-TST\\TFMAN\\CANCELMOVE\\FILE"); |
|
3895 |
#endif |
|
3896 |
} |
|
3897 |
||
3898 |
gFileMan->RmDir(_L("C:\\F32-TST\\TFMAN\\CANCELMOVE\\")); |
|
3899 |
||
3900 |
CFileManObserverCopyAbort* fManObserver=new(ELeave) CFileManObserverCopyAbort(gFileMan); |
|
3901 |
CleanupStack::PushL(fManObserver); |
|
3902 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3903 |
// Check that source files exist when interrupting the copy step |
0 | 3904 |
TInt step = 0; |
3905 |
TInt i = 0; |
|
3906 |
for(step = 1; step <= KNumFiles+1; ++step) |
|
3907 |
{ |
|
3908 |
for (i = 0; i < KNumFiles; i++) |
|
3909 |
{ |
|
3910 |
TFileName sourceFile =_L("C:\\F32-TST\\TFMAN\\CANCELMOVE\\FILE"); |
|
3911 |
sourceFile.AppendNum(i); |
|
3912 |
sourceFile.Append(_L(".TXT")); |
|
3913 |
MakeFile(sourceFile); |
|
3914 |
} |
|
3915 |
||
3916 |
gFileMan->RmDir(trgDirFull); |
|
3917 |
||
3918 |
fManObserver->SetAbortStep(step); |
|
3919 |
gFileMan->SetObserver(fManObserver); |
|
3920 |
||
3921 |
TInt r; |
|
3922 |
if (!gAsynch) |
|
3923 |
r=gFileMan->Move(_L("C:\\F32-TST\\TFMAN\\CANCELMOVE"),trgDirRoot, CFileMan::EOverWrite); |
|
3924 |
else |
|
3925 |
r=gFileMan->Move(_L("C:\\F32-TST\\TFMAN\\CANCELMOVE"),trgDirRoot, CFileMan::EOverWrite, gStat); |
|
3926 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3927 |
test.Printf(_L("TestAbortedMoveAcrossDrives(),gFileMan->Move(),r=%d\n"),r); |
0 | 3928 |
TestResult(r, (step <= KNumFiles) ? KErrCancel : KErrNone); |
3929 |
||
3930 |
gFileMan->SetObserver(NULL); |
|
3931 |
||
3932 |
// Check that the expected target files exist... |
|
3933 |
CheckFileExists(trgDirFull, KErrNone, EFalse); |
|
3934 |
for (i = 0; i < Min(step, KNumFiles); i++) |
|
3935 |
{ |
|
3936 |
TFileName trgAfterFile = trgDirFile; |
|
3937 |
trgAfterFile.AppendNum(i); |
|
3938 |
trgAfterFile.Append(_L(".TXT")); |
|
3939 |
CheckFileExists(trgAfterFile, KErrNone); |
|
3940 |
} |
|
3941 |
||
3942 |
// Check that the expected source files still exist after the abort... |
|
3943 |
CheckFileExists(_L("C:\\F32-TST\\TFMAN\\CANCELMOVE\\"), (step <= KNumFiles) ? KErrNone : KErrNotFound, EFalse); |
|
3944 |
for (; i < KNumFiles; i++) |
|
3945 |
{ |
|
3946 |
TFileName srcAfterFile =_L("C:\\F32-TST\\TFMAN\\CANCELMOVE\\FILE"); |
|
3947 |
srcAfterFile.AppendNum(i); |
|
3948 |
srcAfterFile.Append(_L(".TXT")); |
|
3949 |
CheckFileExists(srcAfterFile, KErrNone); |
|
3950 |
} |
|
3951 |
} |
|
3952 |
||
3953 |
gFileMan->SetObserver(NULL); |
|
3954 |
CleanupStack::PopAndDestroy(); |
|
3955 |
||
3956 |
RmDir(trgDirRoot); // "?:\\F32-TST\\TFMAN\\" |
|
3957 |
TheFs.RmDir(trgDirRoot.Left(16)); |
|
3958 |
TheFs.RmDir(trgDirRoot.Left(10)); |
|
3959 |
TheFs.RmDir(_L("C:\\F32-TST\\TFMAN\\")); |
|
3960 |
TheFs.RmDir(_L("C:\\F32-TST\\")); |
|
3961 |
} |
|
3962 |
||
3963 |
||
3964 |
LOCAL_C void TestMoveEmptyDirectory() |
|
3965 |
// |
|
3966 |
// "Try to move an empty directory C:\F32-TST\TFMAN\DRIVEMOVE\ to C:\" |
|
3967 |
// |
|
3968 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3969 |
test.Next(_L("Test move empty directory")); |
0 | 3970 |
|
3971 |
#if !defined(__WINS__) |
|
3972 |
TFileName trgDrive=_L("D:\\"); |
|
3973 |
#else |
|
3974 |
if (gSessionPath[0]!='C') |
|
3975 |
return; |
|
3976 |
TFileName trgDrive=_L("C:\\"); |
|
3977 |
#endif |
|
3978 |
||
3979 |
MakeDir(_L("C:\\F32-TST\\TFMAN\\DRIVEMOVE\\")); |
|
3980 |
TInt r=gFileMan->Move(_L("C:\\F32-TST\\TFMAN\\DRIVEMOVE\\*"),trgDrive,CFileMan::ERecurse); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3981 |
test.Printf(_L("TestMoveEmptyDirectory(),gFileMan->Move(),r=%d\n"),r); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
3982 |
test_Value(r, r == KErrNotFound); |
0 | 3983 |
} |
3984 |
||
3985 |
LOCAL_C void TestCopyAndRename() |
|
3986 |
// |
|
3987 |
// Rename while copying files and directories |
|
3988 |
// |
|
3989 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3990 |
test.Next(_L("Test rename while copying files and directories")); |
0 | 3991 |
gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\CPMV")); |
3992 |
MakeFile(_L("\\F32-TST\\TFMAN\\CPMV\\ONE\\ONE_1.TXT")); |
|
3993 |
MakeFile(_L("\\F32-TST\\TFMAN\\CPMV\\ONE\\ONE_2.TXT")); |
|
3994 |
MakeFile(_L("\\F32-TST\\TFMAN\\CPMV\\ONE\\ONE_3.TXT")); |
|
3995 |
MakeFile(_L("\\F32-TST\\TFMAN\\CPMV\\ONE\\TWOTWO.TWO")); |
|
3996 |
MakeFile(_L("\\F32-TST\\TFMAN\\CPMV\\ONE_4.TXT")); |
|
3997 |
MakeFile(_L("\\F32-TST\\TFMAN\\CPMV\\ONE_5.TXT")); |
|
3998 |
MakeFile(_L("\\F32-TST\\TFMAN\\CPMV\\TWO.TXT")); |
|
3999 |
MakeFile(_L("\\F32-TST\\TFMAN\\CPMV\\TWO.GOD")); |
|
4000 |
MakeFile(_L("\\F32-TST\\TFMAN\\CPMV\\TWO.BAD")); |
|
4001 |
||
4002 |
TInt r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\TWO.*"), _L("\\F32-TST\\TFMAN\\THREE.*"), CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4003 |
test_KErrNone(r); |
0 | 4004 |
|
4005 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CPMV\\THREE.TXT"), KErrNone); |
|
4006 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CPMV\\THREE.GOD"), KErrNone); |
|
4007 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CPMV\\THREE.BAD"), KErrNone); |
|
4008 |
r=gFileMan->Delete(_L("\\F32-TST\\TFMAN\\CPMV\\THREE.*")); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4009 |
test_KErrNone(r); |
0 | 4010 |
|
4011 |
MakeFile(_L("\\F32-TST\\TFMAN\\CPMV\\TWO2\\TWO__1.TXT")); |
|
4012 |
MakeFile(_L("\\F32-TST\\TFMAN\\CPMV\\TWO2\\TWO__2.TXT")); |
|
4013 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4014 |
// copy and rename dir |
0 | 4015 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\CPMV\\TWO2"), _L("\\F32-TST\\TFMAN\\CPMV\\THREE"), CFileMan::ERecurse); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4016 |
test_KErrNone(r); |
0 | 4017 |
Compare(_L("\\F32-TST\\TFMAN\\CPMV\\TWO2\\*"), _L("\\F32-TST\\TFMAN\\CPMV\\THREE\\*")); |
4018 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4019 |
// copy and move into another dir |
0 | 4020 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\CPMV\\TWO2"), _L("\\F32-TST\\TFMAN\\CPMV\\THREE\\TWO"), CFileMan::ERecurse); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4021 |
test_KErrNone(r); |
0 | 4022 |
Compare(_L("\\F32-TST\\TFMAN\\CPMV\\TWO2\\*"), _L("\\F32-TST\\TFMAN\\CPMV\\THREE\\TWO\\*")); |
4023 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4024 |
// copy and rename files and dirs in current dir |
0 | 4025 |
r=gFileMan->Copy(_L("\\F32-TST\\TFMAN\\CPMV\\TWO*"), _L("\\F32-TST\\TFMAN\\CPMV\\THREE*"), CFileMan::ERecurse); |
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4026 |
test_KErrNone(r); |
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4027 |
// Compare(_L("\\F32-TST\\TFMAN\\CPMV\\TWO2\\*"), _L("\\F32-TST\\TFMAN\\CPMV\\THREE2\\*")); |
0 | 4028 |
|
4029 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CPMV\\ONE\\THREEO.TWO"), KErrNone); |
|
4030 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CPMV\\THREE\\TWO__1.TXT"), KErrNone); |
|
4031 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CPMV\\THREE\\TWO__2.TXT"), KErrNone); |
|
4032 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CPMV\\THREE.TXT"), KErrNone); |
|
4033 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CPMV\\THREE.BAD"), KErrNone); |
|
4034 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CPMV\\THREE.GOD"), KErrNone); |
|
4035 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CPMV\\THREE\\THREE1.TXT"), KErrNone); |
|
4036 |
CheckFileExists(_L("\\F32-TST\\TFMAN\\CPMV\\THREE\\THREE2.TXT"), KErrNone); |
|
4037 |
||
4038 |
gFileMan->RmDir(_L("\\F32-TST\\TFMAN\\CPMV\\")); |
|
4039 |
} |
|
4040 |
||
4041 |
void TestStackUsage(TInt aLevel, TThreadStackInfo& aStack) |
|
4042 |
{ |
|
4043 |
// DEF104115 |
|
4044 |
_LIT(KDir, "\\DEF104115\\"); |
|
4045 |
_LIT(KFile1, "\\DEF104115\\file1veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryverylong.txt"); |
|
4046 |
_LIT(KFile2, "\\DEF104115\\SUBDIR\\longfile2.txt"); |
|
4047 |
||
4048 |
if(aLevel==0) |
|
4049 |
{ |
|
4050 |
test.Next(_L("Test stack usage")); |
|
4051 |
RmDir(KDir); |
|
4052 |
MakeFile(KFile1, _L8("123456789012345678901234567890")); |
|
4053 |
MakeFile(KFile2); |
|
4054 |
} |
|
4055 |
TInt r = KErrNone; |
|
4056 |
char* start = NULL; |
|
4057 |
char* end = NULL; |
|
4058 |
TInt available = 0; |
|
4059 |
TInt stacksize = aStack.iBase - aStack.iLimit; |
|
4060 |
start = (char*)aStack.iLimit; |
|
4061 |
end = (char*)&stacksize; |
|
4062 |
available = (TInt)end - (TInt)start; |
|
4063 |
#ifdef __X86__ |
|
4064 |
if(available > 6 * 1024) // X86 uses about twice as much stack as ARM in debug mode, so double the number. |
|
4065 |
#else |
|
4066 |
if(available > 3 * 1024) // don't touch this constant ... fix CFileMan instead!! |
|
4067 |
#endif |
|
4068 |
{ |
|
4069 |
TestStackUsage(aLevel+1, aStack); |
|
4070 |
return; |
|
4071 |
} |
|
4072 |
||
4073 |
test.Printf(_L("Level:%d Available:%d\n"), aLevel, available); |
|
4074 |
||
4075 |
gFileMan->SetObserver(NULL); |
|
4076 |
// Attribs |
|
4077 |
r = gFileMan->Attribs(KDir, 0, 0, 0, CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4078 |
test_KErrNone(r); |
0 | 4079 |
|
4080 |
// Move |
|
4081 |
r = gFileMan->Move(KFile1, KFile2, CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4082 |
test_Equal(KErrAlreadyExists, r); |
0 | 4083 |
|
4084 |
r = gFileMan->Move(KFile1, KFile2, CFileMan::ERecurse | CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4085 |
test_KErrNone(r); |
0 | 4086 |
|
4087 |
// Copy |
|
4088 |
r = gFileMan->Copy(KFile2, KFile1, CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4089 |
test_KErrNone(r); |
0 | 4090 |
|
4091 |
// Rename |
|
4092 |
r = gFileMan->Rename(KFile1, KFile2, 0); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4093 |
test_Equal(KErrAlreadyExists, r); |
0 | 4094 |
|
4095 |
r = gFileMan->Rename(KFile1, KFile2, CFileMan::EOverWrite); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4096 |
test_KErrNone(r); |
0 | 4097 |
|
4098 |
// Delete |
|
4099 |
r = gFileMan->Delete(KFile2, CFileMan::ERecurse); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4100 |
test_KErrNone(r); |
0 | 4101 |
|
4102 |
// RmDir |
|
4103 |
r = gFileMan->RmDir(KDir); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4104 |
test_KErrNone(r); |
0 | 4105 |
|
4106 |
gFileMan->SetObserver(gObserver); |
|
4107 |
} |
|
4108 |
||
4109 |
LOCAL_C void InitialiseL() |
|
4110 |
// |
|
4111 |
// Set up test variables |
|
4112 |
// |
|
4113 |
{ |
|
4114 |
gFileMan=CFileMan::NewL(TheFs); |
|
4115 |
gObserver=new(ELeave) CFileManObserver(gFileMan); |
|
4116 |
gFileMan->SetObserver(gObserver); |
|
4117 |
} |
|
4118 |
||
4119 |
LOCAL_C void Cleanup() |
|
4120 |
// |
|
4121 |
// Cleanup test variables |
|
4122 |
// |
|
4123 |
{ |
|
4124 |
delete gFileMan; |
|
4125 |
delete gObserver; |
|
4126 |
} |
|
4127 |
||
4128 |
LOCAL_C void SetupDirStructure(TFileName& aSrcPath,TFileName& aTrgPath) |
|
4129 |
{ |
|
4130 |
TFileName tmpName = aSrcPath; |
|
4131 |
||
4132 |
// Create the TrgPath dirs |
|
4133 |
MakeDir(aTrgPath); |
|
4134 |
||
4135 |
// Create the aSrcPath dirs |
|
4136 |
tmpName = aSrcPath; |
|
4137 |
tmpName.Append(_L("EmptyDir01\\")); |
|
4138 |
MakeDir(tmpName); |
|
4139 |
||
4140 |
tmpName = aSrcPath; |
|
4141 |
tmpName.Append(_L("EmptyDir02\\")); |
|
4142 |
MakeDir(tmpName); |
|
4143 |
||
4144 |
tmpName = aSrcPath; |
|
4145 |
tmpName.Append(_L("EmptyDir03\\")); |
|
4146 |
MakeDir(tmpName); |
|
4147 |
||
4148 |
tmpName = aSrcPath; |
|
4149 |
tmpName.Append(_L("FILE01.TXT")); |
|
4150 |
MakeFile(tmpName); |
|
4151 |
||
4152 |
tmpName = aSrcPath; |
|
4153 |
tmpName.Append(_L("FILE02.TXT")); |
|
4154 |
MakeFile(tmpName); |
|
4155 |
||
4156 |
tmpName = aSrcPath; |
|
4157 |
tmpName.Append(_L("FILE03.TXT")); |
|
4158 |
MakeFile(tmpName); |
|
4159 |
||
4160 |
tmpName = aSrcPath; |
|
4161 |
tmpName.Append(_L("SubDir01\\EmptyDir01\\")); |
|
4162 |
MakeDir(tmpName); |
|
4163 |
||
4164 |
tmpName = aSrcPath; |
|
4165 |
tmpName.Append(_L("SubDir02\\EmptyDir02\\")); |
|
4166 |
MakeDir(tmpName); |
|
4167 |
||
4168 |
tmpName = aSrcPath; |
|
4169 |
tmpName.Append(_L("SubDir03\\EmptyDir03\\")); |
|
4170 |
MakeDir(tmpName); |
|
4171 |
||
4172 |
tmpName = aSrcPath; |
|
4173 |
tmpName.Append(_L("SubDir01\\FILE01.TXT")); |
|
4174 |
MakeFile(tmpName); |
|
4175 |
||
4176 |
tmpName = aSrcPath; |
|
4177 |
tmpName.Append(_L("SubDir01\\FILE02.TXT")); |
|
4178 |
MakeFile(tmpName); |
|
4179 |
||
4180 |
tmpName = aSrcPath; |
|
4181 |
tmpName.Append(_L("SubDir01\\FILE03.TXT")); |
|
4182 |
MakeFile(tmpName); |
|
4183 |
||
4184 |
tmpName = aSrcPath; |
|
4185 |
tmpName.Append(_L("SubDir02\\FILE01.TXT")); |
|
4186 |
MakeFile(tmpName); |
|
4187 |
||
4188 |
tmpName = aSrcPath; |
|
4189 |
tmpName.Append(_L("SubDir02\\FILE02.TXT")); |
|
4190 |
MakeFile(tmpName); |
|
4191 |
||
4192 |
tmpName = aSrcPath; |
|
4193 |
tmpName.Append(_L("SubDir02\\FILE03.TXT")); |
|
4194 |
MakeFile(tmpName); |
|
4195 |
||
4196 |
tmpName = aSrcPath; |
|
4197 |
tmpName.Append(_L("SubDir03\\FILE01.TXT")); |
|
4198 |
MakeFile(tmpName); |
|
4199 |
||
4200 |
tmpName = aSrcPath; |
|
4201 |
tmpName.Append(_L("SubDir03\\FILE02.TXT")); |
|
4202 |
MakeFile(tmpName); |
|
4203 |
||
4204 |
tmpName = aSrcPath; |
|
4205 |
tmpName.Append(_L("SubDir03\\FILE03.TXT")); |
|
4206 |
MakeFile(tmpName); |
|
4207 |
} |
|
4208 |
||
4209 |
LOCAL_C void TestPDEF112148() |
|
4210 |
{ |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4211 |
test.Next(_L("Test recursive and non-recursive move across drives (PDEF112148)")); |
0 | 4212 |
|
4213 |
TInt err = 0; |
|
4214 |
||
4215 |
TFileName trgPath; |
|
4216 |
trgPath.Format(_L("%c:\\F32-TST\\TFMAN\\PDEF112148\\dest\\"), (TUint8)gDriveToTest); |
|
4217 |
TFileName srcPath = _L("C:\\F32-TST\\TFMAN\\PDEF112148\\src\\"); |
|
4218 |
||
4219 |
// Non-Recursive move |
|
4220 |
// clean up before testing |
|
4221 |
RmDir(srcPath); |
|
4222 |
RmDir(trgPath); |
|
4223 |
// Setup the directory structure |
|
4224 |
SetupDirStructure(srcPath, trgPath); |
|
4225 |
if(!gAsynch) |
|
4226 |
err = gFileMan->Move(srcPath, trgPath, 0); |
|
4227 |
else |
|
4228 |
err = gFileMan->Move(srcPath, trgPath, 0, gStat); |
|
4229 |
TestResult(err); |
|
4230 |
||
4231 |
// Verify src contents after move operation |
|
4232 |
CDir *dir = NULL; |
|
4233 |
err = TheFs.GetDir(srcPath, KEntryAttMaskSupported, ESortNone, dir); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4234 |
test_Equal(6, dir->Count()); |
0 | 4235 |
delete dir; |
4236 |
// Verify dest contents after move operation |
|
4237 |
err = TheFs.GetDir(trgPath, KEntryAttMaskSupported, ESortNone, dir); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4238 |
test_Equal(3, dir->Count()); |
0 | 4239 |
delete dir; |
4240 |
||
4241 |
// Recursive move with "\\" at the end of srcPath |
|
4242 |
// clean up before execution |
|
4243 |
RmDir(srcPath); |
|
4244 |
RmDir(trgPath); |
|
4245 |
// Setup the directory structure |
|
4246 |
SetupDirStructure(srcPath, trgPath); |
|
4247 |
if(!gAsynch) |
|
4248 |
err = gFileMan->Move(srcPath, trgPath, CFileMan::ERecurse); |
|
4249 |
else |
|
4250 |
err = gFileMan->Move(srcPath, trgPath, CFileMan::ERecurse, gStat); |
|
4251 |
TestResult(err); |
|
4252 |
||
4253 |
// Verify src has no content |
|
4254 |
err = TheFs.GetDir(srcPath, KEntryAttMaskSupported, ESortNone, dir); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4255 |
test_Equal(0, dir->Count()); |
0 | 4256 |
delete dir; |
4257 |
// Verify dest contents after move operation |
|
4258 |
err = TheFs.GetDir(trgPath, KEntryAttMaskSupported, ESortNone, dir); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4259 |
test_Equal(9, dir->Count()); |
0 | 4260 |
delete dir; |
4261 |
||
4262 |
// Recursive move without "\\" at the end of srcPath |
|
4263 |
// clean up before execution |
|
4264 |
RmDir(srcPath); |
|
4265 |
RmDir(trgPath); |
|
4266 |
// Setup the directory structure |
|
4267 |
SetupDirStructure(srcPath, trgPath); |
|
4268 |
// Remove the "\\" at the end of srcPath for Recursive Move |
|
4269 |
srcPath.Delete(srcPath.Length()-1,1); |
|
4270 |
if(!gAsynch) |
|
4271 |
err = gFileMan->Move(srcPath, trgPath, CFileMan::ERecurse); |
|
4272 |
else |
|
4273 |
err = gFileMan->Move(srcPath, trgPath, CFileMan::ERecurse, gStat); |
|
4274 |
TestResult(err); |
|
4275 |
||
4276 |
// Add the "\\" at the end of srcPath for verification |
|
4277 |
srcPath.Append(KPathDelimiter); |
|
4278 |
// Verify src doesnt not exist |
|
4279 |
err = gFileMan->RmDir(srcPath); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4280 |
test_Equal(KErrPathNotFound, err); // KErrPathNotFound expected as src has been moved to dest |
0 | 4281 |
// Verify dest after move operation |
4282 |
err = TheFs.GetDir(trgPath, KEntryAttMaskSupported, ESortNone, dir); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4283 |
test_Equal(1, dir->Count()); |
0 | 4284 |
delete dir; |
4285 |
||
4286 |
// clean up before leaving |
|
4287 |
RmDir(srcPath); |
|
4288 |
RmDir(trgPath); |
|
4289 |
} |
|
4290 |
//--------------------------------------------- |
|
4291 |
//! @SYMTestCaseID PBASE-T_FMAN-2398 |
|
4292 |
//! @SYMTestType UT |
|
4293 |
//! @SYMREQ DEF130678 |
|
4294 |
//! @SYMTestCaseDesc Tests that CFileMan::Move itself does not leak any memory |
|
4295 |
//! @SYMTestActions Move files and keep checking the memory usage for each operation. |
|
4296 |
//! @SYMTestExpectedResults Test completes without any crash and hence without any memory leak. |
|
4297 |
//! @SYMTestPriority High |
|
4298 |
//! @SYMTestStatus Implemented |
|
4299 |
//--------------------------------------------- |
|
4300 |
void TestDEF130678() |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4301 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4302 |
test.Next(_L("Test CFileMan::Move does not leak any memory")); |
0 | 4303 |
_LIT(KFromFile,"C:\\TestDEF130678\\FROM\\from_"); |
4304 |
_LIT(KToFile,"C:\\TestDEF130678\\TO\\"); |
|
4305 |
||
4306 |
TInt run; |
|
4307 |
// choose a number that certainly tests all memory allocations. |
|
4308 |
// it is used for memory allocation failure simulation. |
|
4309 |
TInt maxRun = 50; |
|
4310 |
// start OOM loop |
|
4311 |
for(run=1; run<=maxRun; ++run) |
|
4312 |
{ |
|
4313 |
TInt err = KErrNone; |
|
4314 |
TFileName fromFile, toFile; |
|
4315 |
||
4316 |
fromFile.Append(KFromFile); |
|
4317 |
fromFile.AppendNum(run); |
|
4318 |
fromFile.Append(_L(".txt")); |
|
4319 |
MakeFile(fromFile); |
|
4320 |
||
4321 |
MakeDir(_L("C:\\TestDEF130678\\FROM\\")); |
|
4322 |
MakeDir(_L("C:\\TestDEF130678\\TO\\")); |
|
4323 |
toFile.Append(KToFile); |
|
4324 |
||
4325 |
// Check the memory usage |
|
4326 |
__UHEAP_MARK; |
|
4327 |
// set to fail every run-th memory allocation |
|
4328 |
__UHEAP_SETFAIL(RAllocator::EDeterministic, run); |
|
4329 |
||
4330 |
CFileMan* fileMan = NULL; |
|
4331 |
TInt errTrap1 = KErrNone; |
|
4332 |
TRAP(errTrap1,(fileMan=CFileMan::NewL(TheFs))); |
|
4333 |
if (errTrap1 != KErrNone) |
|
4334 |
{ |
|
4335 |
// reset the memory allocation failure and check for any leak |
|
4336 |
__UHEAP_RESET; |
|
4337 |
__UHEAP_MARKEND; |
|
4338 |
continue; |
|
4339 |
} |
|
4340 |
||
4341 |
CleanupStack::PushL(fileMan); |
|
4342 |
TInt errTrap2 = KErrNone; |
|
4343 |
TRAP(errTrap2,(err = fileMan->Move(fromFile,toFile))); |
|
4344 |
if (errTrap2 != KErrNone || err != KErrNone) |
|
4345 |
{ |
|
4346 |
CleanupStack::PopAndDestroy(fileMan); |
|
4347 |
// reset the memory allocation failure and check for any leak |
|
4348 |
__UHEAP_RESET; |
|
4349 |
__UHEAP_MARKEND; |
|
4350 |
continue; |
|
4351 |
} |
|
4352 |
CleanupStack::PopAndDestroy(fileMan); |
|
4353 |
// reset the memory allocation failure and check for any leak |
|
4354 |
__UHEAP_RESET; |
|
4355 |
__UHEAP_MARKEND; |
|
4356 |
} // End of OOM loop |
|
4357 |
||
4358 |
// cleanup |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4359 |
RmDir(_L("C:\\TestDEF130678\\")); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4360 |
} |
0 | 4361 |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4362 |
void TestBytesTransferredByCopyStep() |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4363 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4364 |
// |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4365 |
// Test BytesCopied |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4366 |
// |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4367 |
test.Next(_L("TestBytesTransferredByCopyStep")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4368 |
(void)gFileMan->Delete(_L("\\bytesTransferred")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4369 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4370 |
RFile tempFile; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4371 |
TFileName tempname; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4372 |
TInt r = tempFile.Temp(TheFs,_L("\\"),tempname,EFileWrite); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4373 |
test_KErrNone(r); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4374 |
r = tempFile.SetSize(50); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4375 |
test_KErrNone(r); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4376 |
tempFile.Flush(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4377 |
tempFile.Close(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4378 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4379 |
CFileManObserverBytesCopied* fManObserver=new(ELeave) CFileManObserverBytesCopied(gFileMan); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4380 |
CleanupStack::PushL(fManObserver); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4381 |
gFileMan->SetObserver(fManObserver); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4382 |
fManObserver->iBytesToBeCopied=50; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4383 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4384 |
if (!gAsynch) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4385 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4386 |
r=gFileMan->Copy(tempname,_L("\\bytesTransferred"),CFileMan::EOverWrite); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4387 |
test_KErrNone(r); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4388 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4389 |
else |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4390 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4391 |
TInt r=gFileMan->Copy(tempname,_L("\\bytesTransferred"),CFileMan::EOverWrite,gStat); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4392 |
test_KErrNone(r); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4393 |
WaitForSuccess(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4394 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4395 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4396 |
(void)gFileMan->Delete(_L("\\bytesTransferred")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4397 |
(void)TheFs.Delete(tempname); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4398 |
CleanupStack::PopAndDestroy(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4399 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4400 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4401 |
void TestGetMoreErrorInfo() |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4402 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4403 |
// |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4404 |
// Test GetMoreErrorInfo |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4405 |
// |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4406 |
test.Next(_L("TestGetMoreErrorInfo")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4407 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4408 |
CFileManObserver* fManObserver=new(ELeave) CFileManObserver(gFileMan); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4409 |
CleanupStack::PushL(fManObserver); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4410 |
gFileMan->SetObserver(fManObserver); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4411 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4412 |
if (!gAsynch) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4413 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4414 |
TInt r=gFileMan->Copy(_L("\\SRC"),_L("\\TRG"),0); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4415 |
if(r!=KErrNone) //correct behaviour |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4416 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4417 |
TFileManError error = gFileMan->GetMoreInfoAboutError(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4418 |
test_Equal((TFileManError)ENoFilesProcessed,error); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4419 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4420 |
else { test_Equal(!KErrNone,r); } |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4421 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4422 |
else |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4423 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4424 |
TInt r=gFileMan->Copy(_L("\\SRC"),_L("\\TRG"),0,gStat); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4425 |
if(r!=KErrNone) //correct behaviour |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4426 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4427 |
TFileManError error = gFileMan->GetMoreInfoAboutError(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4428 |
test_Equal((TFileManError)ENoFilesProcessed,error); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4429 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4430 |
else { test_Equal(!KErrNone,r); } |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4431 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4432 |
CleanupStack::PopAndDestroy(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4433 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4434 |
|
0 | 4435 |
GLDEF_C void CallTestsL() |
4436 |
// |
|
4437 |
// Do tests |
|
4438 |
// |
|
4439 |
{ |
|
4440 |
// T_FMAN is independent of all tests so format first |
|
4441 |
#ifndef __WINS__ |
|
4442 |
Format(CurrentDrive()); |
|
4443 |
#endif |
|
4444 |
||
4445 |
InitialiseL(); |
|
4446 |
CreateTestDirectory(_L("\\F32-TST\\TFMAN\\")); |
|
4447 |
// May not be able to test handling of invalid path lengths because F32 fix |
|
4448 |
// to prevent paths >256 ever being created |
|
4449 |
testingInvalidPathLengths = CheckIfShortPathsAreSupported(); |
|
4450 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4451 |
//----------------------------------------------------------------------------------- |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4452 |
// Asynchronous tests |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4453 |
// |
0 | 4454 |
gAsynch=ETrue; |
4455 |
test.Next(_L("Asynchronous tests ...")); |
|
4456 |
TheFs.SetAllocFailure(gAllocFailOff); |
|
4457 |
||
4458 |
TInt uid; |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4459 |
test_KErrNone(HAL::Get(HAL::EMachineUid,uid)); |
0 | 4460 |
TBool doTargetTests = (!IsTestingLFFS() && |
4461 |
uid!=HAL::EMachineUid_Cogent && |
|
4462 |
uid!=HAL::EMachineUid_IQ80310 && |
|
4463 |
uid!=HAL::EMachineUid_X86PC); |
|
4464 |
||
4465 |
if (doTargetTests) |
|
4466 |
{ |
|
4467 |
TestMoveAcrossDrives(); |
|
4468 |
TestRecursiveMoveAcrossDrives(); |
|
4469 |
TestMoveEmptyDirectory(); |
|
4470 |
TestAbortedMoveAcrossDrives(); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4471 |
TestPDEF112148(); // Test recursive and non-recursive move across drives |
0 | 4472 |
} |
4473 |
||
4474 |
TestOverWrite(); |
|
4475 |
TestRename(); |
|
4476 |
TestErrorHandling(); |
|
4477 |
||
4478 |
TestRecursiveMove(); |
|
4479 |
TestRecursiveDelete(); |
|
4480 |
TestRecursiveAttribs(); |
|
4481 |
TestRecursiveCopy(); |
|
4482 |
||
4483 |
TestRmDir(); |
|
4484 |
TestSimultaneous(); |
|
4485 |
TestAttribs(); |
|
4486 |
TestDelete(); |
|
4487 |
if (!IsTestingLFFS()) |
|
4488 |
TestCopy(); // ??? |
|
4489 |
TestMove(); |
|
4490 |
TestCopyAllCancel(); |
|
4491 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4492 |
//----------------------------------------------------------------------------------- |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4493 |
// Synchronous tests |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4494 |
// |
0 | 4495 |
gAsynch=EFalse; |
4496 |
test.Next(_L("Synchronous tests ...")); |
|
4497 |
TheFs.SetAllocFailure(gAllocFailOn); |
|
4498 |
||
4499 |
if (doTargetTests) |
|
4500 |
{ |
|
4501 |
TestMoveAcrossDrives(); |
|
4502 |
TestRecursiveMoveAcrossDrives(); |
|
4503 |
TestMoveEmptyDirectory(); |
|
4504 |
TestAbortedMoveAcrossDrives(); |
|
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4505 |
TestPDEF112148(); // Test recursive and non-recursive move across drives |
0 | 4506 |
} |
4507 |
||
4508 |
TestCopyOpenFile(); |
|
4509 |
if(testingInvalidPathLengths) |
|
4510 |
TestLongNames(); |
|
4511 |
TestNameMangling(); |
|
4512 |
TestFileAttributes(); |
|
4513 |
TestOverWrite(); |
|
4514 |
TestRename(); |
|
4515 |
TestErrorHandling(); |
|
4516 |
TestRecursiveMove(); |
|
4517 |
TestRecursiveDelete(); |
|
4518 |
TestRecursiveAttribs(); |
|
4519 |
TestRecursiveCopy(); |
|
4520 |
TestRmDir(); |
|
4521 |
TestSimultaneous(); |
|
4522 |
TestAttribs(); |
|
4523 |
TestDelete(); |
|
4524 |
TestCopy(); |
|
4525 |
TestMove(); |
|
4526 |
TestCopyAndRename(); |
|
4527 |
TestCopyAllCancel(); |
|
4528 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4529 |
TestDEF130678(); // Test CFileMan::Move does not leak any memory |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4530 |
TestBytesTransferredByCopyStep(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4531 |
TestGetMoreErrorInfo(); |
0 | 4532 |
#ifndef __WINS__ |
4533 |
RThread t; |
|
4534 |
TThreadStackInfo stack; |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4535 |
test_KErrNone(t.StackInfo(stack)); |
0 | 4536 |
TestStackUsage(0, stack); |
4537 |
#endif |
|
4538 |
||
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
42
diff
changeset
|
4539 |
|
0 | 4540 |
Cleanup(); |
4541 |
DeleteTestDirectory(); |
|
20
597aaf25e343
Revision: 201008
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
4542 |
test_KErrNone(TheFs.RmDir(_L("\\F32-TST\\"))); |
0 | 4543 |
} |
4544 |