os/kernelhwsrv/baseapitest/basesvs/validation/f32/sfsrv/scripts/PBASE-F32-Parse-PublicApi-ANY.script
First public contribution.
2 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
3 // All rights reserved.
4 // This component and the accompanying materials are made available
5 // under the terms of "Eclipse Public License v1.0"
6 // which accompanies this distribution, and is available
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 // Initial Contributors:
10 // Nokia Corporation - initial contribution.
17 //! @SYMTestSuiteName pbase-f32-sfsrv-publicapi-any
18 //! @SYMScriptTestEnvironment This test script requires a basic ANY.
19 //! @SYMScriptAuthor Dmitri Trofimov
20 //! @SYMCreationDate 10/04/2007
21 //! @SYMScriptDescription The test script contains API tests for the following functions of TParse class:
23 //! TInt Set(const TDesC &aName, const TDesC *aRelated, const TDesC *aDefault);
24 //! TInt SetNoWild(const TDesC &aName, const TDesC *aRelated, const TDesC *aDefault);
26 //! const TDesC &NameBufC() const;
33 START_TESTCASE PBASE-F32-Parse-PublicApi-0047
34 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0047
36 //! @SYMTestCaseDesc TParse() test or successful object creation.
37 //! Uses API elements: TParse()
38 //! @SYMTestActions 1. Create TParse object.
39 //! 2. Delete TParse object.
41 //! @SYMTestStatus Implemented
42 //! @SYMTestPriority Critical
43 //! @SYMTestExpectedResults Function does not leave nor panic.
45 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
46 CREATE_OBJECT TParse TParse1
50 END_TESTCASE PBASE-F32-Parse-PublicApi-0047
53 START_TESTCASE PBASE-F32-Parse-PublicApi-0048
54 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0048
56 //! @SYMTestCaseDesc Set() test for successful setting up the TParse object.
57 //! Uses API elements: TParse(), Set()
58 //! @SYMTestActions 1. Create TParse object.
59 //! 2. Call Set() passing "test.txt" The file specification to be parsed.
60 //! 3. Delete TParse object.
62 //! @SYMTestStatus Implemented
63 //! @SYMTestPriority Critical
64 //! @SYMTestExpectedResults Set() returns KErrNone.
66 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
67 CREATE_OBJECT TParse TParse1
69 COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0002command2Set
72 END_TESTCASE PBASE-F32-Parse-PublicApi-0048
75 START_TESTCASE PBASE-F32-Parse-PublicApi-0049
76 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0049
78 //! @SYMTestCaseDesc Set() test for setting up the TParse object with wildcard in filename.
79 //! Uses API elements: TParse(), Set()
80 //! @SYMTestActions 1. Create TParse object.
81 //! 2. Call Set() passing "test.*" The file specification to be parsed.
82 //! 3. Delete TParse object.
84 //! @SYMTestStatus Implemented
85 //! @SYMTestPriority Critical
86 //! @SYMTestExpectedResults Set() returns KErrNone.
88 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
89 CREATE_OBJECT TParse TParse1
91 COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0003command2Set
94 END_TESTCASE PBASE-F32-Parse-PublicApi-0049
97 START_TESTCASE PBASE-F32-Parse-PublicApi-0050
98 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0050
100 //! @SYMTestCaseDesc Set() test for setting up the TParse object with wildcard in filename.
101 //! Uses API elements: TParse(), Set()
102 //! @SYMTestActions 1. Create TParse object.
103 //! 2. Call Set() passing "test.???" The file specification to be parsed.
104 //! 3. Delete TParse object.
106 //! @SYMTestStatus Implemented
107 //! @SYMTestPriority Critical
108 //! @SYMTestExpectedResults Set() returns KErrNone.
110 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
111 CREATE_OBJECT TParse TParse1
113 COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0004command2Set
116 END_TESTCASE PBASE-F32-Parse-PublicApi-0050
119 START_TESTCASE PBASE-F32-Parse-PublicApi-0051
120 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0051
122 //! @SYMTestCaseDesc SetNoWild() test for successful setting up the TParse object.
123 //! Uses API elements: SetNoWild()
124 //! @SYMTestActions 1. Create TParse object.
125 //! 2. Call SetNoWild() passing "test.txt" as name, "b:\rel" as related file specification, "c:\def\test.txt" as default file specification.
126 //! 3. Delete TParse object.
128 //! @SYMTestStatus Implemented
129 //! @SYMTestPriority Critical
130 //! @SYMTestExpectedResults SetNoWild() returns KErrNone.
132 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
133 CREATE_OBJECT TParse TParse1
135 COMMAND TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0005command2SetNoWild
138 END_TESTCASE PBASE-F32-Parse-PublicApi-0051
141 START_TESTCASE PBASE-F32-Parse-PublicApi-0052
142 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0052
144 //! @SYMTestCaseDesc SetNoWild() negative test where file specification to be parsed contain wildcard.
145 //! Uses API elements: SetNoWild()
146 //! @SYMTestActions 1. Create TParse object.
147 //! 2. Call SetNoWild() passing "c:\base\file.*" as parameter of file specification and check that the function return KErrBadName.
148 //! 3. Delete TParse object.
150 //! @SYMTestStatus Implemented
151 //! @SYMTestPriority Critical
152 //! @SYMTestExpectedResults SetNoWild() returns KErrBadName.
154 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
155 CREATE_OBJECT TParse TParse1
157 COMMAND !Error=-28 TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0006command2SetNoWild
160 END_TESTCASE PBASE-F32-Parse-PublicApi-0052
163 START_TESTCASE PBASE-F32-Parse-PublicApi-0053
164 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0053
166 //! @SYMTestCaseDesc SetNoWild() negative test where file specification to be parsed contain wildcard.
167 //! Uses API elements: SetNoWild()
168 //! @SYMTestActions 1. Create TParse object.
169 //! 2. Call SetNoWild() passing "c:\base\file.tx?" as parameter of file specification and check that ne function eturn KErrBadName
170 //! 3. Delete TParse object.
172 //! @SYMTestStatus Implemented
173 //! @SYMTestPriority Critical
174 //! @SYMTestExpectedResults SetNoWild() returns KErrBadName.
176 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
177 CREATE_OBJECT TParse TParse1
179 COMMAND !Error=-28 TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0007command2SetNoWild
182 END_TESTCASE PBASE-F32-Parse-PublicApi-0053
185 START_TESTCASE PBASE-F32-Parse-PublicApi-0054
186 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0054
188 //! @SYMTestCaseDesc SetNoWild() negative test where related file name specification to be parsed contain wildcard.
189 //! Uses API elements: SetNoWild()
190 //! @SYMTestActions 1. Create TParse object.
191 //! 2. Call SetNoWild() passing "c:file" as name, "c:\base\file.*" as related file specification.
192 //! 3. Delete TParse object.
194 //! @SYMTestStatus Implemented
195 //! @SYMTestPriority Critical
196 //! @SYMTestExpectedResults SetNoWild() returns KErrBadName.
198 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
199 CREATE_OBJECT TParse TParse1
201 COMMAND !Error=-28 TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0008command2SetNoWild
204 END_TESTCASE PBASE-F32-Parse-PublicApi-0054
207 START_TESTCASE PBASE-F32-Parse-PublicApi-0055
208 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0055
210 //! @SYMTestCaseDesc SetNoWild() negative test where related file name specification to be parsed contain wildcard.
211 //! Uses API elements: SetNoWild()
212 //! @SYMTestActions 1. Create TParse object.
213 //! 2. Call SetNoWild() passing "c:file" as name, "c:\base\file.ex?" as related file specification.
214 //! 3. Delete TParse object.
216 //! @SYMTestStatus Implemented
217 //! @SYMTestPriority Critical
218 //! @SYMTestExpectedResults SetNoWild() returns KErrBadName.
220 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
221 CREATE_OBJECT TParse TParse1
223 COMMAND !Error=-28 TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0009command2SetNoWild
226 END_TESTCASE PBASE-F32-Parse-PublicApi-0055
229 START_TESTCASE PBASE-F32-Parse-PublicApi-0056
230 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0056
232 //! @SYMTestCaseDesc SetNoWild() negative test where default file name specification to be parsed contain wildcard.
233 //! Uses API elements: SetNoWild()
234 //! @SYMTestActions 1. Create TParse object.
235 //! 2. Call SetNoWild() passing "c:file" as name, "c:\base\file.*" as default file specification.
236 //! 3. Delete TParse object.
238 //! @SYMTestStatus Implemented
239 //! @SYMTestPriority Critical
240 //! @SYMTestExpectedResults SetNoWild() returns KErrBadName.
242 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
243 CREATE_OBJECT TParse TParse1
245 COMMAND !Error=-28 TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0010command2SetNoWild
248 END_TESTCASE PBASE-F32-Parse-PublicApi-0056
251 START_TESTCASE PBASE-F32-Parse-PublicApi-0057
252 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0057
254 //! @SYMTestCaseDesc SetNoWild() negative test where default file name specification to be parsed contain wildcard.
255 //! Uses API elements: SetNoWild()
256 //! @SYMTestActions 1. Create TParse object.
257 //! 2. Call SetNoWild() passing "c:file" as name, "c:\base\file.ex?" as default file specification.
258 //! 3. Delete TParse object.
260 //! @SYMTestStatus Implemented
261 //! @SYMTestPriority Critical
262 //! @SYMTestExpectedResults SetNoWild() returns KErrBadName.
264 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
265 CREATE_OBJECT TParse TParse1
267 COMMAND !Error=-28 TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0011command2SetNoWild
270 END_TESTCASE PBASE-F32-Parse-PublicApi-0057
273 START_TESTCASE PBASE-F32-Parse-PublicApi-0058
274 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0058
276 //! @SYMTestCaseDesc PopDir() test. This test for successful removal of the last directory from the path.
277 //! Uses API elements: PopDir()
278 //! @SYMTestActions 1. Create TParse object '.
279 //! 2. Call Set() for setting up the following path name: "c\dir1\dir2\filename.ext"
280 //! 3. Call PopDir().
281 //! 4. Call FullName(). Expecting 'c:\dir1\filename.ext'
283 //! @SYMTestStatus Implemented
284 //! @SYMTestPriority Critical
285 //! @SYMTestExpectedResults PopDir() returns KErrNone. The value returned by FullName() is the same as expected.
287 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
288 CREATE_OBJECT TParse TParse1
290 COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0012command2Set
291 COMMAND TParse1 PopDir
292 COMMAND TParse1 FullName PBASE-F32-Parse-PublicApi-0012command4FullName
295 END_TESTCASE PBASE-F32-Parse-PublicApi-0058
298 START_TESTCASE PBASE-F32-Parse-PublicApi-0059
299 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0059
301 //! @SYMTestCaseDesc AddDir() test. This tests for successful adding of directory to the end of path.
302 //! Uses API elements: AddDir()
303 //! @SYMTestActions 1. Create TParse object.
304 //! 2. Call Set() setting path to "c:\dir1\filename.ext"
305 //! 3. Call AddDir() passing "dir2" string.
306 //! 4. Call FullName(). Expecting 'c:\dir1\dir2\filename.ext'
308 //! @SYMTestStatus Implemented
309 //! @SYMTestPriority Critical
310 //! @SYMTestExpectedResults AddDir() returns KErrNone. The value returned by FullName() is the same as expected.
312 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
313 CREATE_OBJECT TParse TParse1
315 COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0013command2Set
316 COMMAND TParse1 AddDir PBASE-F32-Parse-PublicApi-0013command3AddDir
317 COMMAND TParse1 FullName PBASE-F32-Parse-PublicApi-0013command4FullName
320 END_TESTCASE PBASE-F32-Parse-PublicApi-0059
323 START_TESTCASE PBASE-F32-Parse-PublicApi-0060
324 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0060
326 //! @SYMTestCaseDesc AddDir() negative test. This tests for the function to return error KErrBadName in case the directory to add begins with slash "\".
327 //! ses API elements: AddDir()
328 //! @SYMTestActions 1. Create TParse object.
329 //! 2. Call Set() setting path to "c:\dir1\dir2\filename.ext"
330 //! 3. Call AddDir() passing "\dir3" string.
332 //! @SYMTestStatus Implemented
333 //! @SYMTestPriority Critical
334 //! @SYMTestExpectedResults AddDir() returns KErrBadName.
336 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
337 CREATE_OBJECT TParse TParse1
339 COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0014command2Set
340 COMMAND !Error=-28 TParse1 AddDir PBASE-F32-Parse-PublicApi-0014command3AddDir
343 END_TESTCASE PBASE-F32-Parse-PublicApi-0060
346 START_TESTCASE PBASE-F32-Parse-PublicApi-0061
347 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0061
349 //! @SYMTestCaseDesc AddDir() test, where name of directory contains the wildcard.
350 //! Uses API elements: AddDir()
351 //! @SYMTestActions 1. Create TParse object.
352 //! 2. Call Set() setting path to "c:\dir1\dir2\filename.ext"
353 //! 3. Call AddDir() passing a "dir*" string.
355 //! @SYMTestStatus Implemented
356 //! @SYMTestPriority Critical
357 //! @SYMTestExpectedResults AddDir() returns KErrNone.
359 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
360 CREATE_OBJECT TParse TParse1
362 COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0015command2Set
363 COMMAND TParse1 AddDir PBASE-F32-Parse-PublicApi-0015command3AddDir
366 END_TESTCASE PBASE-F32-Parse-PublicApi-0061
369 START_TESTCASE PBASE-F32-Parse-PublicApi-0062
370 //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0062
372 //! @SYMTestCaseDesc AddDir() negative test, where name of directory ended with a "\".
373 //! Uses API elements: AddDir()
374 //! @SYMTestActions 1. Create TParse object.
375 //! 2. Call Set() setting path to "c:\dir1\dir2\filename.ext"
376 //! 3. Call AddDir() passing name of directory ended with a "dir\".
378 //! @SYMTestStatus Implemented
379 //! @SYMTestPriority Critical
380 //! @SYMTestExpectedResults AddDir() returns KErrBadName.
382 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini
383 CREATE_OBJECT TParse TParse1
385 COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0016command2Set
386 COMMAND !Error=-28 TParse1 AddDir PBASE-F32-Parse-PublicApi-0016command3AddDir
389 END_TESTCASE PBASE-F32-Parse-PublicApi-0062