Re: cvs: php-src(PHP_5_2) /ext/standard/tests/file fgetcsv_error.phpt

From: Date: Thu, 09 Aug 2007 08:52:41 +0000
Subject: Re: cvs: php-src(PHP_5_2) /ext/standard/tests/file fgetcsv_error.phpt
References: 1 2 3 4  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-45808@lists.php.net to get a copy of this message
On 09.08.2007 10:14, Nikhil Gupta wrote:
Hi Tony, The purpose of testcase (fgetcsv_variation14.phpt) is to read from end of file.The use of feof() in the testcase is to check for the file pointer pointing to end of file. This check is required to confirm the position of file pointer before and after the read function by fgetcsv(). I think this check is required here.
I don't understand why it's required to test feof() in fgetcsv() tests (perhaps you need a separate test for feof() in this case?) and the expected result of the check is definitely wrong. fgetcsv() reads up to the end of line, which happens to be the end of file too, but feof() returns false because the function stopped right in the end, it didn't try to read more, so it didn't get EOF or truncated data. feof() returns bool(false) in this case in all recent PHP versions (4.4, 5.2.3, 5.2), so I dunno why the tests expect bool(true). -- Wbr, Antony Dovgal

« previous php.cvs (#45808) next »