sl@0
|
1 |
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// f32test\server\b_osfil.cpp
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#include <f32file.h>
|
sl@0
|
19 |
#include <e32test.h>
|
sl@0
|
20 |
#include "t_server.h"
|
sl@0
|
21 |
|
sl@0
|
22 |
const TInt KSizeExistsFile=26;
|
sl@0
|
23 |
const TInt KSizeExistsFile2=25;
|
sl@0
|
24 |
|
sl@0
|
25 |
GLDEF_D RTest test(_L("B_OSFIL"));
|
sl@0
|
26 |
|
sl@0
|
27 |
/* these buffers get written to in order to change the file system */
|
sl@0
|
28 |
//LOCAL_D TBuf<5> fileSystemName =_L("LOC::"); /* default file system name */
|
sl@0
|
29 |
LOCAL_D TBuf<20> noDevice = _L("L:\\tmpfile.tmp");
|
sl@0
|
30 |
LOCAL_D TBuf<15> noDevicePath = _L("L:\\");
|
sl@0
|
31 |
LOCAL_D TBuf<28> noDirectory = _L("C:\\nodirect\\tmpfile.tmp");
|
sl@0
|
32 |
LOCAL_D TBuf<30> noDirectoryPath = _L("C:\\nodirect\\");
|
sl@0
|
33 |
LOCAL_D TBuf<20> noFile = _L("C:\\notafile.tmp");
|
sl@0
|
34 |
LOCAL_D TBuf<19> fileName = _L("C:\\tmpfile.tmp");
|
sl@0
|
35 |
LOCAL_D TBuf<20> existsFile = _L("C:\\tmpexst1.tmp");
|
sl@0
|
36 |
LOCAL_D TBuf<20> existsFile2 = _L("C:\\tmpexst2.tmp");
|
sl@0
|
37 |
LOCAL_D TBuf<21> renameFile1 = _L("C:\\tmpren1.tmp");
|
sl@0
|
38 |
LOCAL_D TBuf<21> renameFile2 = _L("C:\\tmpren2.tmp");
|
sl@0
|
39 |
LOCAL_D TBuf<34> directoryFile = _L("C:\\nodirect\\nodirect\\nodirect\\");
|
sl@0
|
40 |
LOCAL_D TBuf<14> openUniqueDir = _L("C:\\nodir2\\");
|
sl@0
|
41 |
|
sl@0
|
42 |
/*************************************************************************/
|
sl@0
|
43 |
LOCAL_C void TestInfo()
|
sl@0
|
44 |
/*
|
sl@0
|
45 |
Test the file info function
|
sl@0
|
46 |
*/
|
sl@0
|
47 |
{
|
sl@0
|
48 |
TEntry entry;
|
sl@0
|
49 |
TInt r=TheFs.Entry(noDevice,entry);
|
sl@0
|
50 |
test((r==KErrNotReady)||(r==KErrPathNotFound));
|
sl@0
|
51 |
r=TheFs.Entry(noDirectory,entry);
|
sl@0
|
52 |
test(r==KErrPathNotFound);
|
sl@0
|
53 |
r=TheFs.Entry(noFile,entry);
|
sl@0
|
54 |
test(r==KErrNotFound);
|
sl@0
|
55 |
r=TheFs.Entry(existsFile,entry);
|
sl@0
|
56 |
test(r==KErrNone);
|
sl@0
|
57 |
test(entry.iSize==KSizeExistsFile);
|
sl@0
|
58 |
test(!entry.IsDir());
|
sl@0
|
59 |
test(!(entry.iAtt&KEntryAttDir));
|
sl@0
|
60 |
r=TheFs.Entry(existsFile2,entry);
|
sl@0
|
61 |
test(r==KErrNone);
|
sl@0
|
62 |
test(entry.iSize==KSizeExistsFile2);
|
sl@0
|
63 |
test(!entry.IsDir());
|
sl@0
|
64 |
test(!(entry.iAtt&KEntryAttDir));
|
sl@0
|
65 |
}
|
sl@0
|
66 |
|
sl@0
|
67 |
LOCAL_C void TestDelete()
|
sl@0
|
68 |
/*
|
sl@0
|
69 |
Test the delete
|
sl@0
|
70 |
*/
|
sl@0
|
71 |
{
|
sl@0
|
72 |
TInt r=TheFs.Delete(noDevice);
|
sl@0
|
73 |
test((r==KErrNotReady)||(r==KErrPathNotFound));
|
sl@0
|
74 |
r=TheFs.Delete(noDirectory);
|
sl@0
|
75 |
test(r==KErrPathNotFound);
|
sl@0
|
76 |
r=TheFs.Delete(noFile);
|
sl@0
|
77 |
test(r==KErrNotFound);
|
sl@0
|
78 |
r=TheFs.Delete(existsFile);
|
sl@0
|
79 |
test(r==KErrNone);
|
sl@0
|
80 |
r=TheFs.Delete(existsFile2);
|
sl@0
|
81 |
test(r==KErrNone);
|
sl@0
|
82 |
TEntry entry;
|
sl@0
|
83 |
r=TheFs.Entry(existsFile,entry);
|
sl@0
|
84 |
test(r==KErrNotFound);
|
sl@0
|
85 |
r=TheFs.Entry(existsFile2,entry);
|
sl@0
|
86 |
test(r==KErrNotFound);
|
sl@0
|
87 |
}
|
sl@0
|
88 |
|
sl@0
|
89 |
LOCAL_C void TestRename()
|
sl@0
|
90 |
/*
|
sl@0
|
91 |
Test the rename
|
sl@0
|
92 |
*/
|
sl@0
|
93 |
{
|
sl@0
|
94 |
TInt r=TheFs.Rename(noDevice,fileName);
|
sl@0
|
95 |
test(r==KErrArgument);
|
sl@0
|
96 |
r=TheFs.Rename(noDirectory,fileName);
|
sl@0
|
97 |
test(r==KErrPathNotFound);
|
sl@0
|
98 |
r=TheFs.Rename(noFile,fileName);
|
sl@0
|
99 |
test(r==KErrNotFound);
|
sl@0
|
100 |
r=TheFs.Rename(existsFile,existsFile2);
|
sl@0
|
101 |
test(r==KErrAlreadyExists);
|
sl@0
|
102 |
r=TheFs.Delete(existsFile);
|
sl@0
|
103 |
test(r==KErrNone);
|
sl@0
|
104 |
r=TheFs.Rename(existsFile,existsFile);
|
sl@0
|
105 |
test(r==KErrNotFound);
|
sl@0
|
106 |
r=TheFs.Rename(existsFile2,existsFile);
|
sl@0
|
107 |
test(r==KErrNone);
|
sl@0
|
108 |
TEntry entry;
|
sl@0
|
109 |
r=TheFs.Entry(existsFile2,entry);
|
sl@0
|
110 |
test(r==KErrNotFound);
|
sl@0
|
111 |
r=TheFs.Entry(existsFile,entry);
|
sl@0
|
112 |
test(r==KErrNone);
|
sl@0
|
113 |
r=TheFs.Delete(existsFile);
|
sl@0
|
114 |
test(r==KErrNone);
|
sl@0
|
115 |
}
|
sl@0
|
116 |
|
sl@0
|
117 |
LOCAL_C void TestMkDir()
|
sl@0
|
118 |
{
|
sl@0
|
119 |
TParse fparse;
|
sl@0
|
120 |
TInt r=TheFs.MkDirAll(directoryFile);
|
sl@0
|
121 |
test(r==KErrNone);
|
sl@0
|
122 |
TEntry entry;
|
sl@0
|
123 |
r=TheFs.Entry(directoryFile.Left(directoryFile.Length()-1),entry);
|
sl@0
|
124 |
test(r==KErrNone);
|
sl@0
|
125 |
test(entry.IsDir());
|
sl@0
|
126 |
test(entry.iAtt&KEntryAttDir);
|
sl@0
|
127 |
r=TheFs.RmDir(directoryFile);
|
sl@0
|
128 |
test(r==KErrNone);
|
sl@0
|
129 |
r=fparse.Set(directoryFile,NULL,NULL);
|
sl@0
|
130 |
test(r==KErrNone);
|
sl@0
|
131 |
r=fparse.PopDir();
|
sl@0
|
132 |
test(r==KErrNone);
|
sl@0
|
133 |
r=TheFs.RmDir(fparse.DriveAndPath());
|
sl@0
|
134 |
test(r==KErrNone);
|
sl@0
|
135 |
r=fparse.PopDir();
|
sl@0
|
136 |
test(r==KErrNone);
|
sl@0
|
137 |
r=TheFs.RmDir(fparse.DriveAndPath());
|
sl@0
|
138 |
test(r==KErrNone);
|
sl@0
|
139 |
}
|
sl@0
|
140 |
|
sl@0
|
141 |
|
sl@0
|
142 |
LOCAL_C void TestOpenUnique()
|
sl@0
|
143 |
/*
|
sl@0
|
144 |
Test unique file name generator
|
sl@0
|
145 |
*/
|
sl@0
|
146 |
{
|
sl@0
|
147 |
RFile p1;
|
sl@0
|
148 |
RFile p2;
|
sl@0
|
149 |
|
sl@0
|
150 |
TInt r=p1.Open(TheFs,noDevice,EFileStreamText);
|
sl@0
|
151 |
test((r==KErrNotReady)||(r==KErrPathNotFound));
|
sl@0
|
152 |
r=p1.Open(TheFs,noDirectory,EFileStreamText);
|
sl@0
|
153 |
test(r==KErrPathNotFound);
|
sl@0
|
154 |
TFileName generated1;
|
sl@0
|
155 |
r=p1.Temp(TheFs,noDevicePath,generated1,EFileStreamText);
|
sl@0
|
156 |
test((r==KErrNotReady)||(r==KErrPathNotFound));
|
sl@0
|
157 |
r=p1.Temp(TheFs,noDirectoryPath,generated1,EFileStreamText);
|
sl@0
|
158 |
test(r==KErrPathNotFound);
|
sl@0
|
159 |
|
sl@0
|
160 |
r=p1.Temp(TheFs,_L(""),generated1,EFileStreamText);
|
sl@0
|
161 |
test(r==KErrNone);
|
sl@0
|
162 |
TFileName generated2;
|
sl@0
|
163 |
r=p2.Temp(TheFs,_L(""),generated2,EFileStreamText);
|
sl@0
|
164 |
test(r==KErrNone);
|
sl@0
|
165 |
test(generated1!=generated2);
|
sl@0
|
166 |
p1.Close();
|
sl@0
|
167 |
TFileName generated3;
|
sl@0
|
168 |
r=p1.Temp(TheFs,_L(""),generated3,EFileStream);
|
sl@0
|
169 |
test(r==KErrNone);
|
sl@0
|
170 |
test(generated3!=generated2);
|
sl@0
|
171 |
test(generated3!=generated1);
|
sl@0
|
172 |
p2.Close();
|
sl@0
|
173 |
p1.Close();
|
sl@0
|
174 |
|
sl@0
|
175 |
r=TheFs.Delete(generated1);
|
sl@0
|
176 |
test(r==KErrNone);
|
sl@0
|
177 |
r=TheFs.Delete(generated2);
|
sl@0
|
178 |
test(r==KErrNone);
|
sl@0
|
179 |
r=TheFs.Delete(generated3);
|
sl@0
|
180 |
test(r==KErrNone);
|
sl@0
|
181 |
|
sl@0
|
182 |
r=p1.Temp(TheFs,_L(""),generated1,EFileStreamText);
|
sl@0
|
183 |
test(r==KErrNone);
|
sl@0
|
184 |
r=p2.Temp(TheFs,_L(""),generated2,EFileStreamText);
|
sl@0
|
185 |
test(r==KErrNone);
|
sl@0
|
186 |
test(generated1!=generated2);
|
sl@0
|
187 |
p1.Close();
|
sl@0
|
188 |
r=p1.Temp(TheFs,_L(""),generated3,EFileStream);
|
sl@0
|
189 |
test(r==KErrNone);
|
sl@0
|
190 |
test(generated3!=generated2);
|
sl@0
|
191 |
test(generated3!=generated1);
|
sl@0
|
192 |
p2.Close();
|
sl@0
|
193 |
p1.Close();
|
sl@0
|
194 |
|
sl@0
|
195 |
r=TheFs.Delete(generated1);
|
sl@0
|
196 |
test(r==KErrNone);
|
sl@0
|
197 |
r=TheFs.Delete(generated2);
|
sl@0
|
198 |
test(r==KErrNone);
|
sl@0
|
199 |
r=TheFs.Delete(generated3);
|
sl@0
|
200 |
test(r==KErrNone);
|
sl@0
|
201 |
|
sl@0
|
202 |
r=TheFs.MkDir(openUniqueDir);
|
sl@0
|
203 |
test(r==KErrNone);
|
sl@0
|
204 |
r=p1.Temp(TheFs,openUniqueDir,generated1,EFileStream);
|
sl@0
|
205 |
test(r==KErrNone);
|
sl@0
|
206 |
r=p2.Temp(TheFs,openUniqueDir,generated2,EFileStreamText|EFileWrite);
|
sl@0
|
207 |
test(r==KErrNone);
|
sl@0
|
208 |
r=p1.Write(_L8("junk"),4);
|
sl@0
|
209 |
test(r==KErrNone);
|
sl@0
|
210 |
TInt pos=0;
|
sl@0
|
211 |
r=p1.Seek(ESeekCurrent,pos);//P_FSET
|
sl@0
|
212 |
test(r==KErrNone);
|
sl@0
|
213 |
p1.Close();
|
sl@0
|
214 |
p2.Close();
|
sl@0
|
215 |
|
sl@0
|
216 |
r=TheFs.Delete(generated1);
|
sl@0
|
217 |
test(r==KErrNone);
|
sl@0
|
218 |
r=TheFs.Delete(generated2);
|
sl@0
|
219 |
test(r==KErrNone);
|
sl@0
|
220 |
|
sl@0
|
221 |
r=p1.Temp(TheFs,openUniqueDir,generated1,EFileStream);
|
sl@0
|
222 |
test(r==KErrNone);
|
sl@0
|
223 |
r=p2.Temp(TheFs,openUniqueDir,generated2,EFileStreamText);
|
sl@0
|
224 |
test(r==KErrNone);
|
sl@0
|
225 |
p1.Close();
|
sl@0
|
226 |
|
sl@0
|
227 |
pos=0;
|
sl@0
|
228 |
r=p2.Seek(ESeekStart,pos);
|
sl@0
|
229 |
test(r==KErrNone);
|
sl@0
|
230 |
p2.Close();
|
sl@0
|
231 |
r=TheFs.Delete(generated1);
|
sl@0
|
232 |
test(r==KErrNone);
|
sl@0
|
233 |
r=TheFs.Delete(generated2);
|
sl@0
|
234 |
test(r==KErrNone);
|
sl@0
|
235 |
r=TheFs.RmDir(openUniqueDir);
|
sl@0
|
236 |
test(r==KErrNone);
|
sl@0
|
237 |
}
|
sl@0
|
238 |
|
sl@0
|
239 |
LOCAL_C void TestPaths()
|
sl@0
|
240 |
{
|
sl@0
|
241 |
TFileName path1;
|
sl@0
|
242 |
TInt r=TheFs.SessionPath(path1);
|
sl@0
|
243 |
test(r==KErrNone);
|
sl@0
|
244 |
r=TheFs.SetSessionPath(path1);
|
sl@0
|
245 |
test(r==KErrNone);
|
sl@0
|
246 |
TFileName path2;
|
sl@0
|
247 |
r=TheFs.SessionPath(path2);
|
sl@0
|
248 |
test(r==KErrNone);
|
sl@0
|
249 |
test(path1==path2);
|
sl@0
|
250 |
RDir dir;
|
sl@0
|
251 |
r=dir.Open(TheFs,path1,0);
|
sl@0
|
252 |
test(r==KErrNone);
|
sl@0
|
253 |
dir.Close();
|
sl@0
|
254 |
}
|
sl@0
|
255 |
|
sl@0
|
256 |
LOCAL_C void TestFileStatus()
|
sl@0
|
257 |
{
|
sl@0
|
258 |
TEntry blk;
|
sl@0
|
259 |
TInt r=TheFs.Entry(existsFile,blk);
|
sl@0
|
260 |
test(r==KErrNone);
|
sl@0
|
261 |
TEntry blk1=blk;
|
sl@0
|
262 |
|
sl@0
|
263 |
/* Toggle the write attribute */
|
sl@0
|
264 |
TUint clear,set; /* were modifying write attrib */
|
sl@0
|
265 |
if (blk1.IsReadOnly())
|
sl@0
|
266 |
{
|
sl@0
|
267 |
clear=KEntryAttReadOnly;
|
sl@0
|
268 |
set=0;
|
sl@0
|
269 |
}
|
sl@0
|
270 |
else
|
sl@0
|
271 |
{
|
sl@0
|
272 |
clear=0;
|
sl@0
|
273 |
set=KEntryAttReadOnly;
|
sl@0
|
274 |
}
|
sl@0
|
275 |
r=TheFs.SetEntry(existsFile,blk1.iModified,set,clear);
|
sl@0
|
276 |
test(r==KErrNone);
|
sl@0
|
277 |
r=TheFs.Entry(existsFile,blk);
|
sl@0
|
278 |
test(r==KErrNone);
|
sl@0
|
279 |
if (blk1.IsReadOnly())
|
sl@0
|
280 |
test(!blk.IsReadOnly());
|
sl@0
|
281 |
else
|
sl@0
|
282 |
test(blk.IsReadOnly());
|
sl@0
|
283 |
|
sl@0
|
284 |
/* set write attrib back */
|
sl@0
|
285 |
r=TheFs.SetEntry(existsFile,blk1.iModified,clear,set);
|
sl@0
|
286 |
test(r==KErrNone);
|
sl@0
|
287 |
r=TheFs.Entry(existsFile,blk);
|
sl@0
|
288 |
test(r==KErrNone);
|
sl@0
|
289 |
if (blk1.IsReadOnly())
|
sl@0
|
290 |
test(blk.IsReadOnly());
|
sl@0
|
291 |
else
|
sl@0
|
292 |
test(!blk.IsReadOnly());
|
sl@0
|
293 |
|
sl@0
|
294 |
/* toggle the archive bit */
|
sl@0
|
295 |
if (blk1.IsArchive())
|
sl@0
|
296 |
{
|
sl@0
|
297 |
clear=KEntryAttArchive;
|
sl@0
|
298 |
set=0;
|
sl@0
|
299 |
}
|
sl@0
|
300 |
else
|
sl@0
|
301 |
{
|
sl@0
|
302 |
clear=0;
|
sl@0
|
303 |
set=KEntryAttArchive;
|
sl@0
|
304 |
}
|
sl@0
|
305 |
r=TheFs.SetEntry(existsFile,blk1.iModified,set,clear);
|
sl@0
|
306 |
test(r==KErrNone);
|
sl@0
|
307 |
r=TheFs.Entry(existsFile,blk);
|
sl@0
|
308 |
test(r==KErrNone);
|
sl@0
|
309 |
if (blk1.IsArchive())
|
sl@0
|
310 |
test(!blk.IsArchive());
|
sl@0
|
311 |
else
|
sl@0
|
312 |
test(blk.IsArchive());
|
sl@0
|
313 |
/* set archive attrib back */
|
sl@0
|
314 |
r=TheFs.SetEntry(existsFile,blk1.iModified,clear,set);
|
sl@0
|
315 |
test(r==KErrNone);
|
sl@0
|
316 |
r=TheFs.Entry(existsFile,blk);
|
sl@0
|
317 |
test(r==KErrNone);
|
sl@0
|
318 |
if (blk1.IsArchive())
|
sl@0
|
319 |
test(blk.IsArchive());
|
sl@0
|
320 |
else
|
sl@0
|
321 |
test(!blk.IsArchive());
|
sl@0
|
322 |
|
sl@0
|
323 |
/* toggle the hidden bit */
|
sl@0
|
324 |
if (blk1.IsHidden())
|
sl@0
|
325 |
{
|
sl@0
|
326 |
clear=KEntryAttHidden;
|
sl@0
|
327 |
set=0;
|
sl@0
|
328 |
}
|
sl@0
|
329 |
else
|
sl@0
|
330 |
{
|
sl@0
|
331 |
clear=0;
|
sl@0
|
332 |
set=KEntryAttHidden;
|
sl@0
|
333 |
}
|
sl@0
|
334 |
r=TheFs.SetEntry(existsFile,blk1.iModified,set,clear);
|
sl@0
|
335 |
test(r==KErrNone);
|
sl@0
|
336 |
r=TheFs.Entry(existsFile,blk);
|
sl@0
|
337 |
test(r==KErrNone);
|
sl@0
|
338 |
if (blk1.IsHidden())
|
sl@0
|
339 |
test(!blk.IsHidden());
|
sl@0
|
340 |
else
|
sl@0
|
341 |
test(blk.IsHidden());
|
sl@0
|
342 |
/* set hidden attrib back */
|
sl@0
|
343 |
r=TheFs.SetEntry(existsFile,blk1.iModified,clear,set);
|
sl@0
|
344 |
test(r==KErrNone);
|
sl@0
|
345 |
r=TheFs.Entry(existsFile,blk);
|
sl@0
|
346 |
test(r==KErrNone);
|
sl@0
|
347 |
if (blk1.IsHidden())
|
sl@0
|
348 |
test(blk.IsHidden());
|
sl@0
|
349 |
else
|
sl@0
|
350 |
test(!blk.IsHidden());
|
sl@0
|
351 |
|
sl@0
|
352 |
/* toggle the system bit */
|
sl@0
|
353 |
if (blk1.IsSystem())
|
sl@0
|
354 |
{
|
sl@0
|
355 |
clear=KEntryAttSystem;
|
sl@0
|
356 |
set=0;
|
sl@0
|
357 |
}
|
sl@0
|
358 |
else
|
sl@0
|
359 |
{
|
sl@0
|
360 |
clear=0;
|
sl@0
|
361 |
set=KEntryAttSystem;
|
sl@0
|
362 |
}
|
sl@0
|
363 |
r=TheFs.SetEntry(existsFile,blk1.iModified,set,clear);
|
sl@0
|
364 |
test(r==KErrNone);
|
sl@0
|
365 |
r=TheFs.Entry(existsFile,blk);
|
sl@0
|
366 |
test(r==KErrNone);
|
sl@0
|
367 |
if (blk1.IsSystem())
|
sl@0
|
368 |
test(!blk.IsSystem());
|
sl@0
|
369 |
else
|
sl@0
|
370 |
test(blk.IsSystem());
|
sl@0
|
371 |
/* set system attrib back */
|
sl@0
|
372 |
r=TheFs.SetEntry(existsFile,blk1.iModified,clear,set);
|
sl@0
|
373 |
test(r==KErrNone);
|
sl@0
|
374 |
r=TheFs.Entry(existsFile,blk);
|
sl@0
|
375 |
test(r==KErrNone);
|
sl@0
|
376 |
if (blk1.IsSystem())
|
sl@0
|
377 |
test(blk.IsSystem());
|
sl@0
|
378 |
else
|
sl@0
|
379 |
test(!blk.IsSystem());
|
sl@0
|
380 |
r=TheFs.Delete(existsFile);
|
sl@0
|
381 |
test(r==KErrNone);
|
sl@0
|
382 |
r=TheFs.Delete(existsFile2);
|
sl@0
|
383 |
test(r==KErrNone);
|
sl@0
|
384 |
}
|
sl@0
|
385 |
|
sl@0
|
386 |
|
sl@0
|
387 |
LOCAL_C void CreateTestFiles()
|
sl@0
|
388 |
{
|
sl@0
|
389 |
RFile fcb;
|
sl@0
|
390 |
TInt r=fcb.Replace(TheFs,existsFile,EFileWrite);
|
sl@0
|
391 |
test(r==KErrNone);
|
sl@0
|
392 |
r=fcb.Write(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),KSizeExistsFile);
|
sl@0
|
393 |
test(r==KErrNone);
|
sl@0
|
394 |
fcb.Close();
|
sl@0
|
395 |
|
sl@0
|
396 |
r=fcb.Replace(TheFs,existsFile2,EFileWrite);
|
sl@0
|
397 |
test(r==KErrNone);
|
sl@0
|
398 |
r=fcb.Write(_L8("bcdefghijklmnopqrstuvwxyz"),KSizeExistsFile2);
|
sl@0
|
399 |
test(r==KErrNone);
|
sl@0
|
400 |
fcb.Close();
|
sl@0
|
401 |
}
|
sl@0
|
402 |
|
sl@0
|
403 |
GLDEF_C void CallTestsL(void)
|
sl@0
|
404 |
//
|
sl@0
|
405 |
// Do testing on aDrive
|
sl@0
|
406 |
//
|
sl@0
|
407 |
{
|
sl@0
|
408 |
test.Title();
|
sl@0
|
409 |
|
sl@0
|
410 |
TVolumeInfo di;
|
sl@0
|
411 |
TInt r=TheFs.Volume(di);
|
sl@0
|
412 |
test(r==KErrNone);
|
sl@0
|
413 |
test.Start(_L("Info()"));
|
sl@0
|
414 |
CreateTestFiles();
|
sl@0
|
415 |
TestInfo();
|
sl@0
|
416 |
test.Next(_L("Delete()"));
|
sl@0
|
417 |
CreateTestFiles();
|
sl@0
|
418 |
TestDelete();
|
sl@0
|
419 |
test.Next(_L("Rename()"));
|
sl@0
|
420 |
CreateTestFiles();
|
sl@0
|
421 |
TestRename();
|
sl@0
|
422 |
test.Next(_L("MkDir()"));
|
sl@0
|
423 |
TestMkDir();
|
sl@0
|
424 |
test.Next(_L("Temp()"));
|
sl@0
|
425 |
TestOpenUnique();
|
sl@0
|
426 |
test.Next(_L("Paths"));
|
sl@0
|
427 |
TestPaths();
|
sl@0
|
428 |
test.Next(_L("File status"));
|
sl@0
|
429 |
CreateTestFiles();
|
sl@0
|
430 |
TestFileStatus();
|
sl@0
|
431 |
test.End();
|
sl@0
|
432 |
}
|