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 0 | a41df078684a |
child 44 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1995-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 |
||
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
16 |
#define __E32TEST_EXTENSION__ |
0 | 17 |
#include <f32file.h> |
18 |
#include <e32test.h> |
|
19 |
#include <e32std.h> |
|
20 |
#include <e32std_private.h> |
|
21 |
#include <e32svr.h> |
|
22 |
#include <e32def.h> |
|
23 |
#include <e32def_private.h> |
|
24 |
#include "t_server.h" |
|
25 |
||
26 |
GLDEF_D RTest test(_L("t_dctcb")); |
|
27 |
GLDEF_D TTime gTimeNow; |
|
28 |
LOCAL_D TInt gTheDriveNum; |
|
29 |
||
30 |
const TInt KPathPosition = 2; |
|
31 |
_LIT(KExpectedPrivatePath, "\\Private\\00000001\\"); |
|
32 |
||
33 |
||
34 |
_LIT(KResourcePath, "?:\\Resource\\"); |
|
35 |
_LIT(KSystemPath, "?:\\Sys\\"); |
|
36 |
_LIT(KPrivatePath, "?:\\Private\\"); |
|
37 |
_LIT(KPrivateFalseID, "?:\\Private\\FFFFFFFF\\"); |
|
38 |
_LIT(KDriveName, "Billy"); |
|
39 |
_LIT(KVolLable, "Benny"); |
|
40 |
||
41 |
_LIT(KFileSys, "systemfile.txt"); |
|
42 |
//_LIT(KFileSys2, "systemfile.tmp"); |
|
43 |
_LIT(KFileSys3, "sysfile.rna"); |
|
44 |
||
45 |
_LIT(KFilePri, "privatefile.txt"); |
|
46 |
_LIT(KFilePri2, "privatefile.tmp"); |
|
47 |
_LIT(KFilePri3, "prifile.rna"); |
|
48 |
||
49 |
_LIT(KFileRes, "resourcefile.txt"); |
|
50 |
//_LIT(KFileRes2, "resourcefile.tmp"); |
|
51 |
_LIT(KFileRes3, "resfile.rna"); |
|
52 |
||
53 |
_LIT(KMkDirSub,"Subdir\\"); |
|
54 |
_LIT(KOldFile,"?:\\Anyold.txt"); |
|
55 |
//_LIT(KNullPath, ""); |
|
56 |
||
57 |
//_LIT(KLFFSName, "Lffs"); |
|
58 |
||
59 |
_LIT(KWildPath, "Z:\\SYS\\"); |
|
60 |
_LIT(KWildFile, "*"); |
|
61 |
||
62 |
TCapability TheCaps; |
|
63 |
TBuf<4> driveBuf=_L("?:\\"); |
|
64 |
RFormat format; |
|
65 |
TInt count; |
|
66 |
RRawDisk rawdisk; |
|
67 |
RFile file1; |
|
68 |
RFile file2; |
|
69 |
RDir dir; |
|
70 |
||
71 |
TInt r; |
|
72 |
TBuf<40> fsname; |
|
73 |
TBuf<40> systestname; |
|
74 |
TBuf<40> pritestname; |
|
75 |
TBuf<40> restestname; |
|
76 |
TBuf<40> theprivatepath; |
|
77 |
TBuf<40> pritestfalseidname; |
|
78 |
TBuf<40> mkdirname; |
|
79 |
TFileName fromTemp; |
|
80 |
||
81 |
TBuf<25> sysfilename; |
|
82 |
TBuf<30> realName; |
|
83 |
TBuf<40> shortfilename; |
|
84 |
TBuf<40> longfilename; |
|
85 |
||
86 |
TRequestStatus aStat1; |
|
87 |
TRequestStatus aStat2; |
|
88 |
TRequestStatus aStat3; |
|
89 |
TRequestStatus aStat4; |
|
90 |
||
91 |
TBuf<40> systestfile; |
|
92 |
TBuf<40> pritestfile; |
|
93 |
TBuf<40> restestfile; |
|
94 |
TBuf<40> systestfile1; |
|
95 |
TBuf<40> pritestfile1; |
|
96 |
TBuf<40> restestfile1; |
|
97 |
||
98 |
TTime testtime; |
|
99 |
TBuf<20> oldName; |
|
100 |
||
101 |
TBuf<25> temp; |
|
102 |
||
103 |
TEntry entry; |
|
104 |
||
105 |
||
106 |
LOCAL_C void TestPathCheck() |
|
107 |
// |
|
108 |
// This test case is brought in by INC054580 |
|
109 |
// (NTT Renaming sys ¨Cfolder on C -drive on H2 allows user to access sys -files) |
|
110 |
// |
|
111 |
{ |
|
112 |
TInt r = TheFs.Rename(_L("\\sys"), _L("\\sysbad")); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
113 |
test_KErrNone(r); |
0 | 114 |
r = TheFs.Rename(_L("\\resource"), _L("\\resourcebad")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
115 |
test_KErrNone(r); |
0 | 116 |
r = TheFs.Rename(_L("\\sysbad"), _L("\\sys")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
117 |
test_KErrNone(r); |
0 | 118 |
r = TheFs.Rename(_L("\\resourcebad"), _L("\\resource")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
119 |
test_KErrNone(r); |
0 | 120 |
r = TheFs.Rename(_L("\\private"), _L("\\privatebad")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
121 |
test_Value(r, r == KErrPermissionDenied); |
0 | 122 |
} |
123 |
||
124 |
LOCAL_C void systemRFsTest() |
|
125 |
// |
|
126 |
// RFs test on system Directory |
|
127 |
// |
|
128 |
{ |
|
129 |
__UHEAP_MARK; |
|
130 |
systestname=KSystemPath; |
|
131 |
systestname[0]=(TText)('A' + gTheDriveNum); |
|
132 |
||
133 |
mkdirname.Zero(); |
|
134 |
mkdirname.Append(systestname); |
|
135 |
mkdirname.Append(KMkDirSub); |
|
136 |
r=TheFs.MkDirAll(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
137 |
test_KErrNone(r); |
0 | 138 |
|
139 |
TheFs.RmDir(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
140 |
test_KErrNone(r); |
0 | 141 |
|
142 |
r=TheFs.SetSubst(systestname,EDriveO); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
143 |
test_Value(r, r == KErrPermissionDenied); |
0 | 144 |
|
145 |
r=TheFs.RealName(_L("O:\\File.XXX"),realName); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
146 |
test_KErrNone(r); |
0 | 147 |
|
148 |
r=TheFs.SetSessionPath(systestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
149 |
test_Value(r, r == KErrPermissionDenied); |
0 | 150 |
|
151 |
TheFs.NotifyChange(ENotifyAll,aStat1,systestname); |
|
152 |
test(aStat1==KErrPermissionDenied); |
|
153 |
||
154 |
systestfile=KSystemPath; |
|
155 |
systestfile[0]=(TText)('A' + gTheDriveNum); |
|
156 |
systestfile1=systestfile; |
|
157 |
systestfile.Append(KFileSys); |
|
158 |
systestfile1.Append(KFileSys3); |
|
159 |
||
160 |
oldName=KOldFile; |
|
161 |
oldName[0]=(TText)gDriveToTest; |
|
162 |
||
163 |
r=TheFs.GetShortName(systestfile, shortfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
164 |
test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported); |
0 | 165 |
|
166 |
r=TheFs.GetLongName(systestfile1, longfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
167 |
test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported); |
0 | 168 |
|
169 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
170 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 171 |
file1.Close(); |
172 |
||
173 |
r=TheFs.Replace(oldName,systestfile); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
174 |
test_KErrNone(r); |
0 | 175 |
|
176 |
r=TheFs.Delete(systestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
177 |
test_Value(r, r == KErrNone || r==KErrNotFound); |
0 | 178 |
|
179 |
r=TheFs.Rename(systestfile,systestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
180 |
test_KErrNone(r); |
0 | 181 |
|
182 |
r=TheFs.Entry(systestfile1,entry); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
183 |
test_Value(r, r == KErrPermissionDenied); |
0 | 184 |
|
185 |
r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
186 |
test_KErrNone(r); |
0 | 187 |
|
188 |
r=TheFs.Delete(systestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
189 |
test_KErrNone(r); |
0 | 190 |
|
191 |
__UHEAP_MARKEND; |
|
192 |
||
193 |
} |
|
194 |
||
195 |
LOCAL_C void ResourceRFsTest() |
|
196 |
// |
|
197 |
// |
|
198 |
// |
|
199 |
{ |
|
200 |
__UHEAP_MARK; |
|
201 |
||
202 |
restestname=KResourcePath; |
|
203 |
restestname[0]=(TText)('A' + gTheDriveNum); |
|
204 |
||
205 |
mkdirname.Zero(); |
|
206 |
mkdirname.Append(restestname); |
|
207 |
mkdirname.Append(KMkDirSub); |
|
208 |
r=TheFs.MkDirAll(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
209 |
test_KErrNone(r); |
0 | 210 |
|
211 |
TheFs.RmDir(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
212 |
test_KErrNone(r); |
0 | 213 |
|
214 |
r=TheFs.SetSubst(restestname,EDriveO); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
215 |
test_Value(r, r == KErrPermissionDenied || r==KErrGeneral); |
0 | 216 |
|
217 |
r=TheFs.RealName(_L("O:\\File.XXX"),realName); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
218 |
test_KErrNone(r); |
0 | 219 |
|
220 |
r=TheFs.SetSessionPath(restestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
221 |
test_KErrNone(r); |
0 | 222 |
|
223 |
TheFs.NotifyChange(ENotifyAll,aStat4,restestname); |
|
224 |
test(aStat4==KRequestPending); |
|
225 |
||
226 |
restestfile=KResourcePath; |
|
227 |
restestfile[0]=(TText)('A' + gTheDriveNum); |
|
228 |
restestfile1=restestfile; |
|
229 |
restestfile.Append(KFileRes); |
|
230 |
restestfile1.Append(KFileRes3); |
|
231 |
||
232 |
oldName=KOldFile; |
|
233 |
oldName[0]=(TText)gDriveToTest; |
|
234 |
||
235 |
r=TheFs.GetShortName(restestfile, shortfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
236 |
// test_Value(r, r == KErrNone || r == KErrNotFound || r==KErrNotSupported); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
237 |
test(r == KErrNone || KErrNotFound || r==KErrNotSupported); |
0 | 238 |
|
239 |
r=TheFs.GetLongName(restestfile1, longfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
240 |
// test_Value(r, r == KErrNone || r == KErrNotFound || r==KErrNotSupported); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
241 |
test(r == KErrNone || KErrNotFound || r==KErrNotSupported); |
0 | 242 |
|
243 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
244 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 245 |
file1.Close(); |
246 |
||
247 |
r=TheFs.Replace(oldName,restestfile); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
248 |
test_KErrNone(r); |
0 | 249 |
|
250 |
r=TheFs.Rename(restestfile,restestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
251 |
test_KErrNone(r); |
0 | 252 |
|
253 |
r=TheFs.Entry(restestfile1,entry); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
254 |
test_KErrNone(r); |
0 | 255 |
|
256 |
r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
257 |
test_KErrNone(r); |
0 | 258 |
|
259 |
r=TheFs.Delete(restestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
260 |
test_KErrNone(r); |
0 | 261 |
|
262 |
__UHEAP_MARK; |
|
263 |
||
264 |
} |
|
265 |
||
266 |
LOCAL_C void privatefalseIDRFsTest() |
|
267 |
// |
|
268 |
// |
|
269 |
// |
|
270 |
{ |
|
271 |
__UHEAP_MARK; |
|
272 |
||
273 |
//private |
|
274 |
pritestfalseidname=KPrivateFalseID; |
|
275 |
pritestfalseidname[0]=(TText)('A' + gTheDriveNum); |
|
276 |
||
277 |
mkdirname.Zero(); |
|
278 |
mkdirname.Append(pritestfalseidname); |
|
279 |
mkdirname.Append(KMkDirSub); |
|
280 |
||
281 |
r=TheFs.MkDirAll(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
282 |
test_Value(r, r == KErrPermissionDenied); |
0 | 283 |
|
284 |
r=TheFs.RmDir(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
285 |
test_Value(r, r == KErrPermissionDenied); |
0 | 286 |
|
287 |
r=TheFs.SetSubst(pritestfalseidname,EDriveO); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
288 |
test_Value(r, r == KErrPermissionDenied); |
0 | 289 |
|
290 |
r=TheFs.RealName(_L("O:\\File.XXX"),realName); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
291 |
test_KErrNone(r); |
0 | 292 |
|
293 |
r=TheFs.SetSessionPath(pritestfalseidname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
294 |
test_Value(r, r == KErrPermissionDenied); |
0 | 295 |
|
296 |
TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
297 |
test_Value(r, r == KErrPermissionDenied); |
0 | 298 |
|
299 |
||
300 |
pritestfile=KPrivateFalseID; |
|
301 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
302 |
pritestfile1=pritestfile; |
|
303 |
pritestfile.Append(KFilePri2); |
|
304 |
pritestfile1.Append(KFilePri3); |
|
305 |
||
306 |
oldName=KOldFile; |
|
307 |
oldName[0]=(TText)gDriveToTest; |
|
308 |
||
309 |
r=TheFs.GetShortName(pritestfile, shortfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
310 |
test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported); |
0 | 311 |
|
312 |
r=TheFs.GetLongName(pritestfile1, longfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
313 |
test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported); |
0 | 314 |
|
315 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
316 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 317 |
file1.Close(); |
318 |
||
319 |
r=TheFs.Replace(oldName,pritestfile); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
320 |
test_Value(r, r == KErrPermissionDenied); |
0 | 321 |
|
322 |
r=TheFs.Rename(pritestfile,pritestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
323 |
test_Value(r, r == KErrPermissionDenied); |
0 | 324 |
|
325 |
r=TheFs.Entry(pritestfile1,entry); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
326 |
test_Value(r, r == KErrPermissionDenied); |
0 | 327 |
|
328 |
r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
329 |
test_Value(r, r == KErrPermissionDenied); |
0 | 330 |
|
331 |
r=TheFs.Delete(pritestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
332 |
test_Value(r, r == KErrPermissionDenied); |
0 | 333 |
|
334 |
__UHEAP_MARKEND; |
|
335 |
} |
|
336 |
||
337 |
||
338 |
||
339 |
LOCAL_C void privateRFsTest() |
|
340 |
// |
|
341 |
// |
|
342 |
// |
|
343 |
{ |
|
344 |
__UHEAP_MARK; |
|
345 |
//private |
|
346 |
pritestname=KPrivatePath; |
|
347 |
pritestname[0]=(TText)('A' + gTheDriveNum); |
|
348 |
||
349 |
mkdirname.Zero(); |
|
350 |
mkdirname.Append(pritestname); |
|
351 |
mkdirname.Append(KMkDirSub); |
|
352 |
||
353 |
r=TheFs.MkDirAll(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
354 |
test_Value(r, r == KErrPermissionDenied); |
0 | 355 |
|
356 |
r=TheFs.RmDir(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
357 |
test_Value(r, r == KErrPermissionDenied); |
0 | 358 |
|
359 |
r=TheFs.SetSubst(pritestname,EDriveO); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
360 |
test_Value(r, r == KErrPermissionDenied); |
0 | 361 |
|
362 |
r=TheFs.RealName(_L("O:\\File.XXX"),realName); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
363 |
test_KErrNone(r); |
0 | 364 |
|
365 |
r=TheFs.SetSessionPath(pritestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
366 |
test_Value(r, r == KErrPermissionDenied); |
0 | 367 |
|
368 |
TheFs.NotifyChange(ENotifyAll,aStat2,pritestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
369 |
test_Value(r, r == KErrPermissionDenied); |
0 | 370 |
|
371 |
||
372 |
pritestfile=KPrivatePath; |
|
373 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
374 |
pritestfile1=pritestfile; |
|
375 |
pritestfile.Append(KFilePri2); |
|
376 |
pritestfile1.Append(KFilePri3); |
|
377 |
||
378 |
oldName=KOldFile; |
|
379 |
oldName[0]=(TText)gDriveToTest; |
|
380 |
||
381 |
r=TheFs.GetShortName(pritestfile, shortfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
382 |
test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported); |
0 | 383 |
|
384 |
r=TheFs.GetLongName(pritestfile1, longfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
385 |
test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported); |
0 | 386 |
|
387 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
388 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 389 |
file1.Close(); |
390 |
||
391 |
r=TheFs.Replace(oldName,pritestfile); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
392 |
test_Value(r, r == KErrPermissionDenied); |
0 | 393 |
|
394 |
r=TheFs.Rename(pritestfile,pritestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
395 |
test_Value(r, r == KErrPermissionDenied); |
0 | 396 |
|
397 |
r=TheFs.Entry(pritestfile1,entry); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
398 |
test_Value(r, r == KErrPermissionDenied); |
0 | 399 |
|
400 |
r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
401 |
test_Value(r, r == KErrPermissionDenied); |
0 | 402 |
|
403 |
r=TheFs.Delete(pritestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
404 |
test_Value(r, r == KErrPermissionDenied); |
0 | 405 |
|
406 |
__UHEAP_MARKEND; |
|
407 |
} |
|
408 |
||
409 |
||
410 |
LOCAL_C void privateSIDRFstest() |
|
411 |
{ |
|
412 |
__UHEAP_MARK; |
|
413 |
||
414 |
theprivatepath[0]=(TText)gDriveToTest; |
|
415 |
test.Printf(_L("the Private Path = %S"),&theprivatepath); |
|
416 |
||
417 |
mkdirname.Zero(); |
|
418 |
mkdirname.Append(theprivatepath); |
|
419 |
mkdirname.Append(KMkDirSub); |
|
420 |
r=TheFs.MkDirAll(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
421 |
test_KErrNone(r); |
0 | 422 |
|
423 |
r=TheFs.RmDir(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
424 |
test_KErrNone(r); |
0 | 425 |
|
426 |
r=TheFs.SetSubst(theprivatepath,EDriveO); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
427 |
test_Value(r, r == KErrPermissionDenied || r==KErrGeneral); // Drive may already be substituted |
0 | 428 |
|
429 |
r=TheFs.RealName(_L("O:\\File.XXX"),realName); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
430 |
test_KErrNone(r); |
0 | 431 |
|
432 |
r=TheFs.SetSessionPath(theprivatepath); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
433 |
test_KErrNone(r); |
0 | 434 |
|
435 |
TheFs.NotifyChange(ENotifyAll,aStat3,theprivatepath); |
|
436 |
test(aStat3==KRequestPending); |
|
437 |
||
438 |
pritestfile=theprivatepath; |
|
439 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
440 |
pritestfile1=pritestfile; |
|
441 |
pritestfile.Append(KFilePri2); |
|
442 |
pritestfile1.Append(KFilePri3); |
|
443 |
||
444 |
oldName=KOldFile; |
|
445 |
oldName[0]=(TText)gDriveToTest; |
|
446 |
||
447 |
r=TheFs.GetShortName(pritestfile, shortfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
448 |
test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported); |
0 | 449 |
|
450 |
r=TheFs.GetLongName(pritestfile1, longfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
451 |
test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported); |
0 | 452 |
|
453 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
454 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 455 |
file1.Close(); |
456 |
||
457 |
r=TheFs.Replace(oldName,pritestfile); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
458 |
test_KErrNone(r); |
0 | 459 |
|
460 |
r=TheFs.Rename(pritestfile,pritestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
461 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 462 |
|
463 |
r=TheFs.Entry(pritestfile1,entry); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
464 |
test_KErrNone(r); |
0 | 465 |
|
466 |
r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
467 |
test_KErrNone(r); |
0 | 468 |
|
469 |
r=TheFs.Delete(pritestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
470 |
test_KErrNone(r); |
0 | 471 |
|
472 |
__UHEAP_MARKEND; |
|
473 |
} |
|
474 |
||
475 |
||
476 |
LOCAL_C void systemRFiletest() |
|
477 |
// |
|
478 |
//RFile testing with session path set to //sys// |
|
479 |
// |
|
480 |
{ |
|
481 |
__UHEAP_MARK; |
|
482 |
||
483 |
r=TheFs.SetSessionPath(systestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
484 |
test_Value(r, r == KErrPermissionDenied); |
0 | 485 |
|
486 |
r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
487 |
test_KErrNone(r); |
0 | 488 |
file1.Close(); |
489 |
||
490 |
TBuf<25> sysfilename; |
|
491 |
sysfilename.Append(systestname); |
|
492 |
sysfilename.Append(KFileSys); |
|
493 |
||
494 |
r=file1.Create(TheFs,sysfilename,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
495 |
test_KErrNone(r); |
0 | 496 |
file1.Close(); |
497 |
||
498 |
r=file1.Open(TheFs,sysfilename,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
499 |
test_KErrNone(r); |
0 | 500 |
file1.Close(); |
501 |
||
502 |
r=file1.Open(TheFs,sysfilename,EFileRead); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
503 |
test_Value(r, r == KErrPermissionDenied); |
0 | 504 |
file1.Close(); |
505 |
||
506 |
r=file1.Replace(TheFs,sysfilename,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
507 |
test_KErrNone(r); |
0 | 508 |
|
509 |
TBuf<25> sysfilename2; |
|
510 |
sysfilename2.Append(systestname); |
|
511 |
sysfilename2.Append(KFileSys3); |
|
512 |
||
513 |
r=file1.Rename(sysfilename2); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
514 |
test_KErrNone(r); |
0 | 515 |
file1.Close(); |
516 |
||
517 |
TFindFile finder(TheFs); |
|
518 |
CDir* dir = NULL; |
|
519 |
r=finder.FindWildByDir(KWildFile, KWildPath, dir); |
|
520 |
if (!(r==KErrPermissionDenied)) |
|
521 |
test.Printf(_L("T_DCTCB: test find wildcards r = %d (expected KErrPermissionDenied)\n"), r); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
522 |
test_Value(r, r == KErrPermissionDenied); |
0 | 523 |
delete dir; |
524 |
||
525 |
__UHEAP_MARKEND; |
|
526 |
} |
|
527 |
||
528 |
LOCAL_C void resourceRFiletest() |
|
529 |
// |
|
530 |
//RFile testing with session path set to //resource// |
|
531 |
// |
|
532 |
{ |
|
533 |
__UHEAP_MARK; |
|
534 |
||
535 |
r=TheFs.SetSessionPath(restestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
536 |
test_KErrNone(r); |
0 | 537 |
|
538 |
r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
539 |
test_KErrNone(r); |
0 | 540 |
file1.Close(); |
541 |
||
542 |
r=file1.Create(TheFs,KFileRes,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
543 |
test_KErrNone(r); |
0 | 544 |
file1.Close(); |
545 |
||
546 |
r=file1.Open(TheFs,KFileRes,EFileWrite|EFileShareExclusive ); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
547 |
test_KErrNone(r); |
0 | 548 |
|
549 |
r=file1.Rename(KFileRes3); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
550 |
test_KErrNone(r); |
0 | 551 |
file1.Close(); |
552 |
||
553 |
r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileRead); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
554 |
test_KErrNone(r); |
0 | 555 |
file1.Close(); |
556 |
||
557 |
r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
558 |
test_KErrNone(r); |
0 | 559 |
file1.Close(); |
560 |
||
561 |
r=file1.Open(TheFs,KFileRes3,EFileShareReadersOnly); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
562 |
test_KErrNone(r); |
0 | 563 |
|
564 |
r=file1.ChangeMode(EFileShareExclusive); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
565 |
test_KErrNone(r); |
0 | 566 |
file1.Close(); |
567 |
||
568 |
r=file1.Replace(TheFs,KFileRes,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
569 |
test_KErrNone(r); |
0 | 570 |
file1.Close(); |
571 |
||
572 |
__UHEAP_MARKEND; |
|
573 |
||
574 |
} |
|
575 |
||
576 |
||
577 |
LOCAL_C void privatefalseIDRFiletest() |
|
578 |
// |
|
579 |
//RFile testing with session path set to //Private//false ID |
|
580 |
// |
|
581 |
{ |
|
582 |
__UHEAP_MARK; |
|
583 |
||
584 |
r=TheFs.SetSessionPath(pritestfalseidname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
585 |
test_Value(r, r == KErrPermissionDenied); |
0 | 586 |
|
587 |
r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
588 |
test_Value(r, r == KErrPermissionDenied); |
0 | 589 |
file1.Close(); |
590 |
||
591 |
// Since can't set session path create explicit path |
|
592 |
pritestfile=KPrivateFalseID; |
|
593 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
594 |
pritestfile.Append(KFilePri); |
|
595 |
||
596 |
r=file1.Create(TheFs,pritestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
597 |
test_Value(r, r == KErrPermissionDenied); |
0 | 598 |
file1.Close(); |
599 |
||
600 |
r=file1.Open(TheFs,pritestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
601 |
test_Value(r, r == KErrPermissionDenied); |
0 | 602 |
file1.Close(); |
603 |
||
604 |
r=file1.Open(TheFs,pritestfile,EFileRead); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
605 |
test_Value(r, r == KErrPermissionDenied); |
0 | 606 |
file1.Close(); |
607 |
||
608 |
r=file1.Replace(TheFs,pritestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
609 |
test_Value(r, r == KErrPermissionDenied); |
0 | 610 |
|
611 |
// File does not exist so can't rename it |
|
612 |
/* r=file1.Rename(KFilePri3); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
613 |
test_Value(r, r == KErrAlreadyExists || r==KErrNone); |
0 | 614 |
file1.Close(); |
615 |
*/ __UHEAP_MARKEND; |
|
616 |
} |
|
617 |
||
618 |
||
619 |
LOCAL_C void privateRFiletest() |
|
620 |
// |
|
621 |
//RFile testing with session path set to //Private// |
|
622 |
// |
|
623 |
{ |
|
624 |
__UHEAP_MARK; |
|
625 |
||
626 |
r=TheFs.SetSessionPath(pritestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
627 |
test_Value(r, r == KErrPermissionDenied); |
0 | 628 |
|
629 |
r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
630 |
test_Value(r, r == KErrPermissionDenied); |
0 | 631 |
file1.Close(); |
632 |
||
633 |
// Since can't set session path create explicit path |
|
634 |
pritestfile=KPrivatePath; |
|
635 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
636 |
pritestfile.Append(KFilePri); |
|
637 |
||
638 |
r=file1.Create(TheFs,pritestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
639 |
test_Value(r, r == KErrPermissionDenied); |
0 | 640 |
file1.Close(); |
641 |
||
642 |
r=file1.Open(TheFs,pritestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
643 |
test_Value(r, r == KErrPermissionDenied); |
0 | 644 |
file1.Close(); |
645 |
||
646 |
r=file1.Open(TheFs,pritestfile,EFileRead); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
647 |
test_Value(r, r == KErrPermissionDenied); |
0 | 648 |
file1.Close(); |
649 |
||
650 |
r=file1.Replace(TheFs,pritestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
651 |
test_Value(r, r == KErrPermissionDenied); |
0 | 652 |
|
653 |
// File does not exist so can't be renamed |
|
654 |
/* r=file1.Rename(KFilePri3); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
655 |
test_KErrNone(r); |
0 | 656 |
file1.Close(); |
657 |
*/ |
|
658 |
__UHEAP_MARKEND; |
|
659 |
} |
|
660 |
||
661 |
||
662 |
LOCAL_C void privateSIDRFiletest() |
|
663 |
// |
|
664 |
//Rfile Testing with session path set to //Private//UID// |
|
665 |
// |
|
666 |
{ |
|
667 |
__UHEAP_MARK; |
|
668 |
r=TheFs.SetSessionToPrivate(gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
669 |
test_KErrNone(r); |
0 | 670 |
|
671 |
r=file1.Temp(TheFs,theprivatepath,fromTemp,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
672 |
test_KErrNone(r); |
0 | 673 |
file1.Close(); |
674 |
||
675 |
r=file1.Create(TheFs,KFilePri,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
676 |
test_KErrNone(r); |
0 | 677 |
file1.Close(); |
678 |
||
679 |
r=file1.Open(TheFs,KFilePri,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
680 |
test_KErrNone(r); |
0 | 681 |
file1.Close(); |
682 |
||
683 |
r=file1.Open(TheFs,KFilePri,EFileRead); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
684 |
test_KErrNone(r); |
0 | 685 |
file1.Close(); |
686 |
||
687 |
r=file1.Replace(TheFs,KFilePri,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
688 |
test_KErrNone(r); |
0 | 689 |
|
690 |
r=file1.Rename(KFilePri3); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
691 |
test_KErrNone(r); |
0 | 692 |
file1.Close(); |
693 |
__UHEAP_MARKEND; |
|
694 |
} |
|
695 |
||
696 |
LOCAL_C void RDirtest() |
|
697 |
// |
|
698 |
// |
|
699 |
// |
|
700 |
{ |
|
701 |
__UHEAP_MARK; |
|
702 |
||
703 |
//system |
|
704 |
CDir* dirEntries; |
|
705 |
TBuf<30> dirNameBuf(KSystemPath); |
|
706 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
707 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
708 |
test_Value(r, r == KErrPermissionDenied); |
0 | 709 |
dir.Close(); |
710 |
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
711 |
test_Value(r, r == KErrPermissionDenied); |
0 | 712 |
dirNameBuf.Zero(); |
713 |
delete dirEntries; |
|
714 |
||
715 |
//Private |
|
716 |
dirNameBuf=KPrivatePath; |
|
717 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
718 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
719 |
test_Value(r, r == KErrPermissionDenied); |
0 | 720 |
dir.Close(); |
721 |
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
722 |
test_Value(r, r == KErrPermissionDenied); |
0 | 723 |
dirNameBuf.Zero(); |
724 |
delete dirEntries; |
|
725 |
||
726 |
//Private//falseID |
|
727 |
dirNameBuf=KPrivateFalseID; |
|
728 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
729 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
730 |
test_Value(r, r == KErrPermissionDenied); |
0 | 731 |
dir.Close(); |
732 |
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
733 |
test_Value(r, r == KErrPermissionDenied); |
0 | 734 |
dirNameBuf.Zero(); |
735 |
delete dirEntries; |
|
736 |
||
737 |
//Private/uid |
|
738 |
TheFs.PrivatePath(dirNameBuf); |
|
739 |
dirNameBuf.Insert(0,_L("?:")); |
|
740 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
741 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
742 |
test_KErrNone(r); |
0 | 743 |
dir.Close(); |
744 |
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
745 |
test_KErrNone(r); |
0 | 746 |
dirNameBuf.Zero(); |
747 |
delete dirEntries; |
|
748 |
//Resource |
|
749 |
dirNameBuf=KResourcePath; |
|
750 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
751 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
752 |
test_KErrNone(r); |
0 | 753 |
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
754 |
test_KErrNone(r); |
0 | 755 |
dir.Close(); |
756 |
delete dirEntries; |
|
757 |
__UHEAP_MARKEND; |
|
758 |
} |
|
759 |
||
760 |
||
761 |
LOCAL_C void TestTcbCaps() |
|
762 |
// |
|
763 |
// Test with tcb capabilities |
|
764 |
// |
|
765 |
{ |
|
766 |
__UHEAP_MARK; |
|
767 |
r=TheFs.FileSystemName(fsname,gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
768 |
test_KErrNone(r); |
0 | 769 |
r = DismountFileSystem(TheFs, fsname, gTheDriveNum); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
770 |
test_Value(r, r == KErrPermissionDenied); |
0 | 771 |
r = MountFileSystem(TheFs, fsname, gTheDriveNum); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
772 |
test_Value(r, r == KErrPermissionDenied); |
0 | 773 |
r=TheFs.SetDriveName(gTheDriveNum,KDriveName); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
774 |
test_Value(r, r == KErrPermissionDenied); |
0 | 775 |
#ifndef __WINS__ |
776 |
r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
777 |
test_Value(r, r == KErrPermissionDenied); |
0 | 778 |
#endif |
779 |
||
780 |
systemRFsTest(); |
|
781 |
ResourceRFsTest(); |
|
782 |
privateRFsTest(); |
|
783 |
privateSIDRFstest(); |
|
784 |
||
785 |
privatefalseIDRFsTest(); |
|
786 |
||
787 |
systemRFiletest(); |
|
788 |
resourceRFiletest(); |
|
789 |
privateRFiletest(); |
|
790 |
privateSIDRFiletest(); |
|
791 |
privatefalseIDRFiletest(); |
|
792 |
||
793 |
//check notifier return values set in rfs testing |
|
794 |
User::WaitForRequest(aStat1); |
|
795 |
User::WaitForRequest(aStat2); |
|
796 |
User::WaitForRequest(aStat3); |
|
797 |
User::WaitForRequest(aStat4); |
|
798 |
test(aStat1==KErrPermissionDenied); |
|
799 |
test(aStat2==KErrPermissionDenied); |
|
800 |
test(aStat3==KErrNone); |
|
801 |
test(aStat4==KErrNone); |
|
802 |
||
803 |
r=TheFs.SetSessionPath(systestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
804 |
test_Value(r, r == KErrPermissionDenied); |
0 | 805 |
|
806 |
//Test RRawDisk class |
|
807 |
r=rawdisk.Open(TheFs,gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
808 |
test_KErrNone(r); |
0 | 809 |
rawdisk.Close(); |
810 |
||
811 |
RDirtest(); |
|
812 |
||
813 |
#ifdef __WINS__ |
|
814 |
if (User::UpperCase(driveBuf[0]) != 'C') |
|
815 |
#endif |
|
816 |
{ |
|
817 |
//Test RFormat class |
|
818 |
r=format.Open(TheFs,driveBuf,EHighDensity,count); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
819 |
test_Value(r, r == KErrPermissionDenied); |
0 | 820 |
|
821 |
while(count) |
|
822 |
{ |
|
823 |
TInt r=format.Next(count); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
824 |
test_KErrNone(r); |
0 | 825 |
} |
826 |
format.Close(); |
|
827 |
} |
|
828 |
||
829 |
driveBuf[0]=(TText)gDriveToTest; |
|
830 |
r=TheFs.ScanDrive(driveBuf); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
831 |
test_Value(r, (r == KErrPermissionDenied)||(r==KErrNotSupported)); |
0 | 832 |
r=TheFs.CheckDisk(driveBuf); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
833 |
test_Value(r, (r == KErrPermissionDenied)||(r==KErrNotSupported)); |
0 | 834 |
__UHEAP_MARKEND; |
835 |
} |
|
836 |
||
837 |
LOCAL_C void TestCaps() |
|
838 |
// |
|
839 |
// test format etc that require certain capabilities |
|
840 |
// |
|
841 |
{ |
|
842 |
__UHEAP_MARK; |
|
843 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
844 |
const char myDiagMsg[] = "Capability Check Failure"; |
|
845 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
846 |
r=RProcess().HasCapability(ECapabilityTCB, __PLATSEC_DIAGNOSTIC_STRING(myDiagMsg)); |
|
847 |
test(r); |
|
848 |
||
849 |
driveBuf[0]=(TText)gDriveToTest; |
|
850 |
r=TheFs.SessionPath(temp); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
851 |
test_KErrNone(r); |
0 | 852 |
test.Printf(_L("Session path: %S"),&temp); |
853 |
r=TheFs.CreatePrivatePath(gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
854 |
test_Value(r, r == KErrNone || r== KErrAlreadyExists); |
0 | 855 |
|
856 |
TBuf<18> tempPri; |
|
857 |
r=TheFs.PrivatePath(tempPri); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
858 |
test_KErrNone(r); |
0 | 859 |
theprivatepath = _L("?:"); |
860 |
theprivatepath.Append(tempPri); |
|
861 |
||
862 |
TestTcbCaps(); |
|
863 |
||
864 |
TFileName thesessionpath; |
|
865 |
r=TheFs.SetSessionToPrivate(gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
866 |
test_KErrNone(r); |
0 | 867 |
r=TheFs.SessionPath(thesessionpath); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
868 |
test_KErrNone(r); |
0 | 869 |
test(thesessionpath == theprivatepath); |
870 |
__UHEAP_MARKEND; |
|
871 |
} |
|
872 |
||
873 |
||
874 |
TFileName dirName; |
|
875 |
||
876 |
LOCAL_C void ScanDir(const TDesC& aName, CDirScan::TScanDirection aDirection, TInt aError) |
|
877 |
{ |
|
878 |
CDirScan* scanner = NULL; |
|
879 |
TRAP(r, scanner = CDirScan::NewL(TheFs)); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
880 |
test_Value(r, r == KErrNone && scanner); |
0 | 881 |
|
882 |
TRAP(r, scanner->SetScanDataL(aName,KEntryAttDir,ESortByName|EAscending,aDirection)); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
883 |
test_KErrNone(r); |
0 | 884 |
|
885 |
CDir *entryList=NULL; |
|
886 |
for (;;) |
|
887 |
{ |
|
888 |
TRAP(r, scanner->NextL(entryList)); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
889 |
test_Value(r, r == aError); |
0 | 890 |
if (entryList==NULL) |
891 |
break; |
|
892 |
TInt count=entryList->Count(); |
|
893 |
while (count--) |
|
894 |
{ |
|
895 |
TEntry data=(*entryList)[count]; |
|
896 |
TBuf<KMaxFileName> path=scanner->AbbreviatedPath(); |
|
897 |
dirName = path; |
|
898 |
dirName.Append(data.iName); |
|
899 |
test.Printf(_L(" %S\n"),&dirName); |
|
900 |
||
901 |
} |
|
902 |
delete entryList; |
|
903 |
entryList=NULL; |
|
904 |
} |
|
905 |
delete scanner; |
|
906 |
||
907 |
} |
|
908 |
||
909 |
/** |
|
910 |
The following test, tests CFileMan and CDirScan API on folders private and sys |
|
911 |
to confirm that any operation on these folders for any app with incorrect capability |
|
912 |
returns KErrPermissionDenied. This test step was added as a result of DEF051428 |
|
913 |
("PlatSec: Incorrect errors returned by f32") |
|
914 |
*/ |
|
915 |
LOCAL_C void TestCaging() |
|
916 |
{ |
|
917 |
CFileMan* fMan=CFileMan::NewL(TheFs); |
|
918 |
TInt r; |
|
919 |
if(fMan!=NULL) |
|
920 |
{ |
|
921 |
||
922 |
// Checking the private path |
|
923 |
TBuf<30> privatepath; |
|
924 |
r=TheFs.PrivatePath(privatepath); |
|
925 |
test.Printf(_L("Private Path is=%S"),&privatepath); |
|
926 |
||
927 |
r = TheFs.MkDir(_L("\\Caged\\")); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
928 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 929 |
|
930 |
CDir* entryCount=NULL; |
|
931 |
r=TheFs.GetDir(_L("\\*.*"),KEntryAttNormal,ESortNone,entryCount); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
932 |
test_KErrNone(r); |
0 | 933 |
TInt rootCount= entryCount->Count(); |
934 |
||
935 |
delete entryCount; |
|
936 |
entryCount=NULL; |
|
937 |
||
938 |
||
939 |
//Testing Copy |
|
940 |
CDir* entryCount2=NULL; |
|
941 |
r=fMan->Copy(_L("\\sys\\"),_L("\\Caged\\")); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
942 |
test_Value(r, r == KErrPermissionDenied); |
0 | 943 |
r=fMan->Copy(_L("\\*"),_L("\\Caged\\")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
944 |
test_KErrNone(r); |
0 | 945 |
|
946 |
r=TheFs.GetDir(_L("\\Caged\\*.*"),KEntryAttNormal,ESortNone,entryCount2); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
947 |
test_KErrNone(r); |
0 | 948 |
TInt cagedCount= entryCount2->Count(); |
949 |
||
950 |
test(cagedCount==rootCount); |
|
951 |
||
952 |
delete entryCount2; |
|
953 |
entryCount2=NULL; |
|
954 |
||
955 |
r=fMan->Copy(_L("\\private\\two\\moo"),_L("\\private\\two\\mew")); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
956 |
test_Value(r, r == KErrPermissionDenied); |
0 | 957 |
|
958 |
// Create a test file |
|
959 |
RFile testFile; |
|
960 |
r = testFile.Replace(TheFs, _L("\\capTest"),EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
961 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 962 |
testFile.Close(); |
963 |
||
964 |
TFileName name; |
|
965 |
name = privatepath; |
|
966 |
name.Append(_L("privateFile.tst")); |
|
967 |
RFile privateFile; |
|
968 |
r = privateFile.Replace(TheFs, name,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
969 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 970 |
privateFile.Close(); |
971 |
||
972 |
||
973 |
r=fMan->Copy(_L("\\capTest"),_L("\\private\\two\\moo")); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
974 |
test_Value(r, r == KErrPermissionDenied); |
0 | 975 |
r=fMan->Copy(_L("\\capTest"),_L("\\sys\\bin\\moo")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
976 |
test_Value(r, r == KErrPathNotFound); |
0 | 977 |
r=fMan->Copy(_L("\\sys\\bin\\capTest"),_L("\\sys\\bin\\moo")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
978 |
test_Value(r, r == KErrPermissionDenied); |
0 | 979 |
r=fMan->Copy(_L("\\capTest"),_L("\\sys\\capTest")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
980 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 981 |
r=fMan->Copy(_L("\\sys\\*"),_L("\\")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
982 |
test_Value(r, r == KErrPermissionDenied); |
0 | 983 |
r=fMan->Copy(name,_L("\\sys\\")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
984 |
test_KErrNone(r); |
0 | 985 |
|
986 |
// Testing Move |
|
987 |
r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo")); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
988 |
test_Value(r, r == KErrPermissionDenied); |
0 | 989 |
r=fMan->Move(_L("\\private\\two\\moo.."),_L("\\private\\one\\moo")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
990 |
test_Value(r, r == KErrPermissionDenied); |
0 | 991 |
r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo..")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
992 |
test_Value(r, r == KErrPermissionDenied); |
0 | 993 |
r=fMan->Move(name,_L("\\privateFile.tst")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
994 |
test_KErrNone(r); |
0 | 995 |
r=fMan->Move(_L("\\privateFile.tst"),name); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
996 |
test_KErrNone(r); |
0 | 997 |
|
998 |
||
999 |
// Testing Attribs |
|
1000 |
r=fMan->Attribs(_L("\\private\\two\\moo"),KEntryAttReadOnly,0,TTime(0)); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1001 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1002 |
r=fMan->Attribs(_L("\\private\\moo"),KEntryAttReadOnly,0,TTime(0)); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1003 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1004 |
r=fMan->Attribs(name,KEntryAttReadOnly,0,TTime(0)); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1005 |
test_KErrNone(r); |
0 | 1006 |
r=fMan->Attribs(name,0,KEntryAttReadOnly,TTime(0)); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1007 |
test_KErrNone(r); |
0 | 1008 |
|
1009 |
// Testing Move |
|
1010 |
r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo")); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1011 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1012 |
r=fMan->Move(_L("\\private\\two\\moo.."),_L("\\private\\one\\moo")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1013 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1014 |
r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo..")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1015 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1016 |
r=fMan->Move(name,_L("\\privateFile.tst")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1017 |
test_KErrNone(r); |
0 | 1018 |
r=fMan->Move(_L("\\privateFile.tst"),name); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1019 |
test_KErrNone(r); |
0 | 1020 |
|
1021 |
||
1022 |
// Testing RmDir |
|
1023 |
r=fMan->RmDir(_L("\\private\\")); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1024 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1025 |
r=fMan->RmDir(_L("\\private\\two\\")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1026 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1027 |
r=fMan->RmDir(_L("\\private\\tw?\\")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1028 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1029 |
r=fMan->RmDir(_L("\\sys\\")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1030 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1031 |
|
1032 |
||
1033 |
// Testing Rename |
|
1034 |
r=fMan->Rename(_L("\\private\\two\\moo"),_L("\\private\\two\\mew")); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1035 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1036 |
|
1037 |
// Testing Delete |
|
1038 |
r=fMan->Delete(_L("\\private\\two\\test")); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1039 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1040 |
r=fMan->Delete(_L("\\private\\moo")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1041 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1042 |
r=fMan->Delete(_L("\\sys\\")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1043 |
test_Value(r, r == KErrPermissionDenied); |
0 | 1044 |
|
1045 |
//Something that actually exists in Private |
|
1046 |
r=fMan->Rename(name,_L("\\private\\00000001\\moo")); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1047 |
test_KErrNone(r); |
0 | 1048 |
r=fMan->Rename(_L("\\private\\00000001\\moo"),name); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1049 |
test_KErrNone(r); |
0 | 1050 |
r=fMan->Copy(name,_L("\\private\\00000001\\moo")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1051 |
test_KErrNone(r); |
0 | 1052 |
r=fMan->Delete(_L("\\private\\00000001\\moo")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1053 |
test_KErrNone(r); |
0 | 1054 |
|
1055 |
// Clean up the test data |
|
1056 |
r=fMan->RmDir(_L("\\Caged\\")); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1057 |
test_KErrNone(r); |
0 | 1058 |
r=fMan->Delete(_L("\\capTest")); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1059 |
test_KErrNone(r); |
0 | 1060 |
r=fMan->Delete(name); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1061 |
test_KErrNone(r); |
0 | 1062 |
delete(fMan); |
1063 |
} |
|
1064 |
||
1065 |
// CDirScan tests |
|
1066 |
ScanDir(_L("\\"), CDirScan::EScanUpTree, KErrNone); |
|
1067 |
ScanDir(_L("\\"), CDirScan::EScanDownTree, KErrNone); |
|
1068 |
ScanDir(_L("\\private\\"), CDirScan::EScanDownTree, KErrPermissionDenied); |
|
1069 |
ScanDir(_L("\\private\\"), CDirScan::EScanUpTree, KErrPermissionDenied); |
|
1070 |
ScanDir(_L("\\sys\\"), CDirScan::EScanDownTree, KErrPermissionDenied); |
|
1071 |
ScanDir(_L("\\sys\\"), CDirScan::EScanUpTree, KErrPermissionDenied); |
|
1072 |
} |
|
1073 |
||
1074 |
void TestSystemDrive() |
|
1075 |
{ |
|
1076 |
test.Next(_L("TestSystemDrive")); |
|
1077 |
TDriveNumber drive = RFs::GetSystemDrive(); |
|
1078 |
test.Printf(_L("System Drive is %c:\n"), 'A'+drive); |
|
1079 |
for(TInt i=EDriveA; i<=EDriveZ; i++) |
|
1080 |
{ |
|
1081 |
TDriveInfo info; |
|
1082 |
test(TheFs.Drive(info, i) == KErrNone); |
|
1083 |
if(info.iType==EMediaHardDisk || info.iType==EMediaFlash || info.iType==EMediaNANDFlash) |
|
1084 |
{ |
|
1085 |
if(info.iDriveAtt & (KDriveAttLocal|KDriveAttInternal)) |
|
1086 |
{ |
|
1087 |
if(!(info.iDriveAtt & (KDriveAttRom|KDriveAttRedirected|KDriveAttSubsted|KDriveAttRemovable))) |
|
1088 |
{ |
|
1089 |
test.Printf(_L("Setting %c:"), 'A'+i); |
|
1090 |
TInt ret = TheFs.SetSystemDrive((TDriveNumber)i); |
|
1091 |
test.Printf(_L("%d\n"), ret); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1092 |
test_Value(ret, ret == KErrNone || ret == KErrAlreadyExists); |
0 | 1093 |
if(ret == KErrNone) |
1094 |
{ |
|
1095 |
drive = (TDriveNumber)i; |
|
1096 |
test.Printf(_L("Re-setting %c:"), 'A'+i); |
|
1097 |
ret = TheFs.SetSystemDrive(drive); |
|
1098 |
test.Printf(_L("%d\n"), ret); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1099 |
test_Value(ret, ret == KErrAlreadyExists); |
0 | 1100 |
} |
1101 |
} |
|
1102 |
} |
|
1103 |
} |
|
1104 |
} |
|
1105 |
TChar drvchar = RFs::GetSystemDriveChar(); |
|
1106 |
test(drvchar == (TChar)('A' + drive)); |
|
1107 |
test(drive == RFs::GetSystemDrive()); |
|
1108 |
} |
|
1109 |
||
1110 |
LOCAL_C void CleanupL() |
|
1111 |
// |
|
1112 |
// Clean up tests |
|
1113 |
// |
|
1114 |
{ |
|
1115 |
test.Next(_L("Delete test directory")); |
|
1116 |
CFileMan* fMan=CFileMan::NewL(TheFs); |
|
1117 |
TInt r=fMan->RmDir(gSessionPath); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1118 |
// test_Value(r, r == KErrNone || r == KErrPathNotFound); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1119 |
test(r == KErrNone || KErrPathNotFound); |
0 | 1120 |
delete fMan; |
1121 |
} |
|
1122 |
||
1123 |
GLDEF_C void CallTestsL(/*TChar aDriveLetter*/) |
|
1124 |
// |
|
1125 |
// Do all tests |
|
1126 |
// |
|
1127 |
{ |
|
1128 |
if( !PlatSec::IsCapabilityEnforced(ECapabilityTCB)) |
|
1129 |
{ |
|
1130 |
test.Printf(_L("Capability ECapabilityTCB not enabled - leaving t_dctcb")); |
|
1131 |
test.Printf(_L("\n")); // Prevent overwrite by next print |
|
1132 |
return; |
|
1133 |
} |
|
1134 |
||
1135 |
TurnAllocFailureOff(); |
|
1136 |
TheFs.CharToDrive(gDriveToTest,gTheDriveNum); |
|
1137 |
||
1138 |
TBuf<30> sesspath; |
|
1139 |
sesspath=_L("?:\\"); |
|
1140 |
sesspath[0] = (TText)gDriveToTest; |
|
1141 |
||
1142 |
TInt r= TheFs.SetSessionPath(sesspath); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1143 |
test_KErrNone(r); |
0 | 1144 |
|
1145 |
//cleanup from previous run of this test |
|
1146 |
TBuf<20> delDir; |
|
1147 |
CFileMan* fMan=CFileMan::NewL(TheFs); |
|
1148 |
delDir=KResourcePath; |
|
1149 |
delDir[0]=(TText)gDriveToTest; |
|
1150 |
r=fMan->RmDir(delDir); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1151 |
// test_Value(r, r == KErrNone || r == KErrNotFound); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1152 |
test(r == KErrNone || KErrNotFound); |
0 | 1153 |
delDir=KSystemPath; |
1154 |
delDir[0]=(TText)gDriveToTest; |
|
1155 |
r=fMan->RmDir(delDir); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1156 |
// test_Value(r, r == KErrNone || r == KErrNotFound); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1157 |
test(r == KErrNone || KErrNotFound); |
0 | 1158 |
delDir=KPrivatePath; |
1159 |
delDir[0]=(TText)gDriveToTest; |
|
1160 |
r=fMan->RmDir(delDir); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1161 |
// test_Value(r, r == KErrNone || r == KErrNotFound); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1162 |
test(r == KErrNone || KErrNotFound); |
0 | 1163 |
delete fMan; |
1164 |
||
1165 |
//check double mode ie that Defpath still works |
|
1166 |
RFs fs1; |
|
1167 |
RFs fs2; |
|
1168 |
||
1169 |
r=fs1.Connect(); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1170 |
test_KErrNone(r); |
0 | 1171 |
r=fs1.SessionPath(sesspath); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1172 |
test_KErrNone(r); |
0 | 1173 |
test.Printf(_L("session1 Path=%S"),&sesspath); |
1174 |
||
1175 |
TBuf<30> privatepath; |
|
1176 |
r=fs1.SetSessionToPrivate(gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1177 |
test_KErrNone(r); |
0 | 1178 |
r=fs1.PrivatePath(privatepath); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1179 |
test_KErrNone(r); |
0 | 1180 |
r=privatepath.Compare(KExpectedPrivatePath()); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1181 |
test_Value(r, r == 0); |
0 | 1182 |
r=fs1.SessionPath(sesspath); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1183 |
test_KErrNone(r); |
0 | 1184 |
r=privatepath.Compare(sesspath.Mid(KPathPosition)); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1185 |
test_Value(r, r == 0); |
0 | 1186 |
r=fs1.CreatePrivatePath(gTheDriveNum); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1187 |
test_KErrNone(r); |
0 | 1188 |
fs1.Close(); |
1189 |
||
1190 |
r=fs2.Connect(); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1191 |
test_KErrNone(r); |
0 | 1192 |
r=fs2.SessionPath(sesspath); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1193 |
test_KErrNone(r); |
0 | 1194 |
test.Printf(_L("session2 Path=%S"),&sesspath); |
1195 |
fs2.Close(); |
|
1196 |
||
1197 |
TestCaps(); |
|
1198 |
TestCaging(); |
|
1199 |
TestPathCheck(); |
|
1200 |
TestSystemDrive(); |
|
1201 |
||
1202 |
test.Printf(_L("No of files open=%d"), TheFs.ResourceCount()); |
|
1203 |
||
1204 |
CleanupL(); |
|
1205 |
} |