From: Zoe Slattery Date: Tue, 5 Jun 2007 09:21:54 +0000 (+0000) Subject: new test cases for general functions X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~529 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=484e14354eb92e33b23a92122abcda577642fdb9;p=php new test cases for general functions --- diff --git a/ext/standard/tests/general_functions/floatval.phpt b/ext/standard/tests/general_functions/floatval.phpt new file mode 100644 index 0000000000..80c257b27e --- /dev/null +++ b/ext/standard/tests/general_functions/floatval.phpt @@ -0,0 +1,353 @@ +--TEST-- +Testing floatval() and its alias doubleval() Functions +--FILE-- + +--EXPECTF-- +*** Testing floatval() with valid float values *** +float(0) +float(1) +float(-1) +float(1.234) +float(-1.234) +float(1200) +float(-1200) +float(10) +float(1050000) +float(100000) +float(-100000) +float(1.0E-5) +float(-0.1) +float(100000) +float(-100000) +float(100000) +float(-100000) +float(100000) +float(-100000) +float(5000000) +float(-5000000) + +*** Testing doubleval() with valid float values *** +float(0) +float(1) +float(-1) +float(1.234) +float(-1.234) +float(1200) +float(-1200) +float(10) +float(1050000) +float(100000) +float(-100000) +float(1.0E-5) +float(-0.1) +float(100000) +float(-100000) +float(100000) +float(-100000) +float(100000) +float(-100000) +float(5000000) +float(-5000000) + +*** Testing floatval() on non floating types *** +float(-2147483648) +float(2147483648) + +Warning: floatval() expects parameter 1 to be double, resource given in %s on line %d +NULL + +Warning: floatval() expects parameter 1 to be double, resource given in %s on line %d +NULL +float(0) +float(1) +float(-1300) + +Warning: floatval() expects parameter 1 to be double, string given in %s on line %d +NULL + +Notice: A non well formed numeric value encountered in %s on line %d +float(10) + +Notice: A non well formed numeric value encountered in %s on line %d +float(10.2) +float(11) +float(11) + +Warning: floatval() expects parameter 1 to be double, string given in %s on line %d +NULL +float(1) +float(0) +float(0) + +*** Testing doubleval() on non floating types *** +float(-2147483648) +float(2147483648) + +Warning: doubleval() expects parameter 1 to be double, resource given in %s on line %d +NULL + +Warning: doubleval() expects parameter 1 to be double, resource given in %s on line %d +NULL +float(0) +float(1) +float(-1300) + +Warning: doubleval() expects parameter 1 to be double, string given in %s on line %d +NULL + +Notice: A non well formed numeric value encountered in %s on line %d +float(10) + +Notice: A non well formed numeric value encountered in %s on line %d +float(10.2) +float(11) +float(11) + +Warning: doubleval() expects parameter 1 to be double, string given in %s on line %d +NULL +float(1) +float(0) +float(0) + +*** Testing error conditions *** + +Warning: floatval() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: doubleval() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: floatval() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: doubleval() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Done +--UEXPECTF-- +*** Testing floatval() with valid float values *** +float(0) +float(1) +float(-1) +float(1.234) +float(-1.234) +float(1200) +float(-1200) +float(10) +float(1050000) +float(100000) +float(-100000) +float(1.0E-5) +float(-0.1) +float(100000) +float(-100000) +float(100000) +float(-100000) +float(100000) +float(-100000) +float(5000000) +float(-5000000) + +*** Testing doubleval() with valid float values *** +float(0) +float(1) +float(-1) +float(1.234) +float(-1.234) +float(1200) +float(-1200) +float(10) +float(1050000) +float(100000) +float(-100000) +float(1.0E-5) +float(-0.1) +float(100000) +float(-100000) +float(100000) +float(-100000) +float(100000) +float(-100000) +float(5000000) +float(-5000000) + +*** Testing floatval() on non floating types *** +float(-2147483648) +float(2147483648) + +Warning: floatval() expects parameter 1 to be double, resource given in %s on line %d +NULL + +Warning: floatval() expects parameter 1 to be double, resource given in %s on line %d +NULL +float(0) +float(1) +float(-1300) + +Warning: floatval() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL + +Notice: A non well formed numeric value encountered in %s on line %d +float(10) + +Notice: A non well formed numeric value encountered in %s on line %d +float(10.2) +float(11) +float(11) + +Warning: floatval() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL +float(1) +float(0) +float(0) + +*** Testing doubleval() on non floating types *** +float(-2147483648) +float(2147483648) + +Warning: doubleval() expects parameter 1 to be double, resource given in %s on line %d +NULL + +Warning: doubleval() expects parameter 1 to be double, resource given in %s on line %d +NULL +float(0) +float(1) +float(-1300) + +Warning: doubleval() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL + +Notice: A non well formed numeric value encountered in %s on line %d +float(10) + +Notice: A non well formed numeric value encountered in %s on line %d +float(10.2) +float(11) +float(11) + +Warning: doubleval() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL +float(1) +float(0) +float(0) + +*** Testing error conditions *** + +Warning: floatval() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: doubleval() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: floatval() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: doubleval() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Done diff --git a/ext/standard/tests/general_functions/is_callable.phpt b/ext/standard/tests/general_functions/is_callable.phpt new file mode 100644 index 0000000000..80dd19a546 Binary files /dev/null and b/ext/standard/tests/general_functions/is_callable.phpt differ