[PHP-CVS] cvs: php-src / run-tests.php

2007-12-23 Thread Raghubansh Kumar
kraghubaMon Dec 24 04:20:16 2007 UTC

  Modified files:  
/php-srcrun-tests.php 
  Log:
  Changing the regex for %f so the it will match e-, e+ and e.
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.334r2=1.335diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.334 php-src/run-tests.php:1.335
--- php-src/run-tests.php:1.334 Mon Dec 17 11:34:55 2007
+++ php-src/run-tests.php   Mon Dec 24 04:20:15 2007
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.334 2007/12/17 11:34:55 bjori Exp $ */
+/* $Id: run-tests.php,v 1.335 2007/12/24 04:20:15 kraghuba Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -415,7 +415,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.334 $'.\n;
+   echo '$Revision: 1.335 $'.\n;
exit(1);
default:
echo Illegal switch specified!\n;
@@ -1600,7 +1600,7 @@
$wanted_re = str_replace('%i', '[+-]?\d+', $wanted_re);
$wanted_re = str_replace('%d', '\d+', $wanted_re);
$wanted_re = str_replace('%x', '[0-9a-fA-F]+', 
$wanted_re);
-   $wanted_re = str_replace('%f', 
'[+-]?\.?\d+\.?\d*(?:E[+-]?\d+)?', $wanted_re);
+   $wanted_re = str_replace('%f', 
'[+-]?\.?\d+\.?\d*(?:E|e[+-]?\d+)?', $wanted_re);
$wanted_re = str_replace('%c', '.', $wanted_re);
// %f allows two points -.0.0 but that is the best 
*simple* expression
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / run-tests.php

2007-12-23 Thread Raghubansh Kumar
kraghubaMon Dec 24 04:23:05 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcrun-tests.php 
  Log:
  Changing the regex for %f so the it will match e-, e+ and e.
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.7r2=1.226.2.37.2.35.2.8diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.35.2.7 
php-src/run-tests.php:1.226.2.37.2.35.2.8
--- php-src/run-tests.php:1.226.2.37.2.35.2.7   Mon Dec 17 11:00:16 2007
+++ php-src/run-tests.php   Mon Dec 24 04:23:04 2007
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.35.2.7 2007/12/17 11:00:16 bjori Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.35.2.8 2007/12/24 04:23:04 kraghuba Exp $ 
*/
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -408,7 +408,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.226.2.37.2.35.2.7 
$'.\n;
+   echo '$Revision: 1.226.2.37.2.35.2.8 
$'.\n;
exit(1);
 
case 'u':
@@ -1537,7 +1537,7 @@
$wanted_re = str_replace('%i', '[+-]?\d+', $wanted_re);
$wanted_re = str_replace('%d', '\d+', $wanted_re);
$wanted_re = str_replace('%x', '[0-9a-fA-F]+', 
$wanted_re);
-   $wanted_re = str_replace('%f', 
'[+-]?\.?\d+\.?\d*(?:E[+-]?\d+)?', $wanted_re);
+   $wanted_re = str_replace('%f', 
'[+-]?\.?\d+\.?\d*(?:E|e[+-]?\d+)?', $wanted_re);
$wanted_re = str_replace('%c', '.', $wanted_re);
// %f allows two points -.0.0 but that is the best 
*simple* expression
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) / run-tests.php

2007-12-23 Thread Raghubansh Kumar
kraghubaMon Dec 24 04:24:21 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcrun-tests.php 
  Log:
  Changing the regex for %f so the it will match e-, e+ and e.
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.38r2=1.226.2.37.2.39diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.38 
php-src/run-tests.php:1.226.2.37.2.39
--- php-src/run-tests.php:1.226.2.37.2.38   Wed Dec 12 20:21:57 2007
+++ php-src/run-tests.php   Mon Dec 24 04:24:20 2007
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.38 2007/12/12 20:21:57 tony2001 Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.39 2007/12/24 04:24:20 kraghuba Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -403,7 +403,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.226.2.37.2.38 
$'.\n;
+   echo '$Revision: 1.226.2.37.2.39 
$'.\n;
exit(1);
 
