wez             Sun Oct 13 22:25:52 2002 EDT

  Modified files:              
    /php4/ext/standard/tests/file       userstreams.phpt 
  Log:
  Add a sanity check and more verbose output in the case of an error.
  
  
Index: php4/ext/standard/tests/file/userstreams.phpt
diff -u php4/ext/standard/tests/file/userstreams.phpt:1.4 
php4/ext/standard/tests/file/userstreams.phpt:1.5
--- php4/ext/standard/tests/file/userstreams.phpt:1.4   Sat Oct  5 06:35:13 2002
+++ php4/ext/standard/tests/file/userstreams.phpt       Sun Oct 13 22:25:51 2002
@@ -269,15 +269,21 @@
 }
 
 $fail_count = 0;
+
 fseek($fp, $DATALEN / 2, SEEK_SET);
 fseek($tf, $DATALEN / 2, SEEK_SET);
 
+if (ftell($fp) != ftell($tf)) {
+       echo "SEEK: positions do not match!\n";
+}
+
+$n = 0;
 while(!feof($fp)) {
        $uline = fgets($fp, 1024);
        $rline = fgets($tf, 1024);
 
        if ($uline != $rline) {
-               echo "FGETS: FAIL\nuser=$uline\nreal=$rline\n";
+               echo "FGETS: FAIL\niter=$n user=$uline [pos=" . ftell($fp) . 
+"]\nreal=$rline [pos=" . ftell($tf) . "]\n";
                $fail_count++;
                break;
        }



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

Reply via email to