wimartin Mon, 08 Mar 2010 15:16:51 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=295966
Log: Add some bcmath tests Changed paths: A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcadd_error1.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcadd_variation001.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bccomp_variation001.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bccomp_variation002.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcmod_error2.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcmul_error1.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcpow_error3.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcpow_variation001.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcpowmod.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcscale_variation001.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcscale_variation002.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcsqrt_error2.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcsqrt_variation001.phpt A php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcsub_error1.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcadd_error1.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcadd_variation001.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bccomp_variation001.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bccomp_variation002.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcmod_error2.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcmul_error1.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcpow_error3.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcpow_variation001.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcpowmod.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcscale_variation001.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcscale_variation002.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcsqrt_error2.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcsqrt_variation001.phpt A php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcsub_error1.phpt A php/php-src/trunk/ext/bcmath/tests/bcadd_error1.phpt A php/php-src/trunk/ext/bcmath/tests/bcadd_variation001.phpt A php/php-src/trunk/ext/bcmath/tests/bccomp_variation001.phpt A php/php-src/trunk/ext/bcmath/tests/bccomp_variation002.phpt A php/php-src/trunk/ext/bcmath/tests/bcmod_error2.phpt A php/php-src/trunk/ext/bcmath/tests/bcmul_error1.phpt A php/php-src/trunk/ext/bcmath/tests/bcpow_error3.phpt A php/php-src/trunk/ext/bcmath/tests/bcpow_variation001.phpt A php/php-src/trunk/ext/bcmath/tests/bcpowmod.phpt A php/php-src/trunk/ext/bcmath/tests/bcscale_variation001.phpt A php/php-src/trunk/ext/bcmath/tests/bcscale_variation002.phpt A php/php-src/trunk/ext/bcmath/tests/bcsqrt_error2.phpt A php/php-src/trunk/ext/bcmath/tests/bcsqrt_variation001.phpt A php/php-src/trunk/ext/bcmath/tests/bcsub_error1.phpt
Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcadd_error1.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcadd_error1.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcadd_error1.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcadd() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcadd(); +?> +--EXPECTF-- +Warning: Wrong parameter count for bcadd() in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcadd_variation001.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcadd_variation001.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcadd_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,16 @@ +--TEST-- +bcadd() with non-integers +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=5 +--FILE-- +<?php +echo bcadd("2.2", "4.3", "2")."\n"; +echo bcadd("2.2", "-7.3", "1")."\n"; +echo bcadd("-4.27", "7.3"); +?> +--EXPECTF-- +6.50 +-5.1 +3.03000 \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bccomp_variation001.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bccomp_variation001.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bccomp_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,16 @@ +--TEST-- +bccomp() with non-integers +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bccomp("2.2", "2.2", "2")."\n"; +echo bccomp("2.32", "2.2", "2")."\n"; +echo bccomp("2.29", "2.3", "2"); +?> +--EXPECTF-- +0 +1 +-1 \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bccomp_variation002.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bccomp_variation002.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bccomp_variation002.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,16 @@ +--TEST-- +bccomp() with negative value +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bccomp("-2", "-2")."\n"; +echo bccomp("-2", "2", "1")."\n"; +echo bccomp("-2.29", "-2.3", "2"); +?> +--EXPECTF-- +0 +-1 +1 \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcmod_error2.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcmod_error2.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcmod_error2.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcmod() - mod by 0 +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcmod("10", "0"); +?> +--EXPECTF-- +Warning: bcmod(): Division by zero in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcmul_error1.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcmul_error1.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcmul_error1.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcmul() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcmul(); +?> +--EXPECTF-- +Warning: Wrong parameter count for bcmul() in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcpow_error3.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcpow_error3.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcpow_error3.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcpow() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcpow(); +?> +--EXPECTF-- +Warning: Wrong parameter count for bcpow() in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcpow_variation001.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcpow_variation001.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcpow_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcpow() with a negative exponent +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcpow("2", "-4"); +?> +--EXPECTF-- +0 \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcpowmod.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcpowmod.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcpowmod.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,16 @@ +--TEST-- +bcpowmod() - Raise an arbitrary precision number to another, reduced by a specified modulus +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcpowmod("5", "2", "7") . "\n"; +echo bcpowmod("-2", "5", "7") . "\n"; +echo bcpowmod("10", "2147483648", "2047"); +?> +--EXPECT-- +4 +-4 +790 \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcscale_variation001.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcscale_variation001.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcscale_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,13 @@ +--TEST-- +bcscale() with negative argument +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +bcscale(-4); +echo bcdiv("20.56", "4"); +?> +--EXPECTF-- +5 \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcscale_variation002.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcscale_variation002.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcscale_variation002.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcadd() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=-2 +--FILE-- +<?php +echo bcadd("-4.27", "7.3"); +?> +--EXPECTF-- +3 \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcsqrt_error2.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcsqrt_error2.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcsqrt_error2.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcsqrt() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcsqrt(); +?> +--EXPECTF-- +Warning: Wrong parameter count for bcsqrt() in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcsqrt_variation001.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcsqrt_variation001.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcsqrt_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcsqrt() with argument of 0 +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcsqrt("0"); +?> +--EXPECTF-- +0 \ No newline at end of file Added: php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcsub_error1.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcsub_error1.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/ext/bcmath/tests/bcsub_error1.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcsub() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcsub(); +?> +--EXPECTF-- +Warning: Wrong parameter count for bcsub() in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcadd_error1.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcadd_error1.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcadd_error1.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcadd() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcadd(); +?> +--EXPECTF-- +Warning: bcadd() expects at least 2 parameters, 0 given in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcadd_variation001.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcadd_variation001.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcadd_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,16 @@ +--TEST-- +bcadd() with non-integers +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=5 +--FILE-- +<?php +echo bcadd("2.2", "4.3", "2")."\n"; +echo bcadd("2.2", "-7.3", "1")."\n"; +echo bcadd("-4.27", "7.3"); +?> +--EXPECTF-- +6.50 +-5.1 +3.03000 \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bccomp_variation001.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bccomp_variation001.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bccomp_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,16 @@ +--TEST-- +bccomp() with non-integers +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bccomp("2.2", "2.2", "2")."\n"; +echo bccomp("2.32", "2.2", "2")."\n"; +echo bccomp("2.29", "2.3", "2"); +?> +--EXPECTF-- +0 +1 +-1 \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bccomp_variation002.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bccomp_variation002.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bccomp_variation002.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,16 @@ +--TEST-- +bccomp() with negative value +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bccomp("-2", "-2")."\n"; +echo bccomp("-2", "2", "1")."\n"; +echo bccomp("-2.29", "-2.3", "2"); +?> +--EXPECTF-- +0 +-1 +1 \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcmod_error2.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcmod_error2.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcmod_error2.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcmod() - mod by 0 +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcmod("10", "0"); +?> +--EXPECTF-- +Warning: bcmod(): Division by zero in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcmul_error1.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcmul_error1.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcmul_error1.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcmul() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcmul(); +?> +--EXPECTF-- +Warning: bcmul() expects at least 2 parameters, 0 given in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcpow_error3.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcpow_error3.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcpow_error3.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcpow() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcpow(); +?> +--EXPECTF-- +Warning: bcpow() expects at least 2 parameters, 0 given in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcpow_variation001.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcpow_variation001.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcpow_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcpow() with a negative exponent +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcpow("2", "-4"); +?> +--EXPECTF-- +0 \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcpowmod.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcpowmod.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcpowmod.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,16 @@ +--TEST-- +bcpowmod() - Raise an arbitrary precision number to another, reduced by a specified modulus +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcpowmod("5", "2", "7") . "\n"; +echo bcpowmod("-2", "5", "7") . "\n"; +echo bcpowmod("10", "2147483648", "2047"); +?> +--EXPECT-- +4 +-4 +790 \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcscale_variation001.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcscale_variation001.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcscale_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,13 @@ +--TEST-- +bcscale() with negative argument +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +bcscale(-4); +echo bcdiv("20.56", "4"); +?> +--EXPECTF-- +5 \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcscale_variation002.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcscale_variation002.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcscale_variation002.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcadd() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=-2 +--FILE-- +<?php +echo bcadd("-4.27", "7.3"); +?> +--EXPECTF-- +3 \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcsqrt_error2.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcsqrt_error2.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcsqrt_error2.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcsqrt() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcsqrt(); +?> +--EXPECTF-- +Warning: bcsqrt() expects at least 1 parameter, 0 given in %s on line %d \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcsqrt_variation001.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcsqrt_variation001.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcsqrt_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcsqrt() with argument of 0 +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcsqrt("0"); +?> +--EXPECTF-- +0 \ No newline at end of file Added: php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcsub_error1.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcsub_error1.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/bcmath/tests/bcsub_error1.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcsub() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcsub(); +?> +--EXPECTF-- +Warning: bcsub() expects at least 2 parameters, 0 given in %s on line %d \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bcadd_error1.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bcadd_error1.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bcadd_error1.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcadd() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcadd(); +?> +--EXPECTF-- +Warning: bcadd() expects at least 2 parameters, 0 given in %s on line %d \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bcadd_variation001.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bcadd_variation001.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bcadd_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,16 @@ +--TEST-- +bcadd() with non-integers +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=5 +--FILE-- +<?php +echo bcadd("2.2", "4.3", "2")."\n"; +echo bcadd("2.2", "-7.3", "1")."\n"; +echo bcadd("-4.27", "7.3"); +?> +--EXPECTF-- +6.50 +-5.1 +3.03000 \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bccomp_variation001.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bccomp_variation001.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bccomp_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,16 @@ +--TEST-- +bccomp() with non-integers +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bccomp("2.2", "2.2", "2")."\n"; +echo bccomp("2.32", "2.2", "2")."\n"; +echo bccomp("2.29", "2.3", "2"); +?> +--EXPECTF-- +0 +1 +-1 \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bccomp_variation002.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bccomp_variation002.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bccomp_variation002.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,16 @@ +--TEST-- +bccomp() with negative value +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bccomp("-2", "-2")."\n"; +echo bccomp("-2", "2", "1")."\n"; +echo bccomp("-2.29", "-2.3", "2"); +?> +--EXPECTF-- +0 +-1 +1 \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bcmod_error2.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bcmod_error2.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bcmod_error2.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcmod() - mod by 0 +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcmod("10", "0"); +?> +--EXPECTF-- +Warning: bcmod(): Division by zero in %s on line %d \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bcmul_error1.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bcmul_error1.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bcmul_error1.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcmul() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcmul(); +?> +--EXPECTF-- +Warning: bcmul() expects at least 2 parameters, 0 given in %s on line %d \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bcpow_error3.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bcpow_error3.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bcpow_error3.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcpow() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcpow(); +?> +--EXPECTF-- +Warning: bcpow() expects at least 2 parameters, 0 given in %s on line %d \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bcpow_variation001.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bcpow_variation001.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bcpow_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcpow() with a negative exponent +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcpow("2", "-4"); +?> +--EXPECTF-- +0 \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bcpowmod.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bcpowmod.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bcpowmod.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,16 @@ +--TEST-- +bcpowmod() - Raise an arbitrary precision number to another, reduced by a specified modulus +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcpowmod("5", "2", "7") . "\n"; +echo bcpowmod("-2", "5", "7") . "\n"; +echo bcpowmod("10", "2147483648", "2047"); +?> +--EXPECT-- +4 +-4 +790 \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bcscale_variation001.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bcscale_variation001.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bcscale_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,14 @@ +--TEST-- +bcscale() with negative argument +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +bcscale(-4); +echo bcdiv("20.56", "4"); +?> +--EXPECTF-- +Notice: bcscale(): Invalid scale given, using zero in %s on line %d +5 \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bcscale_variation002.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bcscale_variation002.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bcscale_variation002.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcadd() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=-2 +--FILE-- +<?php +echo bcadd("-4.27", "7.3"); +?> +--EXPECTF-- +3 \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bcsqrt_error2.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bcsqrt_error2.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bcsqrt_error2.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcsqrt() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcsqrt(); +?> +--EXPECTF-- +Warning: bcsqrt() expects at least 1 parameter, 0 given in %s on line %d \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bcsqrt_variation001.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bcsqrt_variation001.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bcsqrt_variation001.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcsqrt() with argument of 0 +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcsqrt("0"); +?> +--EXPECTF-- +0 \ No newline at end of file Added: php/php-src/trunk/ext/bcmath/tests/bcsub_error1.phpt =================================================================== --- php/php-src/trunk/ext/bcmath/tests/bcsub_error1.phpt (rev 0) +++ php/php-src/trunk/ext/bcmath/tests/bcsub_error1.phpt 2010-03-08 15:16:51 UTC (rev 295966) @@ -0,0 +1,12 @@ +--TEST-- +bcsub() incorrect argument count +--SKIPIF-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--INI-- +bcmath.scale=0 +--FILE-- +<?php +echo bcsub(); +?> +--EXPECTF-- +Warning: bcsub() expects at least 2 parameters, 0 given in %s on line %d \ No newline at end of file
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php