case 'u':
@@ -1517,7 +1517,7 @@
$wanted_re = str_replace('%i', '[+-]?\d+', $wanted_re);
$wanted_re = str_replace('%d', '\d+', $wanted_re);
$wanted_re = str_replace('%x', '[0-9a-fA-F]+', 
$wanted_re);
-   $wanted_re = str_replace('%f', 
'[+-]?\.?\d+\.?\d*(?:E[+-]?\d+)?', $wanted_re);
+   $wanted_re = str_replace('%f', 
'[+-]?\.?\d+\.?\d*(?:E|e[+-]?\d+)?', $wanted_re);
$wanted_re = str_replace('%c', '.', $wanted_re);
// %f allows two points -.0.0 but that is the best 
*simple* expression
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/strings sprintf_variation48.phpt sprintf_variation5.phpt

2007-12-23 Thread Raghubansh Kumar
kraghubaMon Dec 24 04:26:41 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/strings sprintf_variation5.phpt 
sprintf_variation48.phpt 
  Log:
  fix tests
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_variation5.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/standard/tests/strings/sprintf_variation5.phpt
diff -u php-src/ext/standard/tests/strings/sprintf_variation5.phpt:1.1.2.1 
php-src/ext/standard/tests/strings/sprintf_variation5.phpt:1.1.2.2
--- php-src/ext/standard/tests/strings/sprintf_variation5.phpt:1.1.2.1  Sat Sep 
29 14:13:53 2007
+++ php-src/ext/standard/tests/strings/sprintf_variation5.phpt  Mon Dec 24 
04:26:41 2007
@@ -12,11 +12,14 @@
 // resource type variable
 $fp = fopen (__FILE__, r);
 $dfp = opendir ( dirname(__FILE__) );
+
+$fp_copy = $fp;
+$dfp_copy = $dfp;
   
 // array of resource types
 $resource_types = array (
-  $fp,
-  $dfp
+  $fp_copy,
+  $dfp_copy
 );
 
 // various integer formats
@@ -38,7 +41,7 @@
 
 // closing the resources
 fclose($fp);
-fclose($dfp);
+closedir($dfp);
 
 
 echo Done;
@@ -53,8 +56,8 @@
 string(%d)%d
 string(%d) 
 %d
-string(%d)%d
-string(4) 0-9]
+string(%d) %s%d
+string(%d) 0-9]
 string(1) d
 
 -- Iteration 2 --
@@ -64,7 +67,7 @@
 string(%d)%d
 string(%d) 
 %d
-string(%d)%d
-string(4) 0-9]
+string(%d) %s%d
+string(%d) 0-9]
 string(1) d
 Done
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_variation48.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/standard/tests/strings/sprintf_variation48.phpt
diff -u php-src/ext/standard/tests/strings/sprintf_variation48.phpt:1.1.2.1 
php-src/ext/standard/tests/strings/sprintf_variation48.phpt:1.1.2.2
--- php-src/ext/standard/tests/strings/sprintf_variation48.phpt:1.1.2.1 Sat Sep 
29 14:13:53 2007
+++ php-src/ext/standard/tests/strings/sprintf_variation48.phpt Mon Dec 24 
04:26:41 2007
@@ -39,7 +39,7 @@
 
 // closing the resources
 fclose($fp);
-fclose($dfp);
+closedir($dfp);
 
 
 echo Done;
@@ -48,32 +48,32 @@
 *** Testing sprintf() : scientific formats with resource values ***
 
 -- Iteration 1 --
-string(%d) %d.00e+0
+string(%d) %f
 string(1) e
-string(%d) %d.00e+0
+string(%d) %f
 string(1) e
-string(%d)  %d.00e+0
-string(%d) %d.00e+0 
-string(%d)%d.00e+0
+string(%d)  %f
+string(%d) %f 
+string(%d)%f
 string(%d) 
-%d.00e+0
-string(%d) %d.00e+0
-string(%d)%d.00e+0
-string(4) 0-1]
+%f
+string(%d) %f
+string(%d) %s%f
+string(%d) 0-1]
 string(1) e
 
 -- Iteration 2 --
-string(%d) %d.00e+0
+string(%d) %f
 string(1) e
-string(%d) %d.00e+0
+string(%d) %f
 string(1) e
-string(%d)  %d.00e+0
-string(%d) %d.00e+0 
-string(%d)%d.00e+0
+string(%d)  %f
+string(%d) %f 
+string(%d)%f
 string(%d) 
