Re: [PHP-CVS] cvs: php-src /ext/standard/tests/file file.inc stat_basic-win32.phpt stat_variation8-win32.phpt tempnam_variation3-win32.phpt touch.phpt
The touch.phpt is broken on Linux. Please revert it back. Dmitry. Pierre-Alain Joye wrote: pajoye Sun Aug 17 11:10:52 2008 UTC Modified files: /php-src/ext/standard/tests/file file.inc stat_basic-win32.phpt stat_variation8-win32.phpt tempnam_variation3-win32.phpt touch.phpt Log: - MFB: - fix or improve tests - add dump of the array_diff for compare_stats http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/file.inc?r1=1.7r2=1.8diff_format=u Index: php-src/ext/standard/tests/file/file.inc diff -u php-src/ext/standard/tests/file/file.inc:1.7 php-src/ext/standard/tests/file/file.inc:1.8 --- php-src/ext/standard/tests/file/file.inc:1.7Thu Jul 26 13:55:42 2007 +++ php-src/ext/standard/tests/file/file.incSun Aug 17 11:10:52 2008 @@ -279,7 +279,7 @@ if ( $content_type == empty ) { $return_value['filled'] = $count; } else { -//fill the file with specifiec type of data and size +// fill the file with specifiec type of data and size $tmp_name_suffix = $name_suffix; for($loop_counter = 1; $loop_counter = $count; $loop_counter ++) { $filename = $file_path./.$name_prefix.$tmp_name_suffix.$file_extension; @@ -577,7 +577,7 @@ $stat2 = second stat array $op = type of the comparision to be perform between elements of stat1 and stat2 != compare for not equal -== comprae for equality +== compare for equality if each element of stat1 is than stat2 if each element of stat1 is than stat2 $fields = contains the key of the elements that needs to be compared. @@ -585,7 +585,10 @@ $flag = specify true to dump the stat1 and stat2 */ -$all_stat_keys = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, dev, ino, mode, nlink, uid, gid, rdev, size, atime, mtime, ctime, blksize, blocks); +$all_stat_keys = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + dev, ino, mode, nlink, uid, gid, + rdev, size, atime, mtime, ctime, + blksize, blocks); function compare_stats($stat1, $stat2, $fields, $op = ==, $flag = false ) { // dump the stat if requested @@ -635,6 +638,8 @@ // if the result is false(i.e values are not as expected), // dump the stat array so that easy to figure out the error if ( $result == false ) { +echo \n Dumping diff between stat array 1 and 2...\n; +var_dump(array_diff($stat1, $stat2)); echo \n Dumping stat array 1...\n; var_dump($stat1); echo \n Dumping stat array 2...\n; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/stat_basic-win32.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/standard/tests/file/stat_basic-win32.phpt diff -u php-src/ext/standard/tests/file/stat_basic-win32.phpt:1.3 php-src/ext/standard/tests/file/stat_basic-win32.phpt:1.4 --- php-src/ext/standard/tests/file/stat_basic-win32.phpt:1.3 Tue May 27 09:34:54 2008 +++ php-src/ext/standard/tests/file/stat_basic-win32.phpt Sun Aug 17 11:10:52 2008 @@ -80,15 +80,15 @@ [0]= int(%d) [1]= - int(%d) + int(0) [2]= int(%d) [3]= int(%d) [4]= - int(%d) + int(0) [5]= - int(%d) + int(0) [6]= int(%d) [7]= @@ -106,15 +106,15 @@ [udev]= int(%d) [uino]= - int(%d) + int(0) [umode]= int(%d) [unlink]= int(%d) [uuid]= - int(%d) + int(0) [ugid]= - int(%d) + int(0) [urdev]= int(%d) [usize]= http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/stat_variation8-win32.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/file/stat_variation8-win32.phpt diff -u php-src/ext/standard/tests/file/stat_variation8-win32.phpt:1.2 php-src/ext/standard/tests/file/stat_variation8-win32.phpt:1.3 --- php-src/ext/standard/tests/file/stat_variation8-win32.phpt:1.2 Tue May 27 09:34:54 2008 +++ php-src/ext/standard/tests/file/stat_variation8-win32.phpt Sun Aug 17 11:10:52 2008 @@ -34,7 +34,7 @@ $file_handle = fopen($filename, w); fclose($file_handle); -clearstatcache(); +clearstatcache(true, $filename); $old_stat = stat($filename); // clear the cache sleep(2); @@ -44,7 +44,7 @@ var_dump( ftruncate($file_handle, 512) ); // truncate it fclose($file_handle); -clearstatcache(); +clearstatcache(true, $filename); $new_stat = stat($filename); // compare self stats @@ -56,7 +56,7 @@ var_dump( compare_stats($old_stat, $new_stat, $affected_members, '!=') ); // clear the stat -clearstatcache(); // clear previous size value in cache +clearstatcache(true, $filename); // clear previous size value in cache echo \n*** Done ***; ? http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/tempnam_variation3-win32.phpt?r1=1.4r2=1.5diff_format=u Index: php-src/ext/standard/tests/file/tempnam_variation3-win32.phpt diff -u
[PHP-CVS] cvs: php-src /ext/standard/tests/file file.inc stat_basic-win32.phpt stat_variation8-win32.phpt tempnam_variation3-win32.phpt touch.phpt
pajoye Sun Aug 17 11:10:52 2008 UTC Modified files: /php-src/ext/standard/tests/filefile.inc stat_basic-win32.phpt stat_variation8-win32.phpt tempnam_variation3-win32.phpt touch.phpt Log: - MFB: - fix or improve tests - add dump of the array_diff for compare_stats http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/file.inc?r1=1.7r2=1.8diff_format=u Index: php-src/ext/standard/tests/file/file.inc diff -u php-src/ext/standard/tests/file/file.inc:1.7 php-src/ext/standard/tests/file/file.inc:1.8 --- php-src/ext/standard/tests/file/file.inc:1.7Thu Jul 26 13:55:42 2007 +++ php-src/ext/standard/tests/file/file.incSun Aug 17 11:10:52 2008 @@ -279,7 +279,7 @@ if ( $content_type == empty ) { $return_value['filled'] = $count; } else { -//fill the file with specifiec type of data and size +// fill the file with specifiec type of data and size $tmp_name_suffix = $name_suffix; for($loop_counter = 1; $loop_counter = $count; $loop_counter ++) { $filename = $file_path./.$name_prefix.$tmp_name_suffix.$file_extension; @@ -577,7 +577,7 @@ $stat2 = second stat array $op = type of the comparision to be perform between elements of stat1 and stat2 != compare for not equal -== comprae for equality +== compare for equality if each element of stat1 is than stat2 if each element of stat1 is than stat2 $fields = contains the key of the elements that needs to be compared. @@ -585,7 +585,10 @@ $flag = specify true to dump the stat1 and stat2 */ -$all_stat_keys = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, dev, ino, mode, nlink, uid, gid, rdev, size, atime, mtime, ctime, blksize, blocks); +$all_stat_keys = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + dev, ino, mode, nlink, uid, gid, + rdev, size, atime, mtime, ctime, + blksize, blocks); function compare_stats($stat1, $stat2, $fields, $op = ==, $flag = false ) { // dump the stat if requested @@ -635,6 +638,8 @@ // if the result is false(i.e values are not as expected), // dump the stat array so that easy to figure out the error if ( $result == false ) { +echo \n Dumping diff between stat array 1 and 2...\n; +var_dump(array_diff($stat1, $stat2)); echo \n Dumping stat array 1...\n; var_dump($stat1); echo \n Dumping stat array 2...\n; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/stat_basic-win32.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/standard/tests/file/stat_basic-win32.phpt diff -u php-src/ext/standard/tests/file/stat_basic-win32.phpt:1.3 php-src/ext/standard/tests/file/stat_basic-win32.phpt:1.4 --- php-src/ext/standard/tests/file/stat_basic-win32.phpt:1.3 Tue May 27 09:34:54 2008 +++ php-src/ext/standard/tests/file/stat_basic-win32.phpt Sun Aug 17 11:10:52 2008 @@ -80,15 +80,15 @@ [0]= int(%d) [1]= - int(%d) + int(0) [2]= int(%d) [3]= int(%d) [4]= - int(%d) + int(0) [5]= - int(%d) + int(0) [6]= int(%d) [7]= @@ -106,15 +106,15 @@ [udev]= int(%d) [uino]= - int(%d) + int(0) [umode]= int(%d) [unlink]= int(%d) [uuid]= - int(%d) + int(0) [ugid]= - int(%d) + int(0) [urdev]= int(%d) [usize]= http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/stat_variation8-win32.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/file/stat_variation8-win32.phpt diff -u php-src/ext/standard/tests/file/stat_variation8-win32.phpt:1.2 php-src/ext/standard/tests/file/stat_variation8-win32.phpt:1.3 --- php-src/ext/standard/tests/file/stat_variation8-win32.phpt:1.2 Tue May 27 09:34:54 2008 +++ php-src/ext/standard/tests/file/stat_variation8-win32.phpt Sun Aug 17 11:10:52 2008 @@ -34,7 +34,7 @@ $file_handle = fopen($filename, w); fclose($file_handle); -clearstatcache(); +clearstatcache(true, $filename); $old_stat = stat($filename); // clear the cache sleep(2); @@ -44,7 +44,7 @@ var_dump( ftruncate($file_handle, 512) ); // truncate it fclose($file_handle); -clearstatcache(); +clearstatcache(true, $filename); $new_stat = stat($filename); // compare self stats @@ -56,7 +56,7 @@ var_dump( compare_stats($old_stat, $new_stat, $affected_members, '!=') ); // clear the stat -clearstatcache(); // clear previous size value in cache +clearstatcache(true, $filename); // clear previous size value in cache echo \n*** Done ***; ? http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/tempnam_variation3-win32.phpt?r1=1.4r2=1.5diff_format=u Index: php-src/ext/standard/tests/file/tempnam_variation3-win32.phpt diff -u php-src/ext/standard/tests/file/tempnam_variation3-win32.phpt:1.4 php-src/ext/standard/tests/file/tempnam_variation3-win32.phpt:1.5 ---