]> granicus.if.org Git - php/commitdiff
Add a sanity check and more verbose output in the case of an error.
authorWez Furlong <wez@php.net>
Mon, 14 Oct 2002 02:25:51 +0000 (02:25 +0000)
committerWez Furlong <wez@php.net>
Mon, 14 Oct 2002 02:25:51 +0000 (02:25 +0000)
ext/standard/tests/file/userstreams.phpt

index f71333efd959cae5bb58280516c7efd1543bda4f..f35dbc9e7cbf2ad1b518b371aa2bcf903f775f3f 100644 (file)
@@ -269,15 +269,21 @@ if ($fail_count == 0) {
 }
 
 $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;
        }