-%d.00e+0
-string(%d) %d.00e+0
-string(%d)%d.00e+0
-string(4) 0-1]
+%f
+string(%d) %f
+string(%d) %s%f
+string(%d) 0-1]
 string(1) e
 Done

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/strings sprintf_variation48.phpt sprintf_variation5.phpt

2007-12-23 Thread Raghubansh Kumar
kraghubaMon Dec 24 04:27:55 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard/tests/strings sprintf_variation5.phpt 
sprintf_variation48.phpt 
  Log:
  fix tests
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_variation5.phpt?r1=1.2.2.2r2=1.2.2.3diff_format=u
Index: php-src/ext/standard/tests/strings/sprintf_variation5.phpt
diff -u php-src/ext/standard/tests/strings/sprintf_variation5.phpt:1.2.2.2 
php-src/ext/standard/tests/strings/sprintf_variation5.phpt:1.2.2.3
--- php-src/ext/standard/tests/strings/sprintf_variation5.phpt:1.2.2.2  Sat Sep 
29 16:54:57 2007
+++ php-src/ext/standard/tests/strings/sprintf_variation5.phpt  Mon Dec 24 
04:27:55 2007
@@ -12,11 +12,14 @@
 // resource type variable
 $fp = fopen (__FILE__, r);
 $dfp = opendir ( dirname(__FILE__) );
+
+$fp_copy = $fp;
+$dfp_copy = $dfp;
   
 // array of resource types
 $resource_types = array (
-  $fp,
-  $dfp
+  $fp_copy,
+  $dfp_copy
 );
 
 // various integer formats
@@ -38,7 +41,7 @@
 
 // closing the resources
 fclose($fp);
-fclose($dfp);
+closedir($dfp);
 
 
 echo Done;
@@ -53,8 +56,8 @@
 string(%d)%d
 string(%d) 
 %d
-string(%d)%d
-string(4) 0-9]
+string(%d) %s%d
+string(%d) 0-9]
 string(1) d
 
 -- Iteration 2 --
@@ -64,7 +67,7 @@
 string(%d)%d
 string(%d) 
 %d
-string(%d)%d
-string(4) 0-9]
+string(%d) %s%d
+string(%d) 0-9]
 string(1) d
 Done
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_variation48.phpt?r1=1.2.2.2r2=1.2.2.3diff_format=u
Index: php-src/ext/standard/tests/strings/sprintf_variation48.phpt
diff -u php-src/ext/standard/tests/strings/sprintf_variation48.phpt:1.2.2.2 
php-src/ext/standard/tests/strings/sprintf_variation48.phpt:1.2.2.3
--- php-src/ext/standard/tests/strings/sprintf_variation48.phpt:1.2.2.2 Sat Sep 
29 16:54:56 2007
+++ php-src/ext/standard/tests/strings/sprintf_variation48.phpt Mon Dec 24 
04:27:55 2007
@@ -39,7 +39,7 @@
 
 // closing the resources
 fclose($fp);
-fclose($dfp);
+closedir($dfp);
 
 
 echo Done;
@@ -48,32 +48,32 @@
 *** Testing sprintf() : scientific formats with resource values ***
 
 -- Iteration 1 --
-string(%d) %d.00e+0
+string(%d) %f
 string(1) e
-string(%d) %d.00e+0
+string(%d) %f
 string(1) e
-string(%d)  %d.00e+0
-string(%d) %d.00e+0 
-string(%d)%d.00e+0
+string(%d)  %f
+string(%d) %f 
+string(%d)%f
 string(%d) 
-%d.00e+0
-string(%d) %d.00e+0
-string(%d)%d.00e+0
+%f
+string(%d) %f
+string(%d) %s%f
 string(4) 0-1]
 string(1) e
 
 -- Iteration 2 --
-string(%d) %d.00e+0
+string(%d) %f
 string(1) e
-string(%d) %d.00e+0
+string(%d) %f
 string(1) e
-string(%d)  %d.00e+0
-string(%d) %d.00e+0 
-string(%d)%d.00e+0
+string(%d)  %f
+string(%d) %f 
+string(%d)%f
 string(%d) 
-%d.00e+0
-string(%d) %d.00e+0
-string(%d)%d.00e+0
+%f
+string(%d) %f
+string(30) %s%f
 string(4) 0-1]
 string(1) e
 Done

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard/tests/strings sprintf_variation48.phpt sprintf_variation5.phpt

