com php-src: add a test with gmp and PHP_INT_MAX: ext/g mp/tests/gmp_php_int_max.phpt
| From: | Anatol Belski | Date: | Tue, 02 Sep 2014 16:16:19 +0000 |
| Subject: | com php-src: add a test with gmp and PHP_INT_MAX: ext/g mp/tests/gmp_php_int_max.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81371@lists.php.net to get a copy of this message | ||
Commit: e7386aa1fd6291158291c9b041e7d7f531d7f347
Author: Anatol Belski <ab@php.net> Tue, 2 Sep 2014 18:16:19 +0200
Parents: 20e15f55e8b9dad71afe498e910e82ca9e02e12e
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e7386aa1fd6291158291c9b041e7d7f531d7f347
Log:
add a test with gmp and PHP_INT_MAX
Changed paths:
A ext/gmp/tests/gmp_php_int_max.phpt
Diff:
diff --git a/ext/gmp/tests/gmp_php_int_max.phpt b/ext/gmp/tests/gmp_php_int_max.phpt
new file mode 100644
index 0000000..b85d9c5
--- /dev/null
+++ b/ext/gmp/tests/gmp_php_int_max.phpt
@@ -0,0 +1,26 @@
+--TEST--
+PHP_INT_MAX tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gmp_mul(PHP_INT_MAX, PHP_INT_MAX));
+var_dump(gmp_add(PHP_INT_MAX, PHP_INT_MAX));
+var_dump(gmp_mul(PHP_INT_MAX, PHP_INT_MIN));
+?>
+DONE
+--EXPECTF--
+object(GMP)#%d (%d) {
+ ["num"]=>
+ string(38) "85070591730234615847396907784232501249"
+}
+object(GMP)#%d (%d) {
+ ["num"]=>
+ string(20) "18446744073709551614"
+}
+object(GMP)#%d (%d) {
+ ["num"]=>
+ string(39) "-85070591730234615856620279821087277056"
+}
+DONE