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