helly           Fri Nov  1 07:12:40 2002 EDT

  Modified files:              
    /php4/ext/standard/tests/time       001.phpt 
  Log:
  update test
  #This test fails for me. I expanded the test output and checked the function.
  #The only way to fix this behaviour would be to store the last result in a
  #global value and fetch the time again in case the newer value is less the 
  #the older value.
  
  
Index: php4/ext/standard/tests/time/001.phpt
diff -u php4/ext/standard/tests/time/001.phpt:1.2 
php4/ext/standard/tests/time/001.phpt:1.3
--- php4/ext/standard/tests/time/001.phpt:1.2   Sat Aug 18 12:47:02 2001
+++ php4/ext/standard/tests/time/001.phpt       Fri Nov  1 07:12:40 2002
@@ -1,24 +1,32 @@
 --TEST--
 microtime() function
---POST--
---GET--
+--SKIPIF--
+<?php if (!function_exists('microtime'))  die('skip microtime() not available'); ?>
 --FILE--
 <?php
 $passed = 0;
 $failed = 0;
-$last = 0;
+$last_m = 0;
+$last_t = 0;
+$result = '';
 
 set_time_limit(0);
 
 for ($i=1;$i<=100000;$i++) {
-   list($micro,$time)=explode(" ",microtime());
-   $add=$micro+$time;
-   $add<$last ? $failed++: $passed++;
-   $last=$add;
+       list($micro,$time)=explode(" ",microtime());
+       if ($time > $last_t || ($time == $last_t && $micro > $last_m)) {
+               $passed++;
+       } else {
+               $failed++;
+               $result .= sprintf('%06d', $i).": $time $micro < $last_t $last_m\n";
+       }
+       $last_m = $micro;
+       $last_t = $time;
 }
-echo "Passed: ".$passed."\n";
-echo "Failed: ".$failed."\n";
+echo "Passed: $passed\n";
+echo "Failed: $failed\n";
+echo $result;
 ?>
---EXPECT--
-Passed: 100000
-Failed: 0
\ No newline at end of file
+--EXPECTREGEX--
+Passed: 10+
+Failed: 0



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

Reply via email to