summaryrefslogtreecommitdiff
path: root/tests/test-logb-ieee.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2012-04-03 14:05:01 +0200
committerBruno Haible <bruno@clisp.org>2012-04-03 14:05:01 +0200
commitb68d1ab22ef82139c2f1c5bfeeaf2e83edd54bf1 (patch)
treeb8e6c74bd3caa214b096b26aa78d994d661501fe /tests/test-logb-ieee.h
parentcaa96774f54fefa7c93beb174c9963c8b74d5c37 (diff)
downloadgnulib-b68d1ab22ef82139c2f1c5bfeeaf2e83edd54bf1.tar.gz
Tests for module 'logbf-ieee'.
* modules/logbf-ieee-tests: New file. * tests/test-logbf-ieee.c: New file. * tests/test-logb-ieee.h: New file.
Diffstat (limited to 'tests/test-logb-ieee.h')
-rw-r--r--tests/test-logb-ieee.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test-logb-ieee.h b/tests/test-logb-ieee.h
new file mode 100644
index 0000000000..6fbd203a91
--- /dev/null
+++ b/tests/test-logb-ieee.h
@@ -0,0 +1,28 @@
+/* Test of log1b*() function family.
+ Copyright (C) 2012 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/>. */
+
+static void
+test_function (void)
+{
+ /* [MX] shaded specification in POSIX. */
+
+ /* NaN. */
+ ASSERT (ISNAN (LOGB (NAN)));
+
+ /* Infinity. */
+ ASSERT (LOGB (INFINITY) == INFINITY);
+ ASSERT (LOGB (- INFINITY) == INFINITY);
+}