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 <e32def.h> |
|
22 |
#include <e32def_private.h> |
|
23 |
#include <e32svr.h> |
|
24 |
#include "t_server.h" |
|
25 |
||
26 |
GLDEF_D RTest test(_L("t_dctcbdiskadmin")); |
|
27 |
GLDEF_D TTime gTimeNow; |
|
28 |
LOCAL_D TInt gTheDriveNum; |
|
29 |
||
30 |
const TInt KPathPosition = 2; |
|
31 |
_LIT(KExpectedPrivatePath, "\\Private\\00000001\\"); |
|
32 |
_LIT(KResourcePath, "?:\\Resource\\"); |
|
33 |
_LIT(KSystemPath, "?:\\Sys\\"); |
|
34 |
_LIT(KPrivatePath, "?:\\Private\\"); |
|
35 |
_LIT(KPrivateFalseID, "?:\\Private\\FFFFFFFF\\"); |
|
36 |
_LIT(KDriveName, "Billy"); |
|
37 |
_LIT(KVolLable, "Benny"); |
|
38 |
_LIT(KFileSys, "systemfile.txt"); |
|
39 |
_LIT(KFileSys3, "sysfile.rna"); |
|
40 |
_LIT(KFilePri, "privatefile.txt"); |
|
41 |
_LIT(KFilePri2, "privatefile.tmp"); |
|
42 |
_LIT(KFilePri3, "prifile.rna"); |
|
43 |
_LIT(KFileRes, "resourcefile.txt"); |
|
44 |
_LIT(KFileRes3, "resfile.rna"); |
|
45 |
_LIT(KMkDirSub,"Subdir\\"); |
|
46 |
_LIT(KOldFile,"?:\\Anyold.txt"); |
|
47 |
_LIT(KWildPath, "Z:\\SYS\\"); |
|
48 |
_LIT(KWildFile, "*"); |
|
49 |
||
50 |
TCapability TheCaps; |
|
51 |
TBuf<4> driveBuf=_L("?:\\"); |
|
52 |
RFormat format; |
|
53 |
TInt count; |
|
54 |
RRawDisk rawdisk; |
|
55 |
RFile file1; |
|
56 |
RFile file2; |
|
57 |
RDir dir; |
|
58 |
||
59 |
TInt r; |
|
60 |
TBuf<40> fsname; |
|
61 |
TBuf<40> systestname; |
|
62 |
TBuf<40> pritestname; |
|
63 |
TBuf<40> restestname; |
|
64 |
TBuf<40> theprivatepath; |
|
65 |
TBuf<40> pritestfalseidname; |
|
66 |
TBuf<40> mkdirname; |
|
67 |
TFileName fromTemp; |
|
68 |
||
69 |
TBuf<25> sysfilename; |
|
70 |
TBuf<30> realName; |
|
71 |
TBuf<40> shortfilename; |
|
72 |
TBuf<40> longfilename; |
|
73 |
||
74 |
TRequestStatus aStat1; |
|
75 |
TRequestStatus aStat2; |
|
76 |
TRequestStatus aStat3; |
|
77 |
TRequestStatus aStat4; |
|
78 |
||
79 |
TBuf<40> systestfile; |
|
80 |
TBuf<40> pritestfile; |
|
81 |
TBuf<40> restestfile; |
|
82 |
TBuf<40> systestfile1; |
|
83 |
TBuf<40> pritestfile1; |
|
84 |
TBuf<40> restestfile1; |
|
85 |
||
86 |
TTime testtime; |
|
87 |
TBuf<20> oldName; |
|
88 |
||
89 |
TBuf<25> temp; |
|
90 |
||
91 |
TEntry entry; |
|
92 |
||
93 |
||
94 |
LOCAL_C void privateFalseIDRFsTest() |
|
95 |
// |
|
96 |
// |
|
97 |
// |
|
98 |
{ |
|
99 |
__UHEAP_MARK; |
|
100 |
||
101 |
//private and wrong UID |
|
102 |
pritestfalseidname=KPrivateFalseID; |
|
103 |
pritestfalseidname[0]=(TText)('A' + gTheDriveNum); |
|
104 |
||
105 |
mkdirname.Zero(); |
|
106 |
mkdirname.Append(pritestfalseidname); |
|
107 |
mkdirname.Append(KMkDirSub); |
|
108 |
||
109 |
r=TheFs.MkDirAll(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
110 |
test_Value(r, r == KErrPermissionDenied); |
0 | 111 |
|
112 |
r=TheFs.RmDir(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
113 |
test_Value(r, r == KErrPermissionDenied); |
0 | 114 |
|
115 |
r=TheFs.SetSubst(pritestfalseidname,EDriveO); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
116 |
test_Value(r, r == KErrPermissionDenied); |
0 | 117 |
|
118 |
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
|
119 |
test_KErrNone(r); |
0 | 120 |
|
121 |
r=TheFs.SetSessionPath(pritestfalseidname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
122 |
test_Value(r, r == KErrPermissionDenied); |
0 | 123 |
|
124 |
TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname); |
|
125 |
test(aStat2==KErrPermissionDenied); |
|
126 |
||
127 |
||
128 |
pritestfile=KPrivateFalseID; |
|
129 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
130 |
pritestfile1=pritestfile; |
|
131 |
pritestfile.Append(KFilePri2); |
|
132 |
pritestfile1.Append(KFilePri3); |
|
133 |
||
134 |
oldName=KOldFile; |
|
135 |
oldName[0]=(TText)gDriveToTest; |
|
136 |
||
137 |
r=TheFs.GetShortName(pritestfile, shortfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
138 |
test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported); |
0 | 139 |
|
140 |
r=TheFs.GetLongName(pritestfile1, longfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
141 |
test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported); |
0 | 142 |
|
143 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
144 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 145 |
file1.Close(); |
146 |
||
147 |
r=TheFs.Replace(oldName,pritestfile); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
148 |
test_Value(r, r == KErrPermissionDenied); |
0 | 149 |
|
150 |
r=TheFs.Rename(pritestfile,pritestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
151 |
test_Value(r, r == KErrPermissionDenied); |
0 | 152 |
|
153 |
r=TheFs.Entry(pritestfile1,entry); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
154 |
test_Value(r, r == KErrPermissionDenied); |
0 | 155 |
|
156 |
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
|
157 |
test_Value(r, r == KErrPermissionDenied); |
0 | 158 |
|
159 |
r=TheFs.Delete(pritestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
160 |
test_Value(r, r == KErrPermissionDenied); |
0 | 161 |
|
162 |
r=TheFs.Delete(oldName); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
163 |
test_KErrNone(r); |
0 | 164 |
|
165 |
__UHEAP_MARKEND; |
|
166 |
} |
|
167 |
LOCAL_C void systemRFsTest() |
|
168 |
// |
|
169 |
// RFs test on system Directory |
|
170 |
// |
|
171 |
{ |
|
172 |
__UHEAP_MARK; |
|
173 |
||
174 |
systestname=KSystemPath; |
|
175 |
systestname[0]=(TText)('A' + gTheDriveNum); |
|
176 |
||
177 |
mkdirname.Zero(); |
|
178 |
mkdirname.Append(systestname); |
|
179 |
mkdirname.Append(KMkDirSub); |
|
180 |
r=TheFs.MkDirAll(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
181 |
test_KErrNone(r); |
0 | 182 |
|
183 |
TheFs.RmDir(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
184 |
test_KErrNone(r); |
0 | 185 |
|
186 |
r=TheFs.SetSubst(systestname,EDriveO); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
187 |
test_KErrNone(r); |
0 | 188 |
|
189 |
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
|
190 |
test_Value(r, r == KErrPermissionDenied); |
0 | 191 |
|
192 |
r=TheFs.SetSubst(_L(""),EDriveO); //to unsubst |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
193 |
test_KErrNone(r); |
0 | 194 |
|
195 |
r=TheFs.SetSessionPath(systestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
196 |
test_Value(r, r == KErrPermissionDenied); |
0 | 197 |
|
198 |
TheFs.NotifyChange(ENotifyAll,aStat1,systestname); |
|
199 |
test(aStat1==KErrPermissionDenied); |
|
200 |
||
201 |
systestfile=KSystemPath; |
|
202 |
systestfile[0]=(TText)('A' + gTheDriveNum); |
|
203 |
systestfile1=systestfile; |
|
204 |
systestfile.Append(KFileSys); |
|
205 |
systestfile1.Append(KFileSys3); |
|
206 |
||
207 |
oldName=KOldFile; |
|
208 |
oldName[0]=(TText)gDriveToTest; |
|
209 |
||
210 |
r=TheFs.GetShortName(systestfile, shortfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
211 |
test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported); |
0 | 212 |
|
213 |
r=TheFs.GetLongName(systestfile1, longfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
214 |
test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported); |
0 | 215 |
|
216 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
217 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 218 |
file1.Close(); |
219 |
||
220 |
r=TheFs.Replace(oldName,systestfile); |
|
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 |
r=TheFs.Delete(systestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
224 |
test_Value(r, r == KErrNone || r==KErrNotFound); |
0 | 225 |
|
226 |
r=TheFs.Rename(systestfile,systestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
227 |
test_KErrNone(r); |
0 | 228 |
|
229 |
r=TheFs.Entry(systestfile1,entry); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
230 |
test_Value(r, r == KErrPermissionDenied); |
0 | 231 |
|
232 |
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
|
233 |
test_KErrNone(r); |
0 | 234 |
|
235 |
r=TheFs.Delete(systestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
236 |
test_KErrNone(r); |
0 | 237 |
|
238 |
__UHEAP_MARKEND; |
|
239 |
} |
|
240 |
||
241 |
LOCAL_C void ResourceRFsTest() |
|
242 |
// |
|
243 |
// |
|
244 |
// |
|
245 |
{ |
|
246 |
__UHEAP_MARK; |
|
247 |
||
248 |
restestname=KResourcePath; |
|
249 |
restestname[0]=(TText)('A' + gTheDriveNum); |
|
250 |
||
251 |
mkdirname.Zero(); |
|
252 |
mkdirname.Append(restestname); |
|
253 |
mkdirname.Append(KMkDirSub); |
|
254 |
r=TheFs.MkDirAll(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
255 |
test_KErrNone(r); |
0 | 256 |
|
257 |
TheFs.RmDir(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
258 |
test_KErrNone(r); |
0 | 259 |
|
260 |
r=TheFs.SetSubst(restestname,EDriveO); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
261 |
test_KErrNone(r); |
0 | 262 |
|
263 |
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
|
264 |
test_KErrNone(r); |
0 | 265 |
|
266 |
r=TheFs.SetSubst(_L(""),EDriveO); //to unsubst |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
267 |
test_KErrNone(r); |
0 | 268 |
|
269 |
r=TheFs.SetSessionPath(restestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
270 |
test_KErrNone(r); |
0 | 271 |
|
272 |
TheFs.NotifyChange(ENotifyAll,aStat4,restestname); |
|
273 |
test(aStat4==KRequestPending); |
|
274 |
||
275 |
restestfile=KResourcePath; |
|
276 |
restestfile[0]=(TText)('A' + gTheDriveNum); |
|
277 |
restestfile1=restestfile; |
|
278 |
restestfile.Append(KFileRes); |
|
279 |
restestfile1.Append(KFileRes3); |
|
280 |
||
281 |
oldName=KOldFile; |
|
282 |
oldName[0]=(TText)gDriveToTest; |
|
283 |
||
284 |
r=TheFs.GetShortName(restestfile, shortfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
285 |
test_Value(r, r == KErrNone || r == KErrNotFound || r==KErrNotSupported); |
0 | 286 |
|
287 |
r=TheFs.GetLongName(restestfile1, longfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
288 |
test_Value(r, r == KErrNone || r == KErrNotFound || r==KErrNotSupported); |
0 | 289 |
|
290 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
291 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 292 |
file1.Close(); |
293 |
||
294 |
r=TheFs.Replace(oldName,restestfile); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
295 |
test_KErrNone(r); |
0 | 296 |
|
297 |
r=TheFs.Delete(restestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
298 |
test_Value(r, r == KErrNone || r==KErrNotFound); |
0 | 299 |
|
300 |
r=TheFs.Rename(restestfile,restestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
301 |
test_KErrNone(r); |
0 | 302 |
|
303 |
r=TheFs.Entry(restestfile1,entry); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
304 |
test_KErrNone(r); |
0 | 305 |
|
306 |
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
|
307 |
test_KErrNone(r); |
0 | 308 |
|
309 |
r=TheFs.Delete(restestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
310 |
test_KErrNone(r); |
0 | 311 |
|
312 |
||
313 |
__UHEAP_MARKEND; |
|
314 |
} |
|
315 |
||
316 |
LOCAL_C void privateRFsTest() |
|
317 |
// |
|
318 |
// |
|
319 |
// |
|
320 |
{ |
|
321 |
__UHEAP_MARK; |
|
322 |
||
323 |
//private |
|
324 |
pritestname=KPrivatePath; |
|
325 |
pritestname[0]=(TText)('A' + gTheDriveNum); |
|
326 |
||
327 |
mkdirname.Zero(); |
|
328 |
mkdirname.Append(pritestname); |
|
329 |
mkdirname.Append(KMkDirSub); |
|
330 |
||
331 |
r=TheFs.MkDirAll(mkdirname); |
|
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 |
r=TheFs.RmDir(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
335 |
test_Value(r, r == KErrPermissionDenied); |
0 | 336 |
|
337 |
r=TheFs.SetSubst(pritestname,EDriveO); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
338 |
test_Value(r, r == KErrPermissionDenied); |
0 | 339 |
|
340 |
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
|
341 |
test_KErrNone(r); |
0 | 342 |
|
343 |
r=TheFs.SetSessionPath(pritestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
344 |
test_Value(r, r == KErrPermissionDenied); |
0 | 345 |
|
346 |
TheFs.NotifyChange(ENotifyAll,aStat2,pritestname); |
|
347 |
test(aStat2==KErrPermissionDenied); |
|
348 |
||
349 |
||
350 |
pritestfile=KPrivatePath; |
|
351 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
352 |
pritestfile1=pritestfile; |
|
353 |
pritestfile.Append(KFilePri2); |
|
354 |
pritestfile1.Append(KFilePri3); |
|
355 |
||
356 |
oldName=KOldFile; |
|
357 |
oldName[0]=(TText)gDriveToTest; |
|
358 |
||
359 |
r=TheFs.GetShortName(pritestfile, shortfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
360 |
test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported); |
0 | 361 |
|
362 |
r=TheFs.GetLongName(pritestfile1, longfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
363 |
test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported); |
0 | 364 |
|
365 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
366 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 367 |
file1.Close(); |
368 |
||
369 |
r=TheFs.Replace(oldName,pritestfile); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
370 |
test_Value(r, r == KErrPermissionDenied); |
0 | 371 |
|
372 |
r=TheFs.Rename(pritestfile,pritestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
373 |
test_Value(r, r == KErrPermissionDenied); |
0 | 374 |
|
375 |
r=TheFs.Entry(pritestfile1,entry); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
376 |
test_Value(r, r == KErrPermissionDenied); |
0 | 377 |
|
378 |
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
|
379 |
test_Value(r, r == KErrPermissionDenied); |
0 | 380 |
|
381 |
r=TheFs.Delete(pritestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
382 |
test_Value(r, r == KErrPermissionDenied); |
0 | 383 |
|
384 |
||
385 |
__UHEAP_MARKEND; |
|
386 |
} |
|
387 |
||
388 |
||
389 |
LOCAL_C void privateSIDRFstest() |
|
390 |
{ |
|
391 |
__UHEAP_MARK; |
|
392 |
||
393 |
theprivatepath[0]=(TText)gDriveToTest; |
|
394 |
test.Printf(_L("the Private Path = %S"),&theprivatepath); |
|
395 |
||
396 |
mkdirname.Zero(); |
|
397 |
mkdirname.Append(theprivatepath); |
|
398 |
mkdirname.Append(KMkDirSub); |
|
399 |
r=TheFs.MkDirAll(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
400 |
test_KErrNone(r); |
0 | 401 |
|
402 |
r=TheFs.RmDir(mkdirname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
403 |
test_KErrNone(r); |
0 | 404 |
|
405 |
r=TheFs.SetSubst(theprivatepath,EDriveO); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
406 |
test_KErrNone(r); |
0 | 407 |
|
408 |
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
|
409 |
test_KErrNone(r); |
0 | 410 |
|
411 |
r=TheFs.SetSubst(_L(""),EDriveO); //to unsubst |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
412 |
test_KErrNone(r); |
0 | 413 |
|
414 |
r=TheFs.SetSessionPath(theprivatepath); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
415 |
test_KErrNone(r); |
0 | 416 |
|
417 |
TheFs.NotifyChange(ENotifyAll,aStat3,theprivatepath); |
|
418 |
test(aStat3==KRequestPending); |
|
419 |
||
420 |
pritestfile=theprivatepath; |
|
421 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
422 |
pritestfile1=pritestfile; |
|
423 |
pritestfile.Append(KFilePri2); |
|
424 |
pritestfile1.Append(KFilePri3); |
|
425 |
||
426 |
oldName=KOldFile; |
|
427 |
oldName[0]=(TText)gDriveToTest; |
|
428 |
||
429 |
r=TheFs.GetShortName(pritestfile, shortfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
430 |
test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported); |
0 | 431 |
|
432 |
r=TheFs.GetLongName(pritestfile1, longfilename); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
433 |
test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported); |
0 | 434 |
|
435 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
436 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 437 |
file1.Close(); |
438 |
||
439 |
r=TheFs.Replace(oldName,pritestfile); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
440 |
test_KErrNone(r); |
0 | 441 |
|
442 |
r=TheFs.Rename(pritestfile,pritestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
443 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 444 |
|
445 |
r=TheFs.Entry(pritestfile1,entry); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
446 |
test_KErrNone(r); |
0 | 447 |
|
448 |
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
|
449 |
test_KErrNone(r); |
0 | 450 |
|
451 |
r=TheFs.Delete(pritestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
452 |
test_KErrNone(r); |
0 | 453 |
|
454 |
__UHEAP_MARKEND; |
|
455 |
} |
|
456 |
||
457 |
||
458 |
LOCAL_C void systemRFiletest() |
|
459 |
// |
|
460 |
//RFile testing with session path set to //system// |
|
461 |
// |
|
462 |
{ |
|
463 |
__UHEAP_MARK; |
|
464 |
||
465 |
r=TheFs.SetSessionPath(systestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
466 |
test_Value(r, r == KErrPermissionDenied); |
0 | 467 |
|
468 |
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
|
469 |
test_KErrNone(r); |
0 | 470 |
file1.Close(); |
471 |
||
472 |
systestfile=KSystemPath; |
|
473 |
systestfile[0]=(TText)('A' + gTheDriveNum); |
|
474 |
systestfile1=systestfile; |
|
475 |
systestfile.Append(KFileSys); |
|
476 |
systestfile1.Append(KFileSys3); |
|
477 |
||
478 |
r=file1.Create(TheFs,systestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
479 |
test_KErrNone(r); |
0 | 480 |
file1.Close(); |
481 |
||
482 |
r=file1.Open(TheFs,systestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
483 |
test_KErrNone(r); |
0 | 484 |
file1.Close(); |
485 |
||
486 |
r=file1.Open(TheFs,systestfile,EFileRead); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
487 |
test_Value(r, r == KErrPermissionDenied); |
0 | 488 |
file1.Close(); |
489 |
||
490 |
r=file1.Replace(TheFs,systestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
491 |
test_KErrNone(r); |
0 | 492 |
|
493 |
r=file1.Rename(systestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
494 |
test_KErrNone(r); |
0 | 495 |
file1.Close(); |
496 |
||
497 |
TFindFile finder(TheFs); |
|
498 |
CDir* dir = NULL; |
|
499 |
r=finder.FindWildByDir(KWildFile, KWildPath, dir); |
|
500 |
if (!(r==KErrPermissionDenied)) |
|
501 |
test.Printf(_L("T_DCTCBDISKADMIN: 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
|
502 |
test_Value(r, r == KErrPermissionDenied); |
0 | 503 |
// delete dir; |
504 |
||
505 |
r=TheFs.Delete(fromTemp); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
506 |
test_KErrNone(r); |
0 | 507 |
|
508 |
r=TheFs.Delete(systestfile1); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
509 |
test_KErrNone(r); |
0 | 510 |
|
511 |
||
512 |
__UHEAP_MARKEND; |
|
513 |
} |
|
514 |
||
515 |
LOCAL_C void resourceRFiletest() |
|
516 |
// |
|
517 |
//RFile testing with session path set to //resource// |
|
518 |
// |
|
519 |
{ |
|
520 |
__UHEAP_MARK; |
|
521 |
||
522 |
r=TheFs.SetSessionPath(restestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
523 |
test_KErrNone(r); |
0 | 524 |
|
525 |
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
|
526 |
test_KErrNone(r); |
0 | 527 |
file1.Close(); |
528 |
||
529 |
r=file1.Create(TheFs,KFileRes,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
530 |
test_KErrNone(r); |
0 | 531 |
file1.Close(); |
532 |
||
533 |
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
|
534 |
test_KErrNone(r); |
0 | 535 |
|
536 |
r=file1.Rename(KFileRes3); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
537 |
test_KErrNone(r); |
0 | 538 |
file1.Close(); |
539 |
||
540 |
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
|
541 |
test_KErrNone(r); |
0 | 542 |
file1.Close(); |
543 |
||
544 |
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
|
545 |
test_KErrNone(r); |
0 | 546 |
file1.Close(); |
547 |
||
548 |
r=file1.Open(TheFs,KFileRes3,EFileShareReadersOnly); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
549 |
test_KErrNone(r); |
0 | 550 |
|
551 |
r=file1.ChangeMode(EFileShareExclusive); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
552 |
test_KErrNone(r); |
0 | 553 |
file1.Close(); |
554 |
||
555 |
r=file1.Replace(TheFs,KFileRes,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
556 |
test_KErrNone(r); |
0 | 557 |
file1.Close(); |
558 |
||
559 |
r=TheFs.Delete(KFileRes); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
560 |
test_KErrNone(r); |
0 | 561 |
|
562 |
r=TheFs.Delete(KFileRes3); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
563 |
test_KErrNone(r); |
0 | 564 |
|
565 |
r=TheFs.Delete(fromTemp); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
566 |
test_KErrNone(r); |
0 | 567 |
|
568 |
__UHEAP_MARKEND; |
|
569 |
} |
|
570 |
||
571 |
||
572 |
LOCAL_C void privatefalseIDRFiletest() |
|
573 |
// |
|
574 |
//RFile testing with session path set to //Private//<false ID>// |
|
575 |
// |
|
576 |
{ |
|
577 |
__UHEAP_MARK; |
|
578 |
||
579 |
r=TheFs.SetSessionPath(pritestfalseidname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
580 |
test_Value(r, r == KErrPermissionDenied); |
0 | 581 |
|
582 |
// Since can't set the session path to what is required, so use |
|
583 |
// an explicit path |
|
584 |
pritestfile=pritestfalseidname; |
|
585 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
586 |
pritestfile.Append(KFilePri); |
|
587 |
||
588 |
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
|
589 |
test_Value(r, r == KErrPermissionDenied); |
0 | 590 |
file1.Close(); |
591 |
||
592 |
r=file1.Create(TheFs,pritestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
593 |
test_Value(r, r == KErrPermissionDenied); |
0 | 594 |
file1.Close(); |
595 |
||
596 |
r=file1.Open(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.Replace(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 |
|
603 |
// Can't perform this operation since file1 has not been created |
|
604 |
/* r=file1.Rename(KFilePri3); |
|
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 |
__UHEAP_MARKEND; |
|
609 |
} |
|
610 |
||
611 |
||
612 |
||
613 |
LOCAL_C void privateRFiletest() |
|
614 |
// |
|
615 |
//RFile testing with session path set to //Private// |
|
616 |
// |
|
617 |
{ |
|
618 |
__UHEAP_MARK; |
|
619 |
||
620 |
r=TheFs.SetSessionPath(pritestname); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
621 |
test_Value(r, r == KErrPermissionDenied); |
0 | 622 |
|
623 |
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
|
624 |
test_Value(r, r == KErrPermissionDenied); |
0 | 625 |
file1.Close(); |
626 |
||
627 |
// Since can't set session path create explicit path |
|
628 |
pritestfile=KPrivatePath; |
|
629 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
630 |
pritestfile.Append(KFilePri); |
|
631 |
||
632 |
r=file1.Create(TheFs,pritestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
633 |
test_Value(r, r == KErrPermissionDenied); |
0 | 634 |
file1.Close(); |
635 |
||
636 |
r=file1.Open(TheFs,pritestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
637 |
test_Value(r, r == KErrPermissionDenied); |
0 | 638 |
file1.Close(); |
639 |
||
640 |
r=file1.Open(TheFs,pritestfile,EFileRead); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
641 |
test_Value(r, r == KErrPermissionDenied); |
0 | 642 |
file1.Close(); |
643 |
||
644 |
r=file1.Replace(TheFs,pritestfile,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
645 |
test_Value(r, r == KErrPermissionDenied); |
0 | 646 |
|
647 |
// Can't rename nor delete since file1 not created |
|
648 |
/* |
|
649 |
r=file1.Rename(KFilePri3); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
650 |
test_Value(r, r == KErrPermissionDenied); |
0 | 651 |
file1.Close(); |
652 |
||
653 |
r=TheFs.Delete(fromTemp); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
654 |
test_KErrNone(r); |
0 | 655 |
*/ |
656 |
||
657 |
__UHEAP_MARKEND; |
|
658 |
} |
|
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 |
||
669 |
r=TheFs.SetSessionToPrivate(gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
670 |
test_KErrNone(r); |
0 | 671 |
|
672 |
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
|
673 |
test_KErrNone(r); |
0 | 674 |
file1.Close(); |
675 |
||
676 |
r=file1.Create(TheFs,KFilePri,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
677 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 678 |
file1.Close(); |
679 |
||
680 |
r=file1.Open(TheFs,KFilePri,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
681 |
test_KErrNone(r); |
0 | 682 |
file1.Close(); |
683 |
||
684 |
r=file1.Open(TheFs,KFilePri,EFileRead); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
685 |
test_KErrNone(r); |
0 | 686 |
file1.Close(); |
687 |
||
688 |
r=file1.Replace(TheFs,KFilePri,EFileWrite); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
689 |
test_KErrNone(r); |
0 | 690 |
|
691 |
r=file1.Rename(KFilePri3); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
692 |
test_KErrNone(r); |
0 | 693 |
file1.Close(); |
694 |
||
695 |
r=TheFs.Delete(KFilePri3); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
696 |
test_KErrNone(r); |
0 | 697 |
|
698 |
r=TheFs.Delete(fromTemp); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
699 |
test_KErrNone(r); |
0 | 700 |
|
701 |
__UHEAP_MARKEND; |
|
702 |
} |
|
703 |
||
704 |
LOCAL_C void RDirtest() |
|
705 |
// |
|
706 |
// |
|
707 |
// |
|
708 |
{ |
|
709 |
__UHEAP_MARK; |
|
710 |
||
711 |
||
712 |
//system |
|
713 |
CDir* dirEntries; |
|
714 |
TBuf<30> dirNameBuf(KSystemPath); |
|
715 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
716 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
717 |
test_Value(r, r == KErrPermissionDenied); |
0 | 718 |
dir.Close(); |
719 |
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
|
720 |
test_Value(r, r == KErrPermissionDenied); |
0 | 721 |
dirNameBuf.Zero(); |
722 |
delete dirEntries; |
|
723 |
||
724 |
//Private |
|
725 |
dirNameBuf=KPrivatePath; |
|
726 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
727 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
728 |
test_Value(r, r == KErrPermissionDenied); |
0 | 729 |
dir.Close(); |
730 |
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
|
731 |
test_Value(r, r == KErrPermissionDenied); |
0 | 732 |
dirNameBuf.Zero(); |
733 |
delete dirEntries; |
|
734 |
||
735 |
//Private//<wrong ID>// |
|
736 |
dirNameBuf=KPrivateFalseID; |
|
737 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
738 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
739 |
test_Value(r, r == KErrPermissionDenied); |
0 | 740 |
dir.Close(); |
741 |
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
|
742 |
test_Value(r, r == KErrPermissionDenied); |
0 | 743 |
dirNameBuf.Zero(); |
744 |
delete dirEntries; |
|
745 |
||
746 |
//Private/uid |
|
747 |
TheFs.PrivatePath(dirNameBuf); |
|
748 |
dirNameBuf.Insert(0,_L("?:")); |
|
749 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
750 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
751 |
test_KErrNone(r); |
0 | 752 |
dir.Close(); |
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 |
dirNameBuf.Zero(); |
756 |
delete dirEntries; |
|
757 |
//Resource |
|
758 |
||
759 |
dirNameBuf=KResourcePath; |
|
760 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
761 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
762 |
test_KErrNone(r); |
0 | 763 |
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
|
764 |
test_KErrNone(r); |
0 | 765 |
dir.Close(); |
766 |
delete dirEntries; |
|
767 |
||
768 |
__UHEAP_MARKEND; |
|
769 |
} |
|
770 |
||
771 |
||
772 |
LOCAL_C void TestTcbDiskAdmin() |
|
773 |
// |
|
774 |
// Test with tcb capabilities |
|
775 |
// |
|
776 |
{ |
|
777 |
__UHEAP_MARK; |
|
778 |
||
779 |
r=TheFs.FileSystemName(fsname,gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
780 |
test_KErrNone(r); |
0 | 781 |
r = DismountFileSystem(TheFs, fsname, gTheDriveNum); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
782 |
test_Value(r, r == KErrNone || r==KErrNotFound); |
0 | 783 |
// r=TheFs.RemoveFileSystem(fsname); //can not test due to bug else where fix exists |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
784 |
// test_KErrNone(r); |
0 | 785 |
// r=TheFs.AddFileSystem(fsname); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
786 |
// test_KErrNone(r); |
0 | 787 |
r = MountFileSystem(TheFs, fsname, gTheDriveNum); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
788 |
test_KErrNone(r); |
0 | 789 |
r=TheFs.SetDriveName(gTheDriveNum,KDriveName); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
790 |
test_KErrNone(r); |
0 | 791 |
#ifndef __WINS__ |
792 |
r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
793 |
test_KErrNone(r); |
0 | 794 |
#endif |
795 |
||
796 |
systemRFsTest(); |
|
797 |
ResourceRFsTest(); |
|
798 |
privateRFsTest(); |
|
799 |
privateSIDRFstest(); |
|
800 |
privateFalseIDRFsTest(); |
|
801 |
||
802 |
systemRFiletest(); |
|
803 |
resourceRFiletest(); |
|
804 |
privateRFiletest(); |
|
805 |
privateSIDRFiletest(); |
|
806 |
privatefalseIDRFiletest(); |
|
807 |
||
808 |
//check notifier return values set in rfs testing |
|
809 |
User::WaitForRequest(aStat1); |
|
810 |
User::WaitForRequest(aStat2); |
|
811 |
User::WaitForRequest(aStat3); |
|
812 |
User::WaitForRequest(aStat4); |
|
813 |
test(aStat1==KErrPermissionDenied); |
|
814 |
test(aStat2==KErrPermissionDenied); |
|
815 |
test(aStat3==KErrNone); |
|
816 |
test(aStat4==KErrNone); |
|
817 |
||
818 |
r=TheFs.SetSessionPath(systestname); |
|
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 |
//Test RRawDisk class |
|
822 |
r=rawdisk.Open(TheFs,gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
823 |
test_KErrNone(r); |
0 | 824 |
rawdisk.Close(); |
825 |
||
826 |
RDirtest(); |
|
827 |
||
828 |
#ifdef __WINS__ |
|
829 |
if (User::UpperCase(driveBuf[0]) != 'C') |
|
830 |
#endif |
|
831 |
{ |
|
832 |
//Test RFormat class |
|
833 |
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
|
834 |
test_KErrNone(r); |
0 | 835 |
|
836 |
while(count) |
|
837 |
{ |
|
838 |
TInt r=format.Next(count); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
839 |
test_KErrNone(r); |
0 | 840 |
} |
841 |
format.Close(); |
|
842 |
} |
|
843 |
||
844 |
driveBuf[0]=(TText)gDriveToTest; |
|
845 |
r=TheFs.ScanDrive(driveBuf); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
846 |
test_Value(r, r == KErrNone || r==KErrNotSupported); |
0 | 847 |
r=TheFs.CheckDisk(driveBuf); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
848 |
test_Value(r, r == KErrNone || r==KErrNotSupported); |
0 | 849 |
|
850 |
__UHEAP_MARKEND; |
|
851 |
} |
|
852 |
||
853 |
LOCAL_C void TestCaps() |
|
854 |
// |
|
855 |
// test format etc that require certain capabilities |
|
856 |
// |
|
857 |
{ |
|
858 |
||
859 |
__UHEAP_MARK; |
|
860 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
861 |
const char myDiagMsg[] = "Capability Check Failure"; |
|
862 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
863 |
r=RProcess().HasCapability(ECapabilityTCB,ECapabilityDiskAdmin, __PLATSEC_DIAGNOSTIC_STRING(myDiagMsg)); |
|
864 |
test(r); |
|
865 |
||
866 |
driveBuf[0]=(TText)gDriveToTest; |
|
867 |
r=TheFs.SessionPath(temp); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
868 |
test_KErrNone(r); |
0 | 869 |
|
870 |
test.Printf(_L("Session path: %S"),&temp); |
|
871 |
||
872 |
r=TheFs.CreatePrivatePath(gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
873 |
test_Value(r, r == KErrNone || r== KErrAlreadyExists); |
0 | 874 |
|
875 |
TBuf<18> tempPri; |
|
876 |
r=TheFs.PrivatePath(tempPri); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
877 |
test_KErrNone(r); |
0 | 878 |
theprivatepath = _L("?:"); |
879 |
theprivatepath.Append(tempPri); |
|
880 |
||
881 |
TestTcbDiskAdmin(); |
|
882 |
||
883 |
TFileName thesessionpath; |
|
884 |
||
885 |
r=TheFs.SetSessionToPrivate(gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
886 |
test_KErrNone(r); |
0 | 887 |
r=TheFs.SessionPath(thesessionpath); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
888 |
test_KErrNone(r); |
0 | 889 |
|
890 |
test(thesessionpath == theprivatepath); |
|
891 |
||
892 |
__UHEAP_MARKEND; |
|
893 |
} |
|
894 |
||
895 |
LOCAL_C void CleanupL() |
|
896 |
// |
|
897 |
// Clean up tests |
|
898 |
// |
|
899 |
{ |
|
900 |
test.Next(_L("Delete test directory")); |
|
901 |
CFileMan* fMan=CFileMan::NewL(TheFs); |
|
902 |
TInt r=fMan->RmDir(gSessionPath); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
903 |
test_Value(r, r == KErrNone || r==KErrPathNotFound); |
0 | 904 |
|
905 |
TBuf<20> delDir; |
|
906 |
delDir=KResourcePath; |
|
907 |
delDir[0]=(TText)gDriveToTest; |
|
908 |
r=fMan->RmDir(delDir); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
909 |
test_Value(r, r == KErrNone || r==KErrPathNotFound); |
0 | 910 |
delete fMan; |
911 |
||
912 |
delDir=KSystemPath; |
|
913 |
delDir[0]=(TText)gDriveToTest; |
|
914 |
r=TheFs.RmDir(delDir); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
915 |
test_Value(r, r == KErrNone || r==KErrPathNotFound || r==KErrNotFound); |
0 | 916 |
} |
917 |
||
918 |
GLDEF_C void CallTestsL(/*TChar aDriveLetter*/) |
|
919 |
// |
|
920 |
// Do all tests |
|
921 |
// |
|
922 |
{ |
|
923 |
if( !PlatSec::IsCapabilityEnforced(ECapabilityTCB) || |
|
924 |
!PlatSec::IsCapabilityEnforced(ECapabilityDiskAdmin)) |
|
925 |
{ |
|
926 |
test.Printf(_L("Insufficient capabilities enabled - leaving t_dctcbdiskadmin")); |
|
927 |
test.Printf(_L("\n")); // Prevent overwrite by next print |
|
928 |
return; |
|
929 |
} |
|
930 |
||
931 |
__UHEAP_MARK; |
|
932 |
||
933 |
TurnAllocFailureOff(); |
|
934 |
||
935 |
TheFs.CharToDrive(gDriveToTest,gTheDriveNum); |
|
936 |
||
937 |
TBuf<30> sesspath; |
|
938 |
sesspath=_L("?:\\"); |
|
939 |
sesspath[0] = (TText)gDriveToTest; |
|
940 |
||
941 |
TInt r= TheFs.SetSessionPath(sesspath); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
942 |
test_KErrNone(r); |
0 | 943 |
|
944 |
//cleanup from previous run of this test |
|
945 |
RProcess tp; |
|
946 |
r=tp.Create(_L("clean_prepdc.exe"),sesspath); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
947 |
test_KErrNone(r); |
0 | 948 |
{ |
949 |
TRequestStatus ps; |
|
950 |
tp.Logon(ps); |
|
951 |
tp.Resume(); |
|
952 |
tp.Close(); |
|
953 |
User::WaitForRequest(ps); |
|
954 |
} |
|
955 |
||
956 |
//check double mode ie that Defpath still works |
|
957 |
RFs fs1; |
|
958 |
RFs fs2; |
|
959 |
||
960 |
r=fs1.Connect(); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
961 |
test_KErrNone(r); |
0 | 962 |
r=fs1.SessionPath(sesspath); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
963 |
test_KErrNone(r); |
0 | 964 |
test.Printf(_L("session1 Path=%S"),&sesspath); |
965 |
||
966 |
TBuf<30> privatepath; |
|
967 |
r=fs1.SetSessionToPrivate(gTheDriveNum); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
968 |
test_KErrNone(r); |
0 | 969 |
r=fs1.PrivatePath(privatepath); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
970 |
test_KErrNone(r); |
0 | 971 |
r=privatepath.Compare(KExpectedPrivatePath()); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
972 |
test_Value(r, r == 0); |
0 | 973 |
r=fs1.SessionPath(sesspath); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
974 |
test_KErrNone(r); |
0 | 975 |
r=privatepath.Compare(sesspath.Mid(KPathPosition)); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
976 |
test_Value(r, r == 0); |
0 | 977 |
r=fs1.CreatePrivatePath(gTheDriveNum); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
978 |
test_KErrNone(r); |
0 | 979 |
fs1.Close(); |
980 |
||
981 |
r=fs2.Connect(); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
982 |
test_KErrNone(r); |
0 | 983 |
r=fs2.SessionPath(sesspath); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
984 |
test_KErrNone(r); |
0 | 985 |
test.Printf(_L("session2 Path=%S"),&sesspath); |
986 |
fs2.Close(); |
|
987 |
||
988 |
__UHEAP_MARK; |
|
989 |
TestCaps(); |
|
990 |
__UHEAP_MARKEND; |
|
991 |
||
992 |
test.Printf(_L("No of files open=%d"), TheFs.ResourceCount()); |
|
993 |
||
994 |
CleanupL(); |
|
995 |
__UHEAP_MARKEND; |
|
996 |
||
997 |
} |