From: Zoe Slattery Date: Tue, 4 Sep 2007 09:01:02 +0000 (+0000) Subject: Test cases for sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh. X-Git-Tag: php-5.2.5RC1~223 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b78b25a33687f46c0aba75061631eee542464e72;p=php Test cases for sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh. --- diff --git a/ext/standard/tests/math/acos_basic.phpt b/ext/standard/tests/math/acos_basic.phpt new file mode 100644 index 0000000000..150eb975ad --- /dev/null +++ b/ext/standard/tests/math/acos_basic.phpt @@ -0,0 +1,69 @@ +--TEST-- +Test return type and value for expected input acos() +--INI-- +precision = 14 +--FILE-- + +--EXPECTF-- +acos .5 = float(%f) +Pass +acos 0.86602540378444 = float(%f) +Pass +acos 1.0 = float(%f) +Pass +acos 0.0 = float(%f) +Pass diff --git a/ext/standard/tests/math/acos_error.phpt b/ext/standard/tests/math/acos_error.phpt new file mode 100644 index 0000000000..6e3f2ecfd0 --- /dev/null +++ b/ext/standard/tests/math/acos_error.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test wrong number of arguments for acos() +--INI-- +--FILE-- + +--EXPECTF-- +Too many arguments + +Warning: Wrong parameter count for acos() in %s on line 11 +NULL + +Too few arguments + +Warning: Wrong parameter count for acos() in %s on line 14 +NULL diff --git a/ext/standard/tests/math/acos_variation.phpt b/ext/standard/tests/math/acos_variation.phpt new file mode 100644 index 0000000000..2503b8b8d0 --- /dev/null +++ b/ext/standard/tests/math/acos_variation.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test variations in usage of acos() +--INI-- +precision=10 +--FILE-- + +--EXPECT-- +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(1.570796327) +float(NAN) +float(NAN) +float(1.570796327) +float(0) +float(1.570796327) diff --git a/ext/standard/tests/math/acosh_basic.phpt b/ext/standard/tests/math/acosh_basic.phpt new file mode 100644 index 0000000000..34839ee2fd --- /dev/null +++ b/ext/standard/tests/math/acosh_basic.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test return type and value for expected input acosh() +--SKIPIF-- + +--INI-- +precision = 14 +--FILE-- + +--EXPECTF-- +acosh 1.1276259652064= float(%f) +Pass +acosh 10.067661995778= float(%f) +Pass diff --git a/ext/standard/tests/math/acosh_error.phpt b/ext/standard/tests/math/acosh_error.phpt new file mode 100644 index 0000000000..8a4b9730ee --- /dev/null +++ b/ext/standard/tests/math/acosh_error.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test wrong number of arguments for acosh() +--SKIPIF-- + +--INI-- +--FILE-- + +--EXPECTF-- +Too many arguments + +Warning: Wrong parameter count for acosh() in %s on line 11 +NULL + +Too few arguments + +Warning: Wrong parameter count for acosh() in %s on line 14 +NULL diff --git a/ext/standard/tests/math/acosh_variation.phpt b/ext/standard/tests/math/acosh_variation.phpt new file mode 100644 index 0000000000..b0e9f9bd80 --- /dev/null +++ b/ext/standard/tests/math/acosh_variation.phpt @@ -0,0 +1,57 @@ +--TEST-- +Test variations in usage of acosh() +--SKIPIF-- + +--INI-- +precision = 10 +--FILE-- + +--EXPECT-- +float(3.828168471) +float(NAN) +float(3.847562739) +float(NAN) +float(3.828168471) +float(3.828168471) +float(3.828168471) +float(3.847562739) +float(3.847562739) +float(NAN) +float(7.60090221) +float(7.60090221) +float(NAN) +float(0) +float(NAN) diff --git a/ext/standard/tests/math/allowed_rounding_error.inc b/ext/standard/tests/math/allowed_rounding_error.inc new file mode 100644 index 0000000000..71dbf9af4a --- /dev/null +++ b/ext/standard/tests/math/allowed_rounding_error.inc @@ -0,0 +1,18 @@ + $min ) { + return true; + } + else { + return false; + } +} +?> \ No newline at end of file diff --git a/ext/standard/tests/math/asin_basic.phpt b/ext/standard/tests/math/asin_basic.phpt new file mode 100644 index 0000000000..183f7449bb --- /dev/null +++ b/ext/standard/tests/math/asin_basic.phpt @@ -0,0 +1,68 @@ +--TEST-- +Test return type and value for expected input asin() +--INI-- +precision = 14 +--FILE-- + +--EXPECTF-- +asin .5 = float(%f) +Pass +asin 0.86602540378444 = float(%f) +Pass +asin 1.0 = float(%f) +Pass +asin 0.0 = float(%f) +Pass diff --git a/ext/standard/tests/math/asin_error.phpt b/ext/standard/tests/math/asin_error.phpt new file mode 100644 index 0000000000..21c824b55f --- /dev/null +++ b/ext/standard/tests/math/asin_error.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test wrong number of arguments for asin() +--INI-- +--FILE-- + +--EXPECTF-- +Too many arguments + +Warning: Wrong parameter count for asin() in %s on line 11 +NULL + +Too few arguments + +Warning: Wrong parameter count for asin() in %s on line 14 +NULL diff --git a/ext/standard/tests/math/asin_variation.phpt b/ext/standard/tests/math/asin_variation.phpt new file mode 100644 index 0000000000..2902e969b1 --- /dev/null +++ b/ext/standard/tests/math/asin_variation.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test variations in usage of asin() +--INI-- +precision = 10 +--FILE-- + +--EXPECT-- +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(0) +float(NAN) +float(NAN) +float(0) +float(1.570796327) +float(0) diff --git a/ext/standard/tests/math/asinh_basic.phpt b/ext/standard/tests/math/asinh_basic.phpt new file mode 100644 index 0000000000..61f1731553 --- /dev/null +++ b/ext/standard/tests/math/asinh_basic.phpt @@ -0,0 +1,45 @@ +--TEST-- +Test return type and value for expected input asinh() +--SKIPIF-- + +--INI-- +precision = 14 +--FILE-- + +--EXPECTF-- +asinh 0.52109530549375= float(%f) +Pass +asinh 10.01787492741= float(%f) +Pass diff --git a/ext/standard/tests/math/asinh_error.phpt b/ext/standard/tests/math/asinh_error.phpt new file mode 100644 index 0000000000..e6439d1bd4 --- /dev/null +++ b/ext/standard/tests/math/asinh_error.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test wrong number of arguments for asinh() +--SKIPIF-- + +--INI-- +--FILE-- + +--EXPECTF-- +Too many arguments + +Warning: Wrong parameter count for asinh() in %s on line 11 +NULL + +Too few arguments + +Warning: Wrong parameter count for asinh() in %s on line 14 +NULL diff --git a/ext/standard/tests/math/asinh_variation.phpt b/ext/standard/tests/math/asinh_variation.phpt new file mode 100644 index 0000000000..00ade0b8d5 --- /dev/null +++ b/ext/standard/tests/math/asinh_variation.phpt @@ -0,0 +1,57 @@ +--TEST-- +Test variations in usage of asinh() +--SKIPIF-- + +--INI-- +precision = 10 +--FILE-- + +--EXPECT-- +float(3.829113652) +float(-3.829113652) +float(3.848471992) +float(-3.848471992) +float(3.829113652) +float(3.829113652) +float(3.829113652) +float(3.848471992) +float(3.848471992) +float(0) +float(7.60090271) +float(7.60090271) +float(0) +float(0.881373587) +float(0) diff --git a/ext/standard/tests/math/atan_basic.phpt b/ext/standard/tests/math/atan_basic.phpt new file mode 100644 index 0000000000..f4a2bedf76 --- /dev/null +++ b/ext/standard/tests/math/atan_basic.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test return type and value for expected input atan() +--INI-- +precision = 14 +--FILE-- + +--EXPECTF-- +atan 1.7320508075689 = float(%f) +Pass +atan 0.57735026918963 = float(%f) +Pass diff --git a/ext/standard/tests/math/atan_error.phpt b/ext/standard/tests/math/atan_error.phpt new file mode 100644 index 0000000000..07cc93aea6 --- /dev/null +++ b/ext/standard/tests/math/atan_error.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test wrong number of arguments for atan() +--INI-- +--FILE-- + +--EXPECTF-- +Too many arguments + +Warning: Wrong parameter count for atan() in %s on line 11 +NULL + +Too few arguments + +Warning: Wrong parameter count for atan() in %s on line 14 +NULL diff --git a/ext/standard/tests/math/atan_variation.phpt b/ext/standard/tests/math/atan_variation.phpt new file mode 100644 index 0000000000..a53099d103 --- /dev/null +++ b/ext/standard/tests/math/atan_variation.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test variations in usage of atan() +--INI-- +precision = 10 +--FILE-- + +--EXPECT-- +float(1.527345431) +float(-1.527345431) +float(1.528178225) +float(-1.528178225) +float(1.527345431) +float(1.527345431) +float(1.527345431) +float(1.528178225) +float(1.528178225) +float(0) +float(1.569796327) +float(1.569796327) +float(0) +float(0.7853981634) +float(0) diff --git a/ext/standard/tests/math/atanh_basic.phpt b/ext/standard/tests/math/atanh_basic.phpt new file mode 100644 index 0000000000..c259bdb82b --- /dev/null +++ b/ext/standard/tests/math/atanh_basic.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test return type and value for expected input atanh() +--SKIPIF-- + +--INI-- +precision = 14 +--FILE-- + +--EXPECTF-- +atanh 0.46211715726001 = float(%f) +Pass +atanh 0.99505475368673 = float(%f) +Pass diff --git a/ext/standard/tests/math/atanh_error.phpt b/ext/standard/tests/math/atanh_error.phpt new file mode 100644 index 0000000000..cb6fb6def8 --- /dev/null +++ b/ext/standard/tests/math/atanh_error.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test wrong number of arguments for atanh() +--SKIPIF-- + +--INI-- +--FILE-- + +--EXPECTF-- +Too many arguments + +Warning: Wrong parameter count for atanh() in %s on line 11 +NULL + +Too few arguments + +Warning: Wrong parameter count for atanh() in %s on line 14 +NULL diff --git a/ext/standard/tests/math/atanh_variation.phpt b/ext/standard/tests/math/atanh_variation.phpt new file mode 100644 index 0000000000..879b9a9f28 --- /dev/null +++ b/ext/standard/tests/math/atanh_variation.phpt @@ -0,0 +1,57 @@ +--TEST-- +Test variations in usage of atanh() +--SKIPIF-- + +--INI-- +precision = 10 +--FILE-- + +--EXPECT-- +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(NAN) +float(0) +float(NAN) +float(NAN) +float(0) +float(INF) +float(0) diff --git a/ext/standard/tests/math/cos_basic.phpt b/ext/standard/tests/math/cos_basic.phpt new file mode 100644 index 0000000000..f0cfa66ee5 --- /dev/null +++ b/ext/standard/tests/math/cos_basic.phpt @@ -0,0 +1,92 @@ +--TEST-- +Test return type and value for expected input cos() +--INI-- +precision = 14 +--FILE-- + +--EXPECTF-- +cos 30 = float(%f) +Pass +cos 60 = float(%f) +Pass +cos 90 = float(%f) +Pass +cos 180 = float(%f) +Pass +cos 270 = float(%f) +Pass +cos 360 = float(%f) +Pass diff --git a/ext/standard/tests/math/cos_error.phpt b/ext/standard/tests/math/cos_error.phpt new file mode 100644 index 0000000000..1a9a26ce68 --- /dev/null +++ b/ext/standard/tests/math/cos_error.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test wrong number of arguments for cos() +--INI-- +--FILE-- + +--EXPECTF-- +Too many arguments + +Warning: Wrong parameter count for cos() in %s on line 11 +NULL + +Too few arguments + +Warning: Wrong parameter count for cos() in %s on line 14 +NULL diff --git a/ext/standard/tests/math/cos_variation.phpt b/ext/standard/tests/math/cos_variation.phpt new file mode 100644 index 0000000000..0ae3c30da4 --- /dev/null +++ b/ext/standard/tests/math/cos_variation.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test variations in usage of cos() +--INI-- +precision = 10 +--FILE-- + +--EXPECT-- +float(-0.5328330203) +float(-0.5328330203) +float(-0.1117112391) +float(-0.1117112391) +float(-0.5328330203) +float(-0.5328330203) +float(-0.5328330203) +float(-0.1117112391) +float(-0.1117112391) +float(1) +float(0.5623790763) +float(0.5623790763) +float(1) +float(0.5403023059) +float(1) diff --git a/ext/standard/tests/math/cosh_basic.phpt b/ext/standard/tests/math/cosh_basic.phpt new file mode 100644 index 0000000000..0a637ca8e5 --- /dev/null +++ b/ext/standard/tests/math/cosh_basic.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test return type and value for expected input cosh() +--INI-- +precision = 14 +--FILE-- + +--EXPECTF-- +cosh .5 = float(%f) +Pass +cosh -0.5 = float(%f) +Pass +cosh 3 = float(%f) +Pass +cosh -3 = float(%f) +Pass diff --git a/ext/standard/tests/math/cosh_error.phpt b/ext/standard/tests/math/cosh_error.phpt new file mode 100644 index 0000000000..f91cb256ae --- /dev/null +++ b/ext/standard/tests/math/cosh_error.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test wrong number of arguments for cosh() +--INI-- +--FILE-- + +--EXPECTF-- +Too many arguments + +Warning: Wrong parameter count for cosh() in %s on line 11 +NULL + +Too few arguments + +Warning: Wrong parameter count for cosh() in %s on line 14 +NULL diff --git a/ext/standard/tests/math/cosh_variation.phpt b/ext/standard/tests/math/cosh_variation.phpt new file mode 100644 index 0000000000..3bd8852a55 --- /dev/null +++ b/ext/standard/tests/math/cosh_variation.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test variations in usage of cosh() +--INI-- +precision = 10 +--FILE-- + +--EXPECT-- +float(4872401723) +float(4872401723) +float(7641446995) +float(7641446995) +float(4872401723) +float(4872401723) +float(4872401723) +float(7641446995) +float(7641446995) +float(1) +float(INF) +float(INF) +float(1) +float(1.543080635) +float(1) diff --git a/ext/standard/tests/math/sin_basic.phpt b/ext/standard/tests/math/sin_basic.phpt new file mode 100644 index 0000000000..2b55ad7355 --- /dev/null +++ b/ext/standard/tests/math/sin_basic.phpt @@ -0,0 +1,92 @@ +--TEST-- +Test return type and value for expected input sin() +--INI-- +precision = 14 +--FILE-- + +--EXPECTF-- +sin 30 = float(%f) +Pass +sin 60 = float(%f) +Pass +sin 90 = float(%f) +Pass +sin 180 = float(%f) +Pass +sin 270 = float(%f) +Pass +sin 360 = float(%f) +Pass diff --git a/ext/standard/tests/math/sin_error.phpt b/ext/standard/tests/math/sin_error.phpt new file mode 100644 index 0000000000..e2693ea8f4 --- /dev/null +++ b/ext/standard/tests/math/sin_error.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test wrong number of arguments for sin() +--INI-- +--FILE-- + +--EXPECTF-- +Too many arguments + +Warning: Wrong parameter count for sin() in %s on line 11 +NULL + +Too few arguments + +Warning: Wrong parameter count for sin() in %s on line 14 +NULL diff --git a/ext/standard/tests/math/sin_variation.phpt b/ext/standard/tests/math/sin_variation.phpt new file mode 100644 index 0000000000..0e79317d41 --- /dev/null +++ b/ext/standard/tests/math/sin_variation.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test variations in usage of sin() +--INI-- +precision = 10 +--FILE-- + +--EXPECT-- +float(-0.8462204042) +float(0.8462204042) +float(-0.9937407102) +float(0.9937407102) +float(-0.8462204042) +float(-0.8462204042) +float(-0.8462204042) +float(-0.9937407102) +float(-0.9937407102) +float(0) +float(0.8268795405) +float(0.8268795405) +float(0) +float(0.8414709848) +float(0) diff --git a/ext/standard/tests/math/sinh_basic.phpt b/ext/standard/tests/math/sinh_basic.phpt new file mode 100644 index 0000000000..79bef6314c --- /dev/null +++ b/ext/standard/tests/math/sinh_basic.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test return type and value for expected input sinh() +--INI-- +precision = 14 +--FILE-- + +--EXPECTF-- +sinh .5 = float(%f) +Pass +sinh -0.5 = float(%f) +Pass +sinh 3 = float(%f) +Pass +sinh -3 = float(%f) +Pass diff --git a/ext/standard/tests/math/sinh_error.phpt b/ext/standard/tests/math/sinh_error.phpt new file mode 100644 index 0000000000..415d6b09b4 --- /dev/null +++ b/ext/standard/tests/math/sinh_error.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test wrong number of arguments for sinh() +--INI-- +--FILE-- + +--EXPECTF-- +Too many arguments + +Warning: Wrong parameter count for sinh() in %s on line 11 +NULL + +Too few arguments + +Warning: Wrong parameter count for sinh() in %s on line 14 +NULL diff --git a/ext/standard/tests/math/sinh_variation.phpt b/ext/standard/tests/math/sinh_variation.phpt new file mode 100644 index 0000000000..c0f238582e --- /dev/null +++ b/ext/standard/tests/math/sinh_variation.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test variations in usage of sinh() +--INI-- +precision = 10 +--FILE-- + +--EXPECT-- +float(4872401723) +float(-4872401723) +float(7641446995) +float(-7641446995) +float(4872401723) +float(4872401723) +float(4872401723) +float(7641446995) +float(7641446995) +float(0) +float(INF) +float(INF) +float(0) +float(1.175201194) +float(0) diff --git a/ext/standard/tests/math/tan_basic.phpt b/ext/standard/tests/math/tan_basic.phpt new file mode 100644 index 0000000000..e2934fb388 --- /dev/null +++ b/ext/standard/tests/math/tan_basic.phpt @@ -0,0 +1,41 @@ +--TEST-- +Test return type and value for expected input tan() +--INI-- +precision = 14 +--FILE-- + +--EXPECTF-- +tan 60 = float(%f) +Pass +tan 30 = float(%f) +Pass diff --git a/ext/standard/tests/math/tan_error.phpt b/ext/standard/tests/math/tan_error.phpt new file mode 100644 index 0000000000..58dcc2a43e --- /dev/null +++ b/ext/standard/tests/math/tan_error.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test wrong number of arguments for tan() +--INI-- +--FILE-- + +--EXPECTF-- +Too many arguments + +Warning: Wrong parameter count for tan() in %s on line 11 +NULL + +Too few arguments + +Warning: Wrong parameter count for tan() in %s on line 14 +NULL diff --git a/ext/standard/tests/math/tan_variation.phpt b/ext/standard/tests/math/tan_variation.phpt new file mode 100644 index 0000000000..9628d76609 --- /dev/null +++ b/ext/standard/tests/math/tan_variation.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test variations in usage of tan() +--INI-- +precision = 10 +--FILE-- + +--EXPECT-- +float(1.588153083) +float(-1.588153083) +float(8.895619796) +float(-8.895619796) +float(1.588153083) +float(1.588153083) +float(1.588153083) +float(8.895619796) +float(8.895619796) +float(0) +float(1.470324156) +float(1.470324156) +float(0) +float(1.557407725) +float(0) diff --git a/ext/standard/tests/math/tanh_basic.phpt b/ext/standard/tests/math/tanh_basic.phpt new file mode 100644 index 0000000000..6b6a9dff7d --- /dev/null +++ b/ext/standard/tests/math/tanh_basic.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test return type and value for expected input tanh() +--INI-- +precision = 14 +--FILE-- + +--EXPECTF-- +tanh .5 = float(%f) +Pass +tanh -0.5 = float(%f) +Pass +tanh 3 = float(%f) +Pass +tanh -3 = float(%f) +Pass diff --git a/ext/standard/tests/math/tanh_error.phpt b/ext/standard/tests/math/tanh_error.phpt new file mode 100644 index 0000000000..8ce3e9131f --- /dev/null +++ b/ext/standard/tests/math/tanh_error.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test wrong number of arguments for tanh() +--INI-- +--FILE-- + +--EXPECTF-- +Too many arguments + +Warning: Wrong parameter count for tanh() in %s on line 11 +NULL + +Too few arguments + +Warning: Wrong parameter count for tanh() in %s on line 14 +NULL diff --git a/ext/standard/tests/math/tanh_variation.phpt b/ext/standard/tests/math/tanh_variation.phpt new file mode 100644 index 0000000000..5e4afad8fe --- /dev/null +++ b/ext/standard/tests/math/tanh_variation.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test variations in usage of tanh() +--INI-- +precision = 10 +--FILE-- + +--EXPECT-- +float(1) +float(-1) +float(1) +float(-1) +float(1) +float(1) +float(1) +float(1) +float(1) +float(0) +float(1) +float(1) +float(0) +float(0.761594156) +float(0)