2008-02-06 08:44:24 +00:00
|
|
|
--TEST--
|
|
|
|
Test hypot() - wrong params test hypot()
|
|
|
|
--FILE--
|
|
|
|
<?php
|
2009-01-12 14:30:52 +00:00
|
|
|
/* Prototype : float hypot ( float $x , float $y )
|
|
|
|
* Description: Calculate the length of the hypotenuse of a right-angle triangle.
|
|
|
|
* Source code: ext/standard/math.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
echo "*** Testing hypot() : error conditions ***\n";
|
|
|
|
|
|
|
|
echo "\n-- Testing hypot() function with less than expected no. of arguments --\n";
|
2008-02-06 08:44:24 +00:00
|
|
|
hypot();
|
|
|
|
hypot(36);
|
2009-01-12 14:30:52 +00:00
|
|
|
|
|
|
|
echo "\n-- Testing hypot() function with more than expected no. of arguments --\n";
|
2008-02-06 08:44:24 +00:00
|
|
|
hypot(36,25,0);
|
2009-01-12 14:30:52 +00:00
|
|
|
|
2008-02-06 08:44:24 +00:00
|
|
|
?>
|
2009-01-12 14:30:52 +00:00
|
|
|
===Done===
|
2008-02-06 08:44:24 +00:00
|
|
|
--EXPECTF--
|
2009-01-12 14:30:52 +00:00
|
|
|
*** Testing hypot() : error conditions ***
|
|
|
|
|
|
|
|
-- Testing hypot() function with less than expected no. of arguments --
|
|
|
|
|
2008-02-21 17:47:33 +00:00
|
|
|
Warning: hypot() expects exactly 2 parameters, 0 given in %s on line %d
|
2008-02-06 08:44:24 +00:00
|
|
|
|
2008-02-21 17:47:33 +00:00
|
|
|
Warning: hypot() expects exactly 2 parameters, 1 given in %s on line %d
|
2008-02-06 08:44:24 +00:00
|
|
|
|
2009-01-12 14:30:52 +00:00
|
|
|
-- Testing hypot() function with more than expected no. of arguments --
|
|
|
|
|
2008-02-21 17:47:33 +00:00
|
|
|
Warning: hypot() expects exactly 2 parameters, 3 given in %s on line %d
|
2009-01-12 14:30:52 +00:00
|
|
|
===Done===
|