From c957a3ae9c090f63c322c1243ef0194f5b432ccb Mon Sep 17 00:00:00 2001 From: andy wharmby Date: Thu, 8 Jan 2009 21:21:17 +0000 Subject: [PATCH] New PHPT tests for math functions (batch 1 of 3). Tested on Windows, Linux and Linux 64 bit. --- ext/standard/tests/math/abs_basic.phpt | 51 +++++ ext/standard/tests/math/abs_error.phpt | 39 ++++ ext/standard/tests/math/abs_variation.phpt | 135 ++++++++++++ ext/standard/tests/math/atan2_variation1.phpt | 173 ++++++++++++++++ ext/standard/tests/math/atan2_variation2.phpt | 172 ++++++++++++++++ .../tests/math/base_convert_error.phpt | 34 ++- .../tests/math/base_convert_variation1.phpt | 159 +++++++++++++++ .../tests/math/base_convert_variation2.phpt | 193 ++++++++++++++++++ .../tests/math/base_convert_variation3.phpt | 193 ++++++++++++++++++ ext/standard/tests/math/bindec_error.phpt | 31 ++- .../tests/math/bindec_variation1.phpt | 158 ++++++++++++++ .../tests/math/bindec_variation1_64bit.phpt | 158 ++++++++++++++ ext/standard/tests/math/ceil_basic.phpt | 66 ++++++ ext/standard/tests/math/ceil_error.phpt | 33 +++ ext/standard/tests/math/ceil_variation1.phpt | 128 ++++++++++++ ext/standard/tests/math/decbin_error.phpt | 20 +- .../tests/math/decbin_variation1.phpt | 178 ++++++++++++++++ .../tests/math/decbin_variation1_64bit.phpt | 179 ++++++++++++++++ ext/standard/tests/math/dechex_error.phpt | 19 +- .../tests/math/dechex_variation1.phpt | 179 ++++++++++++++++ .../tests/math/dechex_variation1_64bit.phpt | 179 ++++++++++++++++ ext/standard/tests/math/decoct_error.phpt | 20 +- .../tests/math/decoct_variation1.phpt | 180 ++++++++++++++++ .../tests/math/decoct_variation1_64bit.phpt | 180 ++++++++++++++++ ext/standard/tests/math/exp_basic.phpt | 78 +++++++ ext/standard/tests/math/exp_variation1.phpt | 187 +++++++++++++++++ 26 files changed, 3102 insertions(+), 20 deletions(-) create mode 100644 ext/standard/tests/math/abs_basic.phpt create mode 100644 ext/standard/tests/math/abs_error.phpt create mode 100644 ext/standard/tests/math/abs_variation.phpt create mode 100644 ext/standard/tests/math/atan2_variation1.phpt create mode 100644 ext/standard/tests/math/atan2_variation2.phpt create mode 100644 ext/standard/tests/math/base_convert_variation1.phpt create mode 100644 ext/standard/tests/math/base_convert_variation2.phpt create mode 100644 ext/standard/tests/math/base_convert_variation3.phpt create mode 100644 ext/standard/tests/math/bindec_variation1.phpt create mode 100644 ext/standard/tests/math/bindec_variation1_64bit.phpt create mode 100644 ext/standard/tests/math/ceil_basic.phpt create mode 100644 ext/standard/tests/math/ceil_error.phpt create mode 100644 ext/standard/tests/math/ceil_variation1.phpt create mode 100644 ext/standard/tests/math/decbin_variation1.phpt create mode 100644 ext/standard/tests/math/decbin_variation1_64bit.phpt create mode 100644 ext/standard/tests/math/dechex_variation1.phpt create mode 100644 ext/standard/tests/math/dechex_variation1_64bit.phpt create mode 100644 ext/standard/tests/math/decoct_variation1.phpt create mode 100644 ext/standard/tests/math/decoct_variation1_64bit.phpt create mode 100644 ext/standard/tests/math/exp_basic.phpt create mode 100644 ext/standard/tests/math/exp_variation1.phpt 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..490fee076d --- /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: Wrong parameter count for abs() in %s on line %d +NULL + +Too few arguments + +Warning: Wrong parameter count for abs() 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..1be4127c99 --- /dev/null +++ b/ext/standard/tests/math/atan2_variation1.phpt @@ -0,0 +1,173 @@ +--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 -- +float(0) + +-- Iteration 18 -- +float(0) + +-- Iteration 19 -- +float(0) + +-- Iteration 20 -- +float(0) + +-- Iteration 21 -- +float(0) + +-- Iteration 22 -- +float(0) + +-- Iteration 23 -- + +Notice: Object of class classA could not be converted to double in %s on line %d +float(0.04345089539) + +-- Iteration 24 -- +float(0) + +-- Iteration 25 -- +float(0) + +-- Iteration 26 -- +float(%f) +===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..6da019e6f7 --- /dev/null +++ b/ext/standard/tests/math/atan2_variation2.phpt @@ -0,0 +1,172 @@ +--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 -- +float(1.570796327) + +-- Iteration 18 -- +float(1.570796327) + +-- Iteration 19 -- +float(1.570796327) + +-- Iteration 20 -- +float(1.570796327) + +-- Iteration 21 -- +float(1.570796327) + +-- Iteration 22 -- +float(1.570796327) + +-- Iteration 23 -- + +Notice: Object of class classA could not be converted to double in %s on line %d +float(1.527345431) + +-- Iteration 24 -- +float(1.570796327) + +-- Iteration 25 -- +float(1.570796327) + +-- Iteration 26 -- +float(%f) +===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 7806c5648e..b962e86f91 100644 --- a/ext/standard/tests/math/base_convert_error.phpt +++ b/ext/standard/tests/math/base_convert_error.phpt @@ -1,21 +1,43 @@ --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: Wrong parameter count for base_convert() in %s on line %d -Warning: Wrong parameter count for base_convert() in %s on line 2 +Warning: Wrong parameter count for base_convert() in %s on line %d -Warning: Wrong parameter count for base_convert() in %s on line 3 +Warning: Wrong parameter count for base_convert() in %s on line %d -Warning: Wrong parameter count for base_convert() in %s on line 4 +Warning: base_convert(): Invalid `from base' (1) in %s on line %d -Warning: base_convert(): Invalid `from base' (1) in %s on line 5 +Warning: base_convert(): Invalid `to base' (37) in %s on line %d +Incorrect input -Warning: base_convert(): Invalid `to base' (37) in %s on line 6 +Catchable fatal error: Object of class classA could not be converted to string in %s on line %d 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..afa0c5bb8a --- /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 -- +string(1) "0" + +-- Iteration 2 -- +string(1) "1" + +-- Iteration 3 -- +string(2) "14" + +-- Iteration 4 -- +string(2) "14" + +-- Iteration 5 -- +string(11) "17777777777" + +-- Iteration 6 -- +string(3) "151" + +-- Iteration 7 -- +string(3) "151" + +-- Iteration 8 -- +string(7) "4553207" + +-- Iteration 9 -- +string(7) "4553207" + +-- Iteration 10 -- +string(1) "5" + +-- Iteration 11 -- +string(1) "0" + +-- Iteration 12 -- +string(1) "0" + +-- Iteration 13 -- +string(1) "1" + +-- Iteration 14 -- +string(1) "0" + +-- Iteration 15 -- +string(1) "1" + +-- Iteration 16 -- +string(1) "0" + +-- Iteration 17 -- +string(1) "0" + +-- Iteration 18 -- +string(1) "0" + +-- Iteration 19 -- + +Notice: Array to string conversion in %s on line %d +string(1) "0" + +-- Iteration 20 -- +string(1) "0" + +-- Iteration 21 -- +string(1) "0" + +-- Iteration 22 -- +string(1) "0" + +-- Iteration 23 -- +string(1) "0" + +-- Iteration 24 -- +string(1) "0" + +-- Iteration 25 -- +string(%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..81dbbab5e6 --- /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 -- +string(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(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 18 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 19 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 20 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 21 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- Iteration 22 -- + +Warning: base_convert(): Invalid `from base' (0) in %s on line %d +bool(false) + +-- 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=== 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..e52867f565 --- /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 -- +string(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(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 18 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 19 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 20 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 21 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- Iteration 22 -- + +Warning: base_convert(): Invalid `to base' (0) in %s on line %d +bool(false) + +-- 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=== diff --git a/ext/standard/tests/math/bindec_error.phpt b/ext/standard/tests/math/bindec_error.phpt index 36193b63e5..59ceebf6be 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: Wrong parameter count for bindec() in %s on line %d -Warning: Wrong parameter count for bindec() in %s on line 2 +Warning: Wrong parameter count for bindec() in %s on line %d +Incorrect input -Warning: Wrong parameter count for bindec() in %s on line 3 +Catchable fatal error: Object of class classA could not be converted to string in %s on line %d 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..d769c185be --- /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: Wrong parameter count for ceil() in %s on line %d +NULL + +Too few arguments + +Warning: Wrong parameter count for ceil() 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..0045c726dc --- /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(%f) +===Done=== diff --git a/ext/standard/tests/math/decbin_error.phpt b/ext/standard/tests/math/decbin_error.phpt index a350cee7f0..bad5ecd8dc 100644 --- a/ext/standard/tests/math/decbin_error.phpt +++ b/ext/standard/tests/math/decbin_error.phpt @@ -1,13 +1,25 @@ --TEST-- -Test decbin() - wrong params +Test decbin() - error conditions --FILE-- +===Done=== --EXPECTF-- +*** Testing decbin() : error conditions *** +Incorrect number of arguments -Warning: Wrong parameter count for decbin() in %s on line 2 - -Warning: Wrong parameter count for decbin() in %s on line 3 +Warning: Wrong parameter count for decbin() in %s on line %d +Warning: Wrong parameter count for decbin() 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..c532612530 --- /dev/null +++ b/ext/standard/tests/math/decbin_variation1.phpt @@ -0,0 +1,178 @@ +--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 -- +string(1) "0" + +-- Iteration 2 -- +string(1) "1" + +-- Iteration 3 -- +string(14) "11000000111001" + +-- Iteration 4 -- +string(32) "11111111111111111111011011010111" + +-- Iteration 5 -- +string(32) "11111111111111111111111111111111" + +-- Iteration 6 -- +string(1) "0" + +-- Iteration 7 -- +string(4) "1010" + +-- Iteration 8 -- +string(32) "11111111111111111111111111110110" + +-- Iteration 9 -- +string(32) "10111110100110010001101000001000" + +-- Iteration 10 -- +string(1) "0" + +-- Iteration 11 -- +string(1) "0" + +-- Iteration 12 -- +string(1) "0" + +-- Iteration 13 -- +string(1) "0" + +-- Iteration 14 -- +string(1) "1" + +-- Iteration 15 -- +string(1) "0" + +-- Iteration 16 -- +string(1) "1" + +-- Iteration 17 -- +string(1) "0" + +-- Iteration 18 -- +string(1) "0" + +-- Iteration 19 -- +string(1) "0" + +-- Iteration 20 -- +string(1) "0" + +-- Iteration 21 -- +string(1) "0" + +-- Iteration 22 -- +string(1) "0" + +-- Iteration 23 -- +string(1) "0" + +-- Iteration 24 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +string(1) "1" + +-- Iteration 25 -- +string(1) "0" + +-- Iteration 26 -- +string(1) "0" + +-- Iteration 27 -- +string(%d) "%d" +===Done=== 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..e82ee3e88c --- /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 -- +string(1) "0" + +-- Iteration 2 -- +string(1) "1" + +-- Iteration 3 -- +string(14) "11000000111001" + +-- Iteration 4 -- +string(64) "1111111111111111111111111111111111111111111111111111011011010111" + +-- Iteration 5 -- +string(1) "0" + +-- Iteration 6 -- +string(1) "0" + +-- Iteration 7 -- +string(4) "1010" + +-- Iteration 8 -- +string(64) "1111111111111111111111111111111111111111111111111111111111110110" + +-- Iteration 9 -- +string(37) "1110010111110100110010001101000001000" + +-- Iteration 10 -- +string(1) "0" + +-- Iteration 11 -- +string(1) "0" + +-- Iteration 12 -- +string(1) "0" + +-- Iteration 13 -- +string(1) "0" + +-- Iteration 14 -- +string(1) "1" + +-- Iteration 15 -- +string(1) "0" + +-- Iteration 16 -- +string(1) "1" + +-- Iteration 17 -- +string(1) "0" + +-- Iteration 18 -- +string(1) "0" + +-- Iteration 19 -- +string(1) "0" + +-- Iteration 20 -- +string(1) "0" + +-- Iteration 21 -- +string(1) "0" + +-- Iteration 22 -- +string(1) "0" + +-- Iteration 23 -- +string(1) "0" + +-- Iteration 24 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +string(1) "1" + +-- Iteration 25 -- +string(1) "0" + +-- Iteration 26 -- +string(1) "0" + +-- Iteration 27 -- +string(%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 f83afb346a..6188816254 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: Wrong parameter count for dechex() in %s on line 2 +Warning: Wrong parameter count for dechex() in %s on line %d -Warning: Wrong parameter count for dechex() in %s on line 3 +Warning: Wrong parameter count for dechex() 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..43f0e5337a --- /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 -- +string(1) "0" + +-- Iteration 2 -- +string(1) "1" + +-- Iteration 3 -- +string(4) "3039" + +-- Iteration 4 -- +string(8) "fffff6d7" + +-- Iteration 5 -- +string(8) "ffffffff" + +-- Iteration 6 -- +string(1) "0" + +-- Iteration 7 -- +string(1) "a" + +-- Iteration 8 -- +string(8) "fffffff6" + +-- Iteration 9 -- +string(8) "be991a08" + +-- Iteration 10 -- +string(1) "0" + +-- Iteration 11 -- +string(1) "0" + +-- Iteration 12 -- +string(1) "0" + +-- Iteration 13 -- +string(1) "0" + +-- Iteration 14 -- +string(1) "1" + +-- Iteration 15 -- +string(1) "0" + +-- Iteration 16 -- +string(1) "1" + +-- Iteration 17 -- +string(1) "0" + +-- Iteration 18 -- +string(1) "0" + +-- Iteration 19 -- +string(1) "0" + +-- Iteration 20 -- +string(1) "0" + +-- Iteration 21 -- +string(1) "0" + +-- Iteration 22 -- +string(1) "0" + +-- Iteration 23 -- +string(1) "0" + +-- Iteration 24 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +string(1) "1" + +-- Iteration 25 -- +string(1) "0" + +-- Iteration 26 -- +string(1) "0" + +-- Iteration 27 -- +string(%d) "%s" +===Done=== 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..a115fa9135 --- /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 -- +string(1) "0" + +-- Iteration 2 -- +string(1) "1" + +-- Iteration 3 -- +string(4) "3039" + +-- Iteration 4 -- +string(16) "fffffffffffff6d7" + +-- Iteration 5 -- +string(1) "0" + +-- Iteration 6 -- +string(1) "0" + +-- Iteration 7 -- +string(1) "a" + +-- Iteration 8 -- +string(16) "fffffffffffffff6" + +-- Iteration 9 -- +string(10) "1cbe991a08" + +-- Iteration 10 -- +string(1) "0" + +-- Iteration 11 -- +string(1) "0" + +-- Iteration 12 -- +string(1) "0" + +-- Iteration 13 -- +string(1) "0" + +-- Iteration 14 -- +string(1) "1" + +-- Iteration 15 -- +string(1) "0" + +-- Iteration 16 -- +string(1) "1" + +-- Iteration 17 -- +string(1) "0" + +-- Iteration 18 -- +string(1) "0" + +-- Iteration 19 -- +string(1) "0" + +-- Iteration 20 -- +string(1) "0" + +-- Iteration 21 -- +string(1) "0" + +-- Iteration 22 -- +string(1) "0" + +-- Iteration 23 -- +string(1) "0" + +-- Iteration 24 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +string(1) "1" + +-- Iteration 25 -- +string(1) "0" + +-- Iteration 26 -- +string(1) "0" + +-- Iteration 27 -- +string(%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 48c30644fe..b62c52fc88 100644 --- a/ext/standard/tests/math/decoct_error.phpt +++ b/ext/standard/tests/math/decoct_error.phpt @@ -1,13 +1,25 @@ --TEST-- -Test decoct() - wrong params decoct() +Test decoct() - error conditions --FILE-- +===Done=== --EXPECTF-- +*** Testing decoct() : error conditions *** +Incorrect number of arguments -Warning: Wrong parameter count for decoct() in %s on line 2 - -Warning: Wrong parameter count for decoct() in %s on line 3 +Warning: Wrong parameter count for decoct() in %s on line %d +Warning: Wrong parameter count for decoct() 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..49ba57f54b --- /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 -- +string(1) "0" + +-- Iteration 2 -- +string(1) "1" + +-- Iteration 3 -- +string(5) "30071" + +-- Iteration 4 -- +string(11) "37777773327" + +-- Iteration 5 -- +string(11) "37777777777" + +-- Iteration 6 -- +string(1) "0" + +-- Iteration 7 -- +string(2) "12" + +-- Iteration 8 -- +string(11) "37777777766" + +-- Iteration 9 -- +string(11) "27646215010" + +-- Iteration 10 -- +string(1) "0" + +-- Iteration 11 -- +string(1) "0" + +-- Iteration 12 -- +string(1) "0" + +-- Iteration 13 -- +string(1) "0" + +-- Iteration 14 -- +string(1) "1" + +-- Iteration 15 -- +string(1) "0" + +-- Iteration 16 -- +string(1) "1" + +-- Iteration 17 -- +string(1) "0" + +-- Iteration 18 -- +string(1) "0" + +-- Iteration 19 -- +string(1) "0" + +-- Iteration 20 -- +string(1) "0" + +-- Iteration 21 -- +string(1) "0" + +-- Iteration 22 -- +string(1) "0" + +-- Iteration 23 -- +string(1) "0" + +-- Iteration 24 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +string(1) "1" + +-- Iteration 25 -- +string(1) "0" + +-- Iteration 26 -- +string(1) "0" + +-- Iteration 27 -- +string(%d) "%d" +===Done=== 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..40afafa10a --- /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 -- +string(1) "0" + +-- Iteration 2 -- +string(1) "1" + +-- Iteration 3 -- +string(5) "30071" + +-- Iteration 4 -- +string(22) "1777777777777777773327" + +-- Iteration 5 -- +string(1) "0" + +-- Iteration 6 -- +string(1) "0" + +-- Iteration 7 -- +string(2) "12" + +-- Iteration 8 -- +string(22) "1777777777777777777766" + +-- Iteration 9 -- +string(13) "1627646215010" + +-- Iteration 10 -- +string(1) "0" + +-- Iteration 11 -- +string(1) "0" + +-- Iteration 12 -- +string(1) "0" + +-- Iteration 13 -- +string(1) "0" + +-- Iteration 14 -- +string(1) "1" + +-- Iteration 15 -- +string(1) "0" + +-- Iteration 16 -- +string(1) "1" + +-- Iteration 17 -- +string(1) "0" + +-- Iteration 18 -- +string(1) "0" + +-- Iteration 19 -- +string(1) "0" + +-- Iteration 20 -- +string(1) "0" + +-- Iteration 21 -- +string(1) "0" + +-- Iteration 22 -- +string(1) "0" + +-- Iteration 23 -- +string(1) "0" + +-- Iteration 24 -- + +Notice: Object of class classA could not be converted to int in %s on line %d +string(1) "1" + +-- Iteration 25 -- +string(1) "0" + +-- Iteration 26 -- +string(1) "0" + +-- Iteration 27 -- +string(%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..e50e7ced93 --- /dev/null +++ b/ext/standard/tests/math/exp_basic.phpt @@ -0,0 +1,78 @@ +--TEST-- +Test exp() - basic function test for exp() +--INI-- +precision=14 +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing exp() : basic functionality *** + +-- 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..567f6b24b4 --- /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, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: exp() expects parameter 1 to be double, 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, string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: exp() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: exp() expects parameter 1 to be double, 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=== -- 2.40.0