From: andy wharmby Date: Thu, 8 Jan 2009 21:18:37 +0000 (+0000) Subject: New PHPT tests for math functions. Tested on Windows, Linux and Linux 64 bit. X-Git-Tag: php-5.4.0alpha1~191^2~4587 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=685a81b895354c4df92c0deda5f66dd4fbf40dd4;p=php New PHPT tests for math functions. Tested on Windows, Linux and Linux 64 bit. --- diff --git a/ext/standard/tests/math/abs_basic.phpt b/ext/standard/tests/math/abs_basic.phpt new file mode 100644 index 0000000000..0f6ecbc09b --- /dev/null +++ b/ext/standard/tests/math/abs_basic.phpt @@ -0,0 +1,51 @@ +--TEST-- +Test abs() function : basic functionality +--INI-- +precision = 14 +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing abs() : basic functionality *** +int(23) +int(23) +float(23.45) +float(23.45) +int(23) +int(23) +int(23) +int(23) +float(23.45) +float(23.45) +float(23.45) +int(0) +int(1) +int(0) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/abs_error.phpt b/ext/standard/tests/math/abs_error.phpt new file mode 100644 index 0000000000..4d62259afb --- /dev/null +++ b/ext/standard/tests/math/abs_error.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test abs() function : error conditions - incorrect number of args +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing abs() : error conditions *** + +Too many arguments + +Warning: abs() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Too few arguments + +Warning: abs() expects exactly 1 parameter, 0 given in %s on line %d +NULL +===Done=== diff --git a/ext/standard/tests/math/abs_variation.phpt b/ext/standard/tests/math/abs_variation.phpt new file mode 100644 index 0000000000..6df1e6b55c --- /dev/null +++ b/ext/standard/tests/math/abs_variation.phpt @@ -0,0 +1,135 @@ +--TEST-- +Test abs() function : usage variations - different data types as $number arg +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing abs() : usage variations *** + +-- Iteration 1 -- +int(0) + +-- Iteration 2 -- +int(0) + +-- Iteration 3 -- +int(1) + +-- Iteration 4 -- +int(0) + +-- Iteration 5 -- +int(1) + +-- Iteration 6 -- +int(0) + +-- Iteration 7 -- +int(0) + +-- Iteration 8 -- +int(0) + +-- Iteration 9 -- +bool(false) + +-- Iteration 10 -- +int(0) + +-- Iteration 11 -- +int(0) + +-- Iteration 12 -- +int(0) + +-- Iteration 13 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +int(1) + +-- Iteration 14 -- +int(0) + +-- Iteration 15 -- +int(0) + +-- Iteration 16 -- +int(%d) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/atan2_variation1.phpt b/ext/standard/tests/math/atan2_variation1.phpt new file mode 100644 index 0000000000..1369e55bf9 --- /dev/null +++ b/ext/standard/tests/math/atan2_variation1.phpt @@ -0,0 +1,187 @@ +--TEST-- +Test atan2() function : usage variations - different data types as $y arg +--INI-- +precision = 10 +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing atan2() : usage variations *** + +-- Iteration 1 -- +float(0) + +-- Iteration 2 -- +float(0.04345089539) + +-- Iteration 3 -- +float(0.4808872802) + +-- Iteration 4 -- +float(-0.4808872802) + +-- Iteration 5 -- +float(1.570796316) + +-- Iteration 6 -- +float(0.4282641529) + +-- Iteration 7 -- +float(-0.4282641529) + +-- Iteration 8 -- +float(1.386607742) + +-- Iteration 9 -- +float(0.0005367682093) + +-- Iteration 10 -- +float(0.02173570684) + +-- Iteration 11 -- +float(0) + +-- Iteration 12 -- +float(0) + +-- Iteration 13 -- +float(0.04345089539) + +-- Iteration 14 -- +float(0) + +-- Iteration 15 -- +float(0.04345089539) + +-- Iteration 16 -- +float(0) + +-- Iteration 17 -- + +Warning: atan2() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: atan2() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: atan2() expects parameter 1 to be double, array given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: atan2() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: atan2() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: atan2() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: atan2() expects parameter 1 to be double, object given in %s on line %d +NULL + +-- Iteration 24 -- +float(0) + +-- Iteration 25 -- +float(0) + +-- Iteration 26 -- + +Warning: atan2() expects parameter 1 to be double, resource given in %s on line %d +NULL +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/atan2_variation2.phpt b/ext/standard/tests/math/atan2_variation2.phpt new file mode 100644 index 0000000000..166c8d2897 --- /dev/null +++ b/ext/standard/tests/math/atan2_variation2.phpt @@ -0,0 +1,186 @@ +--TEST-- +Test atan2() function : usage variations - different data types as $x arg +--INI-- +precision = 10 +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing atan2() : basic functionality *** + +-- Iteration 1 -- +float(1.570796327) + +-- Iteration 2 -- +float(1.527345431) + +-- Iteration 3 -- +float(1.089909047) + +-- Iteration 4 -- +float(2.051683607) + +-- Iteration 5 -- +float(1.071020961E-8) + +-- Iteration 6 -- +float(1.142532174) + +-- Iteration 7 -- +float(1.99906048) + +-- Iteration 8 -- +float(0.1841885846) + +-- Iteration 9 -- +float(1.570259559) + +-- Iteration 10 -- +float(1.54906062) + +-- Iteration 11 -- +float(1.570796327) + +-- Iteration 12 -- +float(1.570796327) + +-- Iteration 13 -- +float(1.527345431) + +-- Iteration 14 -- +float(1.570796327) + +-- Iteration 15 -- +float(1.527345431) + +-- Iteration 16 -- +float(1.570796327) + +-- Iteration 17 -- + +Warning: atan2() expects parameter 2 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: atan2() expects parameter 2 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: atan2() expects parameter 2 to be double, array given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: atan2() expects parameter 2 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: atan2() expects parameter 2 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: atan2() expects parameter 2 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: atan2() expects parameter 2 to be double, object given in %s on line %d +NULL + +-- Iteration 24 -- +float(1.570796327) + +-- Iteration 25 -- +float(1.570796327) + +-- Iteration 26 -- + +Warning: atan2() expects parameter 2 to be double, resource given in %s on line %d +NULL +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/base_convert_error.phpt b/ext/standard/tests/math/base_convert_error.phpt index 5614073944..c9b51088aa 100644 --- a/ext/standard/tests/math/base_convert_error.phpt +++ b/ext/standard/tests/math/base_convert_error.phpt @@ -1,14 +1,33 @@ --TEST-- -Test base_convert() - wrong params base_convert() +Test base_convert() function : error conditions - incorrect input --FILE-- --EXPECTF-- +*** Testing base_convert() : error conditions *** +Incorrect number of arguments Warning: base_convert() expects exactly 3 parameters, 0 given in %s on line %d @@ -18,4 +37,7 @@ Warning: base_convert() expects exactly 3 parameters, 2 given in %s on line %d Warning: base_convert(): Invalid `from base' (1) in %s on line %d -Warning: base_convert(): Invalid `to base' (37) in %s on line %d +Warning: base_convert(): Invalid `to base' (37) in %s on line %s +Incorrect input + +Catchable fatal error: Object of class classA could not be converted to binary string in %s on line %d \ No newline at end of file diff --git a/ext/standard/tests/math/base_convert_variation1.phpt b/ext/standard/tests/math/base_convert_variation1.phpt new file mode 100644 index 0000000000..3ea711a3bf --- /dev/null +++ b/ext/standard/tests/math/base_convert_variation1.phpt @@ -0,0 +1,159 @@ +--TEST-- +Test base_convert() function : usage variations - different data types as $number argument +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing base_convert() : usage variations *** + +-- Iteration 1 -- +unicode(1) "0" + +-- Iteration 2 -- +unicode(1) "1" + +-- Iteration 3 -- +unicode(2) "14" + +-- Iteration 4 -- +unicode(2) "14" + +-- Iteration 5 -- +unicode(11) "17777777777" + +-- Iteration 6 -- +unicode(3) "151" + +-- Iteration 7 -- +unicode(3) "151" + +-- Iteration 8 -- +unicode(7) "4553207" + +-- Iteration 9 -- +unicode(7) "4553207" + +-- Iteration 10 -- +unicode(1) "5" + +-- Iteration 11 -- +unicode(1) "0" + +-- Iteration 12 -- +unicode(1) "0" + +-- Iteration 13 -- +unicode(1) "1" + +-- Iteration 14 -- +unicode(1) "0" + +-- Iteration 15 -- +unicode(1) "1" + +-- Iteration 16 -- +unicode(1) "0" + +-- Iteration 17 -- +unicode(1) "0" + +-- Iteration 18 -- +unicode(1) "0" + +-- Iteration 19 -- + +Notice: Array to string conversion in %s on line %d +unicode(1) "0" + +-- Iteration 20 -- +unicode(1) "0" + +-- Iteration 21 -- +unicode(1) "0" + +-- Iteration 22 -- +unicode(1) "0" + +-- Iteration 23 -- +unicode(1) "0" + +-- Iteration 24 -- +unicode(1) "0" + +-- Iteration 25 -- +unicode(%d) "%d" +===Done=== diff --git a/ext/standard/tests/math/base_convert_variation2.phpt b/ext/standard/tests/math/base_convert_variation2.phpt new file mode 100644 index 0000000000..a3b65768f2 --- /dev/null +++ b/ext/standard/tests/math/base_convert_variation2.phpt @@ -0,0 +1,193 @@ +--TEST-- +Test base_convert() function : usage variations - different data types as $frombase argument +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing base_convert() : usage variations *** + +-- Iteration 1 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: base_convert(): Invalid `from base' (1) in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: base_convert(): Invalid `from base' (-1) in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: base_convert(): Invalid `from base' (-12) in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: base_convert(): Invalid `from base' (2147483647) in %s on line %d +bool(false) + +-- Iteration 6 -- +unicode(2) "31" + +-- Iteration 7 -- + +Warning: base_convert(): Invalid `from base' (-10) in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: base_convert(): Invalid `from base' (123) in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 10 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 12 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: base_convert(): Invalid `from base' (1) in %s on line %d +bool(false) + +-- Iteration 14 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: base_convert(): Invalid `from base' (1) in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: base_convert() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: base_convert() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: base_convert() expects parameter 2 to be long, array given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: base_convert() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: base_convert() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: base_convert() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/base_convert_variation3.phpt b/ext/standard/tests/math/base_convert_variation3.phpt new file mode 100644 index 0000000000..0b5acb6250 --- /dev/null +++ b/ext/standard/tests/math/base_convert_variation3.phpt @@ -0,0 +1,193 @@ +--TEST-- +Test base_convert() function : usage variations - different data types as $tobase argument +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing base_convert() : usage variations *** + +-- Iteration 1 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: base_convert(): Invalid `to base' (1) in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: base_convert(): Invalid `to base' (-1) in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: base_convert(): Invalid `to base' (-12) in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: base_convert(): Invalid `to base' (2147483647) in %s on line %d +bool(false) + +-- Iteration 6 -- +unicode(2) "25" + +-- Iteration 7 -- + +Warning: base_convert(): Invalid `to base' (-10) in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: base_convert(): Invalid `to base' (123) in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 10 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 12 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: base_convert(): Invalid `to base' (1) in %s on line %d +bool(false) + +-- Iteration 14 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: base_convert(): Invalid `to base' (1) in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: base_convert() expects parameter 3 to be long, Unicode string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: base_convert() expects parameter 3 to be long, Unicode string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: base_convert() expects parameter 3 to be long, array given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: base_convert() expects parameter 3 to be long, Unicode string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: base_convert() expects parameter 3 to be long, Unicode string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: base_convert() expects parameter 3 to be long, Unicode string given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/bindec_error.phpt b/ext/standard/tests/math/bindec_error.phpt index 1cf313f520..0a1cf85e46 100644 --- a/ext/standard/tests/math/bindec_error.phpt +++ b/ext/standard/tests/math/bindec_error.phpt @@ -1,12 +1,37 @@ --TEST-- -Test bindec() - basic function test bindec() +Test bindec() function : error conditions - incorrect input --FILE-- --EXPECTF-- +*** Testing bindec() : error conditions *** +Incorrect number of arguments Warning: bindec() expects exactly 1 parameter, 0 given in %s on line %d Warning: bindec() expects exactly 1 parameter, 2 given in %s on line %d +Incorrect input + +Catchable fatal error: Object of class classA could not be converted to binary string in %s on line %d \ No newline at end of file diff --git a/ext/standard/tests/math/bindec_variation1.phpt b/ext/standard/tests/math/bindec_variation1.phpt new file mode 100644 index 0000000000..1e188bab34 --- /dev/null +++ b/ext/standard/tests/math/bindec_variation1.phpt @@ -0,0 +1,158 @@ +--TEST-- +Test bindec() function : usage variations - different data types as $binary_string arg +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing bindec() : usage variations *** + +-- Iteration 1 -- +int(0) + +-- Iteration 2 -- +int(1) + +-- Iteration 3 -- +int(1) + +-- Iteration 4 -- +int(0) + +-- Iteration 5 -- +int(2) + +-- Iteration 6 -- +int(2) + +-- Iteration 7 -- +int(8) + +-- Iteration 8 -- +int(1) + +-- Iteration 9 -- +int(0) + +-- Iteration 10 -- +int(0) + +-- Iteration 11 -- +int(0) + +-- Iteration 12 -- +int(1) + +-- Iteration 13 -- +int(0) + +-- Iteration 14 -- +int(1) + +-- Iteration 15 -- +int(0) + +-- Iteration 16 -- +int(0) + +-- Iteration 17 -- +int(0) + +-- Iteration 18 -- + +Notice: Array to string conversion in %s on line %d +int(0) + +-- Iteration 19 -- +int(0) + +-- Iteration 20 -- +int(0) + +-- Iteration 21 -- +int(0) + +-- Iteration 22 -- +int(0) + +-- Iteration 23 -- +int(0) + +-- Iteration 24 -- +int(%d) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/bindec_variation1_64bit.phpt b/ext/standard/tests/math/bindec_variation1_64bit.phpt new file mode 100644 index 0000000000..0a37c4c2f9 --- /dev/null +++ b/ext/standard/tests/math/bindec_variation1_64bit.phpt @@ -0,0 +1,158 @@ +--TEST-- +Test bindec() function : usage variations - different data types as $binary_string arg +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing bindec() : usage variations *** + +-- Iteration 1 -- +int(0) + +-- Iteration 2 -- +int(1) + +-- Iteration 3 -- +int(1) + +-- Iteration 4 -- +int(0) + +-- Iteration 5 -- +int(2) + +-- Iteration 6 -- +int(2) + +-- Iteration 7 -- +int(8) + +-- Iteration 8 -- +int(1) + +-- Iteration 9 -- +int(0) + +-- Iteration 10 -- +int(0) + +-- Iteration 11 -- +int(0) + +-- Iteration 12 -- +int(1) + +-- Iteration 13 -- +int(0) + +-- Iteration 14 -- +int(1) + +-- Iteration 15 -- +int(0) + +-- Iteration 16 -- +int(0) + +-- Iteration 17 -- +int(0) + +-- Iteration 18 -- + +Notice: Array to string conversion in %s on line %d +int(0) + +-- Iteration 19 -- +int(0) + +-- Iteration 20 -- +int(0) + +-- Iteration 21 -- +int(0) + +-- Iteration 22 -- +int(0) + +-- Iteration 23 -- +int(0) + +-- Iteration 24 -- +int(%d) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/ceil_basic.phpt b/ext/standard/tests/math/ceil_basic.phpt new file mode 100644 index 0000000000..4264b1cf5e --- /dev/null +++ b/ext/standard/tests/math/ceil_basic.phpt @@ -0,0 +1,66 @@ +--TEST-- +Test ceil() - basic function test for ceil() +--INI-- +precision=14 +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing ceil() : basic functionality *** +float(0) +float(0) +float(1) +float(-0) +float(1) +float(-1) +float(2) +float(-1) +float(3) +float(-2) +float(31) +float(95) +float(11) +float(-10) +float(3950) +float(-3950) +float(39) +float(95) +float(1) +float(0) +float(0) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/ceil_error.phpt b/ext/standard/tests/math/ceil_error.phpt new file mode 100644 index 0000000000..1cf7ce4184 --- /dev/null +++ b/ext/standard/tests/math/ceil_error.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test ceil() - error conditions - incorrect number of args +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing ceil() : error conditions *** + +Too many arguments + +Warning: ceil() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Too few arguments + +Warning: ceil() expects exactly 1 parameter, 0 given in %s on line %d +NULL +===Done=== diff --git a/ext/standard/tests/math/ceil_variation1.phpt b/ext/standard/tests/math/ceil_variation1.phpt new file mode 100644 index 0000000000..7c1f859277 --- /dev/null +++ b/ext/standard/tests/math/ceil_variation1.phpt @@ -0,0 +1,128 @@ +--TEST-- +Test ceil() function : usage variations - different data types as $value arg +--INI-- +precision=14 +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing ceil() : usage variations *** + +-- Iteration 1 -- +float(0) + +-- Iteration 2 -- +float(0) + +-- Iteration 3 -- +float(1) + +-- Iteration 4 -- +float(0) + +-- Iteration 5 -- +float(1) + +-- Iteration 6 -- +float(0) + +-- Iteration 7 -- +float(0) + +-- Iteration 8 -- +float(0) + +-- Iteration 9 -- +bool(false) + +-- Iteration 10 -- +float(0) + +-- Iteration 11 -- +float(0) + +-- Iteration 12 -- +float(0) + +-- Iteration 13 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +float(1) + +-- Iteration 14 -- +float(0) + +-- Iteration 15 -- +float(0) + +-- Iteration 16 -- +float(%d) +===Done=== diff --git a/ext/standard/tests/math/decbin_error.phpt b/ext/standard/tests/math/decbin_error.phpt index 7df4f12c3a..d45a3b0128 100644 --- a/ext/standard/tests/math/decbin_error.phpt +++ b/ext/standard/tests/math/decbin_error.phpt @@ -1,12 +1,25 @@ --TEST-- -Test decbin() - wrong params +Test decbin() - error conditions --FILE-- +===Done=== --EXPECTF-- +*** Testing decbin() : error conditions *** +Incorrect number of arguments Warning: decbin() expects exactly 1 parameter, 0 given in %s on line %d Warning: decbin() expects exactly 1 parameter, 3 given in %s on line %d +===Done=== diff --git a/ext/standard/tests/math/decbin_variation1.phpt b/ext/standard/tests/math/decbin_variation1.phpt new file mode 100644 index 0000000000..d1e3f08e79 --- /dev/null +++ b/ext/standard/tests/math/decbin_variation1.phpt @@ -0,0 +1,179 @@ +--TEST-- +Test decbin() function : usage variations - different data types as $number arg +--INI-- +precision=14 +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing decbin() : usage variations *** + +-- Iteration 1 -- +unicode(1) "0" + +-- Iteration 2 -- +unicode(1) "1" + +-- Iteration 3 -- +unicode(14) "11000000111001" + +-- Iteration 4 -- +unicode(32) "11111111111111111111011011010111" + +-- Iteration 5 -- +unicode(32) "11111111111111111111111111111111" + +-- Iteration 6 -- +unicode(31) "1111111111111111111111111111111" + +-- Iteration 7 -- +unicode(4) "1010" + +-- Iteration 8 -- +unicode(32) "11111111111111111111111111110110" + +-- Iteration 9 -- +unicode(31) "1111111111111111111111111111111" + +-- Iteration 10 -- +unicode(1) "0" + +-- Iteration 11 -- +unicode(1) "0" + +-- Iteration 12 -- +unicode(1) "0" + +-- Iteration 13 -- +unicode(1) "0" + +-- Iteration 14 -- +unicode(1) "1" + +-- Iteration 15 -- +unicode(1) "0" + +-- Iteration 16 -- +unicode(1) "1" + +-- Iteration 17 -- +unicode(1) "0" + +-- Iteration 18 -- +unicode(1) "0" + +-- Iteration 19 -- +unicode(1) "0" + +-- Iteration 20 -- +unicode(1) "0" + +-- Iteration 21 -- +unicode(1) "0" + +-- Iteration 22 -- +unicode(1) "0" + +-- Iteration 23 -- +unicode(1) "0" + +-- Iteration 24 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +unicode(1) "1" + +-- Iteration 25 -- +unicode(1) "0" + +-- Iteration 26 -- +unicode(1) "0" + +-- Iteration 27 -- +unicode(%d) "%d" +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/decbin_variation1_64bit.phpt b/ext/standard/tests/math/decbin_variation1_64bit.phpt new file mode 100644 index 0000000000..09a96d1d9c --- /dev/null +++ b/ext/standard/tests/math/decbin_variation1_64bit.phpt @@ -0,0 +1,179 @@ +--TEST-- +Test decbin() function : usage variations - different data types as $number arg +--INI-- +precision=14 +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing decbin() : usage variations *** + +-- Iteration 1 -- +unicode(1) "0" + +-- Iteration 2 -- +unicode(1) "1" + +-- Iteration 3 -- +unicode(14) "11000000111001" + +-- Iteration 4 -- +unicode(64) "1111111111111111111111111111111111111111111111111111011011010111" + +-- Iteration 5 -- +unicode(63) "111111111111111111111111111111111111111111111111111111111111111" + +-- Iteration 6 -- +unicode(63) "111111111111111111111111111111111111111111111111111111111111111" + +-- Iteration 7 -- +unicode(4) "1010" + +-- Iteration 8 -- +unicode(64) "1111111111111111111111111111111111111111111111111111111111110110" + +-- Iteration 9 -- +unicode(37) "1110010111110100110010001101000001000" + +-- Iteration 10 -- +unicode(1) "0" + +-- Iteration 11 -- +unicode(1) "0" + +-- Iteration 12 -- +unicode(1) "0" + +-- Iteration 13 -- +unicode(1) "0" + +-- Iteration 14 -- +unicode(1) "1" + +-- Iteration 15 -- +unicode(1) "0" + +-- Iteration 16 -- +unicode(1) "1" + +-- Iteration 17 -- +unicode(1) "0" + +-- Iteration 18 -- +unicode(1) "0" + +-- Iteration 19 -- +unicode(1) "0" + +-- Iteration 20 -- +unicode(1) "0" + +-- Iteration 21 -- +unicode(1) "0" + +-- Iteration 22 -- +unicode(1) "0" + +-- Iteration 23 -- +unicode(1) "0" + +-- Iteration 24 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +unicode(1) "1" + +-- Iteration 25 -- +unicode(1) "0" + +-- Iteration 26 -- +unicode(1) "0" + +-- Iteration 27 -- +unicode(%d) "%d" +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/dechex_error.phpt b/ext/standard/tests/math/dechex_error.phpt index 81492a49c6..7ed0c4598c 100644 --- a/ext/standard/tests/math/dechex_error.phpt +++ b/ext/standard/tests/math/dechex_error.phpt @@ -2,12 +2,25 @@ Test dechex() - wrong params dechex() --FILE-- +?> +===Done=== --EXPECTF-- - +*** Testing dechex() : error conditions *** + +Incorrect number of arguments + Warning: dechex() expects exactly 1 parameter, 0 given in %s on line %d Warning: dechex() expects exactly 1 parameter, 3 given in %s on line %d +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/dechex_variation1.phpt b/ext/standard/tests/math/dechex_variation1.phpt new file mode 100644 index 0000000000..54080b0bf2 --- /dev/null +++ b/ext/standard/tests/math/dechex_variation1.phpt @@ -0,0 +1,179 @@ +--TEST-- +Test dechex() function : usage variations - different data types as $number arg +--INI-- +precision=14 +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing dechex() : usage variations *** + +-- Iteration 1 -- +unicode(1) "0" + +-- Iteration 2 -- +unicode(1) "1" + +-- Iteration 3 -- +unicode(4) "3039" + +-- Iteration 4 -- +unicode(8) "fffff6d7" + +-- Iteration 5 -- +unicode(8) "ffffffff" + +-- Iteration 6 -- +unicode(8) "7fffffff" + +-- Iteration 7 -- +unicode(1) "a" + +-- Iteration 8 -- +unicode(8) "fffffff6" + +-- Iteration 9 -- +unicode(8) "7fffffff" + +-- Iteration 10 -- +unicode(1) "0" + +-- Iteration 11 -- +unicode(1) "0" + +-- Iteration 12 -- +unicode(1) "0" + +-- Iteration 13 -- +unicode(1) "0" + +-- Iteration 14 -- +unicode(1) "1" + +-- Iteration 15 -- +unicode(1) "0" + +-- Iteration 16 -- +unicode(1) "1" + +-- Iteration 17 -- +unicode(1) "0" + +-- Iteration 18 -- +unicode(1) "0" + +-- Iteration 19 -- +unicode(1) "0" + +-- Iteration 20 -- +unicode(1) "0" + +-- Iteration 21 -- +unicode(1) "0" + +-- Iteration 22 -- +unicode(1) "0" + +-- Iteration 23 -- +unicode(1) "0" + +-- Iteration 24 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +unicode(1) "1" + +-- Iteration 25 -- +unicode(1) "0" + +-- Iteration 26 -- +unicode(1) "0" + +-- Iteration 27 -- +unicode(%d) "%s" +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/dechex_variation1_64bit.phpt b/ext/standard/tests/math/dechex_variation1_64bit.phpt new file mode 100644 index 0000000000..929e759f58 --- /dev/null +++ b/ext/standard/tests/math/dechex_variation1_64bit.phpt @@ -0,0 +1,179 @@ +--TEST-- +Test dechex() function : usage variations - different data types as $number arg +--INI-- +precision=14 +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing dechex() : usage variations *** + +-- Iteration 1 -- +unicode(1) "0" + +-- Iteration 2 -- +unicode(1) "1" + +-- Iteration 3 -- +unicode(4) "3039" + +-- Iteration 4 -- +unicode(16) "fffffffffffff6d7" + +-- Iteration 5 -- +unicode(16) "7fffffffffffffff" + +-- Iteration 6 -- +unicode(16) "7fffffffffffffff" + +-- Iteration 7 -- +unicode(1) "a" + +-- Iteration 8 -- +unicode(16) "fffffffffffffff6" + +-- Iteration 9 -- +unicode(10) "1cbe991a08" + +-- Iteration 10 -- +unicode(1) "0" + +-- Iteration 11 -- +unicode(1) "0" + +-- Iteration 12 -- +unicode(1) "0" + +-- Iteration 13 -- +unicode(1) "0" + +-- Iteration 14 -- +unicode(1) "1" + +-- Iteration 15 -- +unicode(1) "0" + +-- Iteration 16 -- +unicode(1) "1" + +-- Iteration 17 -- +unicode(1) "0" + +-- Iteration 18 -- +unicode(1) "0" + +-- Iteration 19 -- +unicode(1) "0" + +-- Iteration 20 -- +unicode(1) "0" + +-- Iteration 21 -- +unicode(1) "0" + +-- Iteration 22 -- +unicode(1) "0" + +-- Iteration 23 -- +unicode(1) "0" + +-- Iteration 24 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +unicode(1) "1" + +-- Iteration 25 -- +unicode(1) "0" + +-- Iteration 26 -- +unicode(1) "0" + +-- Iteration 27 -- +unicode(%d) "%s" +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/decoct_error.phpt b/ext/standard/tests/math/decoct_error.phpt index 44212afb07..d3f6699428 100644 --- a/ext/standard/tests/math/decoct_error.phpt +++ b/ext/standard/tests/math/decoct_error.phpt @@ -1,12 +1,25 @@ --TEST-- -Test decoct() - wrong params decoct() +Test decoct() - error conditions --FILE-- +===Done=== --EXPECTF-- +*** Testing decoct() : error conditions *** +Incorrect number of arguments Warning: decoct() expects exactly 1 parameter, 0 given in %s on line %d Warning: decoct() expects exactly 1 parameter, 3 given in %s on line %d +===Done=== diff --git a/ext/standard/tests/math/decoct_variation1.phpt b/ext/standard/tests/math/decoct_variation1.phpt new file mode 100644 index 0000000000..69982da290 --- /dev/null +++ b/ext/standard/tests/math/decoct_variation1.phpt @@ -0,0 +1,180 @@ +--TEST-- +Test decoct() function : usage variations - different data types as $number arg +--INI-- +precision=14 +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing decoct() : usage variations *** + +-- Iteration 1 -- +unicode(1) "0" + +-- Iteration 2 -- +unicode(1) "1" + +-- Iteration 3 -- +unicode(5) "30071" + +-- Iteration 4 -- +unicode(11) "37777773327" + +-- Iteration 5 -- +unicode(11) "37777777777" + +-- Iteration 6 -- +unicode(11) "17777777777" + +-- Iteration 7 -- +unicode(2) "12" + +-- Iteration 8 -- +unicode(11) "37777777766" + +-- Iteration 9 -- +unicode(11) "17777777777" + +-- Iteration 10 -- +unicode(1) "0" + +-- Iteration 11 -- +unicode(1) "0" + +-- Iteration 12 -- +unicode(1) "0" + +-- Iteration 13 -- +unicode(1) "0" + +-- Iteration 14 -- +unicode(1) "1" + +-- Iteration 15 -- +unicode(1) "0" + +-- Iteration 16 -- +unicode(1) "1" + +-- Iteration 17 -- +unicode(1) "0" + +-- Iteration 18 -- +unicode(1) "0" + +-- Iteration 19 -- +unicode(1) "0" + +-- Iteration 20 -- +unicode(1) "0" + +-- Iteration 21 -- +unicode(1) "0" + +-- Iteration 22 -- +unicode(1) "0" + +-- Iteration 23 -- +unicode(1) "0" + +-- Iteration 24 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +unicode(1) "1" + +-- Iteration 25 -- +unicode(1) "0" + +-- Iteration 26 -- +unicode(1) "0" + +-- Iteration 27 -- +unicode(%d) "%d" +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/decoct_variation1_64bit.phpt b/ext/standard/tests/math/decoct_variation1_64bit.phpt new file mode 100644 index 0000000000..40eca6c9bf --- /dev/null +++ b/ext/standard/tests/math/decoct_variation1_64bit.phpt @@ -0,0 +1,180 @@ +--TEST-- +Test decoct() function : usage variations - different data types as $number arg +--INI-- +precision=14 +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing decoct() : usage variations *** + +-- Iteration 1 -- +unicode(1) "0" + +-- Iteration 2 -- +unicode(1) "1" + +-- Iteration 3 -- +unicode(5) "30071" + +-- Iteration 4 -- +unicode(22) "1777777777777777773327" + +-- Iteration 5 -- +unicode(21) "777777777777777777777" + +-- Iteration 6 -- +unicode(21) "777777777777777777777" + +-- Iteration 7 -- +unicode(2) "12" + +-- Iteration 8 -- +unicode(22) "1777777777777777777766" + +-- Iteration 9 -- +unicode(13) "1627646215010" + +-- Iteration 10 -- +unicode(1) "0" + +-- Iteration 11 -- +unicode(1) "0" + +-- Iteration 12 -- +unicode(1) "0" + +-- Iteration 13 -- +unicode(1) "0" + +-- Iteration 14 -- +unicode(1) "1" + +-- Iteration 15 -- +unicode(1) "0" + +-- Iteration 16 -- +unicode(1) "1" + +-- Iteration 17 -- +unicode(1) "0" + +-- Iteration 18 -- +unicode(1) "0" + +-- Iteration 19 -- +unicode(1) "0" + +-- Iteration 20 -- +unicode(1) "0" + +-- Iteration 21 -- +unicode(1) "0" + +-- Iteration 22 -- +unicode(1) "0" + +-- Iteration 23 -- +unicode(1) "0" + +-- Iteration 24 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +unicode(1) "1" + +-- Iteration 25 -- +unicode(1) "0" + +-- Iteration 26 -- +unicode(1) "0" + +-- Iteration 27 -- +unicode(%d) "%d" +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/exp_basic.phpt b/ext/standard/tests/math/exp_basic.phpt new file mode 100644 index 0000000000..9526c66fa4 --- /dev/null +++ b/ext/standard/tests/math/exp_basic.phpt @@ -0,0 +1,71 @@ +--TEST-- +Test exp() - basic function test for exp() +--INI-- +precision=14 +--FILE-- + +===Done=== +--EXPECTF-- + +-- Iteration 1 -- +float(22026.465794807) + +-- Iteration 2 -- +float(29732.618852891) + +-- Iteration 3 -- +float(INF) + +-- Iteration 4 -- +float(29048849665247) + +-- Iteration 5 -- +float(1.811239082889E+41) + +-- Iteration 6 -- +float(22026.465794807) + +-- Iteration 7 -- +float(INF) + +-- Iteration 8 -- +float(INF) + +-- Iteration 9 -- +float(8.6593400423994E+16) + +-- Iteration 10 -- +float(1.811239082889E+41) + +-- Iteration 11 -- +float(2.718281828459) + +-- Iteration 12 -- +float(1) + +-- Iteration 13 -- +float(1) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/exp_variation1.phpt b/ext/standard/tests/math/exp_variation1.phpt new file mode 100644 index 0000000000..790f0b30a9 --- /dev/null +++ b/ext/standard/tests/math/exp_variation1.phpt @@ -0,0 +1,187 @@ +--TEST-- +Test exp() function : usage variations - different data types as $arg argument +--INI-- +precision=14 +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing exp() : usage variations *** + +-- Iteration 1 -- +float(1) + +-- Iteration 2 -- +float(2.718281828459) + +-- Iteration 3 -- +float(INF) + +-- Iteration 4 -- +float(0) + +-- Iteration 5 -- +float(INF) + +-- Iteration 6 -- +float(36315.502674247) + +-- Iteration 7 -- +float(2.7536449349747E-5) + +-- Iteration 8 -- +float(INF) + +-- Iteration 9 -- +float(1.0000000012346) + +-- Iteration 10 -- +float(1.6487212707001) + +-- Iteration 11 -- +float(1) + +-- Iteration 12 -- +float(1) + +-- Iteration 13 -- +float(2.718281828459) + +-- Iteration 14 -- +float(1) + +-- Iteration 15 -- +float(2.718281828459) + +-- Iteration 16 -- +float(1) + +-- Iteration 17 -- + +Warning: exp() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: exp() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: exp() expects parameter 1 to be double, array given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: exp() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: exp() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: exp() expects parameter 1 to be double, Unicode string given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: exp() expects parameter 1 to be double, object given in %s on line %d +NULL + +-- Iteration 24 -- +float(1) + +-- Iteration 25 -- +float(1) + +-- Iteration 26 -- + +Warning: exp() expects parameter 1 to be double, resource given in %s on line %d +NULL +===Done===