summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--modules/totalordermagl-tests19
-rw-r--r--tests/test-totalordermagl.c33
3 files changed, 58 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7bd8b5072d..7ce75a98a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,20 @@
2024-04-18 Bruno Haible <bruno@clisp.org>
+ totalordermagl: Add tests.
+ * tests/test-totalordermagl.c: New file, based on
+ tests/test-totalorderl.c.
+ * modules/totalordermagl-tests: New file, based on
+ modules/totalorderl-tests.
+
totalordermagl: New module.
* lib/math.in.h (totalordermagl): New declaration.
* lib/totalordermagl.c: New file, based on lib/totalorderl.c.
* m4/math_h.m4 (gl_MATH_H): Test whether totalordermagl is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_TOTALORDERMAGL.
(gl_MATH_H_DEFAULTS): Initialize HAVE_TOTALORDERMAGL,
REPLACE_TOTALORDERMAGL.
* modules/math (Makefile.am): Substitute GNULIB_TOTALORDERMAGL,
HAVE_TOTALORDERMAGL, REPLACE_TOTALORDERMAGL.
* modules/totalordermagl: New file, based on modules/totalorderl.
* doc/posix-functions/totalordermagl.texi: Mention the new module.
diff --git a/modules/totalordermagl-tests b/modules/totalordermagl-tests
new file mode 100644
index 0000000000..fe6b6e0a26
--- /dev/null
+++ b/modules/totalordermagl-tests
@@ -0,0 +1,19 @@
+Files:
+tests/test-totalordermagl.c
+tests/test-totalordermag.h
+tests/minus-zero.h
+tests/infinity.h
+tests/signature.h
+tests/macros.h
+
+Depends-on:
+signed-nan
+signed-snan
+setpayloadl
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-totalordermagl
+check_PROGRAMS += test-totalordermagl
+test_totalordermagl_LDADD = $(LDADD) @TOTALORDERMAGL_LIBM@ $(SETPAYLOADL_LIBM)
diff --git a/tests/test-totalordermagl.c b/tests/test-totalordermagl.c
new file mode 100644
index 0000000000..1d33404405
--- /dev/null
+++ b/tests/test-totalordermagl.c
@@ -0,0 +1,33 @@
+/* Test totalordermagl.
+ Copyright 2023-2024 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 <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <math.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (totalordermagl, int, (const long double *, const long double *));
+
+#define TOTALORDER totalordermagl
+#define TOTALORDER_TYPE memory_long_double
+#define TOTALORDER_INF Infinityl
+#define TOTALORDER_MINUS_ZERO minus_zerol
+#define TOTALORDER_SETPAYLOAD setpayloadl
+#define TOTALORDER_HAVE_SNAN HAVE_SNANL
+#define TOTALORDER_POSITIVE_SNAN memory_positive_SNaNl
+#define TOTALORDER_NEGATIVE_SNAN memory_negative_SNaNl
+#include "test-totalordermag.h"

Return to:

Send suggestions and report system problems to the System administrator.