(root)/
glibc-2.38/
stdio-common/
test-strerr.c
       1  /* Test strerrorname_np and strerrordesc_np.
       2     Copyright (C) 2020-2023 Free Software Foundation, Inc.
       3     This file is part of the GNU C Library.
       4  
       5     The GNU C Library is free software; you can redistribute it and/or
       6     modify it under the terms of the GNU Lesser General Public
       7     License as published by the Free Software Foundation; either
       8     version 2.1 of the License, or (at your option) any later version.
       9  
      10     The GNU C Library 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 GNU
      13     Lesser General Public License for more details.
      14  
      15     You should have received a copy of the GNU Lesser General Public
      16     License along with the GNU C Library; if not, see
      17     <https://www.gnu.org/licenses/>.  */
      18  
      19  #include <string.h>
      20  #include <errno.h>
      21  
      22  #include <support/support.h>
      23  #include <support/check.h>
      24  
      25  static int
      26  do_test (void)
      27  {
      28    TEST_COMPARE_STRING (strerrordesc_np (0), "Success");
      29    TEST_COMPARE_STRING (strerrorname_np (0), "0");
      30  
      31  #ifdef EPERM
      32    TEST_COMPARE_STRING (strerrordesc_np (EPERM), "Operation not permitted");
      33    TEST_COMPARE_STRING (strerrorname_np (EPERM), "EPERM");
      34  #endif
      35  #ifdef ENOENT
      36    TEST_COMPARE_STRING (strerrordesc_np (ENOENT),
      37  		       "No such file or directory");
      38    TEST_COMPARE_STRING (strerrorname_np (ENOENT), "ENOENT");
      39  #endif
      40  #ifdef ESRCH
      41    TEST_COMPARE_STRING (strerrordesc_np (ESRCH), "No such process");
      42    TEST_COMPARE_STRING (strerrorname_np (ESRCH), "ESRCH");
      43  #endif
      44  #ifdef EINTR
      45    TEST_COMPARE_STRING (strerrordesc_np (EINTR), "Interrupted system call");
      46    TEST_COMPARE_STRING (strerrorname_np (EINTR), "EINTR");
      47  #endif
      48  #ifdef EIO
      49    TEST_COMPARE_STRING (strerrordesc_np (EIO), "Input/output error");
      50    TEST_COMPARE_STRING (strerrorname_np (EIO), "EIO");
      51  #endif
      52  #ifdef ENXIO
      53    TEST_COMPARE_STRING (strerrordesc_np (ENXIO), "No such device or address");
      54    TEST_COMPARE_STRING (strerrorname_np (ENXIO), "ENXIO");
      55  #endif
      56  #ifdef E2BIG
      57    TEST_COMPARE_STRING (strerrordesc_np (E2BIG), "Argument list too long");
      58    TEST_COMPARE_STRING (strerrorname_np (E2BIG), "E2BIG");
      59  #endif
      60  #ifdef ENOEXEC
      61    TEST_COMPARE_STRING (strerrordesc_np (ENOEXEC), "Exec format error");
      62    TEST_COMPARE_STRING (strerrorname_np (ENOEXEC), "ENOEXEC");
      63  #endif
      64  #ifdef EBADF
      65    TEST_COMPARE_STRING (strerrordesc_np (EBADF), "Bad file descriptor");
      66    TEST_COMPARE_STRING (strerrorname_np (EBADF), "EBADF");
      67  #endif
      68  #ifdef ECHILD
      69    TEST_COMPARE_STRING (strerrordesc_np (ECHILD), "No child processes");
      70    TEST_COMPARE_STRING (strerrorname_np (ECHILD), "ECHILD");
      71  #endif
      72  #ifdef EDEADLK
      73    TEST_COMPARE_STRING (strerrordesc_np (EDEADLK),
      74  		       "Resource deadlock avoided");
      75    TEST_COMPARE_STRING (strerrorname_np (EDEADLK), "EDEADLK");
      76  #endif
      77  #ifdef ENOMEM
      78    TEST_COMPARE_STRING (strerrordesc_np (ENOMEM), "Cannot allocate memory");
      79    TEST_COMPARE_STRING (strerrorname_np (ENOMEM), "ENOMEM");
      80  #endif
      81  #ifdef EACCES
      82    TEST_COMPARE_STRING (strerrordesc_np (EACCES), "Permission denied");
      83    TEST_COMPARE_STRING (strerrorname_np (EACCES), "EACCES");
      84  #endif
      85  #ifdef EFAULT
      86    TEST_COMPARE_STRING (strerrordesc_np (EFAULT), "Bad address");
      87    TEST_COMPARE_STRING (strerrorname_np (EFAULT), "EFAULT");
      88  #endif
      89  #ifdef ENOTBLK
      90    TEST_COMPARE_STRING (strerrordesc_np (ENOTBLK), "Block device required");
      91    TEST_COMPARE_STRING (strerrorname_np (ENOTBLK), "ENOTBLK");
      92  #endif
      93  #ifdef EBUSY
      94    TEST_COMPARE_STRING (strerrordesc_np (EBUSY), "Device or resource busy");
      95    TEST_COMPARE_STRING (strerrorname_np (EBUSY), "EBUSY");
      96  #endif
      97  #ifdef EEXIST
      98    TEST_COMPARE_STRING (strerrordesc_np (EEXIST), "File exists");
      99    TEST_COMPARE_STRING (strerrorname_np (EEXIST), "EEXIST");
     100  #endif
     101  #ifdef EXDEV
     102    TEST_COMPARE_STRING (strerrordesc_np (EXDEV), "Invalid cross-device link");
     103    TEST_COMPARE_STRING (strerrorname_np (EXDEV), "EXDEV");
     104  #endif
     105  #ifdef ENODEV
     106    TEST_COMPARE_STRING (strerrordesc_np (ENODEV), "No such device");
     107    TEST_COMPARE_STRING (strerrorname_np (ENODEV), "ENODEV");
     108  #endif
     109  #ifdef ENOTDIR
     110    TEST_COMPARE_STRING (strerrordesc_np (ENOTDIR), "Not a directory");
     111    TEST_COMPARE_STRING (strerrorname_np (ENOTDIR), "ENOTDIR");
     112  #endif
     113  #ifdef EISDIR
     114    TEST_COMPARE_STRING (strerrordesc_np (EISDIR), "Is a directory");
     115    TEST_COMPARE_STRING (strerrorname_np (EISDIR), "EISDIR");
     116  #endif
     117  #ifdef EINVAL
     118    TEST_COMPARE_STRING (strerrordesc_np (EINVAL), "Invalid argument");
     119    TEST_COMPARE_STRING (strerrorname_np (EINVAL), "EINVAL");
     120  #endif
     121  #ifdef EMFILE
     122    TEST_COMPARE_STRING (strerrordesc_np (EMFILE), "Too many open files");
     123    TEST_COMPARE_STRING (strerrorname_np (EMFILE), "EMFILE");
     124  #endif
     125  #ifdef ENFILE
     126    TEST_COMPARE_STRING (strerrordesc_np (ENFILE),
     127  		       "Too many open files in system");
     128    TEST_COMPARE_STRING (strerrorname_np (ENFILE), "ENFILE");
     129  #endif
     130  #ifdef ENOTTY
     131    TEST_COMPARE_STRING (strerrordesc_np (ENOTTY),
     132  		       "Inappropriate ioctl for device");
     133    TEST_COMPARE_STRING (strerrorname_np (ENOTTY), "ENOTTY");
     134  #endif
     135  #ifdef ETXTBSY
     136    TEST_COMPARE_STRING (strerrordesc_np (ETXTBSY), "Text file busy");
     137    TEST_COMPARE_STRING (strerrorname_np (ETXTBSY), "ETXTBSY");
     138  #endif
     139  #ifdef EFBIG
     140    TEST_COMPARE_STRING (strerrordesc_np (EFBIG), "File too large");
     141    TEST_COMPARE_STRING (strerrorname_np (EFBIG), "EFBIG");
     142  #endif
     143  #ifdef ENOSPC
     144    TEST_COMPARE_STRING (strerrordesc_np (ENOSPC), "No space left on device");
     145    TEST_COMPARE_STRING (strerrorname_np (ENOSPC), "ENOSPC");
     146  #endif
     147  #ifdef ESPIPE
     148    TEST_COMPARE_STRING (strerrordesc_np (ESPIPE), "Illegal seek");
     149    TEST_COMPARE_STRING (strerrorname_np (ESPIPE), "ESPIPE");
     150  #endif
     151  #ifdef EROFS
     152    TEST_COMPARE_STRING (strerrordesc_np (EROFS), "Read-only file system");
     153    TEST_COMPARE_STRING (strerrorname_np (EROFS), "EROFS");
     154  #endif
     155  #ifdef EMLINK
     156    TEST_COMPARE_STRING (strerrordesc_np (EMLINK), "Too many links");
     157    TEST_COMPARE_STRING (strerrorname_np (EMLINK), "EMLINK");
     158  #endif
     159  #ifdef EPIPE
     160    TEST_COMPARE_STRING (strerrordesc_np (EPIPE), "Broken pipe");
     161    TEST_COMPARE_STRING (strerrorname_np (EPIPE), "EPIPE");
     162  #endif
     163  #ifdef EDOM
     164    TEST_COMPARE_STRING (strerrordesc_np (EDOM),
     165  		       "Numerical argument out of domain");
     166    TEST_COMPARE_STRING (strerrorname_np (EDOM), "EDOM");
     167  #endif
     168  #ifdef ERANGE
     169    TEST_COMPARE_STRING (strerrordesc_np (ERANGE),
     170  		       "Numerical result out of range");
     171    TEST_COMPARE_STRING (strerrorname_np (ERANGE), "ERANGE");
     172  #endif
     173  #ifdef EAGAIN
     174    TEST_COMPARE_STRING (strerrordesc_np (EAGAIN),
     175  		       "Resource temporarily unavailable");
     176    TEST_COMPARE_STRING (strerrorname_np (EAGAIN), "EAGAIN");
     177  #endif
     178  #ifdef EINPROGRESS
     179    TEST_COMPARE_STRING (strerrordesc_np (EINPROGRESS),
     180  		       "Operation now in progress");
     181    TEST_COMPARE_STRING (strerrorname_np (EINPROGRESS), "EINPROGRESS");
     182  #endif
     183  #ifdef EALREADY
     184    TEST_COMPARE_STRING (strerrordesc_np (EALREADY),
     185  		       "Operation already in progress");
     186    TEST_COMPARE_STRING (strerrorname_np (EALREADY), "EALREADY");
     187  #endif
     188  #ifdef ENOTSOCK
     189    TEST_COMPARE_STRING (strerrordesc_np (ENOTSOCK),
     190  		       "Socket operation on non-socket");
     191    TEST_COMPARE_STRING (strerrorname_np (ENOTSOCK), "ENOTSOCK");
     192  #endif
     193  #ifdef EMSGSIZE
     194    TEST_COMPARE_STRING (strerrordesc_np (EMSGSIZE), "Message too long");
     195    TEST_COMPARE_STRING (strerrorname_np (EMSGSIZE), "EMSGSIZE");
     196  #endif
     197  #ifdef EPROTOTYPE
     198    TEST_COMPARE_STRING (strerrordesc_np (EPROTOTYPE),
     199  		       "Protocol wrong type for socket");
     200    TEST_COMPARE_STRING (strerrorname_np (EPROTOTYPE), "EPROTOTYPE");
     201  #endif
     202  #ifdef ENOPROTOOPT
     203    TEST_COMPARE_STRING (strerrordesc_np (ENOPROTOOPT),
     204  		       "Protocol not available");
     205    TEST_COMPARE_STRING (strerrorname_np (ENOPROTOOPT), "ENOPROTOOPT");
     206  #endif
     207  #ifdef EPROTONOSUPPORT
     208    TEST_COMPARE_STRING (strerrordesc_np (EPROTONOSUPPORT),
     209  		       "Protocol not supported");
     210    TEST_COMPARE_STRING (strerrorname_np (EPROTONOSUPPORT), "EPROTONOSUPPORT");
     211  #endif
     212  #ifdef ESOCKTNOSUPPORT
     213    TEST_COMPARE_STRING (strerrordesc_np (ESOCKTNOSUPPORT),
     214  		       "Socket type not supported");
     215    TEST_COMPARE_STRING (strerrorname_np (ESOCKTNOSUPPORT), "ESOCKTNOSUPPORT");
     216  #endif
     217  #ifdef EOPNOTSUPP
     218    TEST_COMPARE_STRING (strerrordesc_np (EOPNOTSUPP),
     219  		       "Operation not supported");
     220    TEST_COMPARE_STRING (strerrorname_np (EOPNOTSUPP), "EOPNOTSUPP");
     221  #endif
     222  #ifdef EPFNOSUPPORT
     223    TEST_COMPARE_STRING (strerrordesc_np (EPFNOSUPPORT),
     224  		       "Protocol family not supported");
     225    TEST_COMPARE_STRING (strerrorname_np (EPFNOSUPPORT), "EPFNOSUPPORT");
     226  #endif
     227  #ifdef EAFNOSUPPORT
     228    TEST_COMPARE_STRING (strerrordesc_np (EAFNOSUPPORT),
     229  		       "Address family not supported by protocol");
     230    TEST_COMPARE_STRING (strerrorname_np (EAFNOSUPPORT), "EAFNOSUPPORT");
     231  #endif
     232  #ifdef EADDRINUSE
     233    TEST_COMPARE_STRING (strerrordesc_np (EADDRINUSE),
     234  		       "Address already in use");
     235    TEST_COMPARE_STRING (strerrorname_np (EADDRINUSE), "EADDRINUSE");
     236  #endif
     237  #ifdef EADDRNOTAVAIL
     238    TEST_COMPARE_STRING (strerrordesc_np (EADDRNOTAVAIL),
     239  		       "Cannot assign requested address");
     240    TEST_COMPARE_STRING (strerrorname_np (EADDRNOTAVAIL), "EADDRNOTAVAIL");
     241  #endif
     242  #ifdef ENETDOWN
     243    TEST_COMPARE_STRING (strerrordesc_np (ENETDOWN), "Network is down");
     244    TEST_COMPARE_STRING (strerrorname_np (ENETDOWN), "ENETDOWN");
     245  #endif
     246  #ifdef ENETUNREACH
     247    TEST_COMPARE_STRING (strerrordesc_np (ENETUNREACH),
     248  		       "Network is unreachable");
     249    TEST_COMPARE_STRING (strerrorname_np (ENETUNREACH), "ENETUNREACH");
     250  #endif
     251  #ifdef ENETRESET
     252    TEST_COMPARE_STRING (strerrordesc_np (ENETRESET),
     253  		       "Network dropped connection on reset");
     254    TEST_COMPARE_STRING (strerrorname_np (ENETRESET), "ENETRESET");
     255  #endif
     256  #ifdef ECONNABORTED
     257    TEST_COMPARE_STRING (strerrordesc_np (ECONNABORTED),
     258  		       "Software caused connection abort");
     259    TEST_COMPARE_STRING (strerrorname_np (ECONNABORTED), "ECONNABORTED");
     260  #endif
     261  #ifdef ECONNRESET
     262    TEST_COMPARE_STRING (strerrordesc_np (ECONNRESET),
     263  		       "Connection reset by peer");
     264    TEST_COMPARE_STRING (strerrorname_np (ECONNRESET), "ECONNRESET");
     265  #endif
     266  #ifdef ENOBUFS
     267    TEST_COMPARE_STRING (strerrordesc_np (ENOBUFS),
     268  		       "No buffer space available");
     269    TEST_COMPARE_STRING (strerrorname_np (ENOBUFS), "ENOBUFS");
     270  #endif
     271  #ifdef EISCONN
     272    TEST_COMPARE_STRING (strerrordesc_np (EISCONN),
     273  		       "Transport endpoint is already connected");
     274    TEST_COMPARE_STRING (strerrorname_np (EISCONN), "EISCONN");
     275  #endif
     276  #ifdef ENOTCONN
     277    TEST_COMPARE_STRING (strerrordesc_np (ENOTCONN),
     278  		       "Transport endpoint is not connected");
     279    TEST_COMPARE_STRING (strerrorname_np (ENOTCONN), "ENOTCONN");
     280  #endif
     281  #ifdef EDESTADDRREQ
     282    TEST_COMPARE_STRING (strerrordesc_np (EDESTADDRREQ),
     283  		       "Destination address required");
     284    TEST_COMPARE_STRING (strerrorname_np (EDESTADDRREQ), "EDESTADDRREQ");
     285  #endif
     286  #ifdef ESHUTDOWN
     287    TEST_COMPARE_STRING (strerrordesc_np (ESHUTDOWN),
     288  		       "Cannot send after transport endpoint shutdown");
     289    TEST_COMPARE_STRING (strerrorname_np (ESHUTDOWN), "ESHUTDOWN");
     290  #endif
     291  #ifdef ETOOMANYREFS
     292    TEST_COMPARE_STRING (strerrordesc_np (ETOOMANYREFS),
     293  		       "Too many references: cannot splice");
     294    TEST_COMPARE_STRING (strerrorname_np (ETOOMANYREFS), "ETOOMANYREFS");
     295  #endif
     296  #ifdef ETIMEDOUT
     297    TEST_COMPARE_STRING (strerrordesc_np (ETIMEDOUT), "Connection timed out");
     298    TEST_COMPARE_STRING (strerrorname_np (ETIMEDOUT), "ETIMEDOUT");
     299  #endif
     300  #ifdef ECONNREFUSED
     301    TEST_COMPARE_STRING (strerrordesc_np (ECONNREFUSED), "Connection refused");
     302    TEST_COMPARE_STRING (strerrorname_np (ECONNREFUSED), "ECONNREFUSED");
     303  #endif
     304  #ifdef ELOOP
     305    TEST_COMPARE_STRING (strerrordesc_np (ELOOP),
     306  		       "Too many levels of symbolic links");
     307    TEST_COMPARE_STRING (strerrorname_np (ELOOP), "ELOOP");
     308  #endif
     309  #ifdef ENAMETOOLONG
     310    TEST_COMPARE_STRING (strerrordesc_np (ENAMETOOLONG), "File name too long");
     311    TEST_COMPARE_STRING (strerrorname_np (ENAMETOOLONG), "ENAMETOOLONG");
     312  #endif
     313  #ifdef EHOSTDOWN
     314    TEST_COMPARE_STRING (strerrordesc_np (EHOSTDOWN), "Host is down");
     315    TEST_COMPARE_STRING (strerrorname_np (EHOSTDOWN), "EHOSTDOWN");
     316  #endif
     317  #ifdef EHOSTUNREACH
     318    TEST_COMPARE_STRING (strerrordesc_np (EHOSTUNREACH), "No route to host");
     319    TEST_COMPARE_STRING (strerrorname_np (EHOSTUNREACH), "EHOSTUNREACH");
     320  #endif
     321  #ifdef ENOTEMPTY
     322    TEST_COMPARE_STRING (strerrordesc_np (ENOTEMPTY), "Directory not empty");
     323    TEST_COMPARE_STRING (strerrorname_np (ENOTEMPTY), "ENOTEMPTY");
     324  #endif
     325  #ifdef EUSERS
     326    TEST_COMPARE_STRING (strerrordesc_np (EUSERS), "Too many users");
     327    TEST_COMPARE_STRING (strerrorname_np (EUSERS), "EUSERS");
     328  #endif
     329  #ifdef EDQUOT
     330    TEST_COMPARE_STRING (strerrordesc_np (EDQUOT), "Disk quota exceeded");
     331    TEST_COMPARE_STRING (strerrorname_np (EDQUOT), "EDQUOT");
     332  #endif
     333  #ifdef ESTALE
     334    TEST_COMPARE_STRING (strerrordesc_np (ESTALE), "Stale file handle");
     335    TEST_COMPARE_STRING (strerrorname_np (ESTALE), "ESTALE");
     336  #endif
     337  #ifdef EREMOTE
     338    TEST_COMPARE_STRING (strerrordesc_np (EREMOTE), "Object is remote");
     339    TEST_COMPARE_STRING (strerrorname_np (EREMOTE), "EREMOTE");
     340  #endif
     341  #ifdef ENOLCK
     342    TEST_COMPARE_STRING (strerrordesc_np (ENOLCK), "No locks available");
     343    TEST_COMPARE_STRING (strerrorname_np (ENOLCK), "ENOLCK");
     344  #endif
     345  #ifdef ENOSYS
     346    TEST_COMPARE_STRING (strerrordesc_np (ENOSYS), "Function not implemented");
     347    TEST_COMPARE_STRING (strerrorname_np (ENOSYS), "ENOSYS");
     348  #endif
     349  #ifdef EILSEQ
     350    TEST_COMPARE_STRING (strerrordesc_np (EILSEQ),
     351  		       "Invalid or incomplete multibyte or wide character");
     352    TEST_COMPARE_STRING (strerrorname_np (EILSEQ), "EILSEQ");
     353  #endif
     354  #ifdef EBADMSG
     355    TEST_COMPARE_STRING (strerrordesc_np (EBADMSG), "Bad message");
     356    TEST_COMPARE_STRING (strerrorname_np (EBADMSG), "EBADMSG");
     357  #endif
     358  #ifdef EIDRM
     359    TEST_COMPARE_STRING (strerrordesc_np (EIDRM), "Identifier removed");
     360    TEST_COMPARE_STRING (strerrorname_np (EIDRM), "EIDRM");
     361  #endif
     362  #ifdef EMULTIHOP
     363    TEST_COMPARE_STRING (strerrordesc_np (EMULTIHOP), "Multihop attempted");
     364    TEST_COMPARE_STRING (strerrorname_np (EMULTIHOP), "EMULTIHOP");
     365  #endif
     366  #ifdef ENODATA
     367    TEST_COMPARE_STRING (strerrordesc_np (ENODATA), "No data available");
     368    TEST_COMPARE_STRING (strerrorname_np (ENODATA), "ENODATA");
     369  #endif
     370  #ifdef ENOLINK
     371    TEST_COMPARE_STRING (strerrordesc_np (ENOLINK), "Link has been severed");
     372    TEST_COMPARE_STRING (strerrorname_np (ENOLINK), "ENOLINK");
     373  #endif
     374  #ifdef ENOMSG
     375    TEST_COMPARE_STRING (strerrordesc_np (ENOMSG),
     376  		       "No message of desired type");
     377    TEST_COMPARE_STRING (strerrorname_np (ENOMSG), "ENOMSG");
     378  #endif
     379  #ifdef ENOSR
     380    TEST_COMPARE_STRING (strerrordesc_np (ENOSR), "Out of streams resources");
     381    TEST_COMPARE_STRING (strerrorname_np (ENOSR), "ENOSR");
     382  #endif
     383  #ifdef ENOSTR
     384    TEST_COMPARE_STRING (strerrordesc_np (ENOSTR), "Device not a stream");
     385    TEST_COMPARE_STRING (strerrorname_np (ENOSTR), "ENOSTR");
     386  #endif
     387  #ifdef EOVERFLOW
     388    TEST_COMPARE_STRING (strerrordesc_np (EOVERFLOW),
     389  		       "Value too large for defined data type");
     390    TEST_COMPARE_STRING (strerrorname_np (EOVERFLOW), "EOVERFLOW");
     391  #endif
     392  #ifdef EPROTO
     393    TEST_COMPARE_STRING (strerrordesc_np (EPROTO), "Protocol error");
     394    TEST_COMPARE_STRING (strerrorname_np (EPROTO), "EPROTO");
     395  #endif
     396  #ifdef ETIME
     397    TEST_COMPARE_STRING (strerrordesc_np (ETIME), "Timer expired");
     398    TEST_COMPARE_STRING (strerrorname_np (ETIME), "ETIME");
     399  #endif
     400  #ifdef ECANCELED
     401    TEST_COMPARE_STRING (strerrordesc_np (ECANCELED), "Operation canceled");
     402    TEST_COMPARE_STRING (strerrorname_np (ECANCELED), "ECANCELED");
     403  #endif
     404  #ifdef EOWNERDEAD
     405    TEST_COMPARE_STRING (strerrordesc_np (EOWNERDEAD), "Owner died");
     406    TEST_COMPARE_STRING (strerrorname_np (EOWNERDEAD), "EOWNERDEAD");
     407  #endif
     408  #ifdef ENOTRECOVERABLE
     409    TEST_COMPARE_STRING (strerrordesc_np (ENOTRECOVERABLE),
     410  		       "State not recoverable");
     411    TEST_COMPARE_STRING (strerrorname_np (ENOTRECOVERABLE), "ENOTRECOVERABLE");
     412  #endif
     413  #ifdef ERESTART
     414    TEST_COMPARE_STRING (strerrordesc_np (ERESTART),
     415  		       "Interrupted system call should be restarted");
     416    TEST_COMPARE_STRING (strerrorname_np (ERESTART), "ERESTART");
     417  #endif
     418  #ifdef ECHRNG
     419    TEST_COMPARE_STRING (strerrordesc_np (ECHRNG),
     420  		       "Channel number out of range");
     421    TEST_COMPARE_STRING (strerrorname_np (ECHRNG), "ECHRNG");
     422  #endif
     423  #ifdef EL2NSYNC
     424    TEST_COMPARE_STRING (strerrordesc_np (EL2NSYNC),
     425  		       "Level 2 not synchronized");
     426    TEST_COMPARE_STRING (strerrorname_np (EL2NSYNC), "EL2NSYNC");
     427  #endif
     428  #ifdef EL3HLT
     429    TEST_COMPARE_STRING (strerrordesc_np (EL3HLT), "Level 3 halted");
     430    TEST_COMPARE_STRING (strerrorname_np (EL3HLT), "EL3HLT");
     431  #endif
     432  #ifdef EL3RST
     433    TEST_COMPARE_STRING (strerrordesc_np (EL3RST), "Level 3 reset");
     434    TEST_COMPARE_STRING (strerrorname_np (EL3RST), "EL3RST");
     435  #endif
     436  #ifdef ELNRNG
     437    TEST_COMPARE_STRING (strerrordesc_np (ELNRNG), "Link number out of range");
     438    TEST_COMPARE_STRING (strerrorname_np (ELNRNG), "ELNRNG");
     439  #endif
     440  #ifdef EUNATCH
     441    TEST_COMPARE_STRING (strerrordesc_np (EUNATCH),
     442  		       "Protocol driver not attached");
     443    TEST_COMPARE_STRING (strerrorname_np (EUNATCH), "EUNATCH");
     444  #endif
     445  #ifdef ENOCSI
     446    TEST_COMPARE_STRING (strerrordesc_np (ENOCSI),
     447  		       "No CSI structure available");
     448    TEST_COMPARE_STRING (strerrorname_np (ENOCSI), "ENOCSI");
     449  #endif
     450  #ifdef EL2HLT
     451    TEST_COMPARE_STRING (strerrordesc_np (EL2HLT), "Level 2 halted");
     452    TEST_COMPARE_STRING (strerrorname_np (EL2HLT), "EL2HLT");
     453  #endif
     454  #ifdef EBADE
     455    TEST_COMPARE_STRING (strerrordesc_np (EBADE), "Invalid exchange");
     456    TEST_COMPARE_STRING (strerrorname_np (EBADE), "EBADE");
     457  #endif
     458  #ifdef EBADR
     459    TEST_COMPARE_STRING (strerrordesc_np (EBADR),
     460  		       "Invalid request descriptor");
     461    TEST_COMPARE_STRING (strerrorname_np (EBADR), "EBADR");
     462  #endif
     463  #ifdef EXFULL
     464    TEST_COMPARE_STRING (strerrordesc_np (EXFULL), "Exchange full");
     465    TEST_COMPARE_STRING (strerrorname_np (EXFULL), "EXFULL");
     466  #endif
     467  #ifdef ENOANO
     468    TEST_COMPARE_STRING (strerrordesc_np (ENOANO), "No anode");
     469    TEST_COMPARE_STRING (strerrorname_np (ENOANO), "ENOANO");
     470  #endif
     471  #ifdef EBADRQC
     472    TEST_COMPARE_STRING (strerrordesc_np (EBADRQC), "Invalid request code");
     473    TEST_COMPARE_STRING (strerrorname_np (EBADRQC), "EBADRQC");
     474  #endif
     475  #ifdef EBADSLT
     476    TEST_COMPARE_STRING (strerrordesc_np (EBADSLT), "Invalid slot");
     477    TEST_COMPARE_STRING (strerrorname_np (EBADSLT), "EBADSLT");
     478  #endif
     479  #ifdef EBFONT
     480    TEST_COMPARE_STRING (strerrordesc_np (EBFONT), "Bad font file format");
     481    TEST_COMPARE_STRING (strerrorname_np (EBFONT), "EBFONT");
     482  #endif
     483  #ifdef ENONET
     484    TEST_COMPARE_STRING (strerrordesc_np (ENONET),
     485  		       "Machine is not on the network");
     486    TEST_COMPARE_STRING (strerrorname_np (ENONET), "ENONET");
     487  #endif
     488  #ifdef ENOPKG
     489    TEST_COMPARE_STRING (strerrordesc_np (ENOPKG), "Package not installed");
     490    TEST_COMPARE_STRING (strerrorname_np (ENOPKG), "ENOPKG");
     491  #endif
     492  #ifdef EADV
     493    TEST_COMPARE_STRING (strerrordesc_np (EADV), "Advertise error");
     494    TEST_COMPARE_STRING (strerrorname_np (EADV), "EADV");
     495  #endif
     496  #ifdef ESRMNT
     497    TEST_COMPARE_STRING (strerrordesc_np (ESRMNT), "Srmount error");
     498    TEST_COMPARE_STRING (strerrorname_np (ESRMNT), "ESRMNT");
     499  #endif
     500  #ifdef ECOMM
     501    TEST_COMPARE_STRING (strerrordesc_np (ECOMM),
     502  		       "Communication error on send");
     503    TEST_COMPARE_STRING (strerrorname_np (ECOMM), "ECOMM");
     504  #endif
     505  #ifdef EDOTDOT
     506    TEST_COMPARE_STRING (strerrordesc_np (EDOTDOT), "RFS specific error");
     507    TEST_COMPARE_STRING (strerrorname_np (EDOTDOT), "EDOTDOT");
     508  #endif
     509  #ifdef ENOTUNIQ
     510    TEST_COMPARE_STRING (strerrordesc_np (ENOTUNIQ),
     511  		       "Name not unique on network");
     512    TEST_COMPARE_STRING (strerrorname_np (ENOTUNIQ), "ENOTUNIQ");
     513  #endif
     514  #ifdef EBADFD
     515    TEST_COMPARE_STRING (strerrordesc_np (EBADFD),
     516  		       "File descriptor in bad state");
     517    TEST_COMPARE_STRING (strerrorname_np (EBADFD), "EBADFD");
     518  #endif
     519  #ifdef EREMCHG
     520    TEST_COMPARE_STRING (strerrordesc_np (EREMCHG), "Remote address changed");
     521    TEST_COMPARE_STRING (strerrorname_np (EREMCHG), "EREMCHG");
     522  #endif
     523  #ifdef ELIBACC
     524    TEST_COMPARE_STRING (strerrordesc_np (ELIBACC),
     525  		       "Can not access a needed shared library");
     526    TEST_COMPARE_STRING (strerrorname_np (ELIBACC), "ELIBACC");
     527  #endif
     528  #ifdef ELIBBAD
     529    TEST_COMPARE_STRING (strerrordesc_np (ELIBBAD),
     530  		       "Accessing a corrupted shared library");
     531    TEST_COMPARE_STRING (strerrorname_np (ELIBBAD), "ELIBBAD");
     532  #endif
     533  #ifdef ELIBSCN
     534    TEST_COMPARE_STRING (strerrordesc_np (ELIBSCN),
     535  		       ".lib section in a.out corrupted");
     536    TEST_COMPARE_STRING (strerrorname_np (ELIBSCN), "ELIBSCN");
     537  #endif
     538  #ifdef ELIBMAX
     539    TEST_COMPARE_STRING (strerrordesc_np (ELIBMAX),
     540  		       "Attempting to link in too many shared libraries");
     541    TEST_COMPARE_STRING (strerrorname_np (ELIBMAX), "ELIBMAX");
     542  #endif
     543  #ifdef ELIBEXEC
     544    TEST_COMPARE_STRING (strerrordesc_np (ELIBEXEC),
     545  		       "Cannot exec a shared library directly");
     546    TEST_COMPARE_STRING (strerrorname_np (ELIBEXEC), "ELIBEXEC");
     547  #endif
     548  #ifdef ESTRPIPE
     549    TEST_COMPARE_STRING (strerrordesc_np (ESTRPIPE), "Streams pipe error");
     550    TEST_COMPARE_STRING (strerrorname_np (ESTRPIPE), "ESTRPIPE");
     551  #endif
     552  #ifdef EUCLEAN
     553    TEST_COMPARE_STRING (strerrordesc_np (EUCLEAN),
     554  		       "Structure needs cleaning");
     555    TEST_COMPARE_STRING (strerrorname_np (EUCLEAN), "EUCLEAN");
     556  #endif
     557  #ifdef ENOTNAM
     558    TEST_COMPARE_STRING (strerrordesc_np (ENOTNAM),
     559  		       "Not a XENIX named type file");
     560    TEST_COMPARE_STRING (strerrorname_np (ENOTNAM), "ENOTNAM");
     561  #endif
     562  #ifdef ENAVAIL
     563    TEST_COMPARE_STRING (strerrordesc_np (ENAVAIL),
     564  		       "No XENIX semaphores available");
     565    TEST_COMPARE_STRING (strerrorname_np (ENAVAIL), "ENAVAIL");
     566  #endif
     567  #ifdef EISNAM
     568    TEST_COMPARE_STRING (strerrordesc_np (EISNAM), "Is a named type file");
     569    TEST_COMPARE_STRING (strerrorname_np (EISNAM), "EISNAM");
     570  #endif
     571  #ifdef EREMOTEIO
     572    TEST_COMPARE_STRING (strerrordesc_np (EREMOTEIO), "Remote I/O error");
     573    TEST_COMPARE_STRING (strerrorname_np (EREMOTEIO), "EREMOTEIO");
     574  #endif
     575  #ifdef ENOMEDIUM
     576    TEST_COMPARE_STRING (strerrordesc_np (ENOMEDIUM), "No medium found");
     577    TEST_COMPARE_STRING (strerrorname_np (ENOMEDIUM), "ENOMEDIUM");
     578  #endif
     579  #ifdef EMEDIUMTYPE
     580    TEST_COMPARE_STRING (strerrordesc_np (EMEDIUMTYPE), "Wrong medium type");
     581    TEST_COMPARE_STRING (strerrorname_np (EMEDIUMTYPE), "EMEDIUMTYPE");
     582  #endif
     583  #ifdef ENOKEY
     584    TEST_COMPARE_STRING (strerrordesc_np (ENOKEY),
     585  		       "Required key not available");
     586    TEST_COMPARE_STRING (strerrorname_np (ENOKEY), "ENOKEY");
     587  #endif
     588  #ifdef EKEYEXPIRED
     589    TEST_COMPARE_STRING (strerrordesc_np (EKEYEXPIRED), "Key has expired");
     590    TEST_COMPARE_STRING (strerrorname_np (EKEYEXPIRED), "EKEYEXPIRED");
     591  #endif
     592  #ifdef EKEYREVOKED
     593    TEST_COMPARE_STRING (strerrordesc_np (EKEYREVOKED),
     594  		       "Key has been revoked");
     595    TEST_COMPARE_STRING (strerrorname_np (EKEYREVOKED), "EKEYREVOKED");
     596  #endif
     597  #ifdef EKEYREJECTED
     598    TEST_COMPARE_STRING (strerrordesc_np (EKEYREJECTED),
     599  		       "Key was rejected by service");
     600    TEST_COMPARE_STRING (strerrorname_np (EKEYREJECTED), "EKEYREJECTED");
     601  #endif
     602  #ifdef ERFKILL
     603    TEST_COMPARE_STRING (strerrordesc_np (ERFKILL),
     604  		       "Operation not possible due to RF-kill");
     605    TEST_COMPARE_STRING (strerrorname_np (ERFKILL), "ERFKILL");
     606  #endif
     607  #ifdef EHWPOISON
     608    TEST_COMPARE_STRING (strerrordesc_np (EHWPOISON),
     609  		       "Memory page has hardware error");
     610    TEST_COMPARE_STRING (strerrorname_np (EHWPOISON), "EHWPOISON");
     611  #endif
     612  #ifdef EBADRPC
     613    TEST_COMPARE_STRING (strerrordesc_np (EBADRPC), "RPC struct is bad");
     614    TEST_COMPARE_STRING (strerrorname_np (EBADRPC), "EBADRPC");
     615  #endif
     616  #ifdef EFTYPE
     617    TEST_COMPARE_STRING (strerrordesc_np (EFTYPE),
     618  		       "Inappropriate file type or format");
     619    TEST_COMPARE_STRING (strerrorname_np (EFTYPE), "EFTYPE");
     620  #endif
     621  #ifdef EPROCUNAVAIL
     622    TEST_COMPARE_STRING (strerrordesc_np (EPROCUNAVAIL),
     623  		       "RPC bad procedure for program");
     624    TEST_COMPARE_STRING (strerrorname_np (EPROCUNAVAIL), "EPROCUNAVAIL");
     625  #endif
     626  #ifdef EAUTH
     627    TEST_COMPARE_STRING (strerrordesc_np (EAUTH), "Authentication error");
     628    TEST_COMPARE_STRING (strerrorname_np (EAUTH), "EAUTH");
     629  #endif
     630  #ifdef EDIED
     631    TEST_COMPARE_STRING (strerrordesc_np (EDIED), "Translator died");
     632    TEST_COMPARE_STRING (strerrorname_np (EDIED), "EDIED");
     633  #endif
     634  #ifdef ERPCMISMATCH
     635    TEST_COMPARE_STRING (strerrordesc_np (ERPCMISMATCH), "RPC version wrong");
     636    TEST_COMPARE_STRING (strerrorname_np (ERPCMISMATCH), "ERPCMISMATCH");
     637  #endif
     638  #ifdef EGREGIOUS
     639    TEST_COMPARE_STRING (strerrordesc_np (EGREGIOUS),
     640  		       "You really blew it this time");
     641    TEST_COMPARE_STRING (strerrorname_np (EGREGIOUS), "EGREGIOUS");
     642  #endif
     643  #ifdef EPROCLIM
     644    TEST_COMPARE_STRING (strerrordesc_np (EPROCLIM), "Too many processes");
     645    TEST_COMPARE_STRING (strerrorname_np (EPROCLIM), "EPROCLIM");
     646  #endif
     647  #ifdef EGRATUITOUS
     648    TEST_COMPARE_STRING (strerrordesc_np (EGRATUITOUS), "Gratuitous error");
     649    TEST_COMPARE_STRING (strerrorname_np (EGRATUITOUS), "EGRATUITOUS");
     650  #endif
     651  #if defined (ENOTSUP) && ENOTSUP != EOPNOTSUPP
     652    TEST_COMPARE_STRING (strerrordesc_np (ENOTSUP), "Not supported");
     653    TEST_COMPARE_STRING (strerrorname_np (ENOTSUP), "ENOTSUP");
     654  #endif
     655  #ifdef EPROGMISMATCH
     656    TEST_COMPARE_STRING (strerrordesc_np (EPROGMISMATCH),
     657  		       "RPC program version wrong");
     658    TEST_COMPARE_STRING (strerrorname_np (EPROGMISMATCH), "EPROGMISMATCH");
     659  #endif
     660  #ifdef EBACKGROUND
     661    TEST_COMPARE_STRING (strerrordesc_np (EBACKGROUND),
     662  		       "Inappropriate operation for background process");
     663    TEST_COMPARE_STRING (strerrorname_np (EBACKGROUND), "EBACKGROUND");
     664  #endif
     665  #ifdef EIEIO
     666    TEST_COMPARE_STRING (strerrordesc_np (EIEIO), "Computer bought the farm");
     667    TEST_COMPARE_STRING (strerrorname_np (EIEIO), "EIEIO");
     668  #endif
     669  #if defined (EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
     670    TEST_COMPARE_STRING (strerrordesc_np (EWOULDBLOCK),
     671  		       "Operation would block");
     672    TEST_COMPARE_STRING (strerrorname_np (EWOULDBLOCK), "EWOULDBLOCK");
     673  #endif
     674  #ifdef ENEEDAUTH
     675    TEST_COMPARE_STRING (strerrordesc_np (ENEEDAUTH), "Need authenticator");
     676    TEST_COMPARE_STRING (strerrorname_np (ENEEDAUTH), "ENEEDAUTH");
     677  #endif
     678  #ifdef ED
     679    TEST_COMPARE_STRING (strerrordesc_np (ED), "?");
     680    TEST_COMPARE_STRING (strerrorname_np (ED), "ED");
     681  #endif
     682  #ifdef EPROGUNAVAIL
     683    TEST_COMPARE_STRING (strerrordesc_np (EPROGUNAVAIL),
     684  		       "RPC program not available");
     685    TEST_COMPARE_STRING (strerrorname_np (EPROGUNAVAIL), "EPROGUNAVAIL");
     686  #endif
     687  
     688    return 0;
     689  }
     690  
     691  #include <support/test-driver.c>