Branch
Hash :
4ecbad17
Author :
Date :
2025-09-10T23:19:32
tests: Remove support for IRIX. * tests/minus-zero.h (compute_minus_zerof, compute_minus_zerod, compute_minus_zerol): Remove code for IRIX. * tests/test-c32isgraph.c (main): Likewise. * tests/test-c32isprint.c (main): Likewise. * tests/test-getaddrinfo.c (simple): Likewise. * tests/test-isgraph_l.c (main): Likewise. * tests/test-isprint_l.c (main): Likewise. * tests/test-localeconv-mt.c (ENCODING): Likewise. * tests/test-nl_langinfo-mt.c (ENCODING): Likewise. * tests/test-setlocale_null-mt-all.c (ENCODING): Likewise. * tests/test-setlocale_null-mt-one.c (ENCODING): Likewise. * tests/test-sethostname1.c: Likewise. * tests/test-striconveha.c (main): Likewise. * tests/uniconv/test-u8-conv-from-enc.c (main): Likewise. * tests/uniconv/test-u8-strconv-from-enc.c (main): Likewise. * tests/uniconv/test-u16-conv-from-enc.c (main): Likewise. * tests/uniconv/test-u16-strconv-from-enc.c (main): Likewise. * tests/uniconv/test-u32-conv-from-enc.c (main): Likewise. * tests/uniconv/test-u32-strconv-from-enc.c (main): Likewise. * tests/test-frexpl.c (MIN_NORMAL_EXP): Likewise. * tests/test-ilogbl.c (MIN_NORMAL_EXP): Likewise. * tests/test-logbl.c (MIN_NORMAL_EXP): Likewise. * tests/test-printf-frexpl.c (MIN_NORMAL_EXP, MIN_SUBNORMAL_EXP): Likewise. * tests/test-fma2.h (MIN_SUBNORMAL_EXP): Remove macro. (test_function): Inline its value. * tests/test-lseek.c (main): Update comments. * tests/test-sigabbrev_np.c (main): Remove cases for SIGCKPT, SIGPTINTR, SIGPTRESCHED, SIGRESTART, SIGUME. * tests/test-sigdescr_np.c (main): Likewise. * modules/math-h-c++-tests (Makefile.am): Don't link test-math-h-c++ with extra libraries.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
/* Test of isprint_l() function.
Copyright (C) 2020-2025 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>
#include <ctype.h>
#include "signature.h"
SIGNATURE_CHECK (isprint_l, int, (int, locale_t));
#include <locale.h>
#include <stdio.h>
#include "macros.h"
static void
test_single_locale_common (locale_t locale)
{
int is;
/* Test EOF. */
is = isprint_l (EOF, locale);
ASSERT (is == 0);
/* POSIX specifies in
<https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html>
no explicit list of printable characters. */
{
int c;
for (c = 0; c < 0x100; c++)
switch (c)
{
case '\t': case '\v': case '\f':
case ' ': case '!': case '"': case '#': case '%':
case '&': case '\'': case '(': case ')': case '*':
case '+': case ',': case '-': case '.': case '/':
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case ':': case ';': case '<': case '=': case '>':
case '?':
case 'A': case 'B': case 'C': case 'D': case 'E':
case 'F': case 'G': case 'H': case 'I': case 'J':
case 'K': case 'L': case 'M': case 'N': case 'O':
case 'P': case 'Q': case 'R': case 'S': case 'T':
case 'U': case 'V': case 'W': case 'X': case 'Y':
case 'Z':
case '[': case '\\': case ']': case '^': case '_':
case 'a': case 'b': case 'c': case 'd': case 'e':
case 'f': case 'g': case 'h': case 'i': case 'j':
case 'k': case 'l': case 'm': case 'n': case 'o':
case 'p': case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x': case 'y':
case 'z': case '{': case '|': case '}': case '~':
/* c is in the ISO C "basic character set". */
is = isprint_l ((unsigned char) c, locale);
switch (c)
{
case '\t': case '\v': case '\f':
ASSERT (is == 0);
break;
default:
ASSERT (is != 0);
break;
}
break;
}
}
}
int
main ()
{
{
locale_t locale = newlocale (LC_ALL_MASK, "C", NULL);
ASSERT (locale != NULL);
test_single_locale_common (locale);
freelocale (locale);
}
#if !MUSL_LIBC /* musl libc has no unibyte locales */
{
# if defined _WIN32 && !defined __CYGWIN__
locale_t locale = newlocale (LC_ALL_MASK, "French_France.1252", NULL);
# else
locale_t locale = newlocale (LC_ALL_MASK, "fr_FR.ISO-8859-1", NULL);
if (locale == NULL)
locale = newlocale (LC_ALL_MASK, "fr_FR.ISO8859-1", NULL);
# endif
if (locale != NULL)
{
test_single_locale_common (locale);
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
int is;
/* U+007F <control> */
is = isprint_l ((unsigned char) '\177', locale);
ASSERT (is == 0);
#if !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __DragonFly__ || (defined _WIN32 && !defined __CYGWIN__))
/* U+00A0 NO-BREAK SPACE */
is = isprint_l ((unsigned char) '\240', locale);
ASSERT (is != 0);
#endif
#if !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __DragonFly__)
/* U+00B8 CEDILLA */
is = isprint_l ((unsigned char) '\270', locale);
ASSERT (is != 0);
#endif
freelocale (locale);
}
}
#endif
return test_exit_status;
}