Skip to content

Commit b9116dc

Browse files
committed
add tests
1 parent 2a4ec93 commit b9116dc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
bzcompress/bzdecompress long inputs
3+
--EXTENSIONS--
4+
bz2
5+
--INI--
6+
memory_limit=-1
7+
--SKIPIF--
8+
<?php
9+
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
10+
?>
11+
--FILE--
12+
<?php
13+
14+
$string = str_repeat("A", 8000000000);
15+
16+
try {
17+
bzcompress($string, 1);
18+
} catch (\ValueError $e) {
19+
echo $e->getMessage(), PHP_EOL;
20+
}
21+
try {
22+
bzdecompress($string, 1);
23+
} catch (\ValueError $e) {
24+
echo $e->getMessage(), PHP_EOL;
25+
}
26+
?>
27+
--EXPECTF--
28+
bzcompress(): Argument #1 ($data) length must be lower or equal to %d
29+
bzdecompress(): Argument #1 ($data) length must be lower or equal to %d

0 commit comments

Comments
 (0)