tony2001 Fri Apr 27 11:43:24 2007 UTC
Added files:
/php-src/ext/gmp/tests 040.phpt
Modified files:
/php-src/ext/gmp/tests 011.phpt 016.phpt
Log:
improve the tests
http://cvs.php.net/viewvc.cgi/php-src/ext/gmp/tests/011.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/gmp/tests/011.phpt
diff -u php-src/ext/gmp/tests/011.phpt:1.1 php-src/ext/gmp/tests/011.phpt:1.2
--- php-src/ext/gmp/tests/011.phpt:1.1 Wed Apr 25 18:09:08 2007
+++ php-src/ext/gmp/tests/011.phpt Fri Apr 27 11:43:24 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
@@ -40,6 +48,11 @@
string(9) "-10000000"
Done
--UEXPECTF--
+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
unicode(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&r2=1.2&diff_format=u
Index: php-src/ext/gmp/tests/016.phpt
diff -u php-src/ext/gmp/tests/016.phpt:1.1 php-src/ext/gmp/tests/016.phpt:1.2
--- php-src/ext/gmp/tests/016.phpt:1.1 Wed Apr 18 21:04:05 2007
+++ php-src/ext/gmp/tests/016.phpt Fri Apr 27 11:43:24 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,6 +64,10 @@
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
--UEXPECTF--
unicode(1) "0"
@@ -90,4 +100,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/040.phpt?view=markup&rev=1.1
Index: php-src/ext/gmp/tests/040.phpt
+++ php-src/ext/gmp/tests/040.phpt
--TEST--
gmp_init() basic tests
--FILE--
<?php
var_dump(gmp_init("98765678"));
var_dump(gmp_strval(gmp_init("98765678")));
var_dump(gmp_strval(gmp_init()));
var_dump(gmp_init());
var_dump(gmp_init(1,2,3,4));
var_dump(gmp_init(1,-1));
var_dump(gmp_init("",36));
var_dump(gmp_init("foo",3));
var_dump(gmp_strval(gmp_init("993247326237679187178",3)));
echo "Done\n";
?>
--EXPECTF--
resource(%d) of type (GMP integer)
string(8) "98765678"
Warning: Wrong parameter count for gmp_init() in %s on line %d
Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on
line %d
bool(false)
Warning: Wrong parameter count for gmp_init() in %s on line %d
NULL
Warning: Wrong parameter count for gmp_init() in %s on line %d
NULL
Warning: gmp_init(): Bad base for conversion: -1 (should be between 2 and 36)
in %s on line %d
bool(false)
bool(false)
bool(false)
string(1) "0"
Done
--UEXPECTF--
resource(%d) of type (GMP integer)
unicode(8) "98765678"
Warning: Wrong parameter count for gmp_init() in %s on line %d
Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on
line %d
bool(false)
Warning: Wrong parameter count for gmp_init() in %s on line %d
NULL
Warning: Wrong parameter count for gmp_init() in %s on line %d
NULL
Warning: gmp_init(): Bad base for conversion: -1 (should be between 2 and 36)
in %s on line %d
bool(false)
bool(false)
bool(false)
unicode(1) "0"
Done
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php