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