os/kernelhwsrv/baseapitest/basesvs/validation/f32/sfsrv/scripts/PBASE-F32-FindFile-PublicApi-REM.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-rem
18 //! @SYMScriptTestEnvironment This test script requires a basic ROM.
19 //! @SYMScriptAuthor Dmitri Trofimov
20 //! @SYMScriptDescription The test script contains API tests for the following functions of TFindFile class:
21 //! @SYMCreationDate 17/12/2006
22 //! TFindFile(RFs &aFs);
23 //! TInt FindByDir(const TDesC &aFileName, const TDesC &aDirPath);
24 //! TInt FindWildByDir(const TDesC &aFileName, const TDesC &aDirPath, CDir *&aDir);
26 //! TInt FindWild(CDir *&aDirList);
27 //! const TDesC &File() const;
28 //! TInt SetFindMask(TUint aMask);
34 START_TESTCASE SETUP_FILES
35 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FindFile-PublicApi.ini
36 CREATE_OBJECT RFs RFs1
37 CREATE_OBJECT CFileMan CFileMan1
40 COMMAND RFs1 MkDirAll test_dir
41 COMMAND RFs1 MkDirAll test_dir1
42 COMMAND RFs1 MkDirAll test_rem_dir
43 COMMAND RFs1 MkDirAll test_rem_dir1
44 COMMAND CFileMan1 NewL fileman_fs
45 COMMAND CFileMan1 Copy test_file1
46 COMMAND CFileMan1 Close
47 COMMAND CFileMan1 Copy test_rem_file1
48 COMMAND CFileMan1 Close
52 END_TESTCASE SETUP_FILES
55 START_TESTCASE PBASE-F32-FindFile-PublicApi-0019
56 //! @SYMTestCaseID PBASE-F32-FindFile-PublicApi-0019
58 //! @SYMTestCaseDesc Find() test. This tests for successful finding of file after FindByDir() call.
59 //! Uses API elements: FindByDir(), Find(), File()
60 //! @SYMTestActions 1. Create RFs object.
61 //! 2. Create RDir object.
62 //! 3. Create TFindFile object passing a reference to the connected file session as a parameter.
63 //! 4. Call FindByDir() passing file name "Test1.txt" and path "\base\t_sfsrv\t_findfile\test1\" as arguments.
64 //! 5. Call File() with checking that value is '\base\t_sfsrv\t_findfile\test1\Test1.txt'
66 //! 71.Call File() with checking that value is 'x:\base\t_sfsrv\t_findfile\test1\Test1.txt'
68 //! @SYMTestStatus Implemented
69 //! @SYMTestPriority Critical
70 //! @SYMTestExpectedResults Find() returns KErrNone.
72 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FindFile-PublicApi.ini
73 CREATE_OBJECT RFs RFs1
74 CREATE_OBJECT RDir RDir1
75 CREATE_OBJECT TFindFile TFindFile1
79 COMMAND TFindFile1 new PBASE-F32-FindFile-PublicApi-0019-command4new
80 COMMAND TFindFile1 FindByDir PBASE-F32-FindFile-PublicApi-0019-command5FindByDir
81 COMMAND TFindFile1 File correct_file_path
82 COMMAND TFindFile1 Find
83 COMMAND TFindFile1 File rem_correct_file_path
88 END_TESTCASE PBASE-F32-FindFile-PublicApi-0019
90 START_TESTCASE PBASE-F32-FindFile-PublicApi-0023
91 //! @SYMTestCaseID PBASE-F32-FindFile-PublicApi-0023
93 //! @SYMTestCaseDesc FindWild() test. This test for successful finding of file ather FindWildByDir() call.
94 //! Uses API elements: FindWildByDir(), FindWild()
95 //! @SYMTestActions 1. Create RFs object.
96 //! 2. Call Connect().
97 //! 3. Create TFindFile object passing a reference to the connected file session as a parameter.
98 //! 4. Call FindWildByDir() passing file name "Test1.*" and path "\base\t_sfsrv\t_findfile\test1\" as arguments.
99 //! 5. Call FindWild().
101 //! @SYMTestStatus Implemented
102 //! @SYMTestPriority Critical
103 //! @SYMTestExpectedResults FindWild() returns KErrNone. FindWild find file on another RAM drive.
105 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FindFile-PublicApi.ini
106 CREATE_OBJECT RFs RFs1
107 CREATE_OBJECT TFindFile TFindFile1
108 CREATE_OBJECT TEntry TEntry1
109 CREATE_OBJECT CDir CDir1
112 COMMAND TFindFile1 new PBASE-F32-FindFile-PublicApi-0023-command4new
113 COMMAND TFindFile1 FindWildByDir PBASE-F32-FindFile-PublicApi-0023-command5FindWildByDir
114 COMMAND TFindFile1 FindWild common_dir_wrapper
118 END_TESTCASE PBASE-F32-FindFile-PublicApi-0023
120 START_TESTCASE PBASE-F32-FindFile-PublicApi-0026
121 //! @SYMTestCaseID PBASE-F32-FindFile-PublicApi-0026
122 //! @SYMAPI TFindFile
123 //! @SYMTestCaseDesc FindByDir() test. This tests for function to return correct data.
124 //! Uses API elements: FindByDir(), SetFindMask(), File()
125 //! @SYMTestActions 1. Create RFs object.
126 //! 2. Call Connect().
127 //! 3. Call SetFindMask() with invalid parameter .
128 //! 4. Call SetFindMask() KDriveAttRemovable as passed parameter.
129 //! 5. Create TFindFile object passing a reference to the connected file session as a parameter.
130 //! 6. Call FindByDir() passing file name "Test1.txt" and path "\base\t_sfsrv\t_findfile\test1\" as arguments.
131 //! 7. Call Find() to switch path to removable drive
132 //! 8. Call File() with checking that value is 'X:\base\t_sfsrv\t_findfile\test1\Test1.txt'
134 //! @SYMTestStatus Implemented
135 //! @SYMTestPriority Critical
136 //! @SYMTestExpectedResults SetFindMask() with invalid parameter returns KErrArgument. and File returns a path on removable drive.
138 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FindFile-PublicApi.ini
139 CREATE_OBJECT RFs RFs1
140 CREATE_OBJECT TFindFile TFindFile1
141 CREATE_OBJECT TEntry TEntry1
142 CREATE_OBJECT CDir CDir1
145 COMMAND TFindFile1 new PBASE-F32-FindFile-PublicApi-0026-command4new
146 COMMAND !Error=-6 TFindFile1 SetFindMask PBASE-F32-FindFile-PublicApi-0026__mask_params
147 COMMAND TFindFile1 SetFindMask find_mask_params
148 COMMAND TFindFile1 FindByDir PBASE-F32-FindFile-PublicApi-0026-command5FindByDir
149 COMMAND TFindFile1 Find
153 END_TESTCASE PBASE-F32-FindFile-PublicApi-0026
156 START_TESTCASE REMOVE_FILES
157 START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FindFile-PublicApi.ini
158 CREATE_OBJECT RFs RFs1
159 CREATE_OBJECT CFileMan CFileMan1
162 COMMAND CFileMan1 NewL fileman_fs
163 COMMAND CFileMan1 Delete all_files1
164 COMMAND CFileMan1 Delete all_rem_files1
165 COMMAND RFs1 RmDir test_dir1
166 COMMAND RFs1 RmDir test_dir
167 COMMAND RFs1 RmDir test_rem_dir1
168 COMMAND RFs1 RmDir test_rem_dir
172 END_TESTCASE REMOVE_FILES