php-src/ext/fileinfo/tests/bug68819_002.phpt
Nikita Popov 471540d285 Fix intermittent failure of bug_68819_002.phpt
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".
2016-03-02 00:34:36 +01:00

27 lines
524 B
PHP

--TEST--
Bug #68819 Fileinfo on specific file causes spurious OOM and/or segfault, var 2
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$string = '';
// These two in any order
$string .= "\r\n";
$string .= "''''";
// Total string length > 8192
$string .= str_repeat("a", 8184);
// Ending in this string
$string .= "say";
$finfo = new finfo();
$type = $finfo->buffer($string);
var_dump($type);
?>
--EXPECT--
string(60) "ASCII text, with very long lines, with CRLF line terminators"