Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Oct 24, 2024
1 parent e2b07d7 commit 3534f0a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ext/gmp/tests/gmp_pow_fpe.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,20 @@ try {
try {
gmp_pow(256, PHP_INT_MAX);
} catch (\ValueError $e) {
echo $e->getMessage();
echo $e->getMessage() . PHP_EOL;
}

var_dump(gmp_pow(gmp_add(gmp_mul(gmp_init(PHP_INT_MAX), gmp_init(PHP_INT_MAX)), 3), 256));
var_dump(gmp_pow(gmp_init(PHP_INT_MAX), 256));
?>
--EXPECT--
--EXPECTF--
base and exponent overflow
base and exponent overflow
object(GMP)#%d (1) {
["num"]=>
string(%d) "%s"
}
object(GMP)#%d (1) {
["num"]=>
string(%d) "%s"
}

0 comments on commit 3534f0a

Please sign in to comment.