diff options
author | Bruno Haible <bruno@clisp.org> | 2011-10-08 22:58:51 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2011-10-08 22:58:51 +0200 |
commit | 47f392127d252aa7e7b8058138e3f70cf22d34fe (patch) | |
tree | 14a21d89c84ed325a59310d29a5b81362ce1187b | |
parent | e2de8c10bd15a92eff786f8f51d0a322fbc402ee (diff) | |
download | gnulib-47f392127d252aa7e7b8058138e3f70cf22d34fe.tar.gz |
Tests for module 'sinf'.
* modules/sinf-tests: New file.
* tests/test-sinf.c: New file.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | modules/sinf-tests | 13 | ||||
-rw-r--r-- | tests/test-sinf.c | 40 |
3 files changed, 57 insertions, 0 deletions
@@ -1,5 +1,9 @@ 2011-10-08 Bruno Haible <bruno@clisp.org> + Tests for module 'sinf'. + * modules/sinf-tests: New file. + * tests/test-sinf.c: New file. + New module 'sinf'. * lib/math.in.h (sinf): New declaration. * lib/sinf.c: New file. diff --git a/modules/sinf-tests b/modules/sinf-tests new file mode 100644 index 0000000000..5d05bea33e --- /dev/null +++ b/modules/sinf-tests @@ -0,0 +1,13 @@ +Files: +tests/test-sinf.c +tests/signature.h +tests/macros.h + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-sinf +check_PROGRAMS += test-sinf +test_sinf_LDADD = $(LDADD) @SINF_LIBM@ diff --git a/tests/test-sinf.c b/tests/test-sinf.c new file mode 100644 index 0000000000..55af46fa52 --- /dev/null +++ b/tests/test-sinf.c @@ -0,0 +1,40 @@ +/* Test of sinf() function. + Copyright (C) 2010-2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2010-2011. */ + +#include <config.h> + +#include <math.h> + +#include "signature.h" +SIGNATURE_CHECK (sinf, float, (float)); + +#include "macros.h" + +volatile float x; +float y; + +int +main () +{ + /* A particular value. */ + x = 0.6f; + y = sinf (x); + ASSERT (y >= 0.5646424f && y <= 0.5646426f); + + return 0; +} |