1 /* Test of sigabbrev_np() function.
3 Copyright (C) 2020-2024 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3, or (at your option)
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, see <https://www.gnu.org/licenses/>. */
23 #include "signature.h"
24 SIGNATURE_CHECK (sigabbrev_np
, const char *, (int));
33 /* Signals specified by ISO C. */
34 ASSERT (strcmp (sigabbrev_np (SIGABRT
), "ABRT") == 0);
35 ASSERT (strcmp (sigabbrev_np (SIGFPE
), "FPE") == 0);
36 ASSERT (strcmp (sigabbrev_np (SIGILL
), "ILL") == 0);
37 ASSERT (strcmp (sigabbrev_np (SIGINT
), "INT") == 0);
38 ASSERT (strcmp (sigabbrev_np (SIGSEGV
), "SEGV") == 0);
39 ASSERT (strcmp (sigabbrev_np (SIGTERM
), "TERM") == 0);
41 /* Signals specified by POSIX.
42 <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html> */
44 ASSERT (strcmp (sigabbrev_np (SIGALRM
), "ALRM") == 0);
47 ASSERT (strcmp (sigabbrev_np (SIGBUS
), "BUS") == 0);
50 ASSERT (strcmp (sigabbrev_np (SIGCHLD
), "CHLD") == 0);
53 ASSERT (strcmp (sigabbrev_np (SIGCONT
), "CONT") == 0);
56 ASSERT (strcmp (sigabbrev_np (SIGHUP
), "HUP") == 0);
59 ASSERT (strcmp (sigabbrev_np (SIGKILL
), "KILL") == 0);
62 ASSERT (strcmp (sigabbrev_np (SIGPIPE
), "PIPE") == 0);
65 ASSERT (strcmp (sigabbrev_np (SIGQUIT
), "QUIT") == 0);
68 ASSERT (strcmp (sigabbrev_np (SIGSTOP
), "STOP") == 0);
71 ASSERT (strcmp (sigabbrev_np (SIGTSTP
), "TSTP") == 0);
74 ASSERT (strcmp (sigabbrev_np (SIGTTIN
), "TTIN") == 0);
77 ASSERT (strcmp (sigabbrev_np (SIGTTOU
), "TTOU") == 0);
80 ASSERT (strcmp (sigabbrev_np (SIGUSR1
), "USR1") == 0);
83 ASSERT (strcmp (sigabbrev_np (SIGUSR2
), "USR2") == 0);
86 ASSERT (strcmp (sigabbrev_np (SIGPOLL
), "POLL") == 0);
89 ASSERT (strcmp (sigabbrev_np (SIGPROF
), "PROF") == 0);
92 ASSERT (strcmp (sigabbrev_np (SIGSYS
), "SYS") == 0);
95 ASSERT (strcmp (sigabbrev_np (SIGTRAP
), "TRAP") == 0);
98 ASSERT (strcmp (sigabbrev_np (SIGURG
), "URG") == 0);
101 ASSERT (strcmp (sigabbrev_np (SIGVTALRM
), "VTALRM") == 0);
104 ASSERT (strcmp (sigabbrev_np (SIGXCPU
), "XCPU") == 0);
107 ASSERT (strcmp (sigabbrev_np (SIGXFSZ
), "XFSZ") == 0);
110 /* Other signals on other systems. */
113 ASSERT (strcmp (sigabbrev_np (SIGBREAK
), "BREAK") == 0);
117 ASSERT (strcmp (sigabbrev_np (SIGCKPT
), "CKPT") == 0);
121 ASSERT (strcmp (sigabbrev_np (SIGCPUFAIL
), "CPUFAIL") == 0);
125 ASSERT (strcmp (sigabbrev_np (SIGDANGER
), "DANGER") == 0);
127 /* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin, mingw */
129 ASSERT (strcmp (sigabbrev_np (SIGEMT
), "EMT") == 0);
131 /* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix */
132 #if defined SIGINFO && SIGINFO != SIGPWR
133 ASSERT (strcmp (sigabbrev_np (SIGINFO
), "INFO") == 0);
137 ASSERT (strcmp (sigabbrev_np (SIGKAP
), "KAP") == 0);
141 ASSERT (strcmp (sigabbrev_np (SIGKILLTHR
), "KILLTHR") == 0);
145 ASSERT (strcmp (sigabbrev_np (SIGKMEM
), "KMEM") == 0);
149 ASSERT (strcmp (sigabbrev_np (SIGKMESS
), "KMESS") == 0);
153 ASSERT (strcmp (sigabbrev_np (SIGKSIG
), "KSIG") == 0);
157 ASSERT (strcmp (sigabbrev_np (SIGKSIGSM
), "KSIGSM") == 0);
161 ASSERT (strcmp (sigabbrev_np (SIGLIBRT
), "LIBRT") == 0);
165 ASSERT (strcmp (sigabbrev_np (SIGMIGRATE
), "MIGRATE") == 0);
169 ASSERT (strcmp (sigabbrev_np (SIGMSG
), "MSG") == 0);
173 ASSERT (strcmp (sigabbrev_np (SIGPRE
), "PRE") == 0);
177 ASSERT (strcmp (sigabbrev_np (SIGPTINTR
), "PTINTR") == 0);
181 ASSERT (strcmp (sigabbrev_np (SIGPTRESCHED
), "PTRESCHED") == 0);
183 /* Linux, NetBSD, Minix, AIX, IRIX, Cygwin */
185 ASSERT (strcmp (sigabbrev_np (SIGPWR
), "PWR") == 0);
189 ASSERT (strcmp (sigabbrev_np (SIGRECONFIG
), "RECONFIG") == 0);
193 ASSERT (strcmp (sigabbrev_np (SIGRECOVERY
), "RECOVERY") == 0);
197 ASSERT (strcmp (sigabbrev_np (SIGRESTART
), "RESTART") == 0);
201 ASSERT (strcmp (sigabbrev_np (SIGRETRACT
), "RETRACT") == 0);
205 ASSERT (strcmp (sigabbrev_np (SIGSAK
), "SAK") == 0);
209 ASSERT (strcmp (sigabbrev_np (SIGSNDELAY
), "SNDELAY") == 0);
213 ASSERT (strcmp (sigabbrev_np (SIGSOUND
), "SOUND") == 0);
217 ASSERT (strcmp (sigabbrev_np (SIGSTKFLT
), "STKFLT") == 0);
221 ASSERT (strcmp (sigabbrev_np (SIGSYSERROR
), "SYSERROR") == 0);
225 ASSERT (strcmp (sigabbrev_np (SIGTALRM
), "TALRM") == 0);
227 /* FreeBSD, OpenBSD */
229 ASSERT (strcmp (sigabbrev_np (SIGTHR
), "THR") == 0);
233 ASSERT (strcmp (sigabbrev_np (SIGUME
), "UME") == 0);
237 ASSERT (strcmp (sigabbrev_np (SIGVIRT
), "VIRT") == 0);
241 ASSERT (strcmp (sigabbrev_np (SIGWAITING
), "WAITING") == 0);
243 /* Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin, Haiku */
245 ASSERT (strcmp (sigabbrev_np (SIGWINCH
), "WINCH") == 0);
248 ASSERT (sigabbrev_np (-714) == NULL
);
250 return test_exit_status
;