From fa2036e3aa21bb1230ad3827006f234d193f89af Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 25 Jan 2010 02:01:40 +0100 Subject: [PATCH] Tests for module 'cbrt'. --- ChangeLog | 4 ++++ modules/cbrt-tests | 13 +++++++++++++ tests/test-cbrt.c | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 modules/cbrt-tests create mode 100644 tests/test-cbrt.c diff --git a/ChangeLog b/ChangeLog index 052bde535..97856113d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-01-24 Bruno Haible + Tests for module 'cbrt'. + * modules/cbrt-tests: New file. + * tests/test-cbrt.c: New file. + Tests for module 'atan2'. * modules/atan2-tests: New file. * tests/test-atan2.c: New file. diff --git a/modules/cbrt-tests b/modules/cbrt-tests new file mode 100644 index 000000000..47248e056 --- /dev/null +++ b/modules/cbrt-tests @@ -0,0 +1,13 @@ +Files: +tests/test-cbrt.c +tests/signature.h +tests/macros.h + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-cbrt +check_PROGRAMS += test-cbrt +test_cbrt_LDADD = $(LDADD) @CBRT_LIBM@ diff --git a/tests/test-cbrt.c b/tests/test-cbrt.c new file mode 100644 index 000000000..dae88ca7e --- /dev/null +++ b/tests/test-cbrt.c @@ -0,0 +1,40 @@ +/* Test of cbrt() function. + Copyright (C) 2010 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 . */ + +/* Written by Bruno Haible , 2010. */ + +#include + +#include + +#include "signature.h" +SIGNATURE_CHECK (cbrt, double, (double)); + +#include "macros.h" + +volatile double x; +double y; + +int +main () +{ + /* A particular value. */ + x = 0.6; + y = cbrt (x); + ASSERT (y >= 0.8434326653 && y <= 0.8434326654); + + return 0; +} -- 2.11.0