author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 31 Aug 2010 16:34:26 +0300 | |
branch | RCL_3 |
changeset 256 | c1f20ce4abcf |
parent 0 | a41df078684a |
child 257 | 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 |
// f32test\server\t_dcdiskadmin.cpp |
|
15 |
// |
|
16 |
// |
|
17 |
||
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
18 |
#define __E32TEST_EXTENSION__ |
0 | 19 |
#include <f32file.h> |
20 |
#include <e32test.h> |
|
21 |
#include <e32std.h> |
|
22 |
#include <e32std_private.h> |
|
23 |
#include <e32svr.h> |
|
24 |
#include "t_server.h" |
|
25 |
||
26 |
GLDEF_D RTest test(_L("T_DCDiskadmin")); |
|
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 |
TInt theDrive=0; |
|
51 |
TCapability TheCaps; |
|
52 |
TBuf<4> driveBuf=_L("?:\\"); |
|
53 |
RFormat format; |
|
54 |
TInt count; |
|
55 |
RRawDisk rawdisk; |
|
56 |
RFile file1; |
|
57 |
RFile file2; |
|
58 |
RDir dir; |
|
59 |
CDir* dirEntries; |
|
60 |
TInt r; |
|
61 |
TBuf<40> fsname; |
|
62 |
TBuf<40> systestname; |
|
63 |
TBuf<40> pritestname; |
|
64 |
TBuf<40> restestname; |
|
65 |
TBuf<40> theprivatepath; |
|
66 |
TBuf<40> pritestfalseidname; |
|
67 |
TBuf<40> mkdirname; |
|
68 |
TFileName fromTemp; |
|
69 |
||
70 |
TBuf<40> shortfilename; |
|
71 |
TBuf<40> longfilename; |
|
72 |
||
73 |
TBuf<30> dirNameBuf; |
|
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 |
TBuf<30> realName; |
|
86 |
TTime testtime; |
|
87 |
TBuf<20> oldName; |
|
88 |
||
89 |
TBuf<25> temp; |
|
90 |
||
91 |
TEntry entry; |
|
92 |
||
93 |
||
94 |
||
95 |
LOCAL_C void systemRFstest() |
|
96 |
// |
|
97 |
// |
|
98 |
// |
|
99 |
{ |
|
100 |
||
101 |
//system |
|
102 |
systestname=KSystemPath; |
|
103 |
systestname[0]=(TText)('A' + gTheDriveNum); |
|
104 |
||
105 |
mkdirname.Zero(); |
|
106 |
mkdirname.Append(systestname); |
|
107 |
mkdirname.Append(KMkDirSub); |
|
108 |
r=TheFs.MkDirAll(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
109 |
test_Value(r, r == KErrPermissionDenied); |
0 | 110 |
|
111 |
r=TheFs.RmDir(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
112 |
test_Value(r, r == KErrPermissionDenied); |
0 | 113 |
|
114 |
r=TheFs.SetSubst(systestname,EDriveS); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
115 |
test_Value(r, r == KErrPermissionDenied); |
0 | 116 |
|
117 |
r=TheFs.SetSessionPath(systestname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
118 |
test_Value(r, r == KErrPermissionDenied); |
0 | 119 |
|
120 |
TheFs.NotifyChange(ENotifyAll,aStat1,systestname); |
|
121 |
test(aStat1==KErrPermissionDenied); |
|
122 |
||
123 |
systestfile=KSystemPath; |
|
124 |
systestfile[0]=(TText)('A' + gTheDriveNum); |
|
125 |
systestfile1=systestfile; |
|
126 |
systestfile.Append(KFileSys); |
|
127 |
systestfile1.Append(KFileSys3); |
|
128 |
||
129 |
oldName=KOldFile; |
|
130 |
oldName[0]=(TText)gDriveToTest; |
|
131 |
||
132 |
r=TheFs.GetShortName(systestfile, shortfilename); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
133 |
test_Value(r, r == KErrPermissionDenied); |
0 | 134 |
|
135 |
r=TheFs.GetLongName(systestfile1, longfilename); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
136 |
test_Value(r, r == KErrPermissionDenied); |
0 | 137 |
|
138 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
139 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 140 |
file1.Close(); |
141 |
||
142 |
r=TheFs.Replace(oldName,systestfile); |
|
256
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.Rename(systestfile,systestfile1); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
146 |
test_Value(r, r == KErrPermissionDenied); |
0 | 147 |
|
148 |
r=TheFs.Entry(systestfile1,entry); |
|
256
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 |
r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
152 |
test_Value(r, r == KErrPermissionDenied); |
0 | 153 |
|
154 |
r=TheFs.Delete(systestfile1); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
155 |
test_Value(r, r == KErrPermissionDenied); |
0 | 156 |
|
157 |
||
158 |
// DEF141257: Security Issue in File Server |
|
159 |
// Test that we can't access the system drive by preceding it with a dot character |
|
160 |
_LIT(KSystemPathDot, "?:\\.Sys\\"); |
|
161 |
||
162 |
// try creating a file in "\.SYS"... |
|
163 |
TBuf<40> SysTestFileDot; |
|
164 |
SysTestFileDot=KSystemPathDot; |
|
165 |
SysTestFileDot[0]=(TText)('A' + gTheDriveNum); |
|
166 |
SysTestFileDot.Append(KFileSys); |
|
167 |
RFile file; |
|
168 |
r = file.Replace(TheFs, SysTestFileDot, EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
169 |
test_Value(r, r == KErrPathNotFound); |
0 | 170 |
|
171 |
// try creating a subst drive for "\.SYS"... |
|
172 |
TBuf<40> SysTestNameDot; |
|
173 |
SysTestNameDot=KSystemPathDot; |
|
174 |
SysTestNameDot[0]=(TText)('A' + gTheDriveNum); |
|
175 |
r=TheFs.SetSubst(SysTestNameDot,EDriveA); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
176 |
test_KErrNone(r); |
0 | 177 |
|
178 |
// try creating a file using substituted drive... |
|
179 |
TBuf<40> SubstTestFile = _L("A:\\"); |
|
180 |
SubstTestFile.Append(KFileSys); |
|
181 |
||
182 |
r = file.Replace(TheFs, SubstTestFile, EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
183 |
test_Value(r, r == KErrPathNotFound); |
0 | 184 |
|
185 |
r = TheFs.SetSubst(_L(""),EDriveA); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
186 |
test_KErrNone(r); |
0 | 187 |
|
188 |
||
189 |
||
190 |
// try listing files in "\.SYS" |
|
191 |
_LIT(KWildPathDot, "Z:\\.SYS\\"); |
|
192 |
TFindFile finder(TheFs); |
|
193 |
CDir* dir = NULL; |
|
194 |
r=finder.FindWildByDir(KWildFile, KWildPathDot, dir); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
195 |
test_Value(r, r == KErrNotFound); |
0 | 196 |
delete dir; |
197 |
||
198 |
// Deliberately create a directory called "\.SYS" |
|
199 |
// and verify shortname is NOT the same as "SYS" |
|
200 |
mkdirname.Zero(); |
|
201 |
mkdirname.Append(KSystemPathDot); |
|
202 |
mkdirname[0]=(TText)('A' + gTheDriveNum); |
|
203 |
r=TheFs.MkDirAll(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
204 |
test_KErrNone(r); |
0 | 205 |
|
206 |
r=TheFs.GetShortName(mkdirname, shortfilename); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
207 |
test_Value(r, r == KErrNone || r==KErrNotSupported); // short names not supported on LFFS |
0 | 208 |
// r = shortfilename.Compare(_L("SYS~1")); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
209 |
// test_KErrNone(r); |
0 | 210 |
r = shortfilename.Compare(_L("SYS")); |
211 |
test (r != 0); |
|
212 |
||
213 |
r = TheFs.RmDir(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
214 |
test_KErrNone(r); |
0 | 215 |
|
216 |
// Deliberately create a directory called "\..SYS" |
|
217 |
// and verify shortname is NOT the same as "SYS" |
|
218 |
_LIT(KSystemPathDotDot, "?:\\..Sys\\"); |
|
219 |
mkdirname.Zero(); |
|
220 |
mkdirname.Append(KSystemPathDotDot); |
|
221 |
mkdirname[0]=(TText)('A' + gTheDriveNum); |
|
222 |
r=TheFs.MkDirAll(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
223 |
test_KErrNone(r); |
0 | 224 |
|
225 |
r=TheFs.GetShortName(mkdirname, shortfilename); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
226 |
test_Value(r, r == KErrNone || r==KErrNotSupported); // short names not supported on LFFS |
0 | 227 |
// r = shortfilename.Compare(_L("_.SYS")); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
228 |
// test_KErrNone(r); |
0 | 229 |
r = shortfilename.Compare(_L("SYS")); |
230 |
test (r != 0); |
|
231 |
||
232 |
r = TheFs.RmDir(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
233 |
test_KErrNone(r); |
0 | 234 |
} |
235 |
||
236 |
||
237 |
LOCAL_C void resourceRFstest() |
|
238 |
// |
|
239 |
// |
|
240 |
// |
|
241 |
{ |
|
242 |
//resource |
|
243 |
restestname=KResourcePath; |
|
244 |
restestname[0]=(TText)('A' + gTheDriveNum); |
|
245 |
||
246 |
mkdirname.Zero(); |
|
247 |
mkdirname.Append(restestname); |
|
248 |
mkdirname.Append(KMkDirSub); |
|
249 |
r=TheFs.MkDirAll(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
250 |
test_Value(r, r == KErrPermissionDenied); |
0 | 251 |
|
252 |
TheFs.RmDir(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
253 |
test_Value(r, r == KErrPermissionDenied); |
0 | 254 |
|
255 |
// Change due to defect DEF099546 fix |
|
256 |
// TCB capability is required for following operation. |
|
257 |
r=TheFs.SetSubst(restestname,EDriveS); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
258 |
//test_KErrNone(r); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
259 |
test_Value(r, r == KErrPermissionDenied); |
0 | 260 |
|
261 |
// SetSubst will fail. |
|
262 |
//r=TheFs.RealName(_L("S:\\File.XXX"),realName); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
263 |
//test_KErrNone(r); |
0 | 264 |
|
265 |
//r=TheFs.SetSubst(_L(""),EDriveS); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
266 |
//test_KErrNone(r); |
0 | 267 |
|
268 |
r=TheFs.SetSessionPath(restestname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
269 |
test_KErrNone(r); |
0 | 270 |
|
271 |
TheFs.NotifyChange(ENotifyAll,aStat4,restestname); |
|
272 |
test(aStat4==KRequestPending); |
|
273 |
||
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); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
285 |
test(r == KErrNone || KErrPathNotFound); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
286 |
// test_Value(r, r == KErrNone || r == KErrPathNotFound); |
0 | 287 |
|
288 |
r=TheFs.GetLongName(restestfile1, longfilename); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
289 |
test(r == KErrNone || KErrPathNotFound); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
290 |
// test_Value(r, r == KErrNone || r == KErrPathNotFound); |
0 | 291 |
|
292 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
293 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 294 |
file1.Close(); |
295 |
||
296 |
r=TheFs.Replace(oldName,restestfile); |
|
256
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 |
r=TheFs.Rename(restestfile,restestfile1); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
300 |
test_Value(r, r == KErrPermissionDenied); |
0 | 301 |
|
302 |
r=TheFs.Entry(restestfile1,entry); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
303 |
test(r == KErrNone || KErrPathNotFound); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
304 |
// test_Value(r, r == KErrNone || r == KErrPathNotFound); |
0 | 305 |
|
306 |
r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
307 |
test_Value(r, r == KErrPermissionDenied); |
0 | 308 |
|
309 |
r=TheFs.Delete(restestfile1); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
310 |
test_Value(r, r == KErrPermissionDenied); |
0 | 311 |
} |
312 |
||
313 |
||
314 |
LOCAL_C void privateFalseIDRFstest() |
|
315 |
// |
|
316 |
// |
|
317 |
// |
|
318 |
{ |
|
319 |
pritestfalseidname=KPrivateFalseID; |
|
320 |
pritestfalseidname[0]=(TText)('A' + gTheDriveNum); |
|
321 |
||
322 |
mkdirname.Zero(); |
|
323 |
mkdirname.Append(pritestfalseidname); |
|
324 |
mkdirname.Append(KMkDirSub); |
|
325 |
||
326 |
r=TheFs.MkDirAll(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
327 |
test_Value(r, r == KErrPermissionDenied); |
0 | 328 |
|
329 |
r=TheFs.RmDir(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
330 |
test_Value(r, r == KErrPermissionDenied); |
0 | 331 |
|
332 |
r=TheFs.SetSubst(pritestfalseidname,EDriveS); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
333 |
test_Value(r, r == KErrPermissionDenied); |
0 | 334 |
|
335 |
r=TheFs.SetSessionPath(pritestfalseidname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
336 |
test_Value(r, r == KErrPermissionDenied); |
0 | 337 |
|
338 |
TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname); |
|
339 |
test(aStat2==KErrPermissionDenied); |
|
340 |
||
341 |
pritestfile=KPrivateFalseID; |
|
342 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
343 |
pritestfile1=pritestfile; |
|
344 |
pritestfile.Append(KFilePri2); |
|
345 |
pritestfile1.Append(KFilePri3); |
|
346 |
||
347 |
oldName=KOldFile; |
|
348 |
oldName[0]=(TText)gDriveToTest; |
|
349 |
||
350 |
r=TheFs.GetShortName(pritestfile, shortfilename); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
351 |
test_Value(r, r == KErrPermissionDenied); |
0 | 352 |
|
353 |
r=TheFs.GetLongName(pritestfile1, longfilename); |
|
256
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=file1.Create(TheFs,oldName,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
357 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 358 |
file1.Close(); |
359 |
||
360 |
r=TheFs.Replace(oldName,pritestfile); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
361 |
test_Value(r, r == KErrPermissionDenied); |
0 | 362 |
|
363 |
r=TheFs.Rename(pritestfile,pritestfile1); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
364 |
test_Value(r, r == KErrPermissionDenied); |
0 | 365 |
|
366 |
r=TheFs.Entry(pritestfile1,entry); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
367 |
test_Value(r, r == KErrPermissionDenied); |
0 | 368 |
|
369 |
r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
|
256
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.Delete(pritestfile1); |
|
256
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 |
} |
|
376 |
||
377 |
||
378 |
||
379 |
LOCAL_C void privateRFstest() |
|
380 |
// |
|
381 |
// |
|
382 |
// |
|
383 |
{ |
|
384 |
//private |
|
385 |
pritestname=KPrivatePath; |
|
386 |
pritestname[0]=(TText)('A' + gTheDriveNum); |
|
387 |
||
388 |
mkdirname.Zero(); |
|
389 |
mkdirname.Append(pritestname); |
|
390 |
mkdirname.Append(KMkDirSub); |
|
391 |
||
392 |
r=TheFs.MkDirAll(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
393 |
test_Value(r, r == KErrPermissionDenied); |
0 | 394 |
|
395 |
r=TheFs.RmDir(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
396 |
test_Value(r, r == KErrPermissionDenied); |
0 | 397 |
|
398 |
r=TheFs.SetSubst(pritestname,EDriveS); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
399 |
test_Value(r, r == KErrPermissionDenied); |
0 | 400 |
|
401 |
r=TheFs.SetSessionPath(pritestname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
402 |
test_Value(r, r == KErrPermissionDenied); |
0 | 403 |
|
404 |
TheFs.NotifyChange(ENotifyAll,aStat2,pritestname); |
|
405 |
test(aStat2==KErrPermissionDenied); |
|
406 |
||
407 |
pritestfile=KPrivatePath; |
|
408 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
409 |
pritestfile1=pritestfile; |
|
410 |
pritestfile.Append(KFilePri2); |
|
411 |
pritestfile1.Append(KFilePri3); |
|
412 |
||
413 |
oldName=KOldFile; |
|
414 |
oldName[0]=(TText)gDriveToTest; |
|
415 |
||
416 |
r=TheFs.GetShortName(pritestfile, shortfilename); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
417 |
test_Value(r, r == KErrPermissionDenied); |
0 | 418 |
|
419 |
r=TheFs.GetLongName(pritestfile1, longfilename); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
420 |
test_Value(r, r == KErrPermissionDenied); |
0 | 421 |
|
422 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
423 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 424 |
file1.Close(); |
425 |
||
426 |
r=TheFs.Replace(oldName,pritestfile); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
427 |
test_Value(r, r == KErrPermissionDenied); |
0 | 428 |
|
429 |
r=TheFs.Rename(pritestfile,pritestfile1); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
430 |
test_Value(r, r == KErrPermissionDenied); |
0 | 431 |
|
432 |
r=TheFs.Entry(pritestfile1,entry); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
433 |
test_Value(r, r == KErrPermissionDenied); |
0 | 434 |
|
435 |
r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
436 |
test_Value(r, r == KErrPermissionDenied); |
0 | 437 |
|
438 |
r=TheFs.Delete(pritestfile1); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
439 |
test_Value(r, r == KErrPermissionDenied); |
0 | 440 |
|
441 |
} |
|
442 |
||
443 |
||
444 |
LOCAL_C void privateSIDRFstest() |
|
445 |
// |
|
446 |
// |
|
447 |
// |
|
448 |
{ |
|
449 |
//private/UID |
|
450 |
theprivatepath[0]=(TText)gDriveToTest; |
|
451 |
test.Printf(_L("the Private Path = %S"),&theprivatepath); |
|
452 |
||
453 |
mkdirname.Zero(); |
|
454 |
mkdirname.Append(theprivatepath); |
|
455 |
mkdirname.Append(KMkDirSub); |
|
456 |
r=TheFs.MkDirAll(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
457 |
test_KErrNone(r); |
0 | 458 |
|
459 |
r=TheFs.RmDir(mkdirname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
460 |
test_KErrNone(r); |
0 | 461 |
|
462 |
r=TheFs.SetSubst(theprivatepath,EDriveS); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
463 |
test_KErrNone(r); |
0 | 464 |
|
465 |
r=TheFs.RealName(_L("S:\\File.XXX"),realName); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
466 |
test_KErrNone(r); |
0 | 467 |
|
468 |
r=TheFs.SetSubst(_L(""),EDriveS); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
469 |
test_KErrNone(r); |
0 | 470 |
|
471 |
r=TheFs.SetSessionPath(theprivatepath); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
472 |
test_KErrNone(r); |
0 | 473 |
|
474 |
TheFs.NotifyChange(ENotifyAll,aStat3,theprivatepath); |
|
475 |
test(aStat3==KRequestPending); |
|
476 |
||
477 |
pritestfile=theprivatepath; |
|
478 |
pritestfile[0]=(TText)('A' + gTheDriveNum); |
|
479 |
pritestfile1=pritestfile; |
|
480 |
pritestfile.Append(KFilePri2); |
|
481 |
pritestfile1.Append(KFilePri3); |
|
482 |
||
483 |
oldName=KOldFile; |
|
484 |
oldName[0]=(TText)gDriveToTest; |
|
485 |
||
486 |
r=TheFs.GetShortName(pritestfile, shortfilename); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
487 |
test(r == KErrNone || KErrPathNotFound); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
488 |
// test_Value(r, r == KErrNone || r == KErrPathNotFound); |
0 | 489 |
|
490 |
r=TheFs.GetLongName(pritestfile1, longfilename); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
491 |
test(r == KErrNone || KErrPathNotFound); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
492 |
// test_Value(r, r == KErrNone || r == KErrPathNotFound); |
0 | 493 |
|
494 |
r=file1.Create(TheFs,oldName,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
495 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 496 |
file1.Close(); |
497 |
||
498 |
r=TheFs.Replace(oldName,pritestfile); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
499 |
test_KErrNone(r); |
0 | 500 |
|
501 |
r=TheFs.Rename(pritestfile,pritestfile1); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
502 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 503 |
|
504 |
r=TheFs.Entry(pritestfile1,entry); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
505 |
test_KErrNone(r); |
0 | 506 |
|
507 |
r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
508 |
test_KErrNone(r); |
0 | 509 |
|
510 |
r=TheFs.Delete(pritestfile1); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
511 |
test_KErrNone(r); |
0 | 512 |
} |
513 |
||
514 |
LOCAL_C void systemRFiletest() |
|
515 |
// |
|
516 |
// |
|
517 |
// |
|
518 |
{ |
|
519 |
//RFile testing with session path set to //system// |
|
520 |
||
521 |
r=TheFs.SetSessionPath(systestname); |
|
256
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 |
|
524 |
r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
525 |
test_Value(r, r == KErrPermissionDenied); |
0 | 526 |
|
527 |
TBuf<25> sysfilename; |
|
528 |
sysfilename.Append(systestname); |
|
529 |
sysfilename.Append(KFileSys); |
|
530 |
r=file1.Create(TheFs,sysfilename,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
531 |
test_Value(r, r == KErrPermissionDenied); |
0 | 532 |
|
533 |
r=file1.Open(TheFs,sysfilename,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
534 |
test_Value(r, r == KErrPermissionDenied); |
0 | 535 |
|
536 |
r=file1.Open(TheFs,sysfilename,EFileRead); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
537 |
test_Value(r, r == KErrPermissionDenied); |
0 | 538 |
|
539 |
r=file1.Replace(TheFs,sysfilename,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
540 |
test_Value(r, r == KErrPermissionDenied); |
0 | 541 |
|
542 |
TFindFile finder(TheFs); |
|
543 |
CDir* dir = NULL; |
|
544 |
r=finder.FindWildByDir(KWildFile, KWildPath, dir); |
|
545 |
if (!(r==KErrPermissionDenied)) |
|
546 |
test.Printf(_L("T_DCDISKADMIN: test find wildcards r = %d (expected KErrPermissionDenied)\n"), r); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
547 |
test_Value(r, r == KErrPermissionDenied); |
0 | 548 |
delete dir; |
549 |
} |
|
550 |
||
551 |
LOCAL_C void resourceRFiletest() |
|
552 |
// |
|
553 |
// |
|
554 |
// |
|
555 |
{ |
|
556 |
//RFile testing with session path set to //resource// |
|
557 |
r=TheFs.SetSessionPath(restestname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
558 |
test_KErrNone(r); |
0 | 559 |
|
560 |
r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
561 |
test_Value(r, r == KErrPermissionDenied); |
0 | 562 |
file1.Close(); |
563 |
||
564 |
r=file1.Create(TheFs,KFileRes,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
565 |
test_Value(r, r == KErrPermissionDenied); |
0 | 566 |
file1.Close(); |
567 |
||
568 |
r=file1.Open(TheFs,KFileRes,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
569 |
test_Value(r, r == KErrPermissionDenied); |
0 | 570 |
file1.Close(); |
571 |
||
572 |
r=file1.Open(TheFs,KFileRes,EFileRead|EFileShareReadersOnly); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
573 |
test_Value(r, r == KErrNone || r==KErrPathNotFound); |
0 | 574 |
file1.Close(); |
575 |
||
576 |
r=file1.Open(TheFs,KFileRes,EFileShareReadersOrWriters|EFileRead); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
577 |
test_Value(r, r == KErrNone || r==KErrPathNotFound); |
0 | 578 |
file1.Close(); |
579 |
||
580 |
r=file1.Open(TheFs,KFileRes,EFileShareReadersOrWriters|EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
581 |
test_Value(r, r == KErrPermissionDenied); |
0 | 582 |
file1.Close(); |
583 |
||
584 |
r=file1.Open(TheFs,KFileRes,EFileShareReadersOnly); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
585 |
test_KErrNone(r); |
0 | 586 |
|
587 |
r=file1.ChangeMode(EFileShareExclusive); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
588 |
test_KErrNone(r); |
0 | 589 |
|
590 |
//this operation is prevented as you can not open a file for write access in the resource directory |
|
591 |
r=file1.Rename(KFileRes3); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
592 |
test_Value(r, r == KErrPermissionDenied || r==KErrAccessDenied); |
0 | 593 |
file1.Close(); |
594 |
||
595 |
r=file1.Replace(TheFs,KFileRes,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
596 |
test_Value(r, r == KErrPermissionDenied); |
0 | 597 |
file1.Close(); |
598 |
||
599 |
} |
|
600 |
||
601 |
||
602 |
LOCAL_C void privatefalseIDRFiletest() |
|
603 |
// |
|
604 |
//RFile testing with session path set to //Private//falseID |
|
605 |
// |
|
606 |
{ |
|
607 |
r=TheFs.SetSessionPath(pritestfalseidname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
608 |
test_Value(r, r == KErrPermissionDenied); |
0 | 609 |
|
610 |
r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
611 |
test_Value(r, r == KErrPermissionDenied); |
0 | 612 |
|
613 |
TBuf<25> prifilename; |
|
614 |
prifilename.Append(pritestname); |
|
615 |
prifilename.Append(KFileSys); |
|
616 |
||
617 |
r=file1.Create(TheFs,prifilename,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
618 |
test_Value(r, r == KErrPermissionDenied); |
0 | 619 |
|
620 |
r=file1.Open(TheFs,prifilename,EFileWrite); |
|
256
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.Open(TheFs,prifilename,EFileRead); |
|
256
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 |
|
626 |
r=file1.Replace(TheFs,prifilename,EFileWrite); |
|
256
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 |
||
630 |
||
631 |
LOCAL_C void privateRFiletest() |
|
632 |
// |
|
633 |
//RFile testing with session path set to //Private// |
|
634 |
// |
|
635 |
{ |
|
636 |
r=TheFs.SetSessionPath(pritestname); |
|
256
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 |
|
639 |
r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
640 |
test_Value(r, r == KErrPermissionDenied); |
0 | 641 |
|
642 |
TBuf<25> prifilename; |
|
643 |
prifilename.Append(pritestname); |
|
644 |
prifilename.Append(KFileSys); |
|
645 |
||
646 |
r=file1.Create(TheFs,prifilename,EFileWrite); |
|
256
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 |
|
649 |
r=file1.Open(TheFs,prifilename,EFileWrite); |
|
256
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 |
|
652 |
r=file1.Open(TheFs,prifilename,EFileRead); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
653 |
test_Value(r, r == KErrPermissionDenied); |
0 | 654 |
|
655 |
r=file1.Replace(TheFs,prifilename,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
656 |
test_Value(r, r == KErrPermissionDenied); |
0 | 657 |
} |
658 |
||
659 |
||
660 |
LOCAL_C void privateSIDRFiletest() |
|
661 |
// |
|
662 |
//Rfile Testing with session path set to //Private//UID// |
|
663 |
// |
|
664 |
{ |
|
665 |
r=TheFs.SetSessionToPrivate(gTheDriveNum); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
666 |
test_KErrNone(r); |
0 | 667 |
|
668 |
r=file1.Temp(TheFs,theprivatepath,fromTemp,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
669 |
test_KErrNone(r); |
0 | 670 |
file1.Close(); |
671 |
||
672 |
r=file1.Create(TheFs,KFilePri,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
673 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 674 |
file1.Close(); |
675 |
||
676 |
r=file1.Open(TheFs,KFilePri,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
677 |
test_KErrNone(r); |
0 | 678 |
file1.Close(); |
679 |
||
680 |
r=file1.Open(TheFs,KFilePri,EFileRead); |
|
256
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.Replace(TheFs,KFilePri,EFileWrite); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
685 |
test_KErrNone(r); |
0 | 686 |
|
687 |
r=file1.Rename(KFilePri3); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
688 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 689 |
file1.Close(); |
690 |
} |
|
691 |
||
692 |
||
693 |
LOCAL_C void RDirtest() |
|
694 |
// |
|
695 |
// |
|
696 |
// |
|
697 |
{ |
|
698 |
//system |
|
699 |
dirNameBuf.Zero(); |
|
700 |
dirNameBuf = KSystemPath; |
|
701 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
702 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
703 |
test_Value(r, r == KErrPermissionDenied); |
0 | 704 |
dir.Close(); |
705 |
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
706 |
test_Value(r, r == KErrPermissionDenied); |
0 | 707 |
dirNameBuf.Zero(); |
708 |
delete dirEntries; |
|
709 |
//Private//falseid |
|
710 |
dirNameBuf=KPrivateFalseID; |
|
711 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
712 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
713 |
test_Value(r, r == KErrPermissionDenied); |
0 | 714 |
dir.Close(); |
715 |
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
716 |
test_Value(r, r == KErrPermissionDenied); |
0 | 717 |
dirNameBuf.Zero(); |
718 |
delete dirEntries; |
|
719 |
//Private |
|
720 |
dirNameBuf=KPrivatePath; |
|
721 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
722 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
723 |
test_Value(r, r == KErrPermissionDenied); |
0 | 724 |
dir.Close(); |
725 |
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
726 |
test_Value(r, r == KErrPermissionDenied); |
0 | 727 |
dirNameBuf.Zero(); |
728 |
delete dirEntries; |
|
729 |
//Private/uid |
|
730 |
TheFs.PrivatePath(dirNameBuf); |
|
731 |
dirNameBuf.Insert(0,_L("?:")); |
|
732 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
733 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
734 |
test_KErrNone(r); |
0 | 735 |
dir.Close(); |
736 |
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
737 |
test_KErrNone(r); |
0 | 738 |
dirNameBuf.Zero(); |
739 |
delete dirEntries; |
|
740 |
//Resource |
|
741 |
dirNameBuf=KResourcePath; |
|
742 |
dirNameBuf[0]=(TText)gDriveToTest; |
|
743 |
r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
744 |
test_Value(r, r == KErrNone || r==KErrPathNotFound || r==KErrNotFound); |
0 | 745 |
r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
746 |
test_Value(r, r == KErrNone || r==KErrPathNotFound || r==KErrNotFound); |
0 | 747 |
dir.Close(); |
748 |
delete dirEntries; |
|
749 |
} |
|
750 |
||
751 |
||
752 |
LOCAL_C void DiskAdminTest() |
|
753 |
// |
|
754 |
// test diskadministration capabilitiy |
|
755 |
// |
|
756 |
{ |
|
757 |
r=TheFs.FileSystemName(fsname,gTheDriveNum); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
758 |
test_KErrNone(r); |
0 | 759 |
r = DismountFileSystem(TheFs, fsname, gTheDriveNum); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
760 |
test_KErrNone(r); |
0 | 761 |
// r=TheFs.RemoveFileSystem(fsname); //can not test due to bug else where fix exists |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
762 |
// test_Value(r, r == KErrPermissionDenied); |
0 | 763 |
// r=TheFs.AddFileSystem(fsname); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
764 |
// test_Value(r, r == KErrPermissionDenied); |
0 | 765 |
r = MountFileSystem(TheFs, fsname, gTheDriveNum); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
766 |
test_KErrNone(r); |
0 | 767 |
r=TheFs.SetDriveName(gTheDriveNum,KDriveName); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
768 |
test_KErrNone(r); |
0 | 769 |
r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
770 |
test_Value(r, r == KErrNone || r==KErrNotSupported); |
0 | 771 |
|
772 |
systemRFstest(); |
|
773 |
resourceRFstest(); |
|
774 |
privateRFstest(); |
|
775 |
privateSIDRFstest(); |
|
776 |
privateFalseIDRFstest(); |
|
777 |
||
778 |
systemRFiletest(); |
|
779 |
resourceRFiletest(); |
|
780 |
privateRFiletest(); |
|
781 |
privateSIDRFiletest(); |
|
782 |
privatefalseIDRFiletest(); |
|
783 |
||
784 |
//disk changes to sys and pri paths should have completed these |
|
785 |
test(aStat4 == KRequestPending); |
|
786 |
TheFs.NotifyChangeCancel(aStat4); |
|
787 |
test(aStat4==KErrCancel); |
|
788 |
||
789 |
User::WaitForRequest(aStat3); |
|
790 |
test(aStat1==KErrPermissionDenied); |
|
791 |
test(aStat2==KErrPermissionDenied); |
|
792 |
test(aStat3==KErrNone); |
|
793 |
||
794 |
r=TheFs.SetSessionPath(systestname); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
795 |
test_Value(r, r == KErrPermissionDenied); |
0 | 796 |
|
797 |
//Test RRawDisk class |
|
798 |
r=rawdisk.Open(TheFs,gTheDriveNum); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
799 |
test_Value(r, r == KErrPermissionDenied); |
0 | 800 |
rawdisk.Close(); |
801 |
||
802 |
RDirtest(); |
|
803 |
||
804 |
#ifdef __WINS__ |
|
805 |
if (User::UpperCase(driveBuf[0]) != 'C') |
|
806 |
#endif |
|
807 |
{ |
|
808 |
//Test RFormat class |
|
809 |
r=format.Open(TheFs,driveBuf,EHighDensity,count); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
810 |
test_KErrNone(r); |
0 | 811 |
|
812 |
while(count) |
|
813 |
{ |
|
814 |
TInt r=format.Next(count); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
815 |
test_KErrNone(r); |
0 | 816 |
} |
817 |
format.Close(); |
|
818 |
} |
|
819 |
||
820 |
driveBuf[0]=(TText)gDriveToTest; |
|
821 |
r=TheFs.ScanDrive(driveBuf); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
822 |
test_Value(r, r == KErrNone || r==KErrNotSupported); |
0 | 823 |
r=TheFs.CheckDisk(driveBuf); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
824 |
test_Value(r, r == KErrNone || r==KErrNotSupported); |
0 | 825 |
} |
826 |
||
827 |
||
828 |
||
829 |
LOCAL_C void TestCaps() |
|
830 |
// |
|
831 |
// test format etc that require certain capabilities |
|
832 |
// |
|
833 |
{ |
|
834 |
driveBuf[0]=(TText)gDriveToTest; |
|
835 |
r=TheFs.SessionPath(temp); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
836 |
test_KErrNone(r); |
0 | 837 |
|
838 |
test.Printf(_L("Session path: %S"),&temp); |
|
839 |
||
840 |
r=TheFs.CreatePrivatePath(gTheDriveNum); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
841 |
test_Value(r, r == KErrNone || r== KErrAlreadyExists); |
0 | 842 |
|
843 |
TBuf<18> tempPri; |
|
844 |
r=TheFs.PrivatePath(tempPri); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
845 |
test_KErrNone(r); |
0 | 846 |
theprivatepath = _L("?:"); |
847 |
theprivatepath.Append(tempPri); |
|
848 |
||
849 |
DiskAdminTest(); |
|
850 |
||
851 |
TFileName thesessionpath; |
|
852 |
||
853 |
r=TheFs.SetSessionToPrivate(gTheDriveNum); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
854 |
test_KErrNone(r); |
0 | 855 |
r=TheFs.SessionPath(thesessionpath); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
856 |
test_KErrNone(r); |
0 | 857 |
|
858 |
test(thesessionpath == theprivatepath); |
|
859 |
} |
|
860 |
||
861 |
||
862 |
LOCAL_C void CleanupL() |
|
863 |
// |
|
864 |
// Clean up tests |
|
865 |
// |
|
866 |
{ |
|
867 |
test.Next(_L("Delete test directory")); |
|
868 |
CFileMan* fMan=CFileMan::NewL(TheFs); |
|
869 |
TInt r=fMan->RmDir(gSessionPath); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
870 |
test(r == KErrNone || KErrPathNotFound); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
871 |
// test_Value(r, r == KErrNone || r == KErrPathNotFound); |
0 | 872 |
delete fMan; |
873 |
} |
|
874 |
||
875 |
GLDEF_C void CallTestsL(/*TChar aDriveLetter*/) |
|
876 |
// |
|
877 |
// Do all tests |
|
878 |
// |
|
879 |
{ |
|
880 |
if( !PlatSec::IsCapabilityEnforced(ECapabilityDiskAdmin)) |
|
881 |
{ |
|
882 |
test.Printf(_L("Capability ECapabilityDiskAdmin not enabled - leaving t_dcdiskadmin")); |
|
883 |
test.Printf(_L("\n")); // Prevent overwrite by next print |
|
884 |
return; |
|
885 |
} |
|
886 |
||
887 |
TurnAllocFailureOff(); |
|
888 |
TheFs.CharToDrive(gDriveToTest,gTheDriveNum); |
|
889 |
||
890 |
TBuf<30> sesspath; |
|
891 |
sesspath=_L("?:\\"); |
|
892 |
sesspath[0] = (TText)gDriveToTest; |
|
893 |
||
894 |
TInt r= TheFs.SetSessionPath(sesspath); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
895 |
test_KErrNone(r); |
0 | 896 |
|
897 |
//cleanup from previous run of this test |
|
898 |
TBuf<2> cmd; |
|
899 |
cmd.SetLength(1); |
|
900 |
cmd[0] = (TText)gDriveToTest; |
|
901 |
RProcess tp; |
|
902 |
r=tp.Create(_L("clean_prepdc.exe"),sesspath); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
903 |
test_KErrNone(r); |
0 | 904 |
{ |
905 |
TRequestStatus ps; |
|
906 |
tp.Logon(ps); |
|
907 |
tp.Resume(); |
|
908 |
tp.Close(); |
|
909 |
User::WaitForRequest(ps); |
|
910 |
} |
|
911 |
||
912 |
//check double mode ie that Defpath still works |
|
913 |
RFs fs1; |
|
914 |
RFs fs2; |
|
915 |
||
916 |
r=fs1.Connect(); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
917 |
test_KErrNone(r); |
0 | 918 |
r=fs1.SessionPath(sesspath); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
919 |
test_KErrNone(r); |
0 | 920 |
test.Printf(_L("session1 Path=%S"),&sesspath); |
921 |
||
922 |
TBuf<30> privatepath; |
|
923 |
r=fs1.SetSessionToPrivate(gTheDriveNum); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
924 |
test_KErrNone(r); |
0 | 925 |
r=fs1.PrivatePath(privatepath); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
926 |
test_KErrNone(r); |
0 | 927 |
r=privatepath.Compare(KExpectedPrivatePath()); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
928 |
test_Value(r, r == 0); |
0 | 929 |
r=fs1.SessionPath(sesspath); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
930 |
test_KErrNone(r); |
0 | 931 |
r=privatepath.Compare(sesspath.Mid(KPathPosition)); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
932 |
test_Value(r, r == 0); |
0 | 933 |
r=fs1.CreatePrivatePath(gTheDriveNum); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
934 |
test_KErrNone(r); |
0 | 935 |
fs1.Close(); |
936 |
||
937 |
r=fs2.Connect(); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
938 |
test_KErrNone(r); |
0 | 939 |
r=fs2.SessionPath(sesspath); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
940 |
test_KErrNone(r); |
0 | 941 |
test.Printf(_L("session2 Path=%S"),&sesspath); |
942 |
fs2.Close(); |
|
943 |
||
944 |
TestCaps(); |
|
945 |
||
946 |
test.Printf(_L("No of files open=%d"), TheFs.ResourceCount()); |
|
947 |
||
948 |
CleanupL(); |
|
949 |
} |