2007-12-23 Thread Raghubansh Kumar
kraghubaMon Dec 24 04:29:26 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/strings sprintf_variation5.phpt 
sprintf_variation48.phpt 
  Log:
  fix tests
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_variation5.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/strings/sprintf_variation5.phpt
diff -u php-src/ext/standard/tests/strings/sprintf_variation5.phpt:1.2 
php-src/ext/standard/tests/strings/sprintf_variation5.phpt:1.3
--- php-src/ext/standard/tests/strings/sprintf_variation5.phpt:1.2  Sat Sep 
29 14:15:53 2007
+++ php-src/ext/standard/tests/strings/sprintf_variation5.phpt  Mon Dec 24 
04:29:26 2007
@@ -12,11 +12,14 @@
 // resource type variable
 $fp = fopen (__FILE__, r);
 $dfp = opendir ( dirname(__FILE__) );
+
+$fp_copy = $fp;
+$dfp_copy = $dfp;
   
 // array of resource types
 $resource_types = array (
-  $fp,
-  $dfp
+  $fp_copy,
+  $dfp_copy
 );
 
 // various integer formats
@@ -38,7 +41,7 @@
 
 // closing the resources
 fclose($fp);
-fclose($dfp);
+closedir($dfp);
 
 
 echo Done;
@@ -53,8 +56,8 @@
 string(%d)%d
 string(%d) 
 %d
-string(%d)%d
-string(4) 0-9]
+string(%d) %s%d
+string(%d) 0-9]
 string(1) d
 
 -- Iteration 2 --
@@ -64,11 +67,10 @@
 string(%d)%d
 string(%d) 
 %d
-string(%d)%d
-string(4) 0-9]
+string(%d) %s%d
+string(%d) 0-9]
 string(1) d
 Done
-
 --UEXPECTF--
 *** Testing sprintf() : integer formats with resource values ***
 
@@ -79,8 +81,8 @@
 unicode(%d)   %d
 unicode(%d) 
 %d
-unicode(%d)%d
-unicode(4) 0-9]
+unicode(%d) %s%d
+unicode(%d) 0-9]
 unicode(1) d
 
 -- Iteration 2 --
@@ -90,7 +92,7 @@
 unicode(%d)   %d
 unicode(%d) 
 %d
-unicode(%d)%d
-unicode(4) 0-9]
+unicode(%d) %s%d
+unicode(%d) 0-9]
 unicode(1) d
 Done
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_variation48.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/strings/sprintf_variation48.phpt
diff -u php-src/ext/standard/tests/strings/sprintf_variation48.phpt:1.2 
php-src/ext/standard/tests/strings/sprintf_variation48.phpt:1.3
--- php-src/ext/standard/tests/strings/sprintf_variation48.phpt:1.2 Sat Sep 
29 14:15:53 2007
+++ php-src/ext/standard/tests/strings/sprintf_variation48.phpt Mon Dec 24 
04:29:26 2007
@@ -39,7 +39,7 @@
 
 // closing the resources
 fclose($fp);
-fclose($dfp);
+closedir($dfp);
 
 
 echo Done;
@@ -48,66 +48,65 @@
 *** Testing sprintf() : scientific formats with resource values ***
 
 -- Iteration 1 --
-string(%d) %d.00e+0
+string(%d) %f
 string(1) e
-string(%d) %d.00e+0
+string(%d) %f
 string(1) e
-string(%d)  %d.00e+0
-string(%d) %d.00e+0 
-string(%d)%d.00e+0
+string(%d)  %f
+string(%d) %f 
+string(%d)%f
 string(%d) 
-%d.00e+0
-string(%d) %d.00e+0
-string(%d)%d.00e+0
-string(4) 0-1]
+%f
+string(%d) %f
+string(%d) %s%f
+string(%d) 0-1]
 string(1) e
 
 -- Iteration 2 --
-string(%d) %d.00e+0
+string(%d) %f
 string(1) e
-string(%d) %d.00e+0
+string(%d) %f
 string(1) e
-string(%d)  %d.00e+0
-string(%d) %d.00e+0 
-string(%d)%d.00e+0
+string(%d)  %f
+string(%d) %f 
+string(%d)%f
 string(%d) 
