os/kernelhwsrv/baseapitest/basesvs/validation/f32/sfsrv/scripts/PBASE-F32-FileText-PublicApi-RAM.script
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 //
     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".
     8 //
     9 // Initial Contributors:
    10 // Nokia Corporation - initial contribution.
    11 //
    12 // Contributors:
    13 //
    14 // Description: 
    15 //
    16 //! @file
    17 //! @SYMTestSuiteName			pbase-f32-sfsrv-publicapi-ram
    18 //! @SYMScriptTestEnvironment		This test script requires a basic ROM.
    19 //! @SYMScriptAuthor 			Dmitri Trofimov, Anton Grober, Segei Tveritin
    20 //! @SYMScriptDescription		The test script contains API tests for the following functions of TFileText class
    21 //! @SYMScriptCreationDate		08/12/2006
    22 //! TFileText();
    23 //! void Set(RFile &aFile);
    24 //! TInt Read(TDes &aDes);
    25 //! TInt Write(const TDesC &aDes);
    26 //! TInt Seek(TSeek aMode);
    27 
    28 LOAD_SUITE	T_SfSrv
    29 DELAY		5000
    30 
    31 START_TESTCASE				SETUP_FILES
    32 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
    33 			CREATE_OBJECT	RFs	RFs1
    34 			CREATE_OBJECT	CFileMan	CFileMan1
    35 			COMMAND		RFs1		new
    36 			COMMAND		RFs1		Connect
    37 			COMMAND		RFs1		MkDirAll	test_dir
    38 			COMMAND		CFileMan1	NewL	fileman_fs
    39 			COMMAND		CFileMan1	Copy	test_file1
    40 			COMMAND		CFileMan1	Close
    41 			COMMAND		CFileMan1	Copy	test_file2
    42 			COMMAND		CFileMan1	Close
    43 			COMMAND		CFileMan1	Copy	test_file3
    44 			COMMAND		CFileMan1	Close
    45 			COMMAND		CFileMan1	Copy	test_file4
    46 			COMMAND		CFileMan1	Close
    47 			COMMAND		CFileMan1	Copy	test_file5
    48 			COMMAND		CFileMan1	Close
    49 			COMMAND		CFileMan1	Copy	test_file6
    50 			COMMAND		CFileMan1	Close
    51 			COMMAND		CFileMan1	Copy	test_file7
    52 			COMMAND		CFileMan1	~
    53 			COMMAND		RFs1	~
    54 	END_TEST_BLOCK
    55 END_TESTCASE				SETUP_FILES
    56 
    57 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0001
    58 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0001
    59 //! @SYMAPI				TFileText
    60 //! @SYMTestCaseDesc			TFileText() test.
    61 //!						Uses API elements: TFileText()
    62 //! @SYMTestActions			1. Create TFileText object.
    63 //!
    64 //! @SYMTestStatus			Implemented
    65 //! @SYMTestPriority			Critical
    66 //! @SYMTestExpectedResults		Function does not leave nor panic.
    67 //! @SYMTestType			CIT
    68 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
    69 			CREATE_OBJECT	TFileText	TFileText1
    70 			COMMAND		TFileText1	new
    71 			COMMAND		TFileText1	~
    72 	END_TEST_BLOCK
    73 END_TESTCASE				PBASE-F32-FileText-PublicApi-0001
    74 
    75 
    76 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0002
    77 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0002
    78 //! @SYMAPI				TFindFile
    79 //! @SYMTestCaseDesc			Set() test. This tests for successful Set() call.
    80 //!						Uses API elements: Set()
    81 //! @SYMTestActions			1. Create RFs object.
    82 //!					2. Call Connect().
    83 //!					3. Create RFile object.
    84 //!					4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
    85 //!					 path to file  'filetext_read.txt' string as the second parameter, and EFileRead as the third
    86 //!					parameter.
    87 //!					5. Create TFileText object.
    88 //!					6. Call Set() passing a reference to RFile object as a parameter.
    89 //!
    90 //! @SYMTestStatus			Implemented
    91 //! @SYMTestPriority			Critical
    92 //! @SYMTestExpectedResults		Function does not leave nor panic.
    93 //! @SYMTestType			CIT
    94 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
    95 			CREATE_OBJECT	RFs		RFs1
    96 			CREATE_OBJECT	RFile		RFile1
    97 			CREATE_OBJECT	TFileText	TFileText1
    98 			COMMAND		RFs1		new
    99 			COMMAND		RFs1		Connect
   100 			COMMAND		RFile1		new
   101 			COMMAND		RFile1		Open		PBASE-F32-FileText-PublicApi-0002command5Open
   102 			COMMAND		TFileText1	new
   103 			COMMAND		TFileText1	Set		PBASE-F32-FileText-PublicApi-0002command8Set
   104 			COMMAND		TFileText1	~
   105 			COMMAND		RFile1		Close
   106 			COMMAND		RFs1		~
   107 	END_TEST_BLOCK
   108 END_TESTCASE				PBASE-F32-FileText-PublicApi-0002
   109 
   110 
   111 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0004
   112 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0004
   113 //! @SYMAPI				TFileText
   114 //! @SYMTestCaseDesc			Read() passing a reference to a TDes descriptor with sufficient length to fit the first line of text file.
   115 //!						Uses API elements: Set(), Read()
   116 //! @SYMTestActions			1. Create RFs object.
   117 //!					2. Call Connect().
   118 //!					3. Create RFile object.
   119 //!					4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
   120 //!					 path to file  'filetext_read.txt' string as the second parameter, and EFileRead as the third
   121 //!					 parameter.
   122 //!					5. Create TFileText object.
   123 //!					6. Call Set() passing a reference to RFile object as a parameter.
   124 //!					7. Call Read(). Expecting string 'Symbian rocks my world!'. Buffer length is 64
   125 //!					8. Delete TFiletext object.
   126 //!					9. Call Close() on RFile object.
   127 //!					10. Delete RFile object.
   128 //!					11. Delete RFs object.
   129 //!
   130 //! @SYMTestStatus			Implemented
   131 //! @SYMTestPriority		        Critical
   132 //! @SYMTestExpectedResults	        Read() returns KErrNone. The string read is the same as expected.
   133 //! @SYMTestType			CIT
   134 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
   135 			CREATE_OBJECT	RFs		RFs1
   136 			CREATE_OBJECT	RFile		RFile1
   137 			CREATE_OBJECT	TFileText	TFileText1
   138 			COMMAND		RFs1		new
   139 			COMMAND		RFs1		Connect
   140 			COMMAND		RFile1		new
   141 			COMMAND		RFile1		Open		PBASE-F32-FileText-PublicApi-0004command5Open
   142 			COMMAND		TFileText1	new
   143 			COMMAND		TFileText1	Set		PBASE-F32-FileText-PublicApi-0004command8Set
   144 			COMMAND		TFileText1	Read		PBASE-F32-FileText-PublicApi-0004command9Read
   145 			COMMAND		TFileText1	~
   146 			COMMAND		RFile1		Close
   147 			COMMAND		RFs1		~
   148 	END_TEST_BLOCK
   149 END_TESTCASE				PBASE-F32-FileText-PublicApi-0004
   150 
   151 
   152 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0005
   153 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0005
   154 //! @SYMAPI				TFileText
   155 //! @SYMTestCaseDesc			Write() passing a reference to a TDesC descriptor containing a line of text.
   156 //!						Uses API elements: Set(), Write(), Read()
   157 //! @SYMTestActions			1. Create RFs object.
   158 //!					2. Call Connect().
   159 //!					3. Create RFile object.
   160 //!					4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
   161 //!					 path to file  'filetext_read.txt' string as the second parameter, and EFileWrite as the third 
   162 //!					parameter.
   163 //!					5. Create TFileText object.
   164 //!					6. Call Set() passing a reference to RFile object as a parameter.
   165 //!					7. Call Write() passing a TDesC string reference as a parameter. String contains 'Symbian is the
   166 //!					 best!!11ONEONE'.
   167 //!					8. Call Seek() on TFileText passing ESeekStart as a parameter.
   168 //!					9. Call Read() on TFileText. Expecting string 'Symbian is the best!!11ONEONE'. Buffer length is 64
   169 //!					10. Delete TFileText object.
   170 //!					11. Call Close() on RFile object.
   171 //!					12. Delete RFile object.
   172 //!					13. Call Delete() on RFs passing a reference to TDesC file name that has been created during the test.
   173 //!					14. Delete RFs object.
   174 //!
   175 //! @SYMTestStatus			Implemented
   176 //! @SYMTestPriority			Critical
   177 //! @SYMTestExpectedResults		Write() returns KErrNone. Read() returns KErrNone. The string read is the same as expected.
   178 //! @SYMTestType			CIT
   179 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
   180 			CREATE_OBJECT	RFs	RFs1
   181 			CREATE_OBJECT	RFile	RFile1
   182 			CREATE_OBJECT	TFileText	TFileText1
   183 			COMMAND		RFs1		new
   184 			COMMAND		RFs1		Connect
   185 			COMMAND		RFile1		new
   186 			COMMAND		RFile1		Open		PBASE-F32-FileText-PublicApi-0005command6Open
   187 			COMMAND		TFileText1	new
   188 			COMMAND		TFileText1	Set		PBASE-F32-FileText-PublicApi-0005command8Set
   189 			COMMAND		TFileText1	Write		PBASE-F32-FileText-PublicApi-0005command9Write
   190 			COMMAND		TFileText1	Seek		PBASE-F32-FileText-PublicApi-0005command10Seek
   191 			COMMAND		TFileText1	Read		PBASE-F32-FileText-PublicApi-0005command11Read
   192 			COMMAND		TFileText1	~
   193 			COMMAND		RFile1		Close
   194 			COMMAND		RFile1		~
   195 			COMMAND		RFs1		~
   196 	END_TEST_BLOCK
   197 END_TESTCASE				PBASE-F32-FileText-PublicApi-0005
   198 
   199 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0006
   200 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0006
   201 //! @SYMAPI				TFileText
   202 //! @SYMTestCaseDesc			Seek() passing a ESeekStart as a parameter.
   203 //!							Uses API elements: Set(), Seek(), Read().
   204 //! @SYMTestActions			1. Create RFs object.
   205 //!					2. Call Connect().
   206 //!					3. Create RFile object.
   207 //!					4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
   208 //!					 path to file  'filetext_read.txt' string as the second parameter, and EFileWrite as the third 
   209 //!					parameter.
   210 //!					5. Create TFileText object.
   211 //!					6. Call Set() passing a reference to RFile object as a parameter.
   212 //!					7. Call Seek() on TFileText passing ESeekStart as a parameter.
   213 //!					8. Call Read() on TFileText. Expecting string 'Symbian rocks my world!'.
   214 //!					9. Delete TFiletext object.
   215 //!					10. Call Close() on RFile object.
   216 //!					11. Delete RFile object.
   217 //!					12. Delete RFs object.
   218 //!
   219 //! @SYMTestStatus			Implemented
   220 //! @SYMTestPriority			Critical
   221 //! @SYMTestExpectedResults		Seek() returns KErrNone. Read() returns KErrNone, the string read is the same as expected.
   222 //! @SYMTestType			CIT
   223 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
   224 			CREATE_OBJECT	RFs	RFs1
   225 			CREATE_OBJECT	RFile	RFile1
   226 			CREATE_OBJECT	TFileText	TFileText1
   227 			COMMAND		RFs1		new
   228 			COMMAND		RFs1		Connect
   229 			COMMAND		RFile1		new
   230 			COMMAND		RFile1		Open		PBASE-F32-FileText-PublicApi-0006command5Open
   231 			COMMAND		TFileText1	new
   232 			COMMAND		TFileText1	Set		PBASE-F32-FileText-PublicApi-0006command8Set
   233 			COMMAND		TFileText1	Seek		PBASE-F32-FileText-PublicApi-0006command9Seek
   234 			COMMAND		TFileText1	Read		PBASE-F32-FileText-PublicApi-0006command10Read
   235 			COMMAND		TFileText1	~
   236 			COMMAND		RFile1		Close
   237 			COMMAND		RFs1		~
   238 	END_TEST_BLOCK
   239 END_TESTCASE				PBASE-F32-FileText-PublicApi-0006
   240 
   241 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0007
   242 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0007
   243 //! @SYMAPI				TFileText
   244 //! @SYMTestCaseDesc			Seek() passing a ESeekEnd as a parameter.
   245 //!						Uses API elements: Set(), Seek(), Read()
   246 //! @SYMTestActions			1. Create RFs object.
   247 //!					2. Call Connect().
   248 //!					3. Create RFile object.
   249 //!					4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
   250 //!					 path to file  'filetext_read.txt' string as the second parameter, and EFileWrite as the third
   251 //!					parameter.
   252 //!					5. Create TFileText object.
   253 //!					6. Call Set() passing a reference to RFile object as a parameter.
   254 //!					7. Call Seek() on TFileText passing ESeekEnd as a parameter.
   255 //!					8. Call Read() on TFileText. No string expected. Just to get KErrEof. Buffer length is 64.
   256 //!					9. Delete TFiletext object.
   257 //!					10. Call Close() on RFile object.
   258 //!					11. Delete RFile object.
   259 //!					12. Delete RFs object.
   260 //!
   261 //! @SYMTestStatus			Implemented
   262 //! @SYMTestPriority			Critical
   263 //! @SYMTestExpectedResults		Seek() returns KErrNone. Read() returns KErrEof.
   264 //! @SYMTestType			CIT
   265 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
   266 			CREATE_OBJECT		RFs		RFs1
   267 			CREATE_OBJECT		RFile		RFile1
   268 			CREATE_OBJECT		TFileText	TFileText1
   269 			COMMAND			RFs1		new
   270 			COMMAND			RFs1		Connect
   271 			COMMAND			RFile1		new
   272 			COMMAND			RFile1		Open		PBASE-F32-FileText-PublicApi-0007command5Open
   273 			COMMAND			TFileText1	new
   274 			COMMAND			TFileText1	Set		PBASE-F32-FileText-PublicApi-0007command8Set
   275 			COMMAND			TFileText1	Seek		PBASE-F32-FileText-PublicApi-0007command9Seek
   276 			COMMAND	!Error=-25	TFileText1	Read
   277 			COMMAND			TFileText1	~
   278 			COMMAND			RFile1		Close
   279 			COMMAND			RFs1		~
   280 	END_TEST_BLOCK
   281 END_TESTCASE				PBASE-F32-FileText-PublicApi-0007
   282 
   283 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0008
   284 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0008
   285 //! @SYMAPI				TFileText
   286 //! @SYMTestCaseDesc			Write() trying to write in file opened in read-mode.
   287 //!						Uses API elements: Set(), Write()
   288 //! @SYMTestActions			1. Create RFs object.
   289 //!					2. Call Connect().
   290 //!					3. Create RFile object.
   291 //!					4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
   292 //!					 path to file  'new_file.txt' string as the second parameter, and EFileRead as the third parameter.
   293 //!					5. Create TFileText object.
   294 //!					6. Call Set() passing RFile object instance as parameter.
   295 //!					7. Call Write() on TFileText. Passing string 'Writing in read-mode' as TDesC parameter.
   296 //!					8. Delete TFiletext object.
   297 //!					9. Call Close() on RFile object.
   298 //!					10. Delete RFile object.
   299 //!					11. Delete RFs object.
   300 //!
   301 //! @SYMTestStatus			Implemented
   302 //! @SYMTestPriority			Critical
   303 //! @SYMTestExpectedResults		Write() returns KErrAccessDenied.
   304 //! @SYMTestType			CIT
   305 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
   306 			CREATE_OBJECT		RFs		RFs1
   307 			CREATE_OBJECT		RFile		RFile1
   308 			CREATE_OBJECT		TFileText	TFileText1
   309 			COMMAND			RFs1		new
   310 			COMMAND			RFs1		Connect
   311 			COMMAND			RFile1		new
   312 			COMMAND			RFile1		Open		PBASE-F32-FileText-PublicApi-0008command5Open
   313 			COMMAND			TFileText1	new
   314 			COMMAND			TFileText1	Set		PBASE-F32-FileText-PublicApi-0008command8Set
   315 			COMMAND	!Error=-21	TFileText1	Write		PBASE-F32-FileText-PublicApi-0008command9Write
   316 			COMMAND			TFileText1	~
   317 			COMMAND			RFile1		Close
   318 			COMMAND			RFs1		~
   319 	END_TEST_BLOCK
   320 END_TESTCASE				PBASE-F32-FileText-PublicApi-0008
   321 
   322 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0009
   323 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0009
   324 //! @SYMAPI				TFileText
   325 //! @SYMTestCaseDesc			Read() returns KErrNone reading string more than 256 symbols in length .
   326 //!						Uses API elements: Set(), Read()
   327 //! @SYMTestActions			1. Create RFs object.
   328 //!					2. Call Connect().
   329 //!					3. Create RFile object.
   330 //!					4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
   331 //!					 path to file  'big_line.txt' string as the second parameter, and EFileRead as the third parameter.
   332 //!					5. Create TFileText object.
   333 //!					6. Call Set() passing RFile object instance as parameter.
   334 //!					7. Call Read(). String in file has more than 256 symbols.
   335 //!					8. Delete TFiletext object.
   336 //!					9. Call Close() on RFile object.
   337 //!					10. Delete RFile object.
   338 //!					11. Delete RFs object.
   339 //!
   340 //! @SYMTestStatus			Implemented
   341 //! @SYMTestPriority			Critical
   342 //! @SYMTestExpectedResults		Read() returns KErrNone.
   343 //! @SYMTestType			CIT
   344 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
   345 			CREATE_OBJECT	RFs	RFs1
   346 			CREATE_OBJECT	RFile	RFile1
   347 			CREATE_OBJECT	TFileText	TFileText1
   348 			COMMAND		RFs1		new
   349 			COMMAND		RFs1		Connect
   350 			COMMAND		RFile1		new
   351 			COMMAND		RFile1		Open		PBASE-F32-FileText-PublicApi-0009command5Open
   352 			COMMAND		TFileText1	new
   353 			COMMAND		TFileText1	Set		PBASE-F32-FileText-PublicApi-0009command8Set
   354 			COMMAND		TFileText1	Read		big_buffer
   355 			COMMAND		TFileText1	~
   356 			COMMAND		RFile1		Close
   357 			COMMAND		RFile1		~
   358 			COMMAND		RFs1		~
   359 	END_TEST_BLOCK
   360 END_TESTCASE				PBASE-F32-FileText-PublicApi-0009
   361 
   362 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0010
   363 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0010
   364 //! @SYMAPI				TFileText
   365 //! @SYMTestCaseDesc			Read() returns KErrTooBig error because of too small buffer.
   366 //!						Uses API elements: Set(), Read()
   367 //! @SYMTestActions			1. Create RFs object.
   368 //!					2. Call Connect().
   369 //!					3. Create RFile object.
   370 //!					4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
   371 //!					 path to file  'big_line.txt' string as the second parameter, and EFileRead as the third parameter.
   372 //!					5. Create TFileText object.
   373 //!					6. Call Set() passing RFile object instance as parameter.
   374 //!					7. Call Read(). String in file has more than 256 symbols. Buffer is 32.
   375 //!					8. Delete TFiletext object.
   376 //!					9. Call Close() on RFile object.
   377 //!					10. Delete RFile object.
   378 //!					11. Delete RFs object.
   379 //!
   380 //! @SYMTestStatus			Implemented
   381 //! @SYMTestPriority			Critical
   382 //! @SYMTestExpectedResults		Read() returns KErrTooBig.
   383 //! @SYMTestType			CIT
   384 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
   385 			CREATE_OBJECT		RFs		RFs1
   386 			CREATE_OBJECT		RFile		RFile1
   387 			CREATE_OBJECT		TFileText	TFileText1
   388 			COMMAND			RFs1		new
   389 			COMMAND			RFs1		Connect
   390 			COMMAND			RFile1		new
   391 			COMMAND			RFile1		Open		PBASE-F32-FileText-PublicApi-0010command5Open
   392 			COMMAND			TFileText1	new
   393 			COMMAND			TFileText1	Set		PBASE-F32-FileText-PublicApi-0010command8Set
   394 			COMMAND	!Error=-40	TFileText1	Read		PBASE-F32-FileText-PublicApi-0010command9Read
   395 			COMMAND			TFileText1	~
   396 			COMMAND			RFile1		Close
   397 			COMMAND			RFile1		~
   398 			COMMAND			RFs1		~
   399 	END_TEST_BLOCK
   400 END_TESTCASE				PBASE-F32-FileText-PublicApi-0010
   401 
   402 
   403 
   404 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0011
   405 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0011
   406 //! @SYMAPI				TFileText
   407 //! @SYMTestCaseDesc			Read() returns KErrTooBig error because of too small buffer.
   408 //!						Uses API elements: Set(), Read(), Write()
   409 //! @SYMTestActions			1. Create RFs object.
   410 //!					2. Call Connect().
   411 //!					3. Create RFile object.
   412 //!					4. Call Replace() on RFile object passing a reference to RFs object as the first parameter, a TDesC
   413 //!					 containing path to file  'multiline.txt' string as the second parameter, and EFileWrite as the
   414 //!					 third parameter.
   415 //!					5. Create TFileText object.
   416 //!					6. Call Set() passing RFile object instance as parameter.
   417 //!					7. Call Write(). String parameter is is 'First string'. Buffer is 64.
   418 //!					8. Call Write(). String parameter is is 'Second string'. Buffer is 64.
   419 //!					9. Call Write(). String parameter is is 'Third string'. Buffer is 64.
   420 //!					10. Delete TFiletext object.
   421 //!					11. Call Close() on RFile object.
   422 //!					12. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC file name 
   423 //!					reference as the second parameter, and EFileRead as the third parameter. The file opened named
   424 //!					 'multiline.txt' and contains three lines of text.
   425 //!					13. Create TFileText object.
   426 //!					14. Call Set() passing RFile object instance as parameter.
   427 //!					15. Call Read(). String in file expected as  'First string'. Buffer is 64.
   428 //!					16. Call Read(). String in file expected as 'Second string'. Buffer is 64.
   429 //!					15. Call Read(). String in file expected as 'Third string'. Buffer is 64.
   430 //!					17. Delete TFiletext object.
   431 //!					18. Call Close() on RFile object.
   432 //!					19. Delete RFile object.
   433 //!					20. Delete RFs object.
   434 //!
   435 //! @SYMTestStatus			Implemented
   436 //! @SYMTestPriority			Critical
   437 //! @SYMTestExpectedResults		Write() returns KErrNone. Read() returns KErrNone.
   438 //! @SYMTestType			CIT
   439 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
   440 			CREATE_OBJECT	RFs		RFs1
   441 			CREATE_OBJECT	RFile		RFile1
   442 			CREATE_OBJECT	TFileText	TFileText1
   443 			COMMAND		RFs1		new
   444 			COMMAND		RFs1		Connect
   445 			COMMAND		RFile1		new
   446 			COMMAND		RFile1		Replace		PBASE-F32-FileText-PublicApi-0011command5Replace
   447 			COMMAND		TFileText1	new
   448 			COMMAND		TFileText1	Set		PBASE-F32-FileText-PublicApi-0011command8Set
   449 			COMMAND		TFileText1	Write		PBASE-F32-FileText-PublicApi-0011command9Write
   450 			COMMAND		TFileText1	Write		PBASE-F32-FileText-PublicApi-0011command10Write
   451 			COMMAND		TFileText1	Write		PBASE-F32-FileText-PublicApi-0011command11Write
   452 			COMMAND		TFileText1	~
   453 			COMMAND		RFile1		Close
   454 			COMMAND		RFile1		Open		PBASE-F32-FileText-PublicApi-0011command15Open
   455 			COMMAND		TFileText1	new
   456 			COMMAND		TFileText1	Set		PBASE-F32-FileText-PublicApi-0011command18Set
   457 			COMMAND		TFileText1	Read		PBASE-F32-FileText-PublicApi-0011command19Read
   458 			COMMAND		TFileText1	Read		PBASE-F32-FileText-PublicApi-0011command20Read
   459 			COMMAND		TFileText1	Read		PBASE-F32-FileText-PublicApi-0011command21Read
   460 			COMMAND		TFileText1	~
   461 			COMMAND		RFile1		Close
   462 			COMMAND		RFs1		~
   463 	END_TEST_BLOCK
   464 END_TESTCASE				PBASE-F32-FileText-PublicApi-0011
   465 
   466 
   467 
   468 
   469 
   470 
   471 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0012
   472 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0012
   473 //! @SYMCreationDate			08/08/2007
   474 //! @SYMTestCaseDesc			Write() appending a string. Read() checking if it is added to the end of file.
   475 //!						Uses API elements: Set(), Read(), Write()
   476 //! @SYMTestActions			1. Create RFs object.
   477 //!					2. Call Connect().
   478 //!					3. Create RFile object.
   479 //!					4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
   480 //!					path to file  'oneliner.txt' string as the second parameter, and EFileWrite as the third
   481 //!					parameter.
   482 //!					5. Create TFileText object.
   483 //!					6. Call Set() passing RFile object instance as parameter.
   484 //!					7. Call Write(). String parameter is is 'Appended string'. Buffer is 64.
   485 //!					8. Call Close() on RFile object.
   486 //!					9. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC containing
   487 //!					 path to file  'oneliner.txt' string as the second parameter, and EFileRead as the third parameter.
   488 //!					10. Create TFileText object. And set the position to the beginning of file using Seek().
   489 //!					11. Call Set() passing RFile object instance as parameter.
   490 //!					12. Call Read(). String in file expected as  'First string'. Buffer is 64. (File contained this string
   491 //!					before any modifications. So it's have to be first one.)
   492 //!					13. Call Read(). String in file expected as  'Appended string'. Buffer is 64.
   493 //!					14. Delete TFiletext object.
   494 //!					15. Call Close() on RFile object.
   495 //!					16. Delete RFile object.
   496 //!					17. Delete RFs object.
   497 //!
   498 //! @SYMTestStatus			Implemented
   499 //! @SYMTestPriority			Critical
   500 //! @SYMTestExpectedResults		Write() returns KErrNone. Read() returns KErrNone.
   501 //! @SYMTestType			CIT
   502 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
   503 			CREATE_OBJECT	RFs	RFs1
   504 			CREATE_OBJECT	RFile	RFile1
   505 			CREATE_OBJECT	TFileText	TFileText1
   506 			COMMAND		RFs1		new
   507 			COMMAND		RFs1		Connect
   508 			COMMAND		RFile1		new
   509 			COMMAND		RFile1		Open		PBASE-F32-FileText-PublicApi-0012command5Open
   510 			COMMAND		TFileText1	new
   511 			COMMAND		TFileText1	Set		PBASE-F32-FileText-PublicApi-0012command8Set
   512 			COMMAND		TFileText1	Write		PBASE-F32-FileText-PublicApi-0012command9Write
   513 			COMMAND		TFileText1	~
   514 			COMMAND		RFile1		Close
   515 			COMMAND		RFile1		Open		PBASE-F32-FileText-PublicApi-0012command13Open
   516 			COMMAND		TFileText1	new
   517 			COMMAND		TFileText1	Set		PBASE-F32-FileText-PublicApi-0012command16Set
   518 			COMMAND		TFileText1	Read		PBASE-F32-FileText-PublicApi-0012command18Read
   519 			COMMAND		TFileText1	Read		PBASE-F32-FileText-PublicApi-0012command19Read
   520 			COMMAND		TFileText1	~
   521 			COMMAND		RFile1		Close
   522 			COMMAND		RFs1		~
   523 	END_TEST_BLOCK
   524 END_TESTCASE				PBASE-F32-FileText-PublicApi-0012
   525 
   526 
   527 
   528 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0013
   529 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0013
   530 //! @SYMAPI				TFileText
   531 //! @SYMTestCaseDesc			Seek() passing a ESeekAddress as a parameter.
   532 //!						Uses API elements: Set(), Seek().
   533 //! @SYMTestActions			1. Create RFs object.
   534 //!					2. Call Connect().
   535 //!					3. Create RFile object.
   536 //!					4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC file name
   537 //!					reference as the second parameter, and EFileWrite as the third parameter.
   538 //!					5. Create TFileText object.
   539 //!					6. Call Set() passing a reference to RFile object as a parameter.
   540 //!					7. Call Seek() on TFileText passing ESeekAddress as a parameter.
   541 //!					8. Delete TFiletext object.
   542 //!					9. Call Close() on RFile object.
   543 //!					10. Delete RFile object.
   544 //!					11. Delete RFs object.
   545 //!
   546 //! @SYMTestStatus			Implemented
   547 //! @SYMTestPriority			Critical
   548 //! @SYMTestExpectedResults		Seek() panics with code FSCLIENT-5.
   549 //! @SYMTestType			CIT
   550 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
   551 			CREATE_OBJECT	RFs	RFs1
   552 			CREATE_OBJECT	RFile	RFile1
   553 			CREATE_OBJECT	TFileText	TFileText1
   554 			COMMAND		RFs1		new
   555 			COMMAND		RFs1		Connect
   556 			COMMAND		RFile1		new
   557 			COMMAND		RFile1		Open		PBASE-F32-FileText-PublicApi-0013command5Open
   558 			COMMAND		TFileText1	new
   559 			COMMAND		TFileText1	Set		PBASE-F32-FileText-PublicApi-0013command8Set
   560 			COMMAND		TFileText1	Seek		PBASE-F32-FileText-PublicApi-0013command9Seek
   561 			COMMAND		TFileText1	~
   562 			COMMAND		RFile1		Close
   563 			COMMAND		RFs1		~
   564 	END_TEST_BLOCK	!PanicCode=5	!PanicString="FSCLIENT panic"
   565 
   566 END_TESTCASE				PBASE-F32-FileText-PublicApi-0013
   567 
   568 START_TESTCASE 				PBASE-F32-FileText-PublicApi-0014
   569 //! @SYMTestCaseID			PBASE-F32-FileText-PublicApi-0014
   570 //! @SYMAPI				TFileText
   571 //! @SYMTestCaseDesc			Seek() passing a ESeekCurrent as a parameter.
   572 //!							Uses API elements: Set(), Seek().
   573 //! @SYMTestActions			1. Create RFs object.
   574 //!					2. Call Connect().
   575 //!					3. Create RFile object.
   576 //!					4. Call Open() on RFile object passing a reference to RFs object as the first parameter, a TDesC file name
   577 //!					 reference as the second parameter, and EFileWrite as the third parameter.
   578 //!					5. Create TFileText object.
   579 //!					6. Call Set() passing a reference to RFile object as a parameter.
   580 //!					7. Call Seek() on TFileText passing ESeekCurrent as a parameter.
   581 //!					8. Delete TFiletext object.
   582 //!					9. Call Close() on RFile object.
   583 //!					10. Delete RFile object.
   584 //!					11. Delete RFs object.
   585 //!
   586 //! @SYMTestStatus			Implemented
   587 //! @SYMTestPriority			Critical
   588 //! @SYMTestExpectedResults		Seek() panics with code FSCLIENT-5.
   589 //! @SYMTestType			CIT
   590 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
   591 			CREATE_OBJECT	RFs		RFs1
   592 			CREATE_OBJECT	RFile		RFile1
   593 			CREATE_OBJECT	TFileText	TFileText1
   594 			COMMAND		RFs1		new
   595 			COMMAND		RFs1		Connect
   596 			COMMAND		RFile1		new
   597 			COMMAND		RFile1		Open		PBASE-F32-FileText-PublicApi-0014command5Open
   598 			COMMAND		TFileText1	new
   599 			COMMAND		TFileText1	Set		PBASE-F32-FileText-PublicApi-0014command8Set
   600 			COMMAND		TFileText1	Seek		PBASE-F32-FileText-PublicApi-0014command9Seek
   601 			COMMAND		TFileText1	~
   602 			COMMAND		RFile1		Close
   603 			COMMAND		RFs1		~
   604 	END_TEST_BLOCK	!PanicCode=5	!PanicString="FSCLIENT panic"
   605 END_TESTCASE				PBASE-F32-FileText-PublicApi-0014
   606 
   607 
   608 START_TESTCASE				REMOVE_FILES
   609 	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-FileText-PublicApi.ini
   610 			CREATE_OBJECT	RFs	RFs1
   611 			CREATE_OBJECT	CFileMan	CFileMan1
   612 			COMMAND		RFs1	new
   613 			COMMAND		RFs1	Connect
   614 			COMMAND		CFileMan1	NewL	fileman_fs
   615 			COMMAND		CFileMan1	Delete	all_test_files
   616 			COMMAND		RFs1		RmDir	test_dir
   617 			COMMAND		CFileMan1	new
   618 			COMMAND		CFileMan1	~
   619 			COMMAND		RFs1	~
   620 	END_TEST_BLOCK
   621 END_TESTCASE				REMOVE_FILES