From: andy wharmby Date: Mon, 12 Jan 2009 14:30:52 +0000 (+0000) Subject: New math tests. Tested on Windows, Linux and Linux 64 bit X-Git-Tag: php-5.3.0beta1~186 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4af0b3f396a832976542266ebe6dc734a04d4aa;p=php New math tests. Tested on Windows, Linux and Linux 64 bit --- diff --git a/ext/standard/tests/math/expm1_basic.phpt b/ext/standard/tests/math/expm1_basic.phpt new file mode 100644 index 0000000000..fa1d571db4 --- /dev/null +++ b/ext/standard/tests/math/expm1_basic.phpt @@ -0,0 +1,79 @@ +--TEST-- +Test expm1() - basic function test for expm1() +--INI-- +precision=14 +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing expm1() : basic functionality *** + +-- Iteration 1 -- +float(22025.465794807) + +-- Iteration 2 -- +float(29731.618852891) + +-- Iteration 3 -- +float(INF) + +-- Iteration 4 -- +float(29048849665246) + +-- Iteration 5 -- +float(1.811239082889E+41) + +-- Iteration 6 -- +float(22025.465794807) + +-- Iteration 7 -- +float(INF) + +-- Iteration 8 -- +float(INF) + +-- Iteration 9 -- +float(8.6593400423994E+16) + +-- Iteration 10 -- +float(1.811239082889E+41) + +-- Iteration 11 -- +float(1.718281828459) + +-- Iteration 12 -- +float(0) + +-- Iteration 13 -- +float(0) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/expm1_error.phpt b/ext/standard/tests/math/expm1_error.phpt new file mode 100644 index 0000000000..380633b67b --- /dev/null +++ b/ext/standard/tests/math/expm1_error.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test expm1() - Error conditions +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing expm1() : error conditions *** + +-- Testing expm1() function with less than expected no. of arguments -- + +Warning: expm1() expects exactly 1 parameter, 0 given in %s on line %d + +-- Testing expm1() function with more than expected no. of arguments -- + +Warning: expm1() expects exactly 1 parameter, 2 given in %s on line %d +===Done=== diff --git a/ext/standard/tests/math/expm1_variation1.phpt b/ext/standard/tests/math/expm1_variation1.phpt new file mode 100644 index 0000000000..e976b5ab25 --- /dev/null +++ b/ext/standard/tests/math/expm1_variation1.phpt @@ -0,0 +1,199 @@ +--TEST-- +Test expm1() function : usage variations - different data types as $arg argument +--INI-- +precision=14 +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing expm1() : usage variations *** + +-- Iteration 1 -- +float(0) + +-- Iteration 2 -- +float(1.718281828459) + +-- Iteration 3 -- +float(INF) + +-- Iteration 4 -- +float(-1) + +-- Iteration 5 -- +float(36314.502674247) + +-- Iteration 6 -- +float(-0.99997246355065) + +-- Iteration 7 -- +float(INF) + +-- Iteration 8 -- +float(0.0012353302826471) + +-- Iteration 9 -- +float(0.64872127070013) + +-- Iteration 10 -- +float(0) + +-- Iteration 11 -- +float(0) + +-- Iteration 12 -- +float(1.718281828459) + +-- Iteration 13 -- +float(0) + +-- Iteration 14 -- +float(1.718281828459) + +-- Iteration 15 -- +float(0) + +-- Iteration 16 -- + +Warning: expm1() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 17 -- + +Warning: expm1() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: expm1() expects parameter 1 to be double, array given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: expm1() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: expm1() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: expm1() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: expm1() expects parameter 1 to be double, array given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: expm1() expects parameter 1 to be double, array given in %s on line %d +NULL + +-- Iteration 24 -- + +Warning: expm1() expects parameter 1 to be double, object given in %s on line %d +NULL + +-- Iteration 25 -- +float(0) + +-- Iteration 26 -- +float(0) + +-- Iteration 27 -- + +Warning: expm1() 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/floor_basic.phpt b/ext/standard/tests/math/floor_basic.phpt new file mode 100644 index 0000000000..bbb8a2aa57 --- /dev/null +++ b/ext/standard/tests/math/floor_basic.phpt @@ -0,0 +1,108 @@ +--TEST-- +Test floor() - basic function test for floor() +--INI-- +precision=14 +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing floor() : basic functionality *** + +-- floor 0 -- +float(0) + +-- floor 0 -- +float(0) + +-- floor 0.5 -- +float(0) + +-- floor -0.5 -- +float(-1) + +-- floor 1 -- +float(1) + +-- floor -1 -- +float(-1) + +-- floor 1.5 -- +float(1) + +-- floor -1.5 -- +float(-2) + +-- floor 2.6 -- +float(2) + +-- floor -2.6 -- +float(-3) + +-- floor 31 -- +float(31) + +-- floor 95 -- +float(95) + +-- floor 10.5 -- +float(10) + +-- floor -10.5 -- +float(-11) + +-- floor 3.95E3 -- +float(3950) + +-- floor -3.95E3 -- +float(-3950) + +-- floor 039 -- +float(39) + +-- floor 0x5F -- +float(95) + +-- floor 1 -- +float(1) + +-- floor -- +float(0) + +-- floor -- +float(0) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/floor_error.phpt b/ext/standard/tests/math/floor_error.phpt new file mode 100644 index 0000000000..f33902e6a0 --- /dev/null +++ b/ext/standard/tests/math/floor_error.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test floor() - error conditions - incorrect number of args +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing floor() : error conditions *** + +-- Too many arguments -- + +Warning: floor() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +-- Too few arguments -- + +Warning: floor() expects exactly 1 parameter, 0 given in %s on line %d +NULL +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/floor_variation1.phpt b/ext/standard/tests/math/floor_variation1.phpt new file mode 100644 index 0000000000..baba53aab4 --- /dev/null +++ b/ext/standard/tests/math/floor_variation1.phpt @@ -0,0 +1,128 @@ +--TEST-- +Test floor() function : usage variations - different data types as $value arg +--INI-- +precision=14 +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing floor() : 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/fmod_variation1.phpt b/ext/standard/tests/math/fmod_variation1.phpt new file mode 100644 index 0000000000..9c6ab13fd3 --- /dev/null +++ b/ext/standard/tests/math/fmod_variation1.phpt @@ -0,0 +1,184 @@ +--TEST-- +Test fmod() function : usage variations - different data types as $x argument +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing fmod() : usage variations *** + +-- Iteration 1 -- +float(0) + +-- Iteration 2 -- +float(1) + +-- Iteration 3 -- +float(1) + +-- Iteration 4 -- +float(-1) + +-- Iteration 5 -- +float(1) + +-- Iteration 6 -- +float(0.5) + +-- Iteration 7 -- +float(-0.5) + +-- Iteration 8 -- +float(0) + +-- Iteration 9 -- +float(1.23456789E-9) + +-- Iteration 10 -- +float(0.5) + +-- Iteration 11 -- +float(0) + +-- Iteration 12 -- +float(0) + +-- Iteration 13 -- +float(1) + +-- Iteration 14 -- +float(0) + +-- Iteration 15 -- +float(1) + +-- Iteration 16 -- +float(0) + +-- Iteration 17 -- + +Warning: fmod() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: fmod() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: fmod() expects parameter 1 to be double, array given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: fmod() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: fmod() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: fmod() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: fmod() 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: fmod() expects parameter 1 to be double, resource given in %s on line %d +NULL +===Done=== diff --git a/ext/standard/tests/math/fmod_variation2.phpt b/ext/standard/tests/math/fmod_variation2.phpt new file mode 100644 index 0000000000..bbeddb6876 --- /dev/null +++ b/ext/standard/tests/math/fmod_variation2.phpt @@ -0,0 +1,184 @@ +--TEST-- +Test fmod() function : usage variations - different data types as $y argument +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing fmod() : usage variations *** + +-- Iteration 1 -- +float(NAN) + +-- Iteration 2 -- +float(0) + +-- Iteration 3 -- +float(6) + +-- Iteration 4 -- +float(1516) + +-- Iteration 5 -- +float(123456) + +-- Iteration 6 -- +float(7.5) + +-- Iteration 7 -- +float(7.5) + +-- Iteration 8 -- +float(123456) + +-- Iteration 9 -- +float(2.3605615109341E-10) + +-- Iteration 10 -- +float(0) + +-- Iteration 11 -- +float(NAN) + +-- Iteration 12 -- +float(NAN) + +-- Iteration 13 -- +float(0) + +-- Iteration 14 -- +float(NAN) + +-- Iteration 15 -- +float(0) + +-- Iteration 16 -- +float(NAN) + +-- Iteration 17 -- + +Warning: fmod() expects parameter 2 to be double, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: fmod() expects parameter 2 to be double, string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: fmod() expects parameter 2 to be double, array given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: fmod() expects parameter 2 to be double, string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: fmod() expects parameter 2 to be double, string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: fmod() expects parameter 2 to be double, string given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: fmod() expects parameter 2 to be double, object given in %s on line %d +NULL + +-- Iteration 24 -- +float(NAN) + +-- Iteration 25 -- +float(NAN) + +-- Iteration 26 -- + +Warning: fmod() expects parameter 2 to be double, resource given in %s on line %d +NULL +===Done=== diff --git a/ext/standard/tests/math/hexdec_basic_64bit.phpt b/ext/standard/tests/math/hexdec_basic_64bit.phpt new file mode 100644 index 0000000000..f1a2028b5c --- /dev/null +++ b/ext/standard/tests/math/hexdec_basic_64bit.phpt @@ -0,0 +1,93 @@ +--TEST-- +Test hexdec() - basic function test hexdec() +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing hexdec() : basic functionality *** + +-- hexdec 1194684 -- +int(18433668) + +-- hexdec 7904751 -- +int(126895953) + +-- hexdec 2147483647 -- +int(142929835591) + +-- hexdec 2147483648 -- +int(142929835592) + +-- hexdec 0x123abc -- +int(1194684) + +-- hexdec 0x789DEF -- +int(7904751) + +-- hexdec 0x7FFFFFFF -- +int(2147483647) + +-- hexdec 0x80000000 -- +int(2147483648) + +-- hexdec 0x123XYZABC -- +int(1194684) + +-- hexdec 311015 -- +int(3215381) + +-- hexdec 311015 -- +int(3215381) + +-- hexdec 31101.3 -- +int(3215379) + +-- hexdec 3110130 -- +int(51446064) + +-- hexdec 4767 -- +int(18279) + +-- hexdec 011237 -- +int(70199) + +-- hexdec 1 -- +int(1) + +-- hexdec -- +int(0) + +-- hexdec -- +int(0) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/hexdec_error.phpt b/ext/standard/tests/math/hexdec_error.phpt index dae83b8564..e9ab9e512d 100644 --- a/ext/standard/tests/math/hexdec_error.phpt +++ b/ext/standard/tests/math/hexdec_error.phpt @@ -2,10 +2,35 @@ Test hexdec() - wrong params test hexdec() --FILE-- --EXPECTF-- +*** Testing hexdec() : error conditions *** + +-- Incorrect number of arguments -- + Warning: hexdec() expects exactly 1 parameter, 0 given in %s on line %d Warning: hexdec() 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 string in %s on line %d \ No newline at end of file diff --git a/ext/standard/tests/math/hexdec_variation1.phpt b/ext/standard/tests/math/hexdec_variation1.phpt new file mode 100644 index 0000000000..2b3f1b6ab3 --- /dev/null +++ b/ext/standard/tests/math/hexdec_variation1.phpt @@ -0,0 +1,168 @@ +--TEST-- +Test hexdec() function : usage variations - different data types as $number arg +--INI-- +precision=14 +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing hexdec() : usage variations *** + +-- Iteration 1 -- +int(0) + +-- Iteration 2 -- +int(1) + +-- Iteration 3 -- +int(74565) + +-- Iteration 4 -- +int(9029) + +-- Iteration 5 -- +float(285960729237) + +-- Iteration 6 -- +float(285960729238) + +-- Iteration 7 -- +int(261) + +-- Iteration 8 -- +int(261) + +-- Iteration 9 -- +float(20015998341120) + +-- Iteration 10 -- +float(1250999896553) + +-- Iteration 11 -- +int(5) + +-- Iteration 12 -- +int(0) + +-- Iteration 13 -- +int(0) + +-- Iteration 14 -- +int(1) + +-- Iteration 15 -- +int(0) + +-- Iteration 16 -- +int(1) + +-- Iteration 17 -- +int(0) + +-- Iteration 18 -- +int(0) + +-- Iteration 19 -- +int(0) + +-- Iteration 20 -- + +Notice: Array to string conversion in %s on line %d +int(170) + +-- Iteration 21 -- +int(2748) + +-- Iteration 22 -- +int(2748) + +-- Iteration 23 -- +int(2748) + +-- Iteration 24 -- +int(0) + +-- Iteration 25 -- +int(0) + +-- Iteration 26 -- +%s +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/hexdec_variation1_64bit.phpt b/ext/standard/tests/math/hexdec_variation1_64bit.phpt new file mode 100644 index 0000000000..65beb2d91b --- /dev/null +++ b/ext/standard/tests/math/hexdec_variation1_64bit.phpt @@ -0,0 +1,168 @@ +--TEST-- +Test hexdec() function : usage variations - different data types as $number arg +--INI-- +precision=14 +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing hexdec() : usage variations *** + +-- Iteration 1 -- +int(0) + +-- Iteration 2 -- +int(1) + +-- Iteration 3 -- +int(74565) + +-- Iteration 4 -- +int(9029) + +-- Iteration 5 -- +int(285960729237) + +-- Iteration 6 -- +int(285960729238) + +-- Iteration 7 -- +int(261) + +-- Iteration 8 -- +int(261) + +-- Iteration 9 -- +int(20015998341120) + +-- Iteration 10 -- +int(1250999896553) + +-- Iteration 11 -- +int(5) + +-- Iteration 12 -- +int(0) + +-- Iteration 13 -- +int(0) + +-- Iteration 14 -- +int(1) + +-- Iteration 15 -- +int(0) + +-- Iteration 16 -- +int(1) + +-- Iteration 17 -- +int(0) + +-- Iteration 18 -- +int(0) + +-- Iteration 19 -- +int(0) + +-- Iteration 20 -- + +Notice: Array to string conversion in %s on line %d +int(170) + +-- Iteration 21 -- +int(2748) + +-- Iteration 22 -- +int(2748) + +-- Iteration 23 -- +int(2748) + +-- Iteration 24 -- +int(0) + +-- Iteration 25 -- +int(0) + +-- Iteration 26 -- +%s +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/hypot_basic.phpt b/ext/standard/tests/math/hypot_basic.phpt new file mode 100644 index 0000000000..c280a23bb2 --- /dev/null +++ b/ext/standard/tests/math/hypot_basic.phpt @@ -0,0 +1,444 @@ +--TEST-- +Test hypot() - basic function test hypot() +--INI-- +precision=14 +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing hypot() : basic functionality *** + +Y:23 X:33 float(40.224370722238) + +Y:23 X:-33 float(40.224370722238) + +Y:23 X:33.45 float(40.594365372549) + +Y:23 X:-33.45 float(40.594365372549) + +Y:23 X:39 float(45.276925690687) + +Y:23 X:31 float(38.600518131238) + +Y:23 X:33 float(40.224370722238) + +Y:23 X:43.45 float(49.162002603637) + +Y:23 X:1.345e1 float(26.643995571235) + +Y:23 X:33abc +Notice: A non well formed numeric value encountered in %s on line %d +float(40.224370722238) + +Y:23 X: float(23) + +Y:23 X:1 float(23.021728866443) + +Y:23 X: float(23) + +Y:-23 X:33 float(40.224370722238) + +Y:-23 X:-33 float(40.224370722238) + +Y:-23 X:33.45 float(40.594365372549) + +Y:-23 X:-33.45 float(40.594365372549) + +Y:-23 X:39 float(45.276925690687) + +Y:-23 X:31 float(38.600518131238) + +Y:-23 X:33 float(40.224370722238) + +Y:-23 X:43.45 float(49.162002603637) + +Y:-23 X:1.345e1 float(26.643995571235) + +Y:-23 X:33abc +Notice: A non well formed numeric value encountered in %s on line %d +float(40.224370722238) + +Y:-23 X: float(23) + +Y:-23 X:1 float(23.021728866443) + +Y:-23 X: float(23) + +Y:23.45 X:33 float(40.483360779461) + +Y:23.45 X:-33 float(40.483360779461) + +Y:23.45 X:33.45 float(40.851009779441) + +Y:23.45 X:-33.45 float(40.851009779441) + +Y:23.45 X:39 float(45.507169764774) + +Y:23.45 X:31 float(38.870329301409) + +Y:23.45 X:33 float(40.483360779461) + +Y:23.45 X:43.45 float(49.374132903779) + +Y:23.45 X:1.345e1 float(27.033405260899) + +Y:23.45 X:33abc +Notice: A non well formed numeric value encountered in %s on line %d +float(40.483360779461) + +Y:23.45 X: float(23.45) + +Y:23.45 X:1 float(23.471312276905) + +Y:23.45 X: float(23.45) + +Y:-23.45 X:33 float(40.483360779461) + +Y:-23.45 X:-33 float(40.483360779461) + +Y:-23.45 X:33.45 float(40.851009779441) + +Y:-23.45 X:-33.45 float(40.851009779441) + +Y:-23.45 X:39 float(45.507169764774) + +Y:-23.45 X:31 float(38.870329301409) + +Y:-23.45 X:33 float(40.483360779461) + +Y:-23.45 X:43.45 float(49.374132903779) + +Y:-23.45 X:1.345e1 float(27.033405260899) + +Y:-23.45 X:33abc +Notice: A non well formed numeric value encountered in %s on line %d +float(40.483360779461) + +Y:-23.45 X: float(23.45) + +Y:-23.45 X:1 float(23.471312276905) + +Y:-23.45 X: float(23.45) + +Y:23 X:33 float(40.224370722238) + +Y:23 X:-33 float(40.224370722238) + +Y:23 X:33.45 float(40.594365372549) + +Y:23 X:-33.45 float(40.594365372549) + +Y:23 X:39 float(45.276925690687) + +Y:23 X:31 float(38.600518131238) + +Y:23 X:33 float(40.224370722238) + +Y:23 X:43.45 float(49.162002603637) + +Y:23 X:1.345e1 float(26.643995571235) + +Y:23 X:33abc +Notice: A non well formed numeric value encountered in %s on line %d +float(40.224370722238) + +Y:23 X: float(23) + +Y:23 X:1 float(23.021728866443) + +Y:23 X: float(23) + +Y:23 X:33 float(40.224370722238) + +Y:23 X:-33 float(40.224370722238) + +Y:23 X:33.45 float(40.594365372549) + +Y:23 X:-33.45 float(40.594365372549) + +Y:23 X:39 float(45.276925690687) + +Y:23 X:31 float(38.600518131238) + +Y:23 X:33 float(40.224370722238) + +Y:23 X:43.45 float(49.162002603637) + +Y:23 X:1.345e1 float(26.643995571235) + +Y:23 X:33abc +Notice: A non well formed numeric value encountered in %s on line %d +float(40.224370722238) + +Y:23 X: float(23) + +Y:23 X:1 float(23.021728866443) + +Y:23 X: float(23) + +Y:23 X:33 float(40.224370722238) + +Y:23 X:-33 float(40.224370722238) + +Y:23 X:33.45 float(40.594365372549) + +Y:23 X:-33.45 float(40.594365372549) + +Y:23 X:39 float(45.276925690687) + +Y:23 X:31 float(38.600518131238) + +Y:23 X:33 float(40.224370722238) + +Y:23 X:43.45 float(49.162002603637) + +Y:23 X:1.345e1 float(26.643995571235) + +Y:23 X:33abc +Notice: A non well formed numeric value encountered in %s on line %d +float(40.224370722238) + +Y:23 X: float(23) + +Y:23 X:1 float(23.021728866443) + +Y:23 X: float(23) + +Y:23.45 X:33 float(40.483360779461) + +Y:23.45 X:-33 float(40.483360779461) + +Y:23.45 X:33.45 float(40.851009779441) + +Y:23.45 X:-33.45 float(40.851009779441) + +Y:23.45 X:39 float(45.507169764774) + +Y:23.45 X:31 float(38.870329301409) + +Y:23.45 X:33 float(40.483360779461) + +Y:23.45 X:43.45 float(49.374132903779) + +Y:23.45 X:1.345e1 float(27.033405260899) + +Y:23.45 X:33abc +Notice: A non well formed numeric value encountered in %s on line %d +float(40.483360779461) + +Y:23.45 X: float(23.45) + +Y:23.45 X:1 float(23.471312276905) + +Y:23.45 X: float(23.45) + +Y:2.345e1 X:33 float(40.483360779461) + +Y:2.345e1 X:-33 float(40.483360779461) + +Y:2.345e1 X:33.45 float(40.851009779441) + +Y:2.345e1 X:-33.45 float(40.851009779441) + +Y:2.345e1 X:39 float(45.507169764774) + +Y:2.345e1 X:31 float(38.870329301409) + +Y:2.345e1 X:33 float(40.483360779461) + +Y:2.345e1 X:43.45 float(49.374132903779) + +Y:2.345e1 X:1.345e1 float(27.033405260899) + +Y:2.345e1 X:33abc +Notice: A non well formed numeric value encountered in %s on line %d +float(40.483360779461) + +Y:2.345e1 X: float(23.45) + +Y:2.345e1 X:1 float(23.471312276905) + +Y:2.345e1 X: float(23.45) + +Y:23abc X:33 +Notice: A non well formed numeric value encountered in %s on line %d +float(40.224370722238) + +Y:23abc X:-33 +Notice: A non well formed numeric value encountered in %s on line %d +float(40.224370722238) + +Y:23abc X:33.45 +Notice: A non well formed numeric value encountered in %s on line %d +float(40.594365372549) + +Y:23abc X:-33.45 +Notice: A non well formed numeric value encountered in %s on line %d +float(40.594365372549) + +Y:23abc X:39 +Notice: A non well formed numeric value encountered in %s on line %d +float(45.276925690687) + +Y:23abc X:31 +Notice: A non well formed numeric value encountered in %s on line %d +float(38.600518131238) + +Y:23abc X:33 +Notice: A non well formed numeric value encountered in %s on line %d +float(40.224370722238) + +Y:23abc X:43.45 +Notice: A non well formed numeric value encountered in %s on line %d +float(49.162002603637) + +Y:23abc X:1.345e1 +Notice: A non well formed numeric value encountered in %s on line %d +float(26.643995571235) + +Y:23abc X:33abc +Notice: A non well formed numeric value encountered in %s on line %d + +Notice: A non well formed numeric value encountered in %s on line %d +float(40.224370722238) + +Y:23abc X: +Notice: A non well formed numeric value encountered in %s on line %d +float(23) + +Y:23abc X:1 +Notice: A non well formed numeric value encountered in %s on line %d +float(23.021728866443) + +Y:23abc X: +Notice: A non well formed numeric value encountered in %s on line %d +float(23) + +Y: X:33 float(33) + +Y: X:-33 float(33) + +Y: X:33.45 float(33.45) + +Y: X:-33.45 float(33.45) + +Y: X:39 float(39) + +Y: X:31 float(31) + +Y: X:33 float(33) + +Y: X:43.45 float(43.45) + +Y: X:1.345e1 float(13.45) + +Y: X:33abc +Notice: A non well formed numeric value encountered in %s on line %d +float(33) + +Y: X: float(0) + +Y: X:1 float(1) + +Y: X: float(0) + +Y:1 X:33 float(33.015148038438) + +Y:1 X:-33 float(33.015148038438) + +Y:1 X:33.45 float(33.464944344792) + +Y:1 X:-33.45 float(33.464944344792) + +Y:1 X:39 float(39.012818406262) + +Y:1 X:31 float(31.016124838542) + +Y:1 X:33 float(33.015148038438) + +Y:1 X:43.45 float(43.461505956421) + +Y:1 X:1.345e1 float(13.487123488721) + +Y:1 X:33abc +Notice: A non well formed numeric value encountered in %s on line %d +float(33.015148038438) + +Y:1 X: float(1) + +Y:1 X:1 float(1.4142135623731) + +Y:1 X: float(1) + +Y: X:33 float(33) + +Y: X:-33 float(33) + +Y: X:33.45 float(33.45) + +Y: X:-33.45 float(33.45) + +Y: X:39 float(39) + +Y: X:31 float(31) + +Y: X:33 float(33) + +Y: X:43.45 float(43.45) + +Y: X:1.345e1 float(13.45) + +Y: X:33abc +Notice: A non well formed numeric value encountered in %s on line %d +float(33) + +Y: X: float(0) + +Y: X:1 float(1) + +Y: X: float(0) +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/hypot_error.phpt b/ext/standard/tests/math/hypot_error.phpt index 7f3081bc62..b357a3a809 100644 --- a/ext/standard/tests/math/hypot_error.phpt +++ b/ext/standard/tests/math/hypot_error.phpt @@ -1,16 +1,33 @@ --TEST-- Test hypot() - wrong params test hypot() ---INI-- -precision=14 --FILE-- +===Done=== --EXPECTF-- +*** Testing hypot() : error conditions *** + +-- Testing hypot() function with less than expected no. of arguments -- + Warning: hypot() expects exactly 2 parameters, 0 given in %s on line %d Warning: hypot() expects exactly 2 parameters, 1 given in %s on line %d +-- Testing hypot() function with more than expected no. of arguments -- + Warning: hypot() expects exactly 2 parameters, 3 given in %s on line %d +===Done=== \ No newline at end of file diff --git a/ext/standard/tests/math/hypot_variation1.phpt b/ext/standard/tests/math/hypot_variation1.phpt new file mode 100644 index 0000000000..5ea8b3f3fc --- /dev/null +++ b/ext/standard/tests/math/hypot_variation1.phpt @@ -0,0 +1,185 @@ +--TEST-- +Test hypot() function : usage variations - different data types as $x argument +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing hypot() : usage variations *** + +-- Iteration 1 -- +float(5) + +-- Iteration 2 -- +float(5.0990195135928) + +-- Iteration 3 -- +float(12345.001012556) + +-- Iteration 4 -- +float(2345.0053304843) + +-- Iteration 5 -- +float(2147483647) + +-- Iteration 6 -- +float(11.629703349613) + +-- Iteration 7 -- +float(11.629703349613) + +-- Iteration 8 -- +float(123456789000) + +-- Iteration 9 -- +float(5) + +-- Iteration 10 -- +float(5.0249378105604) + +-- Iteration 11 -- +float(5) + +-- Iteration 12 -- +float(5) + +-- Iteration 13 -- +float(5.0990195135928) + +-- Iteration 14 -- +float(5) + +-- Iteration 15 -- +float(5.0990195135928) + +-- Iteration 16 -- +float(5) + +-- Iteration 17 -- + +Warning: hypot() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: hypot() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: hypot() expects parameter 1 to be double, array given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: hypot() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: hypot() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: hypot() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: hypot() expects parameter 1 to be double, object given in %s on line %d +NULL + +-- Iteration 24 -- +float(5) + +-- Iteration 25 -- +float(5) + +-- Iteration 26 -- + +Warning: hypot() 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/hypot_variation2.phpt b/ext/standard/tests/math/hypot_variation2.phpt new file mode 100644 index 0000000000..a6294748b9 --- /dev/null +++ b/ext/standard/tests/math/hypot_variation2.phpt @@ -0,0 +1,185 @@ +--TEST-- +Test hypot() function : usage variations - different data types as $y argument +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing hypot() : usage variations *** + +-- Iteration 1 -- +float(3) + +-- Iteration 2 -- +float(3.1622776601684) + +-- Iteration 3 -- +float(12345.00036452) + +-- Iteration 4 -- +float(2345.0019189758) + +-- Iteration 5 -- +float(2147483647) + +-- Iteration 6 -- +float(10.920164833921) + +-- Iteration 7 -- +float(10.920164833921) + +-- Iteration 8 -- +float(123456789000) + +-- Iteration 9 -- +float(3) + +-- Iteration 10 -- +float(3.0413812651491) + +-- Iteration 11 -- +float(3) + +-- Iteration 12 -- +float(3) + +-- Iteration 13 -- +float(3.1622776601684) + +-- Iteration 14 -- +float(3) + +-- Iteration 15 -- +float(3.1622776601684) + +-- Iteration 16 -- +float(3) + +-- Iteration 17 -- + +Warning: hypot() expects parameter 2 to be double, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: hypot() expects parameter 2 to be double, string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: hypot() expects parameter 2 to be double, array given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: hypot() expects parameter 2 to be double, string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: hypot() expects parameter 2 to be double, string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: hypot() expects parameter 2 to be double, string given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: hypot() expects parameter 2 to be double, object given in %s on line %d +NULL + +-- Iteration 24 -- +float(3) + +-- Iteration 25 -- +float(3) + +-- Iteration 26 -- + +Warning: hypot() 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/is_finite_variation1.phpt b/ext/standard/tests/math/is_finite_variation1.phpt new file mode 100644 index 0000000000..83786ad93f --- /dev/null +++ b/ext/standard/tests/math/is_finite_variation1.phpt @@ -0,0 +1,184 @@ +--TEST-- +Test is_finite() function : usage variations - different data types as $val argument +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing is_finite() : usage variations *** + +-- Iteration 1 -- +bool(true) + +-- Iteration 2 -- +bool(true) + +-- Iteration 3 -- +bool(true) + +-- Iteration 4 -- +bool(true) + +-- Iteration 5 -- +bool(true) + +-- Iteration 6 -- +bool(true) + +-- Iteration 7 -- +bool(true) + +-- Iteration 8 -- +bool(true) + +-- Iteration 9 -- +bool(true) + +-- Iteration 10 -- +bool(true) + +-- Iteration 11 -- +bool(true) + +-- Iteration 12 -- +bool(true) + +-- Iteration 13 -- +bool(true) + +-- Iteration 14 -- +bool(true) + +-- Iteration 15 -- +bool(true) + +-- Iteration 16 -- +bool(true) + +-- Iteration 17 -- + +Warning: is_finite() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: is_finite() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: is_finite() expects parameter 1 to be double, array given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: is_finite() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: is_finite() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: is_finite() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: is_finite() expects parameter 1 to be double, object given in %s on line %d +NULL + +-- Iteration 24 -- +bool(true) + +-- Iteration 25 -- +bool(true) + +-- Iteration 26 -- + +Warning: is_finite() expects parameter 1 to be double, resource given in %s on line %d +NULL +===Done=== diff --git a/ext/standard/tests/math/is_infinite_variation1.phpt b/ext/standard/tests/math/is_infinite_variation1.phpt new file mode 100644 index 0000000000..0d8573d9b9 --- /dev/null +++ b/ext/standard/tests/math/is_infinite_variation1.phpt @@ -0,0 +1,184 @@ +--TEST-- +Test is_infinite() function : usage variations - different data types as $val argument +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing is_infinite() : usage variations *** + +-- Iteration 1 -- +bool(false) + +-- Iteration 2 -- +bool(false) + +-- Iteration 3 -- +bool(false) + +-- Iteration 4 -- +bool(false) + +-- Iteration 5 -- +bool(false) + +-- Iteration 6 -- +bool(false) + +-- Iteration 7 -- +bool(false) + +-- Iteration 8 -- +bool(false) + +-- Iteration 9 -- +bool(false) + +-- Iteration 10 -- +bool(false) + +-- Iteration 11 -- +bool(false) + +-- Iteration 12 -- +bool(false) + +-- Iteration 13 -- +bool(false) + +-- Iteration 14 -- +bool(false) + +-- Iteration 15 -- +bool(false) + +-- Iteration 16 -- +bool(false) + +-- Iteration 17 -- + +Warning: is_infinite() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: is_infinite() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: is_infinite() expects parameter 1 to be double, array given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: is_infinite() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: is_infinite() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: is_infinite() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: is_infinite() expects parameter 1 to be double, object given in %s on line %d +NULL + +-- Iteration 24 -- +bool(false) + +-- Iteration 25 -- +bool(false) + +-- Iteration 26 -- + +Warning: is_infinite() expects parameter 1 to be double, resource given in %s on line %d +NULL +===Done=== diff --git a/ext/standard/tests/math/is_nan_variation1.phpt b/ext/standard/tests/math/is_nan_variation1.phpt new file mode 100644 index 0000000000..3eb642954e --- /dev/null +++ b/ext/standard/tests/math/is_nan_variation1.phpt @@ -0,0 +1,184 @@ +--TEST-- +Test is_nan() function : usage variations - different data types as $val argument +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing is_nan() : usage variations *** + +-- Iteration 1 -- +bool(false) + +-- Iteration 2 -- +bool(false) + +-- Iteration 3 -- +bool(false) + +-- Iteration 4 -- +bool(false) + +-- Iteration 5 -- +bool(false) + +-- Iteration 6 -- +bool(false) + +-- Iteration 7 -- +bool(false) + +-- Iteration 8 -- +bool(false) + +-- Iteration 9 -- +bool(false) + +-- Iteration 10 -- +bool(false) + +-- Iteration 11 -- +bool(false) + +-- Iteration 12 -- +bool(false) + +-- Iteration 13 -- +bool(false) + +-- Iteration 14 -- +bool(false) + +-- Iteration 15 -- +bool(false) + +-- Iteration 16 -- +bool(false) + +-- Iteration 17 -- + +Warning: is_nan() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: is_nan() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: is_nan() expects parameter 1 to be double, array given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: is_nan() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: is_nan() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: is_nan() expects parameter 1 to be double, string given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: is_nan() expects parameter 1 to be double, object given in %s on line %d +NULL + +-- Iteration 24 -- +bool(false) + +-- Iteration 25 -- +bool(false) + +-- Iteration 26 -- + +Warning: is_nan() expects parameter 1 to be double, resource given in %s on line %d +NULL +===Done===