tony2001 Fri Apr 27 11:43:46 2007 UTC
Added files: (Branch: PHP_5_2)
/php-src/ext/gmp/tests 039.phpt
Modified files:
/php-src/ext/gmp/tests 011.phpt 016.phpt
Log:
MFH: improve the tests
http://cvs.php.net/viewvc.cgi/php-src/ext/gmp/tests/011.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/gmp/tests/011.phpt
diff -u php-src/ext/gmp/tests/011.phpt:1.1.2.2
php-src/ext/gmp/tests/011.phpt:1.1.2.3
--- php-src/ext/gmp/tests/011.phpt:1.1.2.2 Thu Apr 26 13:44:02 2007
+++ php-src/ext/gmp/tests/011.phpt Fri Apr 27 11:43:45 2007
@@ -3,6 +3,9 @@
--FILE--
<?php
+var_dump(gmp_divexact(1, 1, 1));
+var_dump(gmp_divexact());
+
$r = gmp_divexact("233", "23345555555555555555555555");
var_dump(gmp_strval($r));
@@ -29,6 +32,11 @@
echo "Done\n";
?>
--EXPECTF--
+Warning: Wrong parameter count for gmp_divexact() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for gmp_divexact() in %s on line %d
+NULL
string(1) "0"
Warning: gmp_divexact(): Zero operand not allowed in %s on line %d
http://cvs.php.net/viewvc.cgi/php-src/ext/gmp/tests/016.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/gmp/tests/016.phpt
diff -u php-src/ext/gmp/tests/016.phpt:1.1.2.2
php-src/ext/gmp/tests/016.phpt:1.1.2.3
--- php-src/ext/gmp/tests/016.phpt:1.1.2.2 Wed Apr 18 21:04:21 2007
+++ php-src/ext/gmp/tests/016.phpt Fri Apr 27 11:43:45 2007
@@ -25,6 +25,12 @@
var_dump(gmp_powm(array()));
var_dump(gmp_powm());
+$n = gmp_init("-5");
+var_dump(gmp_powm(10, $n, 10));
+
+$n = gmp_init("0");
+var_dump(gmp_powm(10, $n, 10));
+
echo "Done\n";
?>
--EXPECTF--
@@ -58,4 +64,8 @@
Warning: Wrong parameter count for gmp_powm() in %s on line %d
NULL
+
+Warning: gmp_powm(): Second parameter cannot be less than 0 in %s on line %d
+bool(false)
+resource(%d) of type (GMP integer)
Done
http://cvs.php.net/viewvc.cgi/php-src/ext/gmp/tests/039.phpt?view=markup&rev=1.1
Index: php-src/ext/gmp/tests/039.phpt
+++ php-src/ext/gmp/tests/039.phpt
--TEST--
gmp_testbit() basic tests
--FILE--
<?php
$n = gmp_init(0);
var_dump(gmp_testbit($n, -10));
var_dump(gmp_testbit($n, 0));
var_dump(gmp_testbit($n, 1));
var_dump(gmp_testbit($n, 100));
$n = gmp_init(-1);
var_dump(gmp_testbit($n, 1));
var_dump(gmp_testbit($n, -1));
$n = gmp_init("1000000");
var_dump(gmp_testbit($n, 1));
gmp_setbit($n, 1);
var_dump(gmp_testbit($n, 1));
var_dump(gmp_strval($n));
gmp_setbit($n, 5);
var_dump(gmp_testbit($n, 5));
var_dump(gmp_strval($n));
$n = gmp_init("238462734628347239571823641234");
var_dump(gmp_testbit($n, 5));
gmp_setbit($n, 5);
var_dump(gmp_testbit($n, 5));
var_dump(gmp_strval($n));
gmp_clrbit($n, 5);
var_dump(gmp_testbit($n, 5));
var_dump(gmp_strval($n));
echo "Done\n";
?>
--EXPECTF--
Warning: gmp_testbit(): Index must be greater than or equal to zero in %s on
line %d
bool(false)
bool(false)
bool(false)
bool(false)
bool(true)
Warning: gmp_testbit(): Index must be greater than or equal to zero in %s on
line %d
bool(false)
bool(false)
bool(true)
string(7) "1000002"
bool(true)
string(7) "1000034"
bool(false)
bool(true)
string(30) "238462734628347239571823641266"
bool(false)
string(30) "238462734628347239571823641234"
Done
--UEXPECTF--
Warning: gmp_testbit(): Index must be greater than or equal to zero in %s on
line %d
bool(false)
bool(false)
bool(false)
bool(false)
bool(true)
Warning: gmp_testbit(): Index must be greater than or equal to zero in %s on
line %d
bool(false)
bool(false)
bool(true)
unicode(7) "1000002"
bool(true)
unicode(7) "1000034"
bool(false)
bool(true)
unicode(30) "238462734628347239571823641266"
bool(false)
unicode(30) "238462734628347239571823641234"
Done
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php