kraghuba Mon Jun 18 19:51:11 2007 UTC
Modified files:
/php-src/ext/standard/tests/file is_dir_error.phpt fread_error.phpt
is_file_basic.phpt
filesize_basic.phpt
filesize_error.phpt
is_file_error.phpt
fread_basic.phpt is_dir_basic.phpt
Log:
New tests for file system handling functions
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/is_dir_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/is_dir_error.phpt
diff -u /dev/null php-src/ext/standard/tests/file/is_dir_error.phpt:1.2
--- /dev/null Mon Jun 18 19:51:11 2007
+++ php-src/ext/standard/tests/file/is_dir_error.phpt Mon Jun 18 19:51:11 2007
@@ -0,0 +1,44 @@
+--TEST--
+Test is_dir() function: error conditions
+--FILE--
+<?php
+/* Prototype: bool is_dir ( string $filename );
+ * Description: Tells whether the filename is a regular file
+ * Returns TRUE if the filename exists and is a regular file
+ */
+
+echo "*** Testing is_dir() error conditions ***";
+var_dump( is_dir() ); // Zero No. of args
+
+$dir_name = dirname(__FILE__)."/is_dir_error";
+mkdir($dir_name);
+var_dump( is_dir($dir_name, "is_dir_error1") ); // args > expected no.of args
+
+/* Non-existing dir */
+var_dump( is_dir("/no/such/dir") );
+
+echo "*** Done ***";
+?>
+
+--CLEAN--
+<?php
+rmdir(dirname(__FILE__)."/is_dir_error");
+?>
+--EXPECTF--
+*** Testing is_dir() error conditions ***
+Warning: is_dir() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: is_dir() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+bool(false)
+*** Done ***
+--UEXPECTF--
+*** Testing is_dir() error conditions ***
+Warning: is_dir() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: is_dir() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+bool(false)
+*** Done ***
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fread_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/fread_error.phpt
diff -u /dev/null php-src/ext/standard/tests/file/fread_error.phpt:1.2
--- /dev/null Mon Jun 18 19:51:11 2007
+++ php-src/ext/standard/tests/file/fread_error.phpt Mon Jun 18 19:51:11 2007
@@ -0,0 +1,169 @@
+--TEST--
+Test fread() function : error conditions
+--FILE--
+<?php
+/*
+ Prototype: string fread ( resource $handle [, int $length] );
+ Description: reads up to length bytes from the file pointer referenced by
handle.
+ Reading stops when up to length bytes have been read, EOF (end of file) is
+ reached, (for network streams) when a packet becomes available, or (after
+ opening userspace stream) when 8192 bytes have been read whichever comes
first.
+*/
+
+echo "*** Testing error conditions ***\n";
+$filename = __FILE__;
+$file_handle = fopen($filename, "r");
+
+// zero argument
+echo "-- Testing fread() with zero argument --\n";
+var_dump( fread() );
+
+// more than expected no. of args
+echo "-- Testing fread() with more than expected number of arguments --\n";
+var_dump( fread($file_handle, 10, $file_handle) );
+
+// invalid length argument
+echo "-- Testing fread() with invalid length arguments --\n";
+$len = 0;
+var_dump( fread($file_handle, $len) );
+$len = -10;
+var_dump( fread($file_handle, $len) );
+
+// test invalid arguments : non-resources
+echo "-- Testing fread() with invalid arguments --\n";
+$invalid_args = array (
+ "string",
+ 10,
+ 10.5,
+ true,
+ array(1,2,3),
+ new stdclass,
+);
+/* loop to test fread() with different invalid type of args */
+for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++)
{
+ echo "-- Iteration $loop_counter --\n";
+ var_dump( fread($invalid_args[$loop_counter - 1], 10) );
+}
+
+// fwrite() on a file handle which is already closed
+echo "-- Testing fwrite() with closed/unset file handle --\n";
+fclose($file_handle);
+var_dump( fread($file_handle,$file_content_type) );
+
+// fwrite on a file handle which is unset
+$fp = fopen($filename, "r");
+unset($fp); //unset file handle
+var_dump( fread(@$fp,10) );
+var_dump( fclose(@$fp) );
+
+echo "Done\n";
+--EXPECTF--
+*** Testing error conditions ***
+-- Testing fread() with zero argument --
+
+Warning: fread() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+-- Testing fread() with more than expected number of arguments --
+
+Warning: fread() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+-- Testing fread() with invalid length arguments --
+
+Warning: fread(): Length parameter must be greater than 0 in %s on line %d
+bool(false)
+
+Warning: fread(): Length parameter must be greater than 0 in %s on line %d
+bool(false)
+-- Testing fread() with invalid arguments --
+-- Iteration 1 --
+
+Warning: fread() expects parameter 1 to be resource, string given in %s on
line %d
+NULL
+-- Iteration 2 --
+
+Warning: fread() expects parameter 1 to be resource, integer given in %s on
line %d
+NULL
+-- Iteration 3 --
+
+Warning: fread() expects parameter 1 to be resource, double given in %s on
line %d
+NULL
+-- Iteration 4 --
+
+Warning: fread() expects parameter 1 to be resource, boolean given in %s on
line %d
+NULL
+-- Iteration 5 --
+
+Warning: fread() expects parameter 1 to be resource, array given in %s on line
%d
+NULL
+-- Iteration 6 --
+
+Warning: fread() expects parameter 1 to be resource, object given in %s on
line %d
+NULL
+-- Testing fwrite() with closed/unset file handle --
+
+Notice: Undefined variable: file_content_type in %s on line %d
+
+Warning: fread(): 5 is not a valid stream resource in %s on line %d
+bool(false)
+
+Warning: fread() expects parameter 1 to be resource, null given in %s on line
%d
+NULL
+
+Warning: fclose(): supplied argument is not a valid stream resource in %s on
line %d
+bool(false)
+Done
+--UEXPECTF--
+*** Testing error conditions ***
+-- Testing fread() with zero argument --
+
+Warning: fread() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+-- Testing fread() with more than expected number of arguments --
+
+Warning: fread() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+-- Testing fread() with invalid length arguments --
+
+Warning: fread(): Length parameter must be greater than 0 in %s on line %d
+bool(false)
+
+Warning: fread(): Length parameter must be greater than 0 in %s on line %d
+bool(false)
+-- Testing fread() with invalid arguments --
+-- Iteration 1 --
+
+Warning: fread() expects parameter 1 to be resource, Unicode string given in
%s on line %d
+NULL
+-- Iteration 2 --
+
+Warning: fread() expects parameter 1 to be resource, integer given in %s on
line %d
+NULL
+-- Iteration 3 --
+
+Warning: fread() expects parameter 1 to be resource, double given in %s on
line %d
+NULL
+-- Iteration 4 --
+
+Warning: fread() expects parameter 1 to be resource, boolean given in %s on
line %d
+NULL
+-- Iteration 5 --
+
+Warning: fread() expects parameter 1 to be resource, array given in %s on line
%d
+NULL
+-- Iteration 6 --
+
+Warning: fread() expects parameter 1 to be resource, object given in %s on
line %d
+NULL
+-- Testing fwrite() with closed/unset file handle --
+
+Notice: Undefined variable: file_content_type in %s on line %d
+
+Warning: fread(): 5 is not a valid stream resource in %s on line %d
+bool(false)
+
+Warning: fread() expects parameter 1 to be resource, null given in %s on line
%d
+NULL
+
+Warning: fclose(): supplied argument is not a valid stream resource in %s on
line %d
+bool(false)
+Done
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/is_file_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/is_file_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/file/is_file_basic.phpt:1.2
--- /dev/null Mon Jun 18 19:51:11 2007
+++ php-src/ext/standard/tests/file/is_file_basic.phpt Mon Jun 18 19:51:11 2007
@@ -0,0 +1,59 @@
+--TEST--
+Test is_file() function: basic functionality
+--FILE--
+<?php
+/* Prototype: bool is_file ( string $filename );
+ Description: Tells whether the filename is a regular file
+ Returns TRUE if the filename exists and is a regular file
+*/
+
+echo "*** Testing is_file(): basic functionality ***\n";
+
+/* Checking with current file */
+var_dump( is_file(__FILE__) );
+
+/* Checking with (current) dir */
+var_dump( is_file(dirname(__FILE__)) );
+
+$file_path = dirname(__FILE__);
+$file_name = $file_path."/is_file_basic.tmp";
+/* With non-existing file */
+var_dump( is_file($file_name) );
+/* With existing file */
+fclose( fopen($file_name, "w") );
+var_dump( is_file($file_name) );
+
+echo "*** Testing is_file() for its return value type ***\n";
+var_dump( is_bool( is_file(__FILE__) ) );
+var_dump( is_bool( is_file("/no/such/file") ) );
+
+echo "\n*** Done ***";
+?>
+--CLEAN--
+<?php
+$file_path = dirname(__FILE__);
+$file_name = $file_path."/is_file_basic.tmp";
+unlink($file_name);
+?>
+--EXPECTF--
+*** Testing is_file(): basic functionality ***
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+*** Testing is_file() for its return value type ***
+bool(true)
+bool(true)
+
+*** Done ***
+--UEXPECTF--
+*** Testing is_file(): basic functionality ***
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+*** Testing is_file() for its return value type ***
+bool(true)
+bool(true)
+
+*** Done ***
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/filesize_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/filesize_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/file/filesize_basic.phpt:1.2
--- /dev/null Mon Jun 18 19:51:11 2007
+++ php-src/ext/standard/tests/file/filesize_basic.phpt Mon Jun 18 19:51:11 2007
@@ -0,0 +1,45 @@
+--TEST--
+Test filesize() function: basic functionaity
+--FILE--
+<?php
+/*
+ * Prototype: int filesize ( string $filename );
+ * Description: Returns the size of the file in bytes, or FALSE
+ * (and generates an error of level E_WARNING) in case of an
error.
+ */
+
+
+echo "*** Testing size of files and directories with filesize() ***\n";
+
+$file_path = dirname(__FILE__);
+
+var_dump( filesize(__FILE__) );
+var_dump( filesize(".") );
+
+/* Empty file */
+$file_name = $file_path."/filesize_basic.tmp";
+$file_handle = fopen($file_name, "w");
+fclose($file_handle);
+var_dump( filesize($file_name) );
+
+echo "*** Done ***\n";
+?>
+--CLEAN--
+<?php
+$file_path = dirname(__FILE__);
+$file_name = $file_path."/filesize_basic.tmp";
+unlink($file_name);
+?>
+--EXPECTF--
+*** Testing size of files and directories with filesize() ***
+int(%d)
+int(%d)
+int(0)
+*** Done ***
+
+--UEXPECTF--
+*** Testing size of files and directories with filesize() ***
+int(%d)
+int(%d)
+int(0)
+*** Done ***
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/filesize_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/filesize_error.phpt
diff -u /dev/null php-src/ext/standard/tests/file/filesize_error.phpt:1.2
--- /dev/null Mon Jun 18 19:51:11 2007
+++ php-src/ext/standard/tests/file/filesize_error.phpt Mon Jun 18 19:51:11 2007
@@ -0,0 +1,56 @@
+--TEST--
+Test filesize() function: error conditions
+--FILE--
+<?php
+/*
+ * Prototype : int filesize ( string $filename );
+ * Description : Returns the size of the file in bytes, or FALSE
+ * (and generates an error of level E_WARNING) in case of an
error.
+ */
+
+echo "*** Testing filesize(): error conditions ***";
+
+/* Non-existing file or dir */
+var_dump( filesize("/no/such/file") );
+var_dump( filesize("/no/such/dir") );
+
+/* No.of arguments less than expected */
+var_dump( filesize() );
+
+/* No.of arguments greater than expected */
+var_dump( filesize(__FILE__, 2000) );
+echo "\n";
+
+echo "*** Done ***\n";
+?>
+--EXPECTF--
+*** Testing filesize(): error conditions ***
+Warning: filesize(): stat failed for /no/such/file in %s on line %d
+bool(false)
+
+Warning: filesize(): stat failed for /no/such/dir in %s on line %d
+bool(false)
+
+Warning: filesize() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: filesize() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+
+*** Done ***
+
+--UEXPECTF--
+*** Testing filesize(): error conditions ***
+Warning: filesize(): stat failed for /no/such/file in %s on line %d
+bool(false)
+
+Warning: filesize(): stat failed for /no/such/dir in %s on line %d
+bool(false)
+
+Warning: filesize() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: filesize() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+
+*** Done ***
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/is_file_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/is_file_error.phpt
diff -u /dev/null php-src/ext/standard/tests/file/is_file_error.phpt:1.2
--- /dev/null Mon Jun 18 19:51:11 2007
+++ php-src/ext/standard/tests/file/is_file_error.phpt Mon Jun 18 19:51:11 2007
@@ -0,0 +1,60 @@
+--TEST--
+Test is_file() function: error conditions
+--FILE--
+<?php
+/* Prototype: bool is_file ( string $filename );
+ Description: Tells whether the filename is a regular file
+ Returns TRUE if the filename exists and is a regular file
+*/
+
+echo "*** Testing is_file() error conditions ***";
+$file_path = dirname(__FILE__);
+var_dump( is_file() ); // Zero No. of args
+
+/* no of args > expected */
+$file_handle = fopen($file_path."/is_file_error.tmp", "w");
+var_dump( is_file( $file_path."/is_file_error.tmp",
$file_path."/is_file_error1.tmp") );
+
+/* Non-existing file */
+var_dump( is_file($file_path."/is_file_error1.tmp") );
+
+/* Passing resource as an argument */
+var_dump( is_file($file_handle) );
+
+fclose($file_handle);
+
+echo "\n*** Done ***";
+?>
+
+--CLEAN--
+<?php
+$file_path = dirname(__FILE__);
+unlink($file_path."/is_file_error.tmp");
+unlink($file_path."/is_file_error1.tmp");
+?>
+--EXPECTF--
+*** Testing is_file() error conditions ***
+Warning: is_file() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: is_file() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+bool(false)
+
+Warning: is_file() expects parameter 1 to be string (Unicode or binary),
resource given in %s on line %d
+NULL
+
+*** Done ***
+--UEXPECTF--
+*** Testing is_file() error conditions ***
+Warning: is_file() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: is_file() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+bool(false)
+
+Warning: is_file() expects parameter 1 to be string (Unicode or binary),
resource given in %s on line %d
+NULL
+
+*** Done ***
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fread_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/fread_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/file/fread_basic.phpt:1.2
--- /dev/null Mon Jun 18 19:51:11 2007
+++ php-src/ext/standard/tests/file/fread_basic.phpt Mon Jun 18 19:51:11 2007
@@ -0,0 +1,1179 @@
+--TEST--
+Test fread() function : basic functionality
+--FILE--
+<?php
+/*
+ Prototype: string fread ( resource $handle [, int $length] );
+ Description: reads up to length bytes from the file pointer referenced by
handle.
+ Reading stops when up to length bytes have been read, EOF (end of file) is
+ reached, (for network streams) when a packet becomes available, or (after
+ opening userspace stream) when 8192 bytes have been read whichever comes
first.
+*/
+
+// include the file.inc for common functions for test
+include ("file.inc");
+
+/* Function : function check_size(string $data, int $expect_size)
+ Description : Check the length of the data, and compare the size with
$expect_size
+ $data : Text data.
+ $expect_size : Expected data length
+*/
+function check_size($data, $expect_size) {
+
+ $size=strlen($data);
+ if ( $size == $expect_size)
+ echo "OK\n";
+ else
+ echo "Error: Expected: $expect_size, Actual: $size";
+ }
+
+
+echo "*** Testing fread() basic operations ***\n";
+/*
+ test fread with file opened in "r" and "rb" mode only
+ Content with numeric and strings with it
+*/
+$file_modes = array( "r", "rb", "rt", "r+", "r+b", "r+t");
+$file_content_types =
array("numeric","text","text_with_new_line","alphanumeric");
+
+ foreach($file_content_types as $file_content_type) {
+ echo "\n-- Testing fread) with file having data of type ".
$file_content_type ." --\n";
+ /* create files with $file_content_type */
+ create_files ( dirname(__FILE__), 1, $file_content_type, 0755, 1, "w",
"fread_basic");
+ $filename = dirname(__FILE__)."/fread_basic1.tmp"; // this is name of the
file created by create_files()
+
+ /* open the file using $files_modes and perform fread() on it */
+ for($inner_loop_counter = 0;
+ $inner_loop_counter < count($file_modes);
+ $inner_loop_counter++) {
+
+ echo "-- File opened in mode ".$file_modes[$inner_loop_counter]." --\n";
+ $file_handle = fopen($filename, $file_modes[$inner_loop_counter]);
+ if (!$file_handle) {
+ echo "Error: failed to fopen() file: $filename!";
+ exit();
+ }
+
+ /* read file by giving the acutal length, check the length and content by
calculating the
+ hash using md5() function
+ */
+ /* Reading 1024 bytes from file, expecting 1024 bytes */ ;
+
+ var_dump(ftell($file_handle));
+ var_dump( feof($file_handle) );
+ echo "Reading 1024 bytes from file, expecting 1024 bytes ... ";
+ $data_from_file=fread($file_handle, 1024);
+ check_size($data_from_file,1024);
+ var_dump(ftell($file_handle));
+ var_dump( feof($file_handle) );
+ var_dump( md5($data_from_file) ); // calculate the hash and dump it
+
+ /* read file by giving size more than its size */
+ var_dump(rewind($file_handle));
+ var_dump(ftell($file_handle));
+ var_dump( feof($file_handle) );
+ /*reading 1030 bytes from file, expecting 1024 bytes */ ;
+ echo "Reading 1030 bytes from file, expecting 1024 bytes ... ";
+ $data_from_file=fread($file_handle, 1030);// request for 6 bytes more than
its size
+ check_size($data_from_file,1024);
+ var_dump(ftell($file_handle));
+ var_dump( feof($file_handle) );
+ var_dump( md5($data_from_file) ); // calculate the hash and dump it
+
+ // reading 1000 bytes within the file max size
+ var_dump(rewind($file_handle));
+ var_dump(ftell($file_handle));
+ var_dump( feof($file_handle) );
+ /*reading 1000 bytes from file, expecting 1000 bytes */ ;
+ echo "Reading 1000 bytes from file, expecting 1000 bytes ... ";
+ $data_from_file=fread($file_handle, 1000);// request for 24 bytes less
than its size
+ check_size($data_from_file,1000);
+ var_dump(ftell($file_handle));
+ var_dump( feof($file_handle) );
+ var_dump( md5($data_from_file) ); // calculate the hash and dump it
+ var_dump(fclose($file_handle)); // now close the file
+ } // end of inner for loop
+
+ // delete the file created
+ delete_file($filename); // delete file with name
+} // end of outer foreach loop
+echo "Done\n";
+?>
+--EXPECTF--
+*** Testing fread() basic operations ***
+
+-- Testing fread) with file having data of type numeric --
+-- File opened in mode r --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "4501f99f2b79d0345f26f1394aca58a3"
+bool(true)
+-- File opened in mode rb --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "4501f99f2b79d0345f26f1394aca58a3"
+bool(true)
+-- File opened in mode rt --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "4501f99f2b79d0345f26f1394aca58a3"
+bool(true)
+-- File opened in mode r+ --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "4501f99f2b79d0345f26f1394aca58a3"
+bool(true)
+-- File opened in mode r+b --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "4501f99f2b79d0345f26f1394aca58a3"
+bool(true)
+-- File opened in mode r+t --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "4501f99f2b79d0345f26f1394aca58a3"
+bool(true)
+
+-- Testing fread) with file having data of type text --
+-- File opened in mode r --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
+bool(true)
+-- File opened in mode rb --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
+bool(true)
+-- File opened in mode rt --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
+bool(true)
+-- File opened in mode r+ --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
+bool(true)
+-- File opened in mode r+b --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
+bool(true)
+-- File opened in mode r+t --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
+bool(true)
+
+-- Testing fread) with file having data of type text_with_new_line --
+-- File opened in mode r --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "a148fa8110bbac875d84fc9d7056c0a1"
+bool(true)
+-- File opened in mode rb --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "a148fa8110bbac875d84fc9d7056c0a1"
+bool(true)
+-- File opened in mode rt --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "a148fa8110bbac875d84fc9d7056c0a1"
+bool(true)
+-- File opened in mode r+ --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "a148fa8110bbac875d84fc9d7056c0a1"
+bool(true)
+-- File opened in mode r+b --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "a148fa8110bbac875d84fc9d7056c0a1"
+bool(true)
+-- File opened in mode r+t --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "a148fa8110bbac875d84fc9d7056c0a1"
+bool(true)
+
+-- Testing fread) with file having data of type alphanumeric --
+-- File opened in mode r --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "a49d752f980184c7f44568e930f89c72"
+bool(true)
+-- File opened in mode rb --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "a49d752f980184c7f44568e930f89c72"
+bool(true)
+-- File opened in mode rt --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "a49d752f980184c7f44568e930f89c72"
+bool(true)
+-- File opened in mode r+ --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "a49d752f980184c7f44568e930f89c72"
+bool(true)
+-- File opened in mode r+b --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "a49d752f980184c7f44568e930f89c72"
+bool(true)
+-- File opened in mode r+t --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+string(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+string(32) "a49d752f980184c7f44568e930f89c72"
+bool(true)
+Done
+--UEXPECTF--
+*** Testing fread() basic operations ***
+
+-- Testing fread) with file having data of type numeric --
+-- File opened in mode r --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "4501f99f2b79d0345f26f1394aca58a3"
+bool(true)
+-- File opened in mode rb --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "4501f99f2b79d0345f26f1394aca58a3"
+bool(true)
+-- File opened in mode rt --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "4501f99f2b79d0345f26f1394aca58a3"
+bool(true)
+-- File opened in mode r+ --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "4501f99f2b79d0345f26f1394aca58a3"
+bool(true)
+-- File opened in mode r+b --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "4501f99f2b79d0345f26f1394aca58a3"
+bool(true)
+-- File opened in mode r+t --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "950b7457d1deb6332f2fc5d42f3129d6"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "4501f99f2b79d0345f26f1394aca58a3"
+bool(true)
+
+-- Testing fread) with file having data of type text --
+-- File opened in mode r --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
+bool(true)
+-- File opened in mode rb --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
+bool(true)
+-- File opened in mode rt --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
+bool(true)
+-- File opened in mode r+ --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
+bool(true)
+-- File opened in mode r+b --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
+bool(true)
+-- File opened in mode r+t --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "e486000c4c8452774f746a27658d87fa"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd"
+bool(true)
+
+-- Testing fread) with file having data of type text_with_new_line --
+-- File opened in mode r --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "a148fa8110bbac875d84fc9d7056c0a1"
+bool(true)
+-- File opened in mode rb --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "a148fa8110bbac875d84fc9d7056c0a1"
+bool(true)
+-- File opened in mode rt --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "a148fa8110bbac875d84fc9d7056c0a1"
+bool(true)
+-- File opened in mode r+ --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "a148fa8110bbac875d84fc9d7056c0a1"
+bool(true)
+-- File opened in mode r+b --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "a148fa8110bbac875d84fc9d7056c0a1"
+bool(true)
+-- File opened in mode r+t --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "b09c8026a64a88d36d4c2f17983964bb"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "a148fa8110bbac875d84fc9d7056c0a1"
+bool(true)
+
+-- Testing fread) with file having data of type alphanumeric --
+-- File opened in mode r --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "a49d752f980184c7f44568e930f89c72"
+bool(true)
+-- File opened in mode rb --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "a49d752f980184c7f44568e930f89c72"
+bool(true)
+-- File opened in mode rt --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "a49d752f980184c7f44568e930f89c72"
+bool(true)
+-- File opened in mode r+ --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "a49d752f980184c7f44568e930f89c72"
+bool(true)
+-- File opened in mode r+b --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(false)
+unicode(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "a49d752f980184c7f44568e930f89c72"
+bool(true)
+-- File opened in mode r+t --
+int(0)
+bool(false)
+Reading 1024 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1030 bytes from file, expecting 1024 bytes ... OK
+int(1024)
+bool(true)
+unicode(32) "3fabd48d8eaa65c14e0d93d6880c560c"
+bool(true)
+int(0)
+bool(false)
+Reading 1000 bytes from file, expecting 1000 bytes ... OK
+int(1000)
+bool(false)
+unicode(32) "a49d752f980184c7f44568e930f89c72"
+bool(true)
+Done
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/is_dir_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/is_dir_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/file/is_dir_basic.phpt:1.2
--- /dev/null Mon Jun 18 19:51:11 2007
+++ php-src/ext/standard/tests/file/is_dir_basic.phpt Mon Jun 18 19:51:11 2007
@@ -0,0 +1,53 @@
+--TEST--
+Test is_dir() function: basic functionality
+--FILE--
+<?php
+/* Prototype: bool is_dir ( string $filename );
+ Description: Tells whether the filename is a regular file
+ Returns TRUE if the filename exists and is a regular file
+*/
+
+echo "*** Testing is_dir(): basic functionality ***\n";
+$file_path = dirname(__FILE__);
+var_dump( is_dir($file_path) );
+clearstatcache();
+var_dump( is_dir(".") );
+var_dump( is_dir(__FILE__) ); // expected: bool(false)
+
+$dir_name = $file_path."/is_dir_basic";
+mkdir($dir_name);
+var_dump( is_dir($dir_name) );
+
+echo "*** Testing is_dir() for its return value type ***\n";
+var_dump( is_bool( is_dir($file_path) ) );
+var_dump( is_bool( is_dir("/no/such/dir") ) );
+
+echo "*** Done ***";
+?>
+--CLEAN--
+<?php
+$file_path = dirname(__FILE__);
+$dir_name = $file_path."/is_dir_basic";
+rmdir($dir_name);
+?>
+
+--EXPECTF--
+*** Testing is_dir(): basic functionality ***
+bool(true)
+bool(true)
+bool(false)
+bool(true)
+*** Testing is_dir() for its return value type ***
+bool(true)
+bool(true)
+*** Done ***
+--UEXPECTF--
+*** Testing is_dir(): basic functionality ***
+bool(true)
+bool(true)
+bool(false)
+bool(true)
+*** Testing is_dir() for its return value type ***
+bool(true)
+bool(true)
+*** Done ***
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php