From 88587173921b74394414c5367294588052fc91a3 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 8 Oct 2011 22:19:12 +0200 Subject: [PATCH] Tests for module 'logf'. * modules/logf-tests: New file. * tests/test-logf.c: New file. --- ChangeLog | 4 ++++ modules/logf-tests | 13 +++++++++++++ tests/test-logf.c | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 modules/logf-tests create mode 100644 tests/test-logf.c diff --git a/ChangeLog b/ChangeLog index 4b97ae098..64b4a0c7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2011-10-08 Bruno Haible + Tests for module 'logf'. + * modules/logf-tests: New file. + * tests/test-logf.c: New file. + New module 'logf'. * lib/math.in.h (logf): New declaration. * lib/logf.c: New file. diff --git a/modules/logf-tests b/modules/logf-tests new file mode 100644 index 000000000..d56c49e54 --- /dev/null +++ b/modules/logf-tests @@ -0,0 +1,13 @@ +Files: +tests/test-logf.c +tests/signature.h +tests/macros.h + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-logf +check_PROGRAMS += test-logf +test_logf_LDADD = $(LDADD) @LOGF_LIBM@ diff --git a/tests/test-logf.c b/tests/test-logf.c new file mode 100644 index 000000000..2ff5076a5 --- /dev/null +++ b/tests/test-logf.c @@ -0,0 +1,40 @@ +/* Test of logf() 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 . */ + +/* Written by Bruno Haible , 2010-2011. */ + +#include + +#include + +#include "signature.h" +SIGNATURE_CHECK (logf, float, (float)); + +#include "macros.h" + +volatile float x; +float y; + +int +main () +{ + /* A particular value. */ + x = 0.6f; + y = logf (x); + ASSERT (y >= -0.5108257f && y <= -0.5108256f); + + return 0; +} -- 2.11.0