bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

totalorder*: Enhance tests


From: Bruno Haible
Subject: totalorder*: Enhance tests
Date: Sat, 14 Oct 2023 20:47:48 +0200

Here are three patches that enhance the unit tests of the totalorder* functions.

The third patch uses the 'union' workaround, to avoid test failures on i386
and x86_64 platforms.


2023-10-14  Bruno Haible  <bruno@clisp.org>

        totalorder* tests: Test also the signalling NaNs.
        * tests/test-totalorder.h: Include signed-snan.h.
        (main): Change the array initializer to contain memory_* objects rather
        than floating-point numbers. This is needed for i386 and x86_64 CPUs.
        * tests/test-totalorder.c (TOTALORDER_TYPE): Use memory_double.
        (TOTALORDER_HAVE_SNAN, TOTALORDER_POSITIVE_SNAN,
        TOTALORDER_NEGATIVE_SNAN): New macros.
        * tests/test-totalorderf.c (TOTALORDER_TYPE): Use memory_float.
        (TOTALORDER_HAVE_SNAN, TOTALORDER_POSITIVE_SNAN,
        TOTALORDER_NEGATIVE_SNAN): New macros.
        * tests/test-totalorderl.c (TOTALORDER_TYPE): Use memory_long_double.
        (TOTALORDER_HAVE_SNAN, TOTALORDER_POSITIVE_SNAN,
        TOTALORDER_NEGATIVE_SNAN): New macros.
        * modules/totalorder-tests (Depends-on): Add signed-snan.
        * modules/totalorderf-tests (Depends-on): Likewise.
        * modules/totalorderl-tests (Depends-on): Likewise.

2023-10-14  Bruno Haible  <bruno@clisp.org>

        totalorder* tests: Make it easier to debug failures.
        * tests/test-totalorder.h: Include <stdio.h>.
        (main): Print array indices of all failures.

2023-10-14  Bruno Haible  <bruno@clisp.org>

        totalorder* tests: Verify also the function signatures.
        * tests/test-totalorder.h: New file, based on tests/test-totalorder.c.
        * tests/test-totalorder.c: Check the signature. Include
        test-totalorder.h for the rest.
        * tests/test-totalorderf.c: Include <config.h>, <math.h>. Check the
        signature. Include test-totalorder.h instead of test-totalorder.c.
        * tests/test-totalorderl.c: Likewise.
        * modules/totalorder-tests (Files): Add test-totalorder.h, signature.h.
        * modules/totalorderf-tests (Files): Add test-totalorder.h, signature.h.
        Remove test-totalorder.c.
        * modules/totalorderl-tests (Files): Likewise.

Attachment: 0001-totalorder-tests-Verify-also-the-function-signatures.patch
Description: Text Data

Attachment: 0002-totalorder-tests-Make-it-easier-to-debug-failures.patch
Description: Text Data

Attachment: 0003-totalorder-tests-Test-also-the-signalling-NaNs.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]