diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-03 22:52:20 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-03 22:52:20 +0100 |
commit | f8d795820e780a6322e054c26c581570613c14f0 (patch) | |
tree | 99d3ae01ce564752807341c5743863b4c92513f8 /ext/bz2/tests | |
parent | d2cb200e10ada6fa44c54a29292bb4665728fff0 (diff) | |
download | php-git-f8d795820e780a6322e054c26c581570613c14f0.tar.gz |
Reindent phpt files
Diffstat (limited to 'ext/bz2/tests')
-rw-r--r-- | ext/bz2/tests/bug71263.phpt | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ext/bz2/tests/bug71263.phpt b/ext/bz2/tests/bug71263.phpt index d5c3ff91da..108469a293 100644 --- a/ext/bz2/tests/bug71263.phpt +++ b/ext/bz2/tests/bug71263.phpt @@ -8,11 +8,11 @@ Bug #71263: fread() does not detects decoding errors from filter bzip2.decompres // Should notices be generated? function test($case) { - $plain = "The quick brown fox jumps over the lazy dog."; - $fn = "bug71263.bz2"; - $compressed = (string) bzcompress($plain); - echo "Compressed len = ", strlen($compressed), "\n"; - + $plain = "The quick brown fox jumps over the lazy dog."; + $fn = "bug71263.bz2"; + $compressed = (string) bzcompress($plain); + echo "Compressed len = ", strlen($compressed), "\n"; + if ($case == 1) { // Set a random byte in the middle of the compressed data // --> php_bz2_decompress_filter() detects fatal error @@ -22,24 +22,24 @@ function test($case) { // Truncate the compressed data // --> php_bz2_decompress_filter() does not detect errors, // --> fread() displays the empty string: - $compressed = substr($compressed, 0, strlen($compressed) - 20); + $compressed = substr($compressed, 0, strlen($compressed) - 20); } else { // Corrupted final CRC // --> php_bz2_decompress_filter() detects fatal error // --> fread() displays an empty string, then the correct plain text, no error detected: - $compressed[strlen($compressed)-2] = 'X'; + $compressed[strlen($compressed)-2] = 'X'; } - file_put_contents($fn, $compressed); - - $r = fopen($fn, "r"); - stream_filter_append($r, 'bzip2.decompress', STREAM_FILTER_READ); + file_put_contents($fn, $compressed); + + $r = fopen($fn, "r"); + stream_filter_append($r, 'bzip2.decompress', STREAM_FILTER_READ); while (!feof($r)) { $s = fread($r, 100); echo "read: "; var_dump($s); } - fclose($r); - unlink($fn); + fclose($r); + unlink($fn); } test(1); |