os/kernelhwsrv/baseapitest/basesvs/validation/f32/sfsrv/scripts/PBASE-F32-FileText-PublicApi-RAM.script
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/baseapitest/basesvs/validation/f32/sfsrv/scripts/PBASE-F32-FileText-PublicApi-RAM.script Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,621 @@
1.4 +//
1.5 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of "Eclipse Public License v1.0"
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +//! @file
1.20 +//! @SYMTestSuiteName pbase-f32-sfsrv-publicapi-ram
1.21 +//! @SYMScriptTestEnvironment This test script requires a basic ROM.
1.22 +//! @SYMScriptAuthor Dmitri Trofimov, Anton Grober, Segei Tveritin
1.23 +//! @SYMScriptDescription The test script contains API tests for the following functions of TFileText class
1.24 +//! @SYMScriptCreationDate 08/12/2006
1.25 +//! TFileText();
1.26 +//! void Set(RFile &aFile);
1.27 +//! TInt Read(TDes &aDes);
1.28 +//! TInt Write(const TDesC &aDes);
1.29 +//! TInt Seek(TSeek aMode);
1.30 +
1.31 +LOAD_SUITE T_SfSrv
1.32 +DELAY 5000
1.33 +
1.34 +START_TESTCASE SETUP_FILES
1.35 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.36 + CREATE_OBJECT RFs RFs1
1.37 + CREATE_OBJECT CFileMan CFileMan1
1.38 + COMMAND RFs1 new
1.39 + COMMAND RFs1 Connect
1.40 + COMMAND RFs1 MkDirAll test_dir
1.41 + COMMAND CFileMan1 NewL fileman_fs
1.42 + COMMAND CFileMan1 Copy test_file1
1.43 + COMMAND CFileMan1 Close
1.44 + COMMAND CFileMan1 Copy test_file2
1.45 + COMMAND CFileMan1 Close
1.46 + COMMAND CFileMan1 Copy test_file3
1.47 + COMMAND CFileMan1 Close
1.48 + COMMAND CFileMan1 Copy test_file4
1.49 + COMMAND CFileMan1 Close
1.50 + COMMAND CFileMan1 Copy test_file5
1.51 + COMMAND CFileMan1 Close
1.52 + COMMAND CFileMan1 Copy test_file6
1.53 + COMMAND CFileMan1 Close
1.54 + COMMAND CFileMan1 Copy test_file7
1.55 + COMMAND CFileMan1 ~
1.56 + COMMAND RFs1 ~
1.57 + END_TEST_BLOCK
1.58 +END_TESTCASE SETUP_FILES
1.59 +
1.60 +START_TESTCASE PBASE-F32-FileText-PublicApi-0001
1.61 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0001
1.62 +//! @SYMAPI TFileText
1.63 +//! @SYMTestCaseDesc TFileText() test.
1.64 +//! Uses API elements: TFileText()
1.65 +//! @SYMTestActions 1. Create TFileText object.
1.66 +//!
1.67 +//! @SYMTestStatus Implemented
1.68 +//! @SYMTestPriority Critical
1.69 +//! @SYMTestExpectedResults Function does not leave nor panic.
1.70 +//! @SYMTestType CIT
1.71 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.72 + CREATE_OBJECT TFileText TFileText1
1.73 + COMMAND TFileText1 new
1.74 + COMMAND TFileText1 ~
1.75 + END_TEST_BLOCK
1.76 +END_TESTCASE PBASE-F32-FileText-PublicApi-0001
1.77 +
1.78 +
1.79 +START_TESTCASE PBASE-F32-FileText-PublicApi-0002
1.80 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0002
1.81 +//! @SYMAPI TFindFile
1.82 +//! @SYMTestCaseDesc Set() test. This tests for successful Set() call.
1.83 +//! Uses API elements: Set()
1.84 +//! @SYMTestActions 1. Create RFs object.
1.85 +//! 2. Call Connect().
1.86 +//! 3. Create RFile object.
1.87 +//! 4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
1.88 +//! path to file 'filetext_read.txt' string as the second parameter, and EFileRead as the third
1.89 +//! parameter.
1.90 +//! 5. Create TFileText object.
1.91 +//! 6. Call Set() passing a reference to RFile object as a parameter.
1.92 +//!
1.93 +//! @SYMTestStatus Implemented
1.94 +//! @SYMTestPriority Critical
1.95 +//! @SYMTestExpectedResults Function does not leave nor panic.
1.96 +//! @SYMTestType CIT
1.97 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.98 + CREATE_OBJECT RFs RFs1
1.99 + CREATE_OBJECT RFile RFile1
1.100 + CREATE_OBJECT TFileText TFileText1
1.101 + COMMAND RFs1 new
1.102 + COMMAND RFs1 Connect
1.103 + COMMAND RFile1 new
1.104 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0002command5Open
1.105 + COMMAND TFileText1 new
1.106 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0002command8Set
1.107 + COMMAND TFileText1 ~
1.108 + COMMAND RFile1 Close
1.109 + COMMAND RFs1 ~
1.110 + END_TEST_BLOCK
1.111 +END_TESTCASE PBASE-F32-FileText-PublicApi-0002
1.112 +
1.113 +
1.114 +START_TESTCASE PBASE-F32-FileText-PublicApi-0004
1.115 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0004
1.116 +//! @SYMAPI TFileText
1.117 +//! @SYMTestCaseDesc Read() passing a reference to a TDes descriptor with sufficient length to fit the first line of text file.
1.118 +//! Uses API elements: Set(), Read()
1.119 +//! @SYMTestActions 1. Create RFs object.
1.120 +//! 2. Call Connect().
1.121 +//! 3. Create RFile object.
1.122 +//! 4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
1.123 +//! path to file 'filetext_read.txt' string as the second parameter, and EFileRead as the third
1.124 +//! parameter.
1.125 +//! 5. Create TFileText object.
1.126 +//! 6. Call Set() passing a reference to RFile object as a parameter.
1.127 +//! 7. Call Read(). Expecting string 'Symbian rocks my world!'. Buffer length is 64
1.128 +//! 8. Delete TFiletext object.
1.129 +//! 9. Call Close() on RFile object.
1.130 +//! 10. Delete RFile object.
1.131 +//! 11. Delete RFs object.
1.132 +//!
1.133 +//! @SYMTestStatus Implemented
1.134 +//! @SYMTestPriority Critical
1.135 +//! @SYMTestExpectedResults Read() returns KErrNone. The string read is the same as expected.
1.136 +//! @SYMTestType CIT
1.137 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.138 + CREATE_OBJECT RFs RFs1
1.139 + CREATE_OBJECT RFile RFile1
1.140 + CREATE_OBJECT TFileText TFileText1
1.141 + COMMAND RFs1 new
1.142 + COMMAND RFs1 Connect
1.143 + COMMAND RFile1 new
1.144 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0004command5Open
1.145 + COMMAND TFileText1 new
1.146 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0004command8Set
1.147 + COMMAND TFileText1 Read PBASE-F32-FileText-PublicApi-0004command9Read
1.148 + COMMAND TFileText1 ~
1.149 + COMMAND RFile1 Close
1.150 + COMMAND RFs1 ~
1.151 + END_TEST_BLOCK
1.152 +END_TESTCASE PBASE-F32-FileText-PublicApi-0004
1.153 +
1.154 +
1.155 +START_TESTCASE PBASE-F32-FileText-PublicApi-0005
1.156 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0005
1.157 +//! @SYMAPI TFileText
1.158 +//! @SYMTestCaseDesc Write() passing a reference to a TDesC descriptor containing a line of text.
1.159 +//! Uses API elements: Set(), Write(), Read()
1.160 +//! @SYMTestActions 1. Create RFs object.
1.161 +//! 2. Call Connect().
1.162 +//! 3. Create RFile object.
1.163 +//! 4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
1.164 +//! path to file 'filetext_read.txt' string as the second parameter, and EFileWrite as the third
1.165 +//! parameter.
1.166 +//! 5. Create TFileText object.
1.167 +//! 6. Call Set() passing a reference to RFile object as a parameter.
1.168 +//! 7. Call Write() passing a TDesC string reference as a parameter. String contains 'Symbian is the
1.169 +//! best!!11ONEONE'.
1.170 +//! 8. Call Seek() on TFileText passing ESeekStart as a parameter.
1.171 +//! 9. Call Read() on TFileText. Expecting string 'Symbian is the best!!11ONEONE'. Buffer length is 64
1.172 +//! 10. Delete TFileText object.
1.173 +//! 11. Call Close() on RFile object.
1.174 +//! 12. Delete RFile object.
1.175 +//! 13. Call Delete() on RFs passing a reference to TDesC file name that has been created during the test.
1.176 +//! 14. Delete RFs object.
1.177 +//!
1.178 +//! @SYMTestStatus Implemented
1.179 +//! @SYMTestPriority Critical
1.180 +//! @SYMTestExpectedResults Write() returns KErrNone. Read() returns KErrNone. The string read is the same as expected.
1.181 +//! @SYMTestType CIT
1.182 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.183 + CREATE_OBJECT RFs RFs1
1.184 + CREATE_OBJECT RFile RFile1
1.185 + CREATE_OBJECT TFileText TFileText1
1.186 + COMMAND RFs1 new
1.187 + COMMAND RFs1 Connect
1.188 + COMMAND RFile1 new
1.189 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0005command6Open
1.190 + COMMAND TFileText1 new
1.191 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0005command8Set
1.192 + COMMAND TFileText1 Write PBASE-F32-FileText-PublicApi-0005command9Write
1.193 + COMMAND TFileText1 Seek PBASE-F32-FileText-PublicApi-0005command10Seek
1.194 + COMMAND TFileText1 Read PBASE-F32-FileText-PublicApi-0005command11Read
1.195 + COMMAND TFileText1 ~
1.196 + COMMAND RFile1 Close
1.197 + COMMAND RFile1 ~
1.198 + COMMAND RFs1 ~
1.199 + END_TEST_BLOCK
1.200 +END_TESTCASE PBASE-F32-FileText-PublicApi-0005
1.201 +
1.202 +START_TESTCASE PBASE-F32-FileText-PublicApi-0006
1.203 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0006
1.204 +//! @SYMAPI TFileText
1.205 +//! @SYMTestCaseDesc Seek() passing a ESeekStart as a parameter.
1.206 +//! Uses API elements: Set(), Seek(), Read().
1.207 +//! @SYMTestActions 1. Create RFs object.
1.208 +//! 2. Call Connect().
1.209 +//! 3. Create RFile object.
1.210 +//! 4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
1.211 +//! path to file 'filetext_read.txt' string as the second parameter, and EFileWrite as the third
1.212 +//! parameter.
1.213 +//! 5. Create TFileText object.
1.214 +//! 6. Call Set() passing a reference to RFile object as a parameter.
1.215 +//! 7. Call Seek() on TFileText passing ESeekStart as a parameter.
1.216 +//! 8. Call Read() on TFileText. Expecting string 'Symbian rocks my world!'.
1.217 +//! 9. Delete TFiletext object.
1.218 +//! 10. Call Close() on RFile object.
1.219 +//! 11. Delete RFile object.
1.220 +//! 12. Delete RFs object.
1.221 +//!
1.222 +//! @SYMTestStatus Implemented
1.223 +//! @SYMTestPriority Critical
1.224 +//! @SYMTestExpectedResults Seek() returns KErrNone. Read() returns KErrNone, the string read is the same as expected.
1.225 +//! @SYMTestType CIT
1.226 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.227 + CREATE_OBJECT RFs RFs1
1.228 + CREATE_OBJECT RFile RFile1
1.229 + CREATE_OBJECT TFileText TFileText1
1.230 + COMMAND RFs1 new
1.231 + COMMAND RFs1 Connect
1.232 + COMMAND RFile1 new
1.233 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0006command5Open
1.234 + COMMAND TFileText1 new
1.235 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0006command8Set
1.236 + COMMAND TFileText1 Seek PBASE-F32-FileText-PublicApi-0006command9Seek
1.237 + COMMAND TFileText1 Read PBASE-F32-FileText-PublicApi-0006command10Read
1.238 + COMMAND TFileText1 ~
1.239 + COMMAND RFile1 Close
1.240 + COMMAND RFs1 ~
1.241 + END_TEST_BLOCK
1.242 +END_TESTCASE PBASE-F32-FileText-PublicApi-0006
1.243 +
1.244 +START_TESTCASE PBASE-F32-FileText-PublicApi-0007
1.245 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0007
1.246 +//! @SYMAPI TFileText
1.247 +//! @SYMTestCaseDesc Seek() passing a ESeekEnd as a parameter.
1.248 +//! Uses API elements: Set(), Seek(), Read()
1.249 +//! @SYMTestActions 1. Create RFs object.
1.250 +//! 2. Call Connect().
1.251 +//! 3. Create RFile object.
1.252 +//! 4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
1.253 +//! path to file 'filetext_read.txt' string as the second parameter, and EFileWrite as the third
1.254 +//! parameter.
1.255 +//! 5. Create TFileText object.
1.256 +//! 6. Call Set() passing a reference to RFile object as a parameter.
1.257 +//! 7. Call Seek() on TFileText passing ESeekEnd as a parameter.
1.258 +//! 8. Call Read() on TFileText. No string expected. Just to get KErrEof. Buffer length is 64.
1.259 +//! 9. Delete TFiletext object.
1.260 +//! 10. Call Close() on RFile object.
1.261 +//! 11. Delete RFile object.
1.262 +//! 12. Delete RFs object.
1.263 +//!
1.264 +//! @SYMTestStatus Implemented
1.265 +//! @SYMTestPriority Critical
1.266 +//! @SYMTestExpectedResults Seek() returns KErrNone. Read() returns KErrEof.
1.267 +//! @SYMTestType CIT
1.268 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.269 + CREATE_OBJECT RFs RFs1
1.270 + CREATE_OBJECT RFile RFile1
1.271 + CREATE_OBJECT TFileText TFileText1
1.272 + COMMAND RFs1 new
1.273 + COMMAND RFs1 Connect
1.274 + COMMAND RFile1 new
1.275 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0007command5Open
1.276 + COMMAND TFileText1 new
1.277 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0007command8Set
1.278 + COMMAND TFileText1 Seek PBASE-F32-FileText-PublicApi-0007command9Seek
1.279 + COMMAND !Error=-25 TFileText1 Read
1.280 + COMMAND TFileText1 ~
1.281 + COMMAND RFile1 Close
1.282 + COMMAND RFs1 ~
1.283 + END_TEST_BLOCK
1.284 +END_TESTCASE PBASE-F32-FileText-PublicApi-0007
1.285 +
1.286 +START_TESTCASE PBASE-F32-FileText-PublicApi-0008
1.287 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0008
1.288 +//! @SYMAPI TFileText
1.289 +//! @SYMTestCaseDesc Write() trying to write in file opened in read-mode.
1.290 +//! Uses API elements: Set(), Write()
1.291 +//! @SYMTestActions 1. Create RFs object.
1.292 +//! 2. Call Connect().
1.293 +//! 3. Create RFile object.
1.294 +//! 4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
1.295 +//! path to file 'new_file.txt' string as the second parameter, and EFileRead as the third parameter.
1.296 +//! 5. Create TFileText object.
1.297 +//! 6. Call Set() passing RFile object instance as parameter.
1.298 +//! 7. Call Write() on TFileText. Passing string 'Writing in read-mode' as TDesC parameter.
1.299 +//! 8. Delete TFiletext object.
1.300 +//! 9. Call Close() on RFile object.
1.301 +//! 10. Delete RFile object.
1.302 +//! 11. Delete RFs object.
1.303 +//!
1.304 +//! @SYMTestStatus Implemented
1.305 +//! @SYMTestPriority Critical
1.306 +//! @SYMTestExpectedResults Write() returns KErrAccessDenied.
1.307 +//! @SYMTestType CIT
1.308 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.309 + CREATE_OBJECT RFs RFs1
1.310 + CREATE_OBJECT RFile RFile1
1.311 + CREATE_OBJECT TFileText TFileText1
1.312 + COMMAND RFs1 new
1.313 + COMMAND RFs1 Connect
1.314 + COMMAND RFile1 new
1.315 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0008command5Open
1.316 + COMMAND TFileText1 new
1.317 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0008command8Set
1.318 + COMMAND !Error=-21 TFileText1 Write PBASE-F32-FileText-PublicApi-0008command9Write
1.319 + COMMAND TFileText1 ~
1.320 + COMMAND RFile1 Close
1.321 + COMMAND RFs1 ~
1.322 + END_TEST_BLOCK
1.323 +END_TESTCASE PBASE-F32-FileText-PublicApi-0008
1.324 +
1.325 +START_TESTCASE PBASE-F32-FileText-PublicApi-0009
1.326 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0009
1.327 +//! @SYMAPI TFileText
1.328 +//! @SYMTestCaseDesc Read() returns KErrNone reading string more than 256 symbols in length .
1.329 +//! Uses API elements: Set(), Read()
1.330 +//! @SYMTestActions 1. Create RFs object.
1.331 +//! 2. Call Connect().
1.332 +//! 3. Create RFile object.
1.333 +//! 4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
1.334 +//! path to file 'big_line.txt' string as the second parameter, and EFileRead as the third parameter.
1.335 +//! 5. Create TFileText object.
1.336 +//! 6. Call Set() passing RFile object instance as parameter.
1.337 +//! 7. Call Read(). String in file has more than 256 symbols.
1.338 +//! 8. Delete TFiletext object.
1.339 +//! 9. Call Close() on RFile object.
1.340 +//! 10. Delete RFile object.
1.341 +//! 11. Delete RFs object.
1.342 +//!
1.343 +//! @SYMTestStatus Implemented
1.344 +//! @SYMTestPriority Critical
1.345 +//! @SYMTestExpectedResults Read() returns KErrNone.
1.346 +//! @SYMTestType CIT
1.347 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.348 + CREATE_OBJECT RFs RFs1
1.349 + CREATE_OBJECT RFile RFile1
1.350 + CREATE_OBJECT TFileText TFileText1
1.351 + COMMAND RFs1 new
1.352 + COMMAND RFs1 Connect
1.353 + COMMAND RFile1 new
1.354 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0009command5Open
1.355 + COMMAND TFileText1 new
1.356 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0009command8Set
1.357 + COMMAND TFileText1 Read big_buffer
1.358 + COMMAND TFileText1 ~
1.359 + COMMAND RFile1 Close
1.360 + COMMAND RFile1 ~
1.361 + COMMAND RFs1 ~
1.362 + END_TEST_BLOCK
1.363 +END_TESTCASE PBASE-F32-FileText-PublicApi-0009
1.364 +
1.365 +START_TESTCASE PBASE-F32-FileText-PublicApi-0010
1.366 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0010
1.367 +//! @SYMAPI TFileText
1.368 +//! @SYMTestCaseDesc Read() returns KErrTooBig error because of too small buffer.
1.369 +//! Uses API elements: Set(), Read()
1.370 +//! @SYMTestActions 1. Create RFs object.
1.371 +//! 2. Call Connect().
1.372 +//! 3. Create RFile object.
1.373 +//! 4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
1.374 +//! path to file 'big_line.txt' string as the second parameter, and EFileRead as the third parameter.
1.375 +//! 5. Create TFileText object.
1.376 +//! 6. Call Set() passing RFile object instance as parameter.
1.377 +//! 7. Call Read(). String in file has more than 256 symbols. Buffer is 32.
1.378 +//! 8. Delete TFiletext object.
1.379 +//! 9. Call Close() on RFile object.
1.380 +//! 10. Delete RFile object.
1.381 +//! 11. Delete RFs object.
1.382 +//!
1.383 +//! @SYMTestStatus Implemented
1.384 +//! @SYMTestPriority Critical
1.385 +//! @SYMTestExpectedResults Read() returns KErrTooBig.
1.386 +//! @SYMTestType CIT
1.387 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.388 + CREATE_OBJECT RFs RFs1
1.389 + CREATE_OBJECT RFile RFile1
1.390 + CREATE_OBJECT TFileText TFileText1
1.391 + COMMAND RFs1 new
1.392 + COMMAND RFs1 Connect
1.393 + COMMAND RFile1 new
1.394 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0010command5Open
1.395 + COMMAND TFileText1 new
1.396 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0010command8Set
1.397 + COMMAND !Error=-40 TFileText1 Read PBASE-F32-FileText-PublicApi-0010command9Read
1.398 + COMMAND TFileText1 ~
1.399 + COMMAND RFile1 Close
1.400 + COMMAND RFile1 ~
1.401 + COMMAND RFs1 ~
1.402 + END_TEST_BLOCK
1.403 +END_TESTCASE PBASE-F32-FileText-PublicApi-0010
1.404 +
1.405 +
1.406 +
1.407 +START_TESTCASE PBASE-F32-FileText-PublicApi-0011
1.408 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0011
1.409 +//! @SYMAPI TFileText
1.410 +//! @SYMTestCaseDesc Read() returns KErrTooBig error because of too small buffer.
1.411 +//! Uses API elements: Set(), Read(), Write()
1.412 +//! @SYMTestActions 1. Create RFs object.
1.413 +//! 2. Call Connect().
1.414 +//! 3. Create RFile object.
1.415 +//! 4. Call Replace() on RFile object passing a reference to RFs object as the first parameter, a TDesC
1.416 +//! containing path to file 'multiline.txt' string as the second parameter, and EFileWrite as the
1.417 +//! third parameter.
1.418 +//! 5. Create TFileText object.
1.419 +//! 6. Call Set() passing RFile object instance as parameter.
1.420 +//! 7. Call Write(). String parameter is is 'First string'. Buffer is 64.
1.421 +//! 8. Call Write(). String parameter is is 'Second string'. Buffer is 64.
1.422 +//! 9. Call Write(). String parameter is is 'Third string'. Buffer is 64.
1.423 +//! 10. Delete TFiletext object.
1.424 +//! 11. Call Close() on RFile object.
1.425 +//! 12. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC file name
1.426 +//! reference as the second parameter, and EFileRead as the third parameter. The file opened named
1.427 +//! 'multiline.txt' and contains three lines of text.
1.428 +//! 13. Create TFileText object.
1.429 +//! 14. Call Set() passing RFile object instance as parameter.
1.430 +//! 15. Call Read(). String in file expected as 'First string'. Buffer is 64.
1.431 +//! 16. Call Read(). String in file expected as 'Second string'. Buffer is 64.
1.432 +//! 15. Call Read(). String in file expected as 'Third string'. Buffer is 64.
1.433 +//! 17. Delete TFiletext object.
1.434 +//! 18. Call Close() on RFile object.
1.435 +//! 19. Delete RFile object.
1.436 +//! 20. Delete RFs object.
1.437 +//!
1.438 +//! @SYMTestStatus Implemented
1.439 +//! @SYMTestPriority Critical
1.440 +//! @SYMTestExpectedResults Write() returns KErrNone. Read() returns KErrNone.
1.441 +//! @SYMTestType CIT
1.442 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.443 + CREATE_OBJECT RFs RFs1
1.444 + CREATE_OBJECT RFile RFile1
1.445 + CREATE_OBJECT TFileText TFileText1
1.446 + COMMAND RFs1 new
1.447 + COMMAND RFs1 Connect
1.448 + COMMAND RFile1 new
1.449 + COMMAND RFile1 Replace PBASE-F32-FileText-PublicApi-0011command5Replace
1.450 + COMMAND TFileText1 new
1.451 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0011command8Set
1.452 + COMMAND TFileText1 Write PBASE-F32-FileText-PublicApi-0011command9Write
1.453 + COMMAND TFileText1 Write PBASE-F32-FileText-PublicApi-0011command10Write
1.454 + COMMAND TFileText1 Write PBASE-F32-FileText-PublicApi-0011command11Write
1.455 + COMMAND TFileText1 ~
1.456 + COMMAND RFile1 Close
1.457 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0011command15Open
1.458 + COMMAND TFileText1 new
1.459 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0011command18Set
1.460 + COMMAND TFileText1 Read PBASE-F32-FileText-PublicApi-0011command19Read
1.461 + COMMAND TFileText1 Read PBASE-F32-FileText-PublicApi-0011command20Read
1.462 + COMMAND TFileText1 Read PBASE-F32-FileText-PublicApi-0011command21Read
1.463 + COMMAND TFileText1 ~
1.464 + COMMAND RFile1 Close
1.465 + COMMAND RFs1 ~
1.466 + END_TEST_BLOCK
1.467 +END_TESTCASE PBASE-F32-FileText-PublicApi-0011
1.468 +
1.469 +
1.470 +
1.471 +
1.472 +
1.473 +
1.474 +START_TESTCASE PBASE-F32-FileText-PublicApi-0012
1.475 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0012
1.476 +//! @SYMCreationDate 08/08/2007
1.477 +//! @SYMTestCaseDesc Write() appending a string. Read() checking if it is added to the end of file.
1.478 +//! Uses API elements: Set(), Read(), Write()
1.479 +//! @SYMTestActions 1. Create RFs object.
1.480 +//! 2. Call Connect().
1.481 +//! 3. Create RFile object.
1.482 +//! 4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
1.483 +//! path to file 'oneliner.txt' string as the second parameter, and EFileWrite as the third
1.484 +//! parameter.
1.485 +//! 5. Create TFileText object.
1.486 +//! 6. Call Set() passing RFile object instance as parameter.
1.487 +//! 7. Call Write(). String parameter is is 'Appended string'. Buffer is 64.
1.488 +//! 8. Call Close() on RFile object.
1.489 +//! 9. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
1.490 +//! path to file 'oneliner.txt' string as the second parameter, and EFileRead as the third parameter.
1.491 +//! 10. Create TFileText object. And set the position to the beginning of file using Seek().
1.492 +//! 11. Call Set() passing RFile object instance as parameter.
1.493 +//! 12. Call Read(). String in file expected as 'First string'. Buffer is 64. (File contained this string
1.494 +//! before any modifications. So it's have to be first one.)
1.495 +//! 13. Call Read(). String in file expected as 'Appended string'. Buffer is 64.
1.496 +//! 14. Delete TFiletext object.
1.497 +//! 15. Call Close() on RFile object.
1.498 +//! 16. Delete RFile object.
1.499 +//! 17. Delete RFs object.
1.500 +//!
1.501 +//! @SYMTestStatus Implemented
1.502 +//! @SYMTestPriority Critical
1.503 +//! @SYMTestExpectedResults Write() returns KErrNone. Read() returns KErrNone.
1.504 +//! @SYMTestType CIT
1.505 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.506 + CREATE_OBJECT RFs RFs1
1.507 + CREATE_OBJECT RFile RFile1
1.508 + CREATE_OBJECT TFileText TFileText1
1.509 + COMMAND RFs1 new
1.510 + COMMAND RFs1 Connect
1.511 + COMMAND RFile1 new
1.512 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0012command5Open
1.513 + COMMAND TFileText1 new
1.514 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0012command8Set
1.515 + COMMAND TFileText1 Write PBASE-F32-FileText-PublicApi-0012command9Write
1.516 + COMMAND TFileText1 ~
1.517 + COMMAND RFile1 Close
1.518 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0012command13Open
1.519 + COMMAND TFileText1 new
1.520 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0012command16Set
1.521 + COMMAND TFileText1 Read PBASE-F32-FileText-PublicApi-0012command18Read
1.522 + COMMAND TFileText1 Read PBASE-F32-FileText-PublicApi-0012command19Read
1.523 + COMMAND TFileText1 ~
1.524 + COMMAND RFile1 Close
1.525 + COMMAND RFs1 ~
1.526 + END_TEST_BLOCK
1.527 +END_TESTCASE PBASE-F32-FileText-PublicApi-0012
1.528 +
1.529 +
1.530 +
1.531 +START_TESTCASE PBASE-F32-FileText-PublicApi-0013
1.532 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0013
1.533 +//! @SYMAPI TFileText
1.534 +//! @SYMTestCaseDesc Seek() passing a ESeekAddress as a parameter.
1.535 +//! Uses API elements: Set(), Seek().
1.536 +//! @SYMTestActions 1. Create RFs object.
1.537 +//! 2. Call Connect().
1.538 +//! 3. Create RFile object.
1.539 +//! 4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC file name
1.540 +//! reference as the second parameter, and EFileWrite as the third parameter.
1.541 +//! 5. Create TFileText object.
1.542 +//! 6. Call Set() passing a reference to RFile object as a parameter.
1.543 +//! 7. Call Seek() on TFileText passing ESeekAddress as a parameter.
1.544 +//! 8. Delete TFiletext object.
1.545 +//! 9. Call Close() on RFile object.
1.546 +//! 10. Delete RFile object.
1.547 +//! 11. Delete RFs object.
1.548 +//!
1.549 +//! @SYMTestStatus Implemented
1.550 +//! @SYMTestPriority Critical
1.551 +//! @SYMTestExpectedResults Seek() panics with code FSCLIENT-5.
1.552 +//! @SYMTestType CIT
1.553 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.554 + CREATE_OBJECT RFs RFs1
1.555 + CREATE_OBJECT RFile RFile1
1.556 + CREATE_OBJECT TFileText TFileText1
1.557 + COMMAND RFs1 new
1.558 + COMMAND RFs1 Connect
1.559 + COMMAND RFile1 new
1.560 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0013command5Open
1.561 + COMMAND TFileText1 new
1.562 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0013command8Set
1.563 + COMMAND TFileText1 Seek PBASE-F32-FileText-PublicApi-0013command9Seek
1.564 + COMMAND TFileText1 ~
1.565 + COMMAND RFile1 Close
1.566 + COMMAND RFs1 ~
1.567 + END_TEST_BLOCK !PanicCode=5 !PanicString="FSCLIENT panic"
1.568 +
1.569 +END_TESTCASE PBASE-F32-FileText-PublicApi-0013
1.570 +
1.571 +START_TESTCASE PBASE-F32-FileText-PublicApi-0014
1.572 +//! @SYMTestCaseID PBASE-F32-FileText-PublicApi-0014
1.573 +//! @SYMAPI TFileText
1.574 +//! @SYMTestCaseDesc Seek() passing a ESeekCurrent as a parameter.
1.575 +//! Uses API elements: Set(), Seek().
1.576 +//! @SYMTestActions 1. Create RFs object.
1.577 +//! 2. Call Connect().
1.578 +//! 3. Create RFile object.
1.579 +//! 4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC file name
1.580 +//! reference as the second parameter, and EFileWrite as the third parameter.
1.581 +//! 5. Create TFileText object.
1.582 +//! 6. Call Set() passing a reference to RFile object as a parameter.
1.583 +//! 7. Call Seek() on TFileText passing ESeekCurrent as a parameter.
1.584 +//! 8. Delete TFiletext object.
1.585 +//! 9. Call Close() on RFile object.
1.586 +//! 10. Delete RFile object.
1.587 +//! 11. Delete RFs object.
1.588 +//!
1.589 +//! @SYMTestStatus Implemented
1.590 +//! @SYMTestPriority Critical
1.591 +//! @SYMTestExpectedResults Seek() panics with code FSCLIENT-5.
1.592 +//! @SYMTestType CIT
1.593 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.594 + CREATE_OBJECT RFs RFs1
1.595 + CREATE_OBJECT RFile RFile1
1.596 + CREATE_OBJECT TFileText TFileText1
1.597 + COMMAND RFs1 new
1.598 + COMMAND RFs1 Connect
1.599 + COMMAND RFile1 new
1.600 + COMMAND RFile1 Open PBASE-F32-FileText-PublicApi-0014command5Open
1.601 + COMMAND TFileText1 new
1.602 + COMMAND TFileText1 Set PBASE-F32-FileText-PublicApi-0014command8Set
1.603 + COMMAND TFileText1 Seek PBASE-F32-FileText-PublicApi-0014command9Seek
1.604 + COMMAND TFileText1 ~
1.605 + COMMAND RFile1 Close
1.606 + COMMAND RFs1 ~
1.607 + END_TEST_BLOCK !PanicCode=5 !PanicString="FSCLIENT panic"
1.608 +END_TESTCASE PBASE-F32-FileText-PublicApi-0014
1.609 +
1.610 +
1.611 +START_TESTCASE REMOVE_FILES
1.612 + START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FileText-PublicApi.ini
1.613 + CREATE_OBJECT RFs RFs1
1.614 + CREATE_OBJECT CFileMan CFileMan1
1.615 + COMMAND RFs1 new
1.616 + COMMAND RFs1 Connect
1.617 + COMMAND CFileMan1 NewL fileman_fs
1.618 + COMMAND CFileMan1 Delete all_test_files
1.619 + COMMAND RFs1 RmDir test_dir
1.620 + COMMAND CFileMan1 new
1.621 + COMMAND CFileMan1 ~
1.622 + COMMAND RFs1 ~
1.623 + END_TEST_BLOCK
1.624 +END_TESTCASE REMOVE_FILES