]> granicus.if.org Git - php/commitdiff
Fix intermittent failure of bug_68819_002.phpt
authorNikita Popov <nikic@php.net>
Tue, 1 Mar 2016 23:34:36 +0000 (00:34 +0100)
committerNikita Popov <nikic@php.net>
Tue, 1 Mar 2016 23:34:36 +0000 (00:34 +0100)
The test used rand(32, 127) to select the character, however
chr(127) results in "data" instead of the expected result, so this
test would fail in something like 1% of the runs.

Replace rand() with fixed character "a".

ext/fileinfo/tests/bug68819_002.phpt

index cec238d63ed606f5a4813331ad76f195192cc218..7d5f6c642dd86f601f1cd47ba01a36ec054cdc2d 100644 (file)
@@ -12,7 +12,7 @@ $string .= "\r\n";
 $string .= "''''";
 
 // Total string length > 8192
-$string .= str_repeat(chr(rand(32, 127)), 8184);
+$string .= str_repeat("a", 8184);
 
 // Ending in this string
 $string .= "say";