]> granicus.if.org Git - php/commitdiff
fix tests
authorRaghubansh Kumar <kraghuba@php.net>
Mon, 24 Dec 2007 04:29:26 +0000 (04:29 +0000)
committerRaghubansh Kumar <kraghuba@php.net>
Mon, 24 Dec 2007 04:29:26 +0000 (04:29 +0000)
ext/standard/tests/strings/sprintf_variation48.phpt
ext/standard/tests/strings/sprintf_variation5.phpt

index 07e7511ce193dd6ce0f5d73bdc5ea2352b57b2ce..0acc5a8d2c070b5015fc3742ef67bdb542bcfac4 100644 (file)
@@ -39,7 +39,7 @@ foreach($resource_values as $resource_value) {
 
 // closing the resources
 fclose($fp);
-fclose($dfp);
+closedir($dfp);
 
 
 echo "Done";
@@ -48,66 +48,65 @@ echo "Done";
 *** Testing sprintf() : scientific formats with resource values ***
 
 -- Iteration 1 --
-string(%d) "%d.000000e+0"
+string(%d) "%f"
 string(1) "e"
-string(%d) "%d.000000e+0"
+string(%d) "%f"
 string(1) "e"
-string(%d) " %d.000000e+0"
-string(%d) "%d.000000e+0 "
-string(%d) "   %d.000000e+0"
+string(%d) " %f"
+string(%d) "%f "
+string(%d) "   %f"
 string(%d) "
-%d.000000e+0"
-string(%d) "%d.000000e+0"
-string(%d) "                   %d.000000e+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.000000e+0"
+string(%d) "%f"
 string(1) "e"
-string(%d) "%d.000000e+0"
+string(%d) "%f"
 string(1) "e"
-string(%d) " %d.000000e+0"
-string(%d) "%d.000000e+0 "
-string(%d) "   %d.000000e+0"
+string(%d) " %f"
+string(%d) "%f "
+string(%d) "   %f"
 string(%d) "
-%d.000000e+0"
-string(%d) "%d.000000e+0"
-string(%d) "                   %d.000000e+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.000000e+0"
+unicode(%d) "%f"
 unicode(1) "e"
-unicode(%d) "%d.000000e+0"
+unicode(%d) "%f"
 unicode(1) "e"
-unicode(%d) " %d.000000e+0"
-unicode(%d) "%d.000000e+0 "
-unicode(%d) "  %d.000000e+0"
+unicode(%d) " %f"
+unicode(%d) "%f "
+unicode(%d) "  %f"
 unicode(%d) "
-%d.000000e+0"
-unicode(%d) "%d.000000e+0"
-unicode(%d) "                   %d.000000e+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.000000e+0"
+unicode(%d) "%f"
 unicode(1) "e"
-unicode(%d) "%d.000000e+0"
+unicode(%d) "%f"
 unicode(1) "e"
-unicode(%d) " %d.000000e+0"
-unicode(%d) "%d.000000e+0 "
-unicode(%d) "  %d.000000e+0"
+unicode(%d) " %f"
+unicode(%d) "%f "
+unicode(%d) "  %f"
 unicode(%d) "
-%d.000000e+0"
-unicode(%d) "%d.000000e+0"
-unicode(%d) "                   %d.000000e+0"
-unicode(4) "0-1]"
+%f"
+unicode(%d) "%f"
+unicode(%d) "%s%f"
+unicode(%d) "0-1]"
 unicode(1) "e"
 Done
index e24f6d21c170073dd59d1a298f6a131f05cc30ab..afcdb1a9a5e854db449deb5707fe2af4db0ccae8 100644 (file)
@@ -12,11 +12,14 @@ echo "*** Testing sprintf() : integer formats with resource values ***\n";
 // 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 @@ foreach($resource_types as $res) {
 
 // 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(%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(%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(%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(%d) "   %d"
-unicode(4) "0-9]"
+unicode(%d) "%s%d"
+unicode(%d) "0-9]"
 unicode(1) "d"
 Done