summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog22
-rw-r--r--modules/totalorder-tests3
-rw-r--r--modules/totalorderf-tests3
-rw-r--r--modules/totalorderl-tests3
-rw-r--r--tests/test-totalorder.c3
-rw-r--r--tests/test-totalorder.h24
-rw-r--r--tests/test-totalorderf.c3
-rw-r--r--tests/test-totalorderl.c3
8 files changed, 53 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 646653ffe5..7c2e380dba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,30 @@
12024-04-17 Bruno Haible <bruno@clisp.org> 12024-04-17 Bruno Haible <bruno@clisp.org>
2 2
3 totalorder* tests: Strengthen tests.
4 * tests/test-totalorder.h: Include <math.h>.
5 (positive_NaN_with_payload, negative_NaN_with_payload): New functions.
6 (main): Test quiet NaNs of each sign with different payload.
7 * tests/test-totalorder.c (TOTALORDER_POSITIVE_NAN,
8 TOTALORDER_NEGATIVE_NAN): Remove macros.
9 (TOTALORDER_SETPAYLOAD): New macro.
10 * tests/test-totalorderf.c (TOTALORDER_POSITIVE_NAN,
11 TOTALORDER_NEGATIVE_NAN): Remove macros.
12 (TOTALORDER_SETPAYLOAD): New macro.
13 * tests/test-totalorderl.c (TOTALORDER_POSITIVE_NAN,
14 TOTALORDER_NEGATIVE_NAN): Remove macros.
15 (TOTALORDER_SETPAYLOAD): New macro.
16 * modules/totalorder-tests (Depends-on): Add setpayload.
17 (Makefile.am): Link test-totalorder with $(SETPAYLOAD_LIBM).
18 * modules/totalorderf-tests (Depends-on): Add setpayloadf.
19 (Makefile.am): Link test-totalorderf with $(SETPAYLOADF_LIBM).
20 * modules/totalorderl-tests (Depends-on): Add setpayloadl.
21 (Makefile.am): Link test-totalorderl with $(SETPAYLOADL_LIBM).
22
232024-04-17 Bruno Haible <bruno@clisp.org>
24
3 gnulib-tool.py: Use same warning style as gnulib-tool.sh. 25 gnulib-tool.py: Use same warning style as gnulib-tool.sh.
4 * pygnulib/GLTestDir.py (GLTestDir.execute): Prefix the 26 * pygnulib/GLTestDir.py (GLTestDir.execute): Prefix the
5 "incompatible license" message with "gnulib-tool: warning: ". 27 "incompatible license" message with "gnulib-tool: warning: ".
6 28
72024-04-17 Bruno Haible <bruno@clisp.org> 292024-04-17 Bruno Haible <bruno@clisp.org>
8 30
diff --git a/modules/totalorder-tests b/modules/totalorder-tests
index ca6238f7cb..6df07edfcf 100644
--- a/modules/totalorder-tests
+++ b/modules/totalorder-tests
@@ -6,13 +6,14 @@ tests/infinity.h
6tests/signature.h 6tests/signature.h
7tests/macros.h 7tests/macros.h
8 8
9Depends-on: 9Depends-on:
10signed-nan 10signed-nan
11signed-snan 11signed-snan
12setpayload
12 13
13configure.ac: 14configure.ac:
14 15
15Makefile.am: 16Makefile.am:
16TESTS += test-totalorder 17TESTS += test-totalorder
17check_PROGRAMS += test-totalorder 18check_PROGRAMS += test-totalorder
18test_totalorder_LDADD = $(LDADD) @TOTALORDER_LIBM@ 19test_totalorder_LDADD = $(LDADD) @TOTALORDER_LIBM@ $(SETPAYLOAD_LIBM)
diff --git a/modules/totalorderf-tests b/modules/totalorderf-tests
index dbca0add15..258cb9c0c2 100644
--- a/modules/totalorderf-tests
+++ b/modules/totalorderf-tests
@@ -6,13 +6,14 @@ tests/infinity.h
6tests/signature.h 6tests/signature.h
7tests/macros.h 7tests/macros.h
8 8
9Depends-on: 9Depends-on:
10signed-nan 10signed-nan
11signed-snan 11signed-snan
12setpayloadf
12 13
13configure.ac: 14configure.ac:
14 15
15Makefile.am: 16Makefile.am:
16TESTS += test-totalorderf 17TESTS += test-totalorderf
17check_PROGRAMS += test-totalorderf 18check_PROGRAMS += test-totalorderf
18test_totalorderf_LDADD = $(LDADD) @TOTALORDERF_LIBM@ 19test_totalorderf_LDADD = $(LDADD) @TOTALORDERF_LIBM@ $(SETPAYLOADF_LIBM)
diff --git a/modules/totalorderl-tests b/modules/totalorderl-tests
index ab73b6a5fd..222cc32992 100644
--- a/modules/totalorderl-tests
+++ b/modules/totalorderl-tests
@@ -6,13 +6,14 @@ tests/infinity.h
6tests/signature.h 6tests/signature.h
7tests/macros.h 7tests/macros.h
8 8
9Depends-on: 9Depends-on:
10signed-nan 10signed-nan
11signed-snan 11signed-snan
12setpayloadl
12 13
13configure.ac: 14configure.ac:
14 15
15Makefile.am: 16Makefile.am:
16TESTS += test-totalorderl 17TESTS += test-totalorderl
17check_PROGRAMS += test-totalorderl 18check_PROGRAMS += test-totalorderl
18test_totalorderl_LDADD = $(LDADD) @TOTALORDERL_LIBM@ 19test_totalorderl_LDADD = $(LDADD) @TOTALORDERL_LIBM@ $(SETPAYLOADL_LIBM)
diff --git a/tests/test-totalorder.c b/tests/test-totalorder.c
index 77926e4a5f..412c3d301e 100644
--- a/tests/test-totalorder.c
+++ b/tests/test-totalorder.c
@@ -23,12 +23,11 @@
23SIGNATURE_CHECK (totalorder, int, (const double *, const double *)); 23SIGNATURE_CHECK (totalorder, int, (const double *, const double *));
24 24
25#define TOTALORDER totalorder 25#define TOTALORDER totalorder
26#define TOTALORDER_TYPE memory_double 26#define TOTALORDER_TYPE memory_double
27#define TOTALORDER_INF Infinityd 27#define TOTALORDER_INF Infinityd
28#define TOTALORDER_MINUS_ZERO minus_zerod 28#define TOTALORDER_MINUS_ZERO minus_zerod
29#define TOTALORDER_POSITIVE_NAN positive_NaNd 29#define TOTALORDER_SETPAYLOAD setpayload
30#define TOTALORDER_NEGATIVE_NAN negative_NaNd
31#define TOTALORDER_HAVE_SNAN HAVE_SNAND 30#define TOTALORDER_HAVE_SNAN HAVE_SNAND
32#define TOTALORDER_POSITIVE_SNAN memory_positive_SNaNd 31#define TOTALORDER_POSITIVE_SNAN memory_positive_SNaNd
33#define TOTALORDER_NEGATIVE_SNAN memory_negative_SNaNd 32#define TOTALORDER_NEGATIVE_SNAN memory_negative_SNaNd
34#include "test-totalorder.h" 33#include "test-totalorder.h"
diff --git a/tests/test-totalorder.h b/tests/test-totalorder.h
index c82d112956..b02cec310b 100644
--- a/tests/test-totalorder.h
+++ b/tests/test-totalorder.h
@@ -13,24 +13,43 @@
13 13
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
16 16
17#include <stdio.h> 17#include <stdio.h>
18 18
19#include <math.h>
19#include "infinity.h" 20#include "infinity.h"
20#include "macros.h" 21#include "macros.h"
21#include "minus-zero.h" 22#include "minus-zero.h"
22#include "signed-nan.h" 23#include "signed-nan.h"
23#include "signed-snan.h" 24#include "signed-snan.h"
24 25
26static TOTALORDER_TYPE
27positive_NaN_with_payload (int payload)
28{
29 TOTALORDER_TYPE x;
30 ASSERT (TOTALORDER_SETPAYLOAD (&x.value, payload) == 0);
31 return x;
32}
33
34static TOTALORDER_TYPE
35negative_NaN_with_payload (int payload)
36{
37 TOTALORDER_TYPE x;
38 ASSERT (TOTALORDER_SETPAYLOAD (&x.value, payload) == 0);
39 x.value = - x.value;
40 return x;
41}
42
25int 43int
26main () 44main ()
27{ 45{
28 TOTALORDER_TYPE x[] = 46 TOTALORDER_TYPE x[] =
29 { 47 {
30 { TOTALORDER_NEGATIVE_NAN () }, 48 negative_NaN_with_payload (1729),
49 negative_NaN_with_payload (641),
31#if TOTALORDER_HAVE_SNAN 50#if TOTALORDER_HAVE_SNAN
32 TOTALORDER_NEGATIVE_SNAN (), 51 TOTALORDER_NEGATIVE_SNAN (),
33#endif 52#endif
34 { -TOTALORDER_INF () }, 53 { -TOTALORDER_INF () },
35 { -1e37 }, 54 { -1e37 },
36 { -1 }, 55 { -1 },
@@ -41,13 +60,14 @@ main ()
41 { 1 }, 60 { 1 },
42 { 1e37 }, 61 { 1e37 },
43 { TOTALORDER_INF () }, 62 { TOTALORDER_INF () },
44#if TOTALORDER_HAVE_SNAN 63#if TOTALORDER_HAVE_SNAN
45 TOTALORDER_POSITIVE_SNAN (), 64 TOTALORDER_POSITIVE_SNAN (),
46#endif 65#endif
47 { TOTALORDER_POSITIVE_NAN () } 66 positive_NaN_with_payload (641),
67 positive_NaN_with_payload (1729)
48 }; 68 };
49 int n = SIZEOF (x); 69 int n = SIZEOF (x);
50 int result = 0; 70 int result = 0;
51 71
52 for (int i = 0; i < n; i++) 72 for (int i = 0; i < n; i++)
53 for (int j = 0; j < n; j++) 73 for (int j = 0; j < n; j++)
diff --git a/tests/test-totalorderf.c b/tests/test-totalorderf.c
index 0094fad5c5..a3dd23a296 100644
--- a/tests/test-totalorderf.c
+++ b/tests/test-totalorderf.c
@@ -23,12 +23,11 @@
23SIGNATURE_CHECK (totalorderf, int, (const float *, const float *)); 23SIGNATURE_CHECK (totalorderf, int, (const float *, const float *));
24 24
25#define TOTALORDER totalorderf 25#define TOTALORDER totalorderf
26#define TOTALORDER_TYPE memory_float 26#define TOTALORDER_TYPE memory_float
27#define TOTALORDER_INF Infinityf 27#define TOTALORDER_INF Infinityf
28#define TOTALORDER_MINUS_ZERO minus_zerof 28#define TOTALORDER_MINUS_ZERO minus_zerof
29#define TOTALORDER_POSITIVE_NAN positive_NaNf 29#define TOTALORDER_SETPAYLOAD setpayloadf
30#define TOTALORDER_NEGATIVE_NAN negative_NaNf
31#define TOTALORDER_HAVE_SNAN HAVE_SNANF 30#define TOTALORDER_HAVE_SNAN HAVE_SNANF
32#define TOTALORDER_POSITIVE_SNAN memory_positive_SNaNf 31#define TOTALORDER_POSITIVE_SNAN memory_positive_SNaNf
33#define TOTALORDER_NEGATIVE_SNAN memory_negative_SNaNf 32#define TOTALORDER_NEGATIVE_SNAN memory_negative_SNaNf
34#include "test-totalorder.h" 33#include "test-totalorder.h"
diff --git a/tests/test-totalorderl.c b/tests/test-totalorderl.c
index 74364ddd75..f3db8194f7 100644
--- a/tests/test-totalorderl.c
+++ b/tests/test-totalorderl.c
@@ -23,12 +23,11 @@
23SIGNATURE_CHECK (totalorderl, int, (const long double *, const long double *)); 23SIGNATURE_CHECK (totalorderl, int, (const long double *, const long double *));
24 24
25#define TOTALORDER totalorderl 25#define TOTALORDER totalorderl