From: Steve Peters Date: Wed, 21 Dec 2005 19:04:37 +0000 (+0000) Subject: Add tests for untested math functions in POSIX X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=867bef193ba790d4f06f4e5549e8b8b4c2f6a389;p=p5sagit%2Fp5-mst-13.2.git Add tests for untested math functions in POSIX p4raw-id: //depot/perl@26435 --- diff --git a/MANIFEST b/MANIFEST index 37c8d4b..a8b5a98 100644 --- a/MANIFEST +++ b/MANIFEST @@ -832,6 +832,7 @@ ext/POSIX/POSIX.pm POSIX extension Perl module ext/POSIX/POSIX.pod POSIX extension documentation ext/POSIX/POSIX.xs POSIX extension external subroutines ext/POSIX/t/is.t See if POSIX isxxx() work +ext/POSIX/t/math.t Basic math tests for POSIX ext/POSIX/t/posix.t See if POSIX works ext/POSIX/t/sigaction.t See if POSIX::sigaction works ext/POSIX/t/taint.t See if POSIX works with taint diff --git a/ext/POSIX/t/math.t b/ext/POSIX/t/math.t new file mode 100644 index 0000000..2923689 --- /dev/null +++ b/ext/POSIX/t/math.t @@ -0,0 +1,25 @@ +#!perl -w + +use strict; + +use POSIX; +use Test::More tests => 14; + +# These tests are mainly to make sure that these arithmatic functions +# exist and are accessible. They are not meant to be an exhaustive +# test for the interface. + +is(acos(1), 0, "Basic acos(1) test"); +is(asin(0), 0, "Basic asin(0) test"); +is(atan(0), 0, "Basic atan(0) test"); +is(cosh(0), 1, "Basic cosh(0) test"); +is(floor(1.23441242), 1, "Basic floor(1.23441242) test"); +is(fmod(3.5, 2.0), 1.5, "Basic fmod(3.5, 2.0) test"); +is(join(" ", frexp(1)), "0.5 1", "Basic frexp(1) test"); +is(ldexp(0,1), 0, "Basic ldexp(0,1) test"); +is(log10(1), 0, "Basic log10(1) test"); +is(log10(10), 1, "Basic log10(10) test"); +is(join(" ", modf(1.76)), "0.76 1", "Basic modf(1.76) test"); +is(sinh(0), 0, "Basic sinh(0) test"); +is(tan(0), 0, "Basic tan(0) test"); +is(tanh(0), 0, "Basic tanh(0) test");