Skip to content

Commit abf5fbb

Browse files
committed
add test
1 parent bf0c2a8 commit abf5fbb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

ext/gmp/tests/gmp_pow_fpe.phpt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
gmp_pow() floating point exception
3+
--EXTENSIONS--
4+
gmp
5+
--FILE--
6+
<?php
7+
$g = gmp_init(256);
8+
9+
try {
10+
gmp_pow($g, PHP_INT_MAX);
11+
} catch (\ValueError $e) {
12+
echo $e->getMessage() . PHP_EOL;
13+
}
14+
try {
15+
gmp_pow(256, PHP_INT_MAX);
16+
} catch (\ValueError $e) {
17+
echo $e->getMessage();
18+
}
19+
?>
20+
--EXPECT--
21+
base and exponent overflow
22+
base and exponent overflow

0 commit comments

Comments
 (0)