Add %0 format to run-tests.php

This format matches against null bytes, and prevents the test
expectation from being interpreted as binary data.

bless_tests.php will automatically replace \0 with %0 as well.
This commit is contained in:
Nikita Popov 2021-05-28 13:08:25 +02:00 committed by Nikita Popov
parent e838de342a
commit ea256a218b
120 changed files with 55 additions and 52 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1618,7 +1618,7 @@ array(34) {
["Copyright"]=>
string(12) "Eric Stewart"
["GPSVersion"]=>
string(4) ""
string(4) "%0%0"
["GPSLatitudeRef"]=>
string(1) "N"
["GPSLatitude"]=>
@ -1642,7 +1642,7 @@ array(34) {
string(3) "0/1"
}
["GPSAltitudeRef"]=>
string(1) ""
string(1) "%0"
["GPSAltitude"]=>
string(5) "295/1"
["GPSTimeStamp"]=>

View file

@ -1618,7 +1618,7 @@ array(34) {
["Copyright"]=>
string(12) "Eric Stewart"
["GPSVersion"]=>
string(4) ""
string(4) "%0%0"
["GPSLatitudeRef"]=>
string(1) "N"
["GPSLatitude"]=>
@ -1642,7 +1642,7 @@ array(34) {
string(3) "0/1"
}
["GPSAltitudeRef"]=>
string(1) ""
string(1) "%0"
["GPSAltitude"]=>
string(5) "295/1"
["GPSTimeStamp"]=>

View file

@ -1642,7 +1642,7 @@ array(45) {
["ExifImageLength"]=>
int(1)
["GPSVersion"]=>
string(4) ""
string(4) "%0%0"
["GPSLatitudeRef"]=>
string(1) "N"
["GPSLatitude"]=>
@ -1666,7 +1666,7 @@ array(45) {
string(3) "0/1"
}
["GPSAltitudeRef"]=>
string(1) ""
string(1) "%0"
["GPSAltitude"]=>
string(5) "295/1"
["GPSTimeStamp"]=>

View file

@ -1642,7 +1642,7 @@ array(45) {
["ExifImageLength"]=>
int(1)
["GPSVersion"]=>
string(4) ""
string(4) "%0%0"
["GPSLatitudeRef"]=>
string(1) "N"
["GPSLatitude"]=>
@ -1666,7 +1666,7 @@ array(45) {
string(3) "0/1"
}
["GPSAltitudeRef"]=>
string(1) ""
string(1) "%0"
["GPSAltitude"]=>
string(5) "295/1"
["GPSTimeStamp"]=>

View file

@ -24,7 +24,7 @@ $position = ftell($fp);
//test binary data transfer
var_dump(ftp_fget($ftp, $fp, 'binary data.bin', FTP_BINARY));
fseek($fp, $position);
var_dump(urlencode(fgets($fp)));
echo json_encode(fgets($fp)), "\n";
//test non-existent file request
ftp_fget($ftp, $fp ,'a warning.txt', FTP_ASCII);
@ -37,6 +37,6 @@ bool(true)
bool(true)
For sale: baby shoes, never worn.
bool(true)
string(21) "BINARYFoo%00Bar%0D%0A"
"BINARYFoo\u0000Bar\r\n"
Warning: ftp_fget(): a warning: No such file or directory in %sftp_fget_basic.php on line %d

View file

@ -23,7 +23,7 @@ unlink($tmpfname);
//test binary data transfer
$tmpfname = tempnam(__DIR__, "ftp_test");
var_dump(ftp_get($ftp, $tmpfname, 'binary data.bin', FTP_BINARY));
var_dump(urlencode(file_get_contents($tmpfname)));
echo json_encode(file_get_contents($tmpfname)), "\n";
unlink($tmpfname);
//test non-existent file request
@ -34,6 +34,6 @@ bool(true)
bool(true)
For sale: baby shoes, never worn.
bool(true)
string(21) "BINARYFoo%00Bar%0D%0A"
"BINARYFoo\u0000Bar\r\n"
Warning: ftp_get(): a warning: No such file or directory in %sftp_get_basic.php on line %d

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -271,7 +271,7 @@ closedir($dir_handle);
echo "Done\n";
?>
--EXPECT--
--EXPECTF--
*** Testing print_r() on integer variables ***
-- Iteration 1 --
@ -565,9 +565,9 @@ Array
0
0
-- Iteration 6 --
%0
%0
%0
-- Iteration 7 --
\0
\0
@ -589,13 +589,13 @@ PHP
PHP
PHP
-- Iteration 12 --
abcdn12340567800efgh\xijkl
abcdn12340567800efgh\xijkl
abcdn12340567800efgh\xijkl
abcd%0n1234%005678%000efgh\xijkl
abcd%0n1234%005678%000efgh\xijkl
abcd%0n1234%005678%000efgh\xijkl
-- Iteration 13 --
abcdefghijklmnop0qrstuvwx0yz
abcdefghijklmnop0qrstuvwx0yz
abcdefghijklmnop0qrstuvwx0yz
abcd%0efgh%0ijkl%0mnop%00qrst%0uvwx%00yz
abcd%0efgh%0ijkl%0mnop%00qrst%0uvwx%00yz
abcd%0efgh%0ijkl%0mnop%00qrst%0uvwx%00yz
-- Iteration 14 --
1234
5678

View file

@ -275,7 +275,7 @@ closedir($dir_handle);
echo "Done\n";
?>
--EXPECT--
--EXPECTF--
*** Testing print_r() on integer variables ***
-- Iteration 1 --
@ -569,9 +569,9 @@ Array
0
0
-- Iteration 6 --
%0
%0
%0
-- Iteration 7 --
\0
\0
@ -593,13 +593,13 @@ PHP
PHP
PHP
-- Iteration 12 --
abcdn12340567800efgh\xijkl
abcdn12340567800efgh\xijkl
abcdn12340567800efgh\xijkl
abcd%0n1234%005678%000efgh\xijkl
abcd%0n1234%005678%000efgh\xijkl
abcd%0n1234%005678%000efgh\xijkl
-- Iteration 13 --
abcdefghijklmnop0qrstuvwx0yz
abcdefghijklmnop0qrstuvwx0yz
abcdefghijklmnop0qrstuvwx0yz
abcd%0efgh%0ijkl%0mnop%00qrst%0uvwx%00yz
abcd%0efgh%0ijkl%0mnop%00qrst%0uvwx%00yz
abcd%0efgh%0ijkl%0mnop%00qrst%0uvwx%00yz
-- Iteration 14 --
1234
5678

View file

@ -427,7 +427,7 @@ string(1) " "
-- Iteration 5 --
string(1) "0"
-- Iteration 6 --
string(1) ""
string(1) "%0"
-- Iteration 7 --
string(2) "\0"
-- Iteration 8 --
@ -439,9 +439,9 @@ string(3) "PHP"
-- Iteration 11 --
string(3) "PHP"
-- Iteration 12 --
string(29) "abcdn12340567800efgh\xijkl"
string(29) "abcd%0n1234%005678%000efgh\xijkl"
-- Iteration 13 --
string(34) "abcdefghijklmnop0qrstuvwx0yz"
string(34) "abcd%0efgh%0ijkl%0mnop%00qrst%0uvwx%00yz"
-- Iteration 14 --
string(22) "1234
5678
@ -1081,7 +1081,7 @@ array(14) {
[4]=>
string(1) "0"
[5]=>
string(1) ""
string(1) "%0"
[6]=>
string(2) "\0"
[7]=>
@ -1093,9 +1093,9 @@ array(14) {
[10]=>
string(3) "PHP"
[11]=>
string(29) "abcdn12340567800efgh\xijkl"
string(29) "abcd%0n1234%005678%000efgh\xijkl"
[12]=>
string(34) "abcdefghijklmnop0qrstuvwx0yz"
string(34) "abcd%0efgh%0ijkl%0mnop%00qrst%0uvwx%00yz"
[13]=>
string(22) "1234
5678

View file

@ -274,7 +274,7 @@ closedir($dir_handle);
echo "Done\n";
?>
--EXPECT--
--EXPECTF--
*** Testing var_dump() on integer variables ***
-- Iteration 1 --
int(0)
@ -427,7 +427,7 @@ string(1) " "
-- Iteration 5 --
string(1) "0"
-- Iteration 6 --
string(1) ""
string(1) "%0"
-- Iteration 7 --
string(2) "\0"
-- Iteration 8 --
@ -439,9 +439,9 @@ string(3) "PHP"
-- Iteration 11 --
string(3) "PHP"
-- Iteration 12 --
string(29) "abcdn12340567800efgh\xijkl"
string(29) "abcd%0n1234%005678%000efgh\xijkl"
-- Iteration 13 --
string(34) "abcdefghijklmnop0qrstuvwx0yz"
string(34) "abcd%0efgh%0ijkl%0mnop%00qrst%0uvwx%00yz"
-- Iteration 14 --
string(22) "1234
5678
@ -1081,7 +1081,7 @@ array(14) {
[4]=>
string(1) "0"
[5]=>
string(1) ""
string(1) "%0"
[6]=>
string(2) "\0"
[7]=>
@ -1093,9 +1093,9 @@ array(14) {
[10]=>
string(3) "PHP"
[11]=>
string(29) "abcdn12340567800efgh\xijkl"
string(29) "abcd%0n1234%005678%000efgh\xijkl"
[12]=>
string(34) "abcdefghijklmnop0qrstuvwx0yz"
string(34) "abcd%0efgh%0ijkl%0mnop%00qrst%0uvwx%00yz"
[13]=>
string(22) "1234
5678

View file

@ -486,8 +486,8 @@ Array
[4] => 99
)
%0
%0
C
c
@ -595,7 +595,7 @@ Array
(
[0] => %5s
[1] => %-5s
[2] => %05s
[2] => %r%%r05s
[3] => %'#5s
)

View file

@ -486,8 +486,8 @@ Array
[4] => 99
)
%0
%0
C
c
@ -595,7 +595,7 @@ Array
(
[0] => %5s
[1] => %-5s
[2] => %05s
[2] => %r%%r05s
[3] => %'#5s
)

Some files were not shown because too many files have changed in this diff Show more