totalordermagf: Add tests.
authorBruno Haible <bruno@clisp.org>
Fri, 19 Apr 2024 00:22:01 +0000 (02:22 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 19 Apr 2024 00:22:08 +0000 (02:22 +0200)
* tests/test-totalordermagf.c: New file, based on
tests/test-totalorderf.c.
* modules/totalordermagf-tests: New file, based on
modules/totalorderf-tests.

ChangeLog
modules/totalordermagf-tests [new file with mode: 0644]
tests/test-totalordermagf.c [new file with mode: 0644]

index 42d2c6cbc19a607b6b794968359d89b37498e879..3257161de606d81fa77615261e107191d52797c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2024-04-18  Bruno Haible  <bruno@clisp.org>
 
+       totalordermagf: Add tests.
+       * tests/test-totalordermagf.c: New file, based on
+       tests/test-totalorderf.c.
+       * modules/totalordermagf-tests: New file, based on
+       modules/totalorderf-tests.
+
        totalordermagf: New module.
        * lib/math.in.h (totalordermagf): New declaration.
        * lib/totalordermagf.c: New file, based on lib/totalorderf.c.
diff --git a/modules/totalordermagf-tests b/modules/totalordermagf-tests
new file mode 100644 (file)
index 0000000..fd8a50f
--- /dev/null
@@ -0,0 +1,19 @@
+Files:
+tests/test-totalordermagf.c
+tests/test-totalordermag.h
+tests/minus-zero.h
+tests/infinity.h
+tests/signature.h
+tests/macros.h
+
+Depends-on:
+signed-nan
+signed-snan
+setpayloadf
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-totalordermagf
+check_PROGRAMS += test-totalordermagf
+test_totalordermagf_LDADD = $(LDADD) @TOTALORDERMAGF_LIBM@ $(SETPAYLOADF_LIBM)
diff --git a/tests/test-totalordermagf.c b/tests/test-totalordermagf.c
new file mode 100644 (file)
index 0000000..b6ada9d
--- /dev/null
@@ -0,0 +1,33 @@
+/* Test totalordermagf.
+   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 (totalordermagf, int, (const float *, const float *));
+
+#define TOTALORDER totalordermagf
+#define TOTALORDER_TYPE memory_float
+#define TOTALORDER_INF Infinityf
+#define TOTALORDER_MINUS_ZERO minus_zerof
+#define TOTALORDER_SETPAYLOAD setpayloadf
+#define TOTALORDER_HAVE_SNAN HAVE_SNANF
+#define TOTALORDER_POSITIVE_SNAN memory_positive_SNaNf
+#define TOTALORDER_NEGATIVE_SNAN memory_negative_SNaNf
+#include "test-totalordermag.h"