-%d.00e+0
-string(%d) %d.00e+0
-string(%d)%d.00e+0
-string(4) 0-1]
+%f
+string(%d) %f
+string(%d) %s%f
+string(%d) 0-1]
 string(1) e
 Done
-
 --UEXPECTF--
 *** Testing sprintf() : scientific formats with resource values ***
 
 -- Iteration 1 --
-unicode(%d) %d.00e+0
+unicode(%d) %f
 unicode(1) e
-unicode(%d) %d.00e+0
+unicode(%d) %f
 unicode(1) e
-unicode(%d)  %d.00e+0
-unicode(%d) %d.00e+0 
-unicode(%d)   %d.00e+0
+unicode(%d)  %f
+unicode(%d) %f 
+unicode(%d)   %f
 unicode(%d) 
-%d.00e+0
-unicode(%d) %d.00e+0
-unicode(%d)%d.00e+0
-unicode(4) 0-1]
+%f
+unicode(%d) %f
+unicode(%d) %s%f
+unicode(%d) 0-1]
 unicode(1) e
 
 -- Iteration 2 --
-unicode(%d) %d.00e+0
+unicode(%d) %f
 unicode(1) e
-unicode(%d) %d.00e+0
+unicode(%d) %f
 unicode(1) e
-unicode(%d)  %d.00e+0
-unicode(%d) %d.00e+0 
-unicode(%d)   %d.00e+0
+unicode(%d)  %f
+unicode(%d) %f 
+unicode(%d)   %f
 unicode(%d) 
-%d.00e+0
-unicode(%d) %d.00e+0
-unicode(%d)%d.00e+0
-unicode(4) 0-1]
+%f
+unicode(%d) %f
+unicode(%d) %s%f
+unicode(%d) 0-1]
 unicode(1) e
 Done

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/dir dir_basic.phpt dir_error.phpt dir_variation1.phpt dir_variation2.phpt dir_variation3.phpt dir_variation4.phpt dir_variation5.phpt dir_variation6

2007-12-23 Thread Raghubansh Kumar
kraghubaMon Dec 24 05:19:42 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/dir dir_variation1.phpt 
dir_variation2.phpt 
dir_variation3.phpt 
dir_variation4.phpt 
dir_variation5.phpt dir_basic.phpt 
dir_variation6.phpt 
dir_variation7.phpt 
dir_variation8.phpt 
dir_variation9.phpt dir_error.phpt 
  Log:
  new testcases for dir() function
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/dir/dir_variation1.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/dir/dir_variation1.phpt
+++ php-src/ext/standard/tests/dir/dir_variation1.phpt
--TEST--
Test dir() function : usage variations - unexpected value for 'dir' argument
--FILE--
?php
/* 
 * Prototype  : object dir(string $directory[, resource $context])
 * Description: Directory class with properties, handle and class and methods 
read, rewind and close
 * Source code: ext/standard/dir.c
 */

/*
 * Passing non string values to 'directory' argument of dir() and see
 * that the function outputs proper warning messages wherever expected.
 */

echo *** Testing dir() : unexpected values for \$directory argument ***\n;

// get an unset variable
$unset_var = 10;
unset($unset_var);

class A
{
  public $var;
  public function init() {
$this-var = 10;
  }
  public function __toString() {
return ClassAObject;
  }
}

// get a resource variable
$fp = fopen(__FILE__, r); // get a file handle 
$dfp = opendir( dirname(__FILE__) ); // get a dir handle

// unexpected values to be passed to $directory argument
$unexpected_values = array (

   // array data
/*1*/  array(),
   array(0),
   array(1),
   array(1, 2),
   array('color' = 'red', 'item' = 'pen'),

   // null data
/*6*/  NULL,
   null,

   // boolean data
/*8*/  true,
   false,
   TRUE,
   FALSE,

   // empty data
/*12*/ ,
   '',

   // undefined data
/*14*/ @$undefined_var,

   // unset data
/*15*/ @$unset_var,

   // resource variable(dir and file handle)
/*16*/ $fp,
   $dfp,

   // object data
/*18*/ new A()
);

// loop through various elements of $unexpected_values to check the behavior of 
dir()
$iterator = 1;
foreach( $unexpected_values as $unexpected_value ) {
  echo \n-- Iteration $iterator --\n;
  var_dump( dir($unexpected_value) );
  $iterator++;
}

fclose($fp);
closedir($dfp);
echo Done;
?
--EXPECTF--
*** Testing dir() : unexpected values for $directory argument ***

-- Iteration 1 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 2 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 3 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 4 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 5 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 6 --
bool(false)

-- Iteration 7 --
bool(false)

-- Iteration 8 --

Warning: dir(1): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 9 --
bool(false)

-- Iteration 10 --

Warning: dir(1): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 11 --
bool(false)

-- Iteration 12 --
bool(false)

-- Iteration 13 --
bool(false)

-- Iteration 14 --
bool(false)

-- Iteration 15 --
bool(false)

-- Iteration 16 --

Warning: dir(Resource id #%d): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 17 --

Warning: dir(Resource id #%d): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 18 --

Warning: dir(ClassAObject): failed to open dir: %s in %s on line %d
bool(false)
Done
--UEXPECTF--
*** Testing dir() : unexpected values for $directory argument ***

-- Iteration 1 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 2 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 3 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 4 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 5 --

Notice: Array to string conversion in %s on line %d


[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/dir dir_basic.phpt dir_error.phpt dir_variation1.phpt dir_variation2.phpt dir_variation3.phpt dir_variation4.phpt dir_variation5.phpt dir_variation6

2007-12-23 Thread Raghubansh Kumar
kraghubaMon Dec 24 05:21:08 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/dir dir_variation1.phpt dir_error.phpt 
dir_variation2.phpt 
dir_variation3.phpt 
dir_variation4.phpt 
dir_variation5.phpt 
dir_variation6.phpt 
dir_variation7.phpt dir_basic.phpt 
dir_variation8.phpt 
dir_variation9.phpt 
  Log:
  new testcases for dir() function
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/dir/dir_variation1.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/dir/dir_variation1.phpt
+++ php-src/ext/standard/tests/dir/dir_variation1.phpt
--TEST--
Test dir() function : usage variations - unexpected value for 'dir' argument
--FILE--
?php
/* 
 * Prototype  : object dir(string $directory[, resource $context])
 * Description: Directory class with properties, handle and class and methods 
read, rewind and close
 * Source code: ext/standard/dir.c
 */

/*
 * Passing non string values to 'directory' argument of dir() and see
 * that the function outputs proper warning messages wherever expected.
 */

echo *** Testing dir() : unexpected values for \$directory argument ***\n;

// get an unset variable
$unset_var = 10;
unset($unset_var);

class A
{
  public $var;
  public function init() {
$this-var = 10;
  }
  public function __toString() {
return ClassAObject;
  }
}

// get a resource variable
$fp = fopen(__FILE__, r); // get a file handle 
$dfp = opendir( dirname(__FILE__) ); // get a dir handle

// unexpected values to be passed to $directory argument
$unexpected_values = array (

   // array data
/*1*/  array(),
   array(0),
   array(1),
   array(1, 2),
   array('color' = 'red', 'item' = 'pen'),

   // null data
/*6*/  NULL,
   null,

   // boolean data
/*8*/  true,
   false,
   TRUE,
   FALSE,

   // empty data
/*12*/ ,
   '',

   // undefined data
/*14*/ @$undefined_var,

   // unset data
/*15*/ @$unset_var,

   // resource variable(dir and file handle)
/*16*/ $fp,
   $dfp,

   // object data
/*18*/ new A()
);

// loop through various elements of $unexpected_values to check the behavior of 
dir()
$iterator = 1;
foreach( $unexpected_values as $unexpected_value ) {
  echo \n-- Iteration $iterator --\n;
  var_dump( dir($unexpected_value) );
  $iterator++;
}

fclose($fp);
closedir($dfp);
echo Done;
?
--EXPECTF--
*** Testing dir() : unexpected values for $directory argument ***

-- Iteration 1 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 2 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 3 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 4 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 5 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 6 --
bool(false)

-- Iteration 7 --
bool(false)

-- Iteration 8 --

Warning: dir(1): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 9 --
bool(false)

-- Iteration 10 --

Warning: dir(1): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 11 --
bool(false)

-- Iteration 12 --
bool(false)

-- Iteration 13 --
bool(false)

-- Iteration 14 --
bool(false)

-- Iteration 15 --
bool(false)

-- Iteration 16 --

Warning: dir(Resource id #%d): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 17 --

Warning: dir(Resource id #%d): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 18 --

Warning: dir(ClassAObject): failed to open dir: %s in %s on line %d
bool(false)
Done
--UEXPECTF--
*** Testing dir() : unexpected values for $directory argument ***

-- Iteration 1 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 2 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 3 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 4 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 5 --

Notice: Array to string conversion in %s on line %d


[PHP-CVS] cvs: php-src /ext/standard/tests/dir dir_basic.phpt dir_error.phpt dir_variation1.phpt dir_variation2.phpt dir_variation3.phpt dir_variation4.phpt dir_variation5.phpt dir_variation6.phpt dir

2007-12-23 Thread Raghubansh Kumar
kraghubaMon Dec 24 05:07:47 2007 UTC

  Added files: 
/php-src/ext/standard/tests/dir dir_variation1.phpt 
dir_variation2.phpt 
dir_variation3.phpt dir_error.phpt 
dir_variation4.phpt 
dir_variation5.phpt 
dir_variation6.phpt 
dir_variation7.phpt 
dir_variation8.phpt 
dir_variation9.phpt dir_basic.phpt 
  Log:
  new testcases for dir() function
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/dir/dir_variation1.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/dir/dir_variation1.phpt
+++ php-src/ext/standard/tests/dir/dir_variation1.phpt
--TEST--
Test dir() function : usage variations - unexpected value for 'dir' argument
--FILE--
?php
/* 
 * Prototype  : object dir(string $directory[, resource $context])
 * Description: Directory class with properties, handle and class and methods 
read, rewind and close
 * Source code: ext/standard/dir.c
 */

/*
 * Passing non string values to 'directory' argument of dir() and see
 * that the function outputs proper warning messages wherever expected.
 */

echo *** Testing dir() : unexpected values for \$directory argument ***\n;

// get an unset variable
$unset_var = 10;
unset($unset_var);

class A
{
  public $var;
  public function init() {
$this-var = 10;
  }
  public function __toString() {
return ClassAObject;
  }
}

// get a resource variable
$fp = fopen(__FILE__, r); // get a file handle 
$dfp = opendir( dirname(__FILE__) ); // get a dir handle

// unexpected values to be passed to $directory argument
$unexpected_values = array (

   // array data
/*1*/  array(),
   array(0),
   array(1),
   array(1, 2),
   array('color' = 'red', 'item' = 'pen'),

   // null data
/*6*/  NULL,
   null,

   // boolean data
/*8*/  true,
   false,
   TRUE,
   FALSE,

   // empty data
/*12*/ ,
   '',

   // undefined data
/*14*/ @$undefined_var,

   // unset data
/*15*/ @$unset_var,

   // resource variable(dir and file handle)
/*16*/ $fp,
   $dfp,

   // object data
/*18*/ new A()
);

// loop through various elements of $unexpected_values to check the behavior of 
dir()
$iterator = 1;
foreach( $unexpected_values as $unexpected_value ) {
  echo \n-- Iteration $iterator --\n;
  var_dump( dir($unexpected_value) );
  $iterator++;
}

fclose($fp);
closedir($dfp);
echo Done;
?
--EXPECTF--
*** Testing dir() : unexpected values for $directory argument ***

-- Iteration 1 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 2 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 3 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 4 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 5 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 6 --
bool(false)

-- Iteration 7 --
bool(false)

-- Iteration 8 --

Warning: dir(1): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 9 --
bool(false)

-- Iteration 10 --

Warning: dir(1): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 11 --
bool(false)

-- Iteration 12 --
bool(false)

-- Iteration 13 --
bool(false)

-- Iteration 14 --
bool(false)

-- Iteration 15 --
bool(false)

-- Iteration 16 --

Warning: dir(Resource id #%d): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 17 --

Warning: dir(Resource id #%d): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 18 --

Warning: dir(ClassAObject): failed to open dir: %s in %s on line %d
bool(false)
Done
--UEXPECTF--
*** Testing dir() : unexpected values for $directory argument ***

-- Iteration 1 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 2 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 3 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 4 --

Notice: Array to string conversion in %s on line %d

Warning: dir(Array): failed to open dir: %s in %s on line %d
bool(false)

-- Iteration 5 --

Notice: Array to string conversion in %s on line %d

Warning: