From 5c40bd9a6cf398d2e031d37b77e670b2babf9020 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 25 Mar 2023 20:00:58 +0000 Subject: Experimental fix for [fa128568a5]: EOVERFLOW does not necessarily mean "file too big" Let's synchronize the POSIX error-messages with what Linux gives nowadays. --- doc/SetErrno.3 | 2 +- doc/package.n | 2 +- doc/safe.n | 2 +- doc/tclvars.n | 2 +- generic/tclCmdAH.c | 2 +- generic/tclFCmd.c | 6 +- generic/tclIOCmd.c | 2 +- generic/tclInterp.c | 8 +- generic/tclPosixStr.c | 276 +++++++++++++++++++++++++------------------------- generic/tclResult.c | 2 +- generic/tclZipfs.c | 2 +- library/http/http.tcl | 8 +- library/init.tcl | 4 +- library/safe.tcl | 22 ++-- tests/chanio.test | 16 +-- tests/cmdAH.test | 42 ++++---- tests/cmdMZ.test | 2 +- tests/event.test | 4 +- tests/exec.test | 32 +++--- tests/fCmd.test | 78 +++++++------- tests/fileName.test | 4 +- tests/fileSystem.test | 36 +++---- tests/http.test | 2 +- tests/interp.test | 20 ++-- tests/io.test | 36 +++---- tests/ioCmd.test | 22 ++-- tests/load.test | 8 +- tests/macOSXFCmd.test | 4 +- tests/result.test | 2 +- tests/safe-stock.test | 2 +- tests/safe.test | 28 ++--- tests/socket.test | 24 ++--- tests/source.test | 4 +- tests/unixFCmd.test | 24 ++--- tests/winFCmd.test | 10 +- unix/tclUnixInit.c | 2 +- win/tclWinFCmd.c | 2 +- 37 files changed, 374 insertions(+), 370 deletions(-) diff --git a/doc/SetErrno.3 b/doc/SetErrno.3 index c202e2e..3cc0dbc 100644 --- a/doc/SetErrno.3 +++ b/doc/SetErrno.3 @@ -55,7 +55,7 @@ returns a machine-readable textual identifier such as .QW EACCES that corresponds to the current value of \fBerrno\fR. \fBTcl_ErrnoMsg\fR returns a human-readable string such as -.QW "permission denied" +.QW "Permission denied" that corresponds to the value of its \fIerrorCode\fR argument. The \fIerrorCode\fR argument is typically the value returned by \fBTcl_GetErrno\fR. diff --git a/doc/package.n b/doc/package.n index 5687480..820938c 100644 --- a/doc/package.n +++ b/doc/package.n @@ -286,7 +286,7 @@ then the attempt to set it back to is ineffective and the mode value remains .QW latest . .PP -When passed any other value as an argument, raise an invalid argument +When passed any other value as an argument, raise an Invalid argument error. .PP When an interpreter is created, its initial selection mode value is set to diff --git a/doc/safe.n b/doc/safe.n index 6e0d948..86f58bc 100644 --- a/doc/safe.n +++ b/doc/safe.n @@ -191,7 +191,7 @@ the file was not found: NOTICE for child interp10 : Created NOTICE for child interp10 : Setting accessPath=(/foo/bar) staticsok=1 nestedok=0 deletehook=() NOTICE for child interp10 : auto_path in interp10 has been set to {$p(:0:)} -ERROR for child interp10 : /foo/bar/init.tcl: no such file or directory +ERROR for child interp10 : /foo/bar/init.tcl: No such file or directory .CE .RE .SS OPTIONS diff --git a/doc/tclvars.n b/doc/tclvars.n index 4d1413c..6e41405 100644 --- a/doc/tclvars.n +++ b/doc/tclvars.n @@ -197,7 +197,7 @@ of the error that occurred, such as \fBENOENT\fR; this will be one of the values defined in the include file errno.h. The \fImsg\fR element will be a human-readable message corresponding to \fIerrName\fR, such as -.QW "no such file or directory" +.QW "No such file or directory" for the \fBENOENT\fR case. .TP \fBTCL\fR ... diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 5c27bbc..f2d8904 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -2201,7 +2201,7 @@ PathSplitCmd( res = Tcl_FSSplitPath(objv[1], (int *)NULL); if (res == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "could not read \"%s\": no such file or directory", + "could not read \"%s\": No such file or directory", TclGetString(objv[1]))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PATHSPLIT", "NONESUCH", NULL); diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index ea8f715..daddbf2 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -1225,8 +1225,8 @@ TclFileLinkCmd( if (errno == EEXIST) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "could not create new link \"%s\": that path already" - " exists", TclGetString(objv[index]))); + "could not create new link \"%s\": File exists", + TclGetString(objv[index]))); Tcl_PosixError(interp); } else if (errno == ENOENT) { /* @@ -1245,7 +1245,7 @@ TclFileLinkCmd( Tcl_DecrRefCount(dirPtr); if (access != 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "could not create new link \"%s\": no such file" + "could not create new link \"%s\": No such file" " or directory", TclGetString(objv[index]))); Tcl_PosixError(interp); } else { diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index e8a534f..1c9909c 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -442,7 +442,7 @@ Tcl_ReadObjCmd( if (strcmp(TclGetString(objv[i]), "nonewline") != 0) { #endif Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "expected non-negative integer but got \"%s\"", + "Expected non-negative integer but got \"%s\"", TclGetString(objv[i]))); Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", NULL); return TCL_ERROR; diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 70cf8fa..302ac17 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -2950,7 +2950,7 @@ ChildExpose( if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "permission denied: safe interpreter cannot expose commands", + "Permission denied: safe interpreter cannot expose commands", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", NULL); @@ -2995,7 +2995,7 @@ ChildRecursionLimit( if (objc) { if (Tcl_IsSafe(interp)) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("permission denied: " + Tcl_SetObjResult(interp, Tcl_NewStringObj("Permission denied: " "safe interpreters cannot change recursion limit", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", NULL); @@ -3056,7 +3056,7 @@ ChildHide( if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "permission denied: safe interpreter cannot hide commands", + "Permission denied: safe interpreter cannot hide commands", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", NULL); @@ -3218,7 +3218,7 @@ ChildMarkTrusted( { if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "permission denied: safe interpreter cannot mark trusted", + "Permission denied: safe interpreter cannot mark trusted", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", NULL); diff --git a/generic/tclPosixStr.c b/generic/tclPosixStr.c index ecdf652..c4647d9 100644 --- a/generic/tclPosixStr.c +++ b/generic/tclPosixStr.c @@ -496,447 +496,451 @@ const char * Tcl_ErrnoMsg( int err) /* Error number (such as in errno variable). */ { +#ifndef _WIN32 + return strerror(err); +#else switch (err) { #if defined(E2BIG) && (!defined(EOVERFLOW) || (E2BIG != EOVERFLOW)) - case E2BIG: return "argument list too long"; + case E2BIG: return "Argument list too long"; #endif #ifdef EACCES - case EACCES: return "permission denied"; + case EACCES: return "Permission denied"; #endif #ifdef EADDRINUSE - case EADDRINUSE: return "address already in use"; + case EADDRINUSE: return "Address in use"; #endif #ifdef EADDRNOTAVAIL - case EADDRNOTAVAIL: return "cannot assign requested address"; + case EADDRNOTAVAIL: return "Address not available"; #endif #ifdef EADV - case EADV: return "advertise error"; + case EADV: return "Advertise error"; #endif #ifdef EAFNOSUPPORT - case EAFNOSUPPORT: return "address family not supported by protocol"; + case EAFNOSUPPORT: return "Address family not supported"; #endif #ifdef EAGAIN - case EAGAIN: return "resource temporarily unavailable"; + case EAGAIN: return "Resource unavailable, try again"; #endif #ifdef EALIGN case EALIGN: return "EALIGN"; #endif #if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY)) - case EALREADY: return "operation already in progress"; + case EALREADY: return "Connection already in progress"; #endif #ifdef EBADE - case EBADE: return "bad exchange descriptor"; + case EBADE: return "Bad exchange descriptor"; #endif #ifdef EBADF - case EBADF: return "bad file number"; + case EBADF: return "Bad file descriptor"; #endif #ifdef EBADFD - case EBADFD: return "file descriptor in bad state"; + case EBADFD: return "File descriptor in bad state"; #endif #ifdef EBADMSG - case EBADMSG: return "not a data message"; -#endif -#ifdef ECANCELED - case ECANCELED: return "operation canceled"; + case EBADMSG: return "Bad message"; #endif #ifdef EBADR - case EBADR: return "bad request descriptor"; + case EBADR: return "Bad request descriptor"; #endif #ifdef EBADRPC case EBADRPC: return "RPC structure is bad"; #endif #ifdef EBADRQC - case EBADRQC: return "bad request code"; + case EBADRQC: return "Bad request code"; #endif #ifdef EBADSLT - case EBADSLT: return "invalid slot"; + case EBADSLT: return "Invalid slot"; #endif #ifdef EBFONT - case EBFONT: return "bad font file format"; + case EBFONT: return "Bad font file format"; #endif #ifdef EBUSY - case EBUSY: return "file busy"; + case EBUSY: return "Device or resource busy"; +#endif +#ifdef ECANCELED + case ECANCELED: return "Operation canceled"; #endif #ifdef ECHILD - case ECHILD: return "no children"; + case ECHILD: return "No child processes"; #endif #ifdef ECHRNG - case ECHRNG: return "channel number out of range"; + case ECHRNG: return "Channel number out of range"; #endif #ifdef ECOMM - case ECOMM: return "communication error on send"; + case ECOMM: return "Communication error on send"; #endif #ifdef ECONNABORTED - case ECONNABORTED: return "software caused connection abort"; + case ECONNABORTED: return "Connection aborted"; #endif #ifdef ECONNREFUSED - case ECONNREFUSED: return "connection refused"; + case ECONNREFUSED: return "Connection refused"; #endif #ifdef ECONNRESET - case ECONNRESET: return "connection reset by peer"; + case ECONNRESET: return "Connection reset"; #endif #if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK)) - case EDEADLK: return "resource deadlock avoided"; + case EDEADLK: return "Resource deadlock would occur"; #endif #if defined(EDEADLOCK) && (!defined(EDEADLK) || (EDEADLOCK != EDEADLK)) - case EDEADLOCK: return "resource deadlock avoided"; + case EDEADLOCK: return "Resource deadlock would occur"; #endif #ifdef EDESTADDRREQ - case EDESTADDRREQ: return "destination address required"; + case EDESTADDRREQ: return "Destination address required"; #endif #ifdef EDIRTY - case EDIRTY: return "mounting a dirty fs w/o force"; + case EDIRTY: return "Mounting a dirty fs w/o force"; #endif #ifdef EDOM - case EDOM: return "math argument out of range"; + case EDOM: return "Mathematics argument out of domain of function"; #endif #ifdef EDOTDOT - case EDOTDOT: return "cross mount point"; + case EDOTDOT: return "Cross mount point"; #endif #ifdef EDQUOT - case EDQUOT: return "disk quota exceeded"; + case EDQUOT: return "Disk quota exceeded"; #endif #ifdef EDUPPKG - case EDUPPKG: return "duplicate package name"; + case EDUPPKG: return "Duplicate package name"; #endif #ifdef EEXIST - case EEXIST: return "file already exists"; + case EEXIST: return "File exists"; #endif #ifdef EFAULT - case EFAULT: return "bad address in system call argument"; + case EFAULT: return "Bad address"; #endif #ifdef EFBIG - case EFBIG: return "file too large"; + case EFBIG: return "File too large"; #endif #ifdef EHOSTDOWN - case EHOSTDOWN: return "host is down"; + case EHOSTDOWN: return "Host is down"; #endif #ifdef EHOSTUNREACH - case EHOSTUNREACH: return "host is unreachable"; + case EHOSTUNREACH: return "Host is unreachable"; #endif #if defined(EIDRM) && (!defined(EINPROGRESS) || (EIDRM != EINPROGRESS)) - case EIDRM: return "identifier removed"; + case EIDRM: return "Identifier removed"; #endif #ifdef EINIT - case EINIT: return "initialization error"; + case EINIT: return "Initialization error"; #endif #ifdef EILSEQ - case EILSEQ: return "illegal byte sequence"; + case EILSEQ: return "Invalid or incomplete multibyte or wide character"; #endif #ifdef EINPROGRESS - case EINPROGRESS: return "operation now in progress"; + case EINPROGRESS: return "Operation in progress"; #endif #ifdef EINTR - case EINTR: return "interrupted system call"; + case EINTR: return "Interrupted function"; #endif #ifdef EINVAL - case EINVAL: return "invalid argument"; + case EINVAL: return "Invalid argument"; #endif #ifdef EIO case EIO: return "I/O error"; #endif #ifdef EISCONN - case EISCONN: return "socket is already connected"; + case EISCONN: return "Socket is connected"; #endif #ifdef EISDIR - case EISDIR: return "illegal operation on a directory"; + case EISDIR: return "Is a directory"; #endif #ifdef EISNAME - case EISNAM: return "is a name file"; + case EISNAM: return "Is a name file"; #endif #ifdef ELBIN case ELBIN: return "ELBIN"; #endif #ifdef EL2HLT - case EL2HLT: return "level 2 halted"; + case EL2HLT: return "Level 2 halted"; #endif #ifdef EL2NSYNC - case EL2NSYNC: return "level 2 not synchronized"; + case EL2NSYNC: return "Level 2 not synchronized"; #endif #ifdef EL3HLT - case EL3HLT: return "level 3 halted"; + case EL3HLT: return "Level 3 halted"; #endif #ifdef EL3RST - case EL3RST: return "level 3 reset"; + case EL3RST: return "Level 3 reset"; #endif #ifdef ELIBACC - case ELIBACC: return "cannot access a needed shared library"; + case ELIBACC: return "Cannot access a needed shared library"; #endif #ifdef ELIBBAD - case ELIBBAD: return "accessing a corrupted shared library"; + case ELIBBAD: return "Accessing a corrupted shared library"; #endif #ifdef ELIBEXEC - case ELIBEXEC: return "cannot exec a shared library directly"; + case ELIBEXEC: return "Cannot exec a shared library directly"; #endif #if defined(ELIBMAX) && (!defined(ECANCELED) || (ELIBMAX != ECANCELED)) case ELIBMAX: return - "attempting to link in more shared libraries than system limit"; + "Attempting to link in more shared libraries than system limit"; #endif #ifdef ELIBSCN case ELIBSCN: return ".lib section in a.out corrupted"; #endif #ifdef ELNRNG - case ELNRNG: return "link number out of range"; + case ELNRNG: return "Link number out of range"; #endif #if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT)) - case ELOOP: return "too many levels of symbolic links"; + case ELOOP: return "Too many levels of symbolic links"; #endif #ifdef EMFILE - case EMFILE: return "too many open files"; + case EMFILE: return "File descriptor value too large"; #endif #ifdef EMLINK - case EMLINK: return "too many links"; + case EMLINK: return "Too many links"; #endif #ifdef EMSGSIZE - case EMSGSIZE: return "message too long"; + case EMSGSIZE: return "Message too large"; #endif #ifdef EMULTIHOP - case EMULTIHOP: return "multihop attempted"; + case EMULTIHOP: return "Multihop attempted"; #endif #ifdef ENAMETOOLONG - case ENAMETOOLONG: return "file name too long"; + case ENAMETOOLONG: return "Filename too long"; #endif #ifdef ENAVAIL - case ENAVAIL: return "not available"; + case ENAVAIL: return "Not available"; #endif #ifdef ENET case ENET: return "ENET"; #endif #ifdef ENETDOWN - case ENETDOWN: return "network is down"; + case ENETDOWN: return "Network is down"; #endif #ifdef ENETRESET - case ENETRESET: return "network dropped connection on reset"; + case ENETRESET: return "Network dropped connection on reset"; #endif #ifdef ENETUNREACH - case ENETUNREACH: return "network is unreachable"; + case ENETUNREACH: return "Network is unreachable"; #endif #ifdef ENFILE - case ENFILE: return "file table overflow"; + case ENFILE: return "Too many files open in system"; #endif #ifdef ENOANO - case ENOANO: return "anode table overflow"; + case ENOANO: return "Anode table overflow"; #endif #if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR)) - case ENOBUFS: return "no buffer space available"; + case ENOBUFS: return "No buffer space available"; #endif #ifdef ENOCSI - case ENOCSI: return "no CSI structure available"; + case ENOCSI: return "No CSI structure available"; #endif #if defined(ENODATA) && (!defined(ECONNREFUSED) || (ENODATA != ECONNREFUSED)) - case ENODATA: return "no data available"; + case ENODATA: return "No data available"; #endif #ifdef ENODEV - case ENODEV: return "no such device"; + case ENODEV: return "No such device"; #endif #ifdef ENOENT - case ENOENT: return "no such file or directory"; + case ENOENT: return "No such file or directory"; #endif #ifdef ENOEXEC - case ENOEXEC: return "exec format error"; + case ENOEXEC: return "Executable format error"; #endif #ifdef ENOLCK - case ENOLCK: return "no locks available"; + case ENOLCK: return "No locks available"; #endif #ifdef ENOLINK - case ENOLINK: return "link has been severed"; + case ENOLINK: return "Link has been severed"; #endif #ifdef ENOMEM - case ENOMEM: return "not enough memory"; + case ENOMEM: return "Not enough space"; #endif #ifdef ENOMSG - case ENOMSG: return "no message of desired type"; + case ENOMSG: return "No message of desired type"; #endif #ifdef ENONET - case ENONET: return "machine is not on the network"; + case ENONET: return "Machine is not on the network"; #endif #ifdef ENOPKG - case ENOPKG: return "package not installed"; + case ENOPKG: return "Package not installed"; #endif #ifdef ENOPROTOOPT - case ENOPROTOOPT: return "bad protocol option"; + case ENOPROTOOPT: return "Protocol not available"; #endif #ifdef ENOSPC - case ENOSPC: return "no space left on device"; + case ENOSPC: return "No space left on device"; #endif #if defined(ENOSR) && (!defined(ENAMETOOLONG) || (ENAMETOOLONG != ENOSR)) - case ENOSR: return "out of stream resources"; + case ENOSR: return "No stream resources"; #endif #if defined(ENOSTR) && (!defined(ENOTTY) || (ENOTTY != ENOSTR)) - case ENOSTR: return "not a stream device"; + case ENOSTR: return "Not a stream"; #endif #ifdef ENOSYM - case ENOSYM: return "unresolved symbol name"; + case ENOSYM: return "Unresolved symbol name"; #endif #ifdef ENOSYS - case ENOSYS: return "function not implemented"; + case ENOSYS: return "Functionality not supported"; #endif #ifdef ENOTBLK - case ENOTBLK: return "block device required"; + case ENOTBLK: return "Block device required"; #endif #ifdef ENOTCONN - case ENOTCONN: return "socket is not connected"; + case ENOTCONN: return "Transport endpoint is not connected"; #endif #ifdef ENOTRECOVERABLE - case ENOTRECOVERABLE: return "state not recoverable"; + case ENOTRECOVERABLE: return "State not recoverable"; #endif #ifdef ENOTDIR - case ENOTDIR: return "not a directory"; + case ENOTDIR: return "Not a directory or a symbolic link to a directory"; #endif #if defined(ENOTEMPTY) && (!defined(EEXIST) || (ENOTEMPTY != EEXIST)) - case ENOTEMPTY: return "directory not empty"; + case ENOTEMPTY: return "Directory not empty"; #endif #ifdef ENOTNAM - case ENOTNAM: return "not a name file"; + case ENOTNAM: return "Not a name file"; #endif #ifdef ENOTSOCK - case ENOTSOCK: return "socket operation on non-socket"; + case ENOTSOCK: return "Not a socket"; #endif #ifdef ENOTSUP - case ENOTSUP: return "operation not supported"; + case ENOTSUP: return "Not supported"; #endif #ifdef ENOTTY - case ENOTTY: return "inappropriate device for ioctl"; + case ENOTTY: return "Inappropriate I/O control operation"; #endif #ifdef ENOTUNIQ - case ENOTUNIQ: return "name not unique on network"; + case ENOTUNIQ: return "Name not unique on network"; #endif #ifdef ENXIO - case ENXIO: return "no such device or address"; + case ENXIO: return "No such device or address"; #endif #if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP)) - case EOPNOTSUPP: return "operation not supported on socket"; + case EOPNOTSUPP: return "Operation not supported on socket"; #endif #ifdef EOTHER - case EOTHER: return "other error"; + case EOTHER: return "Other error"; #endif #if defined(EOVERFLOW) && (!defined(EFBIG) || (EOVERFLOW != EFBIG)) && (!defined(EINVAL) || (EOVERFLOW != EINVAL)) - case EOVERFLOW: return "file too big"; + case EOVERFLOW: return "Value too large to be stored in data type"; #endif #ifdef EOWNERDEAD - case EOWNERDEAD: return "owner died"; + case EOWNERDEAD: return "Previous owner died"; #endif #ifdef EPERM - case EPERM: return "not owner"; + case EPERM: return "Operation not permitted"; #endif #if defined(EPFNOSUPPORT) && (!defined(ENOLCK) || (ENOLCK != EPFNOSUPPORT)) - case EPFNOSUPPORT: return "protocol family not supported"; + case EPFNOSUPPORT: return "Protocol family not supported"; #endif #ifdef EPIPE - case EPIPE: return "broken pipe"; + case EPIPE: return "Broken pipe"; #endif #ifdef EPROCLIM - case EPROCLIM: return "too many processes"; + case EPROCLIM: return "Too many processes"; #endif #ifdef EPROCUNAVAIL - case EPROCUNAVAIL: return "bad procedure for program"; + case EPROCUNAVAIL: return "Bad procedure for program"; #endif #ifdef EPROGMISMATCH - case EPROGMISMATCH: return "program version wrong"; + case EPROGMISMATCH: return "Program version wrong"; #endif #ifdef EPROGUNAVAIL case EPROGUNAVAIL: return "RPC program not available"; #endif #ifdef EPROTO - case EPROTO: return "protocol error"; + case EPROTO: return "Protocol error"; #endif #ifdef EPROTONOSUPPORT - case EPROTONOSUPPORT: return "protocol not supported"; + case EPROTONOSUPPORT: return "Protocol not supported"; #endif #ifdef EPROTOTYPE - case EPROTOTYPE: return "protocol wrong type for socket"; + case EPROTOTYPE: return "Protocol wrong type for socket"; #endif #ifdef ERANGE - case ERANGE: return "math result unrepresentable"; + case ERANGE: return "Result too large"; #endif #if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED)) case EREFUSED: return "EREFUSED"; #endif #ifdef EREMCHG - case EREMCHG: return "remote address changed"; + case EREMCHG: return "Remote address changed"; #endif #ifdef EREMDEV - case EREMDEV: return "remote device"; + case EREMDEV: return "Remote device"; #endif #ifdef EREMOTE - case EREMOTE: return "pathname hit remote file system"; + case EREMOTE: return "Pathname hit remote file system"; #endif #ifdef EREMOTEIO - case EREMOTEIO: return "remote i/o error"; + case EREMOTEIO: return "Remote i/o error"; #endif #ifdef EREMOTERELEASE case EREMOTERELEASE: return "EREMOTERELEASE"; #endif #ifdef EROFS - case EROFS: return "read-only file system"; + case EROFS: return "Read-only file system"; #endif #ifdef ERPCMISMATCH case ERPCMISMATCH: return "RPC version is wrong"; #endif #ifdef ERREMOTE - case ERREMOTE: return "object is remote"; + case ERREMOTE: return "Object is remote"; #endif #ifdef ESHUTDOWN - case ESHUTDOWN: return "cannot send after socket shutdown"; + case ESHUTDOWN: return "Cannot send after socket shutdown"; #endif #ifdef ESOCKTNOSUPPORT - case ESOCKTNOSUPPORT: return "socket type not supported"; + case ESOCKTNOSUPPORT: return "Socket type not supported"; #endif #ifdef ESPIPE - case ESPIPE: return "invalid seek"; + case ESPIPE: return "Invalid seek"; #endif #ifdef ESRCH - case ESRCH: return "no such process"; + case ESRCH: return "No such process"; #endif #ifdef ESRMNT - case ESRMNT: return "srmount error"; + case ESRMNT: return "Srmount error"; #endif #ifdef ESTALE - case ESTALE: return "stale remote file handle"; + case ESTALE: return "Stale remote file handle"; #endif #ifdef ESUCCESS case ESUCCESS: return "Error 0"; #endif #if defined(ETIME) && (!defined(ELOOP) || (ETIME != ELOOP)) - case ETIME: return "timer expired"; + case ETIME: return "Timer expired"; #endif #if defined(ETIMEDOUT) && (!defined(ENOSTR) || (ETIMEDOUT != ENOSTR)) - case ETIMEDOUT: return "connection timed out"; + case ETIMEDOUT: return "Connection timed out"; #endif #ifdef ETOOMANYREFS - case ETOOMANYREFS: return "too many references: cannot splice"; + case ETOOMANYREFS: return "Too many references: cannot splice"; #endif #ifdef ETXTBSY - case ETXTBSY: return "text file or pseudo-device busy"; + case ETXTBSY: return "Text file busy"; #endif #ifdef EUCLEAN - case EUCLEAN: return "structure needs cleaning"; + case EUCLEAN: return "Structure needs cleaning"; #endif #ifdef EUNATCH - case EUNATCH: return "protocol driver not attached"; + case EUNATCH: return "Protocol driver not attached"; #endif #ifdef EUSERS - case EUSERS: return "too many users"; + case EUSERS: return "Too many users"; #endif #ifdef EVERSION - case EVERSION: return "version mismatch"; + case EVERSION: return "Version mismatch"; #endif #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN)) - case EWOULDBLOCK: return "operation would block"; + case EWOULDBLOCK: return "Operation would block"; #endif #ifdef EXDEV - case EXDEV: return "cross-domain link"; + case EXDEV: return "Cross-domain link"; #endif #ifdef EXFULL - case EXFULL: return "message tables full"; + case EXFULL: return "Message tables full"; #endif default: #ifdef NO_STRERROR - return "unknown POSIX error"; + return "Unknown POSIX error"; #else return strerror(err); #endif } +#endif } /* diff --git a/generic/tclResult.c b/generic/tclResult.c index 7e108e9..620c939 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -1474,7 +1474,7 @@ TclMergeReturnOptions( */ Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "bad -level value: expected non-negative integer but got" + "bad -level value: Expected non-negative integer but got" " \"%s\"", TclGetString(valuePtr))); Tcl_SetErrorCode(interp, "TCL", "RESULT", "ILLEGAL_LEVEL", NULL); goto error; diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 1b602ea..014d95e 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -2569,7 +2569,7 @@ ZipAddFile( Tcl_DStringFree(&zpathDs); #ifdef _WIN32 /* hopefully a directory */ - if (strcmp("permission denied", Tcl_PosixError(interp)) == 0) { + if (strcmp("Permission denied", Tcl_PosixError(interp)) == 0) { Tcl_Close(interp, in); return TCL_OK; } diff --git a/library/http/http.tcl b/library/http/http.tcl index 79f876a..d744433 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -1773,7 +1773,7 @@ proc http::OpenSocket {token DoLater} { set socketPlayCmd($state(socketinfo)) [list ReplayIfClose Wready {} $socketPhQueue($sockOld)] set socketPhQueue($sockOld) {} } - if {[string range $result 0 20] eq {proxy connect failed:}} { + if {[string range $result 0 20] eq {Proxy connect failed:}} { # - The HTTPS proxy did not create a socket. The pre-existing value # (a "placeholder socket") is unchanged. # - The proxy returned a valid HTTP response to the failed CONNECT @@ -1786,7 +1786,7 @@ proc http::OpenSocket {token DoLater} { Finish $token $result # Because socket creation failed, the placeholder "socket" must be # "closed" and (if persistent) removed from the persistent sockets - # table. In the {proxy connect failed:} case Finish does this because + # table. In the {Proxy connect failed:} case Finish does this because # the value of ${token}(connection) is "close". In the other cases here, # it does so because $result is non-empty. } @@ -3392,7 +3392,7 @@ proc http::Connect {token proto phost srvurl} { # If any other requests are in flight or pipelined/queued, they will # be discarded. } - Finish $token "connect failed $err" + Finish $token "Connect failed: $err" return } @@ -5135,7 +5135,7 @@ proc http::SecureProxyConnect {args} { } } set state(connection) close - set msg "proxy connect failed: $code" + set msg "Proxy connect failed: $code" # - This error message will be detected by http::OpenSocket and will # cause it to present the proxy's HTTP response as that of the # original $token transaction, identified only by state(proxyUsed) diff --git a/library/init.tcl b/library/init.tcl index bbff158..22579c2 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -726,7 +726,7 @@ proc tcl::CopyDirectory {action src dest} { # the following code is now commented out. # # return -code error "error $action \"$src\" to\ - # \"$dest\": file already exists" + # \"$dest\": File exists" } else { # Depending on the platform, and on the current # working directory, the directories '.', '..' @@ -738,7 +738,7 @@ proc tcl::CopyDirectory {action src dest} { foreach s $existing { if {[file tail $s] ni {. ..}} { return -code error "error $action \"$src\" to\ - \"$dest\": file already exists" + \"$dest\": File exists" } } } diff --git a/library/safe.tcl b/library/safe.tcl index 7fc2b5c..c5546e5 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -818,7 +818,7 @@ proc ::safe::CheckFileName {child file} { if {![file exists $file]} { # don't tell the file path - return -code error "no such file or directory" + return -code error "No such file or directory" } if {![file readable $file]} { @@ -908,7 +908,7 @@ proc ::safe::AliasGlob {child args} { } on error msg { Log $child $msg if {$got(-nocomplain)} return - return -code error "permission denied" + return -code error "Permission denied" } if {$got(--)} { set cmd [linsert $cmd end-1 -directory $dir] @@ -921,7 +921,7 @@ proc ::safe::AliasGlob {child args} { # return now and reduce the number of cases to be considered later. Log $child {option -directory must be supplied} if {$got(-nocomplain)} return - return -code error "permission denied" + return -code error "Permission denied" } # Apply the -join semantics ourselves (hence -join not copied to $cmd) @@ -980,7 +980,7 @@ proc ::safe::AliasGlob {child args} { } on error msg { Log $child $msg if {$got(-nocomplain)} continue - return -code error "permission denied" + return -code error "Permission denied" } lappend cmd $opt } @@ -1034,7 +1034,7 @@ proc ::safe::AliasSource {child args} { set at 2 if {$encoding eq "identity"} { Log $child "attempt to use the identity encoding" - return -code error "permission denied" + return -code error "Permission denied" } } else { set at 0 @@ -1052,7 +1052,7 @@ proc ::safe::AliasSource {child args} { set realfile [TranslatePath $child $file] } msg]} { Log $child $msg - return -code error "permission denied" + return -code error "Permission denied" } # check that the path is in the access path of that child @@ -1060,7 +1060,7 @@ proc ::safe::AliasSource {child args} { FileInAccessPath $child $realfile } msg]} { Log $child $msg - return -code error "permission denied" + return -code error "Permission denied" } # Check that the filename exists and is readable. If it is not, deliver @@ -1124,7 +1124,7 @@ proc ::safe::AliasLoad {child file args} { if {!$state(nestedok)} { Log $child "loading to a sub interp (nestedok)\ disabled (trying to load $prefix to $target)" - return -code error "permission denied (nested load)" + return -code error "Permission denied (nested load)" } } @@ -1139,7 +1139,7 @@ proc ::safe::AliasLoad {child file args} { if {!$state(staticsok)} { Log $child "static loading disabled\ (trying to load $prefix to $target)" - return -code error "permission denied (static library)" + return -code error "Permission denied (static library)" } } else { # file loading @@ -1149,7 +1149,7 @@ proc ::safe::AliasLoad {child file args} { set file [TranslatePath $child $file] } on error msg { Log $child $msg - return -code error "permission denied" + return -code error "Permission denied" } # check the translated path @@ -1157,7 +1157,7 @@ proc ::safe::AliasLoad {child file args} { FileInAccessPath $child $file } on error msg { Log $child $msg - return -code error "permission denied (path)" + return -code error "Permission denied (path)" } } diff --git a/tests/chanio.test b/tests/chanio.test index d2008e6..4ad5e3a 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -2676,8 +2676,8 @@ test chan-io-29.27 {Tcl_Flush on chan closed pipeline} -setup { } else { set x {this was supposed to fail and did not} } - string tolower $x -} -match glob -result {1 {error flushing "*": broken pipe} {posix epipe {broken pipe}}} + set x +} -match glob -result {1 {error flushing "*": Broken pipe} {POSIX EPIPE {Broken pipe}}} test chan-io-29.28 {Tcl_WriteChars, lf mode} -setup { file delete $path(test1) } -body { @@ -3958,7 +3958,7 @@ test chan-io-32.3 {Tcl_Read, negative byte count} -setup { chan read $f -1 } -returnCodes error -cleanup { chan close $f -} -result {expected non-negative integer but got "-1"} +} -result {Expected non-negative integer but got "-1"} test chan-io-32.4 {Tcl_Read, positive byte count} -body { set f [open $path(longfile) r] string length [chan read $f 1024] @@ -4363,7 +4363,7 @@ test chan-io-34.8 {Tcl_Seek on pipes: not supported} -setup { chan seek $pipe 0 current } -returnCodes error -cleanup { chan close $pipe -} -match glob -result {error during seek on "*": invalid argument} +} -match glob -result {error during seek on "*": Invalid argument} test chan-io-34.9 {Tcl_Seek, testing buffered input flushing} -setup { file delete $path(test3) } -body { @@ -5462,11 +5462,11 @@ test chan-io-40.10 {POSIX open access modes: RDONLY} -body { test chan-io-40.11 {POSIX open access modes: RDONLY} -match regexp -body { file delete $path(test3) open $path(test3) RDONLY -} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} test chan-io-40.12 {POSIX open access modes: WRONLY} -match regexp -body { file delete $path(test3) open $path(test3) WRONLY -} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} test chan-io-40.13 {POSIX open access modes: WRONLY} -body { makeFile xyzzy test3 set f [open $path(test3) WRONLY] @@ -5480,7 +5480,7 @@ test chan-io-40.13 {POSIX open access modes: WRONLY} -body { test chan-io-40.14 {POSIX open access modes: RDWR} -match regexp -body { file delete $path(test3) open $path(test3) RDWR -} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} test chan-io-40.15 {POSIX open access modes: RDWR} { makeFile xyzzy test3 set f [open $path(test3) RDWR] @@ -7585,7 +7585,7 @@ test chan-io-60.1 {writing illegal utf sequences} {fileevent testbytestring} { # cut of the remainder of the error stack, especially the filename set result [lreplace $result 3 3 [lindex [split [lindex $result 3] \n] 0]] list $x $result -} {1 {gets {} catch {error writing "stdout": illegal byte sequence}}} +} {1 {gets {} catch {error writing "stdout": Invalid or incomplete multibyte or wide character}}} test chan-io-61.1 {Reset eof state after changing the eof char} -setup { set datafile [makeFile {} eofchar] diff --git a/tests/cmdAH.test b/tests/cmdAH.test index 01a4a36..a417e34 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -137,10 +137,10 @@ test cmdAH-2.5 {Tcl_CdObjCmd} -returnCodes error -body { } -result {user "~" doesn't exist} test cmdAH-2.6 {Tcl_CdObjCmd} -returnCodes error -body { cd _foobar -} -result {couldn't change working directory to "_foobar": no such file or directory} +} -result {couldn't change working directory to "_foobar": No such file or directory} test cmdAH-2.6.1 {Tcl_CdObjCmd} -returnCodes error -body { cd "" -} -result {couldn't change working directory to "": no such file or directory} +} -result {couldn't change working directory to "": No such file or directory} test cmdAH-2.6.2 {cd} -constraints {unix nonPortable} -setup { set dir [pwd] } -body { @@ -1459,8 +1459,8 @@ test cmdAH-20.2 {Tcl_FileObjCmd: atime} -setup { [expr {[file atime $gorpfile] == $stat(atime)}] } -result {1 1} test cmdAH-20.3 {Tcl_FileObjCmd: atime} { - list [catch {file atime _bogus_} msg] [string tolower $msg] $errorCode -} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} + list [catch {file atime _bogus_} msg] $msg $errorCode +} {1 {could not read "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} test cmdAH-20.4 {Tcl_FileObjCmd: atime} -returnCodes error -body { file atime $file notint } -result {expected integer but got "notint"} @@ -1525,7 +1525,7 @@ test cmdAH-22.3 {Tcl_FileObjCmd: isfile} {file isfile $dirfile} 0 catch {file link -symbolic $linkfile $gorpfile} test cmdAH-23.1 {Tcl_FileObjCmd: lstat} -returnCodes error -body { file lstat a -} -result {could not read "a": no such file or directory} +} -result {could not read "a": No such file or directory} test cmdAH-23.2 {Tcl_FileObjCmd: lstat} -returnCodes error -body { file lstat a b c } -result {wrong # args: should be "file lstat name ?varName?"} @@ -1542,9 +1542,9 @@ test cmdAH-23.4 {Tcl_FileObjCmd: lstat} -setup { list $stat(nlink) [expr {$stat(mode) & 0o777}] $stat(type) } -result {1 511 link} test cmdAH-23.5 {Tcl_FileObjCmd: lstat errors} {nonPortable} { - list [catch {file lstat _bogus_ stat} msg] [string tolower $msg] \ + list [catch {file lstat _bogus_ stat} msg] $msg \ $errorCode -} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} +} {1 {could not read "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} test cmdAH-23.6 {Tcl_FileObjCmd: lstat errors} -setup { unset -nocomplain x } -body { @@ -1634,8 +1634,8 @@ test cmdAH-24.3 {Tcl_FileObjCmd: mtime} -setup { [expr {[file atime $gorpfile] == $stat(atime)}] } -result {1 1} test cmdAH-24.4 {Tcl_FileObjCmd: mtime} { - list [catch {file mtime _bogus_} msg] [string tolower $msg] $errorCode -} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} + list [catch {file mtime _bogus_} msg] $msg $errorCode +} {1 {could not read "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} test cmdAH-24.5 {Tcl_FileObjCmd: mtime} -setup { # Under Unix, use a file in /tmp to avoid clock skew due to NFS. On other # platforms, just use a file in the local directory. @@ -1814,11 +1814,11 @@ test cmdAH-26.2 {Tcl_FileObjCmd: readlink} {unix nonPortable} { file readlink $linkfile } $gorpfile test cmdAH-26.3 {Tcl_FileObjCmd: readlink errors} {unix nonPortable} { - list [catch {file readlink _bogus_} msg] [string tolower $msg] $errorCode -} {1 {could not readlink "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} + list [catch {file readlink _bogus_} msg] $msg $errorCode +} {1 {could not readlink "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} test cmdAH-26.5 {Tcl_FileObjCmd: readlink errors} {win nonPortable} { - list [catch {file readlink _bogus_} msg] [string tolower $msg] $errorCode -} {1 {could not readlink "_bogus_": invalid argument} {POSIX EINVAL {invalid argument}}} + list [catch {file readlink _bogus_} msg] $msg $errorCode +} {1 {could not readlink "_bogus_": Invalid argument} {POSIX EINVAL {Invalid argument}}} # size test cmdAH-27.1 {Tcl_FileObjCmd: size} -returnCodes error -body { @@ -1833,8 +1833,8 @@ test cmdAH-27.2 {Tcl_FileObjCmd: size} { expr {[file size $gorpfile] - $oldsize} } {10} test cmdAH-27.3 {Tcl_FileObjCmd: size} { - list [catch {file size _bogus_} msg] [string tolower $msg] $errorCode -} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} + list [catch {file size _bogus_} msg] $msg $errorCode +} {1 {could not read "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} test cmdAH-27.4 { Tcl_FileObjCmd: size (built-in Windows names) } -constraints {win} -body { @@ -1884,8 +1884,8 @@ test cmdAH-28.5 {Tcl_FileObjCmd: stat} -constraints {unix notWsl} -setup { format 0o%03o [expr {$stat(mode) & 0o777}] } -result 0o765 test cmdAH-28.6 {Tcl_FileObjCmd: stat} { - list [catch {file stat _bogus_ stat} msg] [string tolower $msg] $errorCode -} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} + list [catch {file stat _bogus_ stat} msg] $msg $errorCode +} {1 {could not read "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} test cmdAH-28.7 {Tcl_FileObjCmd: stat} -setup { unset -nocomplain x } -returnCodes error -body { @@ -2006,8 +2006,8 @@ test cmdAH-29.4.1 {Tcl_FileObjCmd: type} -constraints {linkDirectory notWine} -s removeDirectory $tempdir } -result link test cmdAH-29.5 {Tcl_FileObjCmd: type} { - list [catch {file type _bogus_} msg] [string tolower $msg] $errorCode -} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} + list [catch {file type _bogus_} msg] $msg $errorCode +} {1 {could not read "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} test cmdAH-29.6 { Tcl_FileObjCmd: type (built-in Windows names) } -constraints {win} -body { @@ -2206,7 +2206,7 @@ test cmdAH-33.6 {file tempdir: missing parent dir} -setup { file tempdir $base/quux/ } -cleanup { catch {file delete -force $base} -} -result {can't create temporary directory: no such file or directory} +} -result {can't create temporary directory: No such file or directory} test cmdAH-33.7 {file tempdir: missing parent dir} -setup { set base [file join [temporaryDirectory] gorp] file mkdir $base @@ -2214,7 +2214,7 @@ test cmdAH-33.7 {file tempdir: missing parent dir} -setup { file tempdir $base/quux/foobar } -cleanup { catch {file delete -force $base} -} -result {can't create temporary directory: no such file or directory} +} -result {can't create temporary directory: No such file or directory} # This shouldn't work, but just in case a test above failed... catch {close $newFileId} diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test index a7aa36c..27ec3bf 100644 --- a/tests/cmdMZ.test +++ b/tests/cmdMZ.test @@ -64,7 +64,7 @@ test cmdMZ-1.4 {Tcl_PwdObjCmd: failure} -setup { } -returnCodes error -cleanup { cd $cwd file delete -force $foodir -} -result {error getting working directory name: permission denied} +} -result {error getting working directory name: Permission denied} # The tests for Tcl_RegexpObjCmd, Tcl_RegsubObjCmd are in regexp.test diff --git a/tests/event.test b/tests/event.test index 16cbc24..163a6f9 100644 --- a/tests/event.test +++ b/tests/event.test @@ -184,10 +184,10 @@ test event-5.1 {Tcl_BackgroundError, HandleBgErrors procedures} -setup { } -result {{{a simple error} {a simple error while executing "error "a simple error"" - ("after" script)} NONE} {{couldn't open "non_existent": no such file or directory} {couldn't open "non_existent": no such file or directory + ("after" script)} NONE} {{couldn't open "non_existent": No such file or directory} {couldn't open "non_existent": No such file or directory while executing "open non_existent" - ("after" script)} {POSIX ENOENT {no such file or directory}}}} + ("after" script)} {POSIX ENOENT {No such file or directory}}}} test event-5.2 {Tcl_BackgroundError, HandleBgErrors procedures} -setup { catch {rename bgerror {}} } -body { diff --git a/tests/exec.test b/tests/exec.test index d1ef418..888042e 100644 --- a/tests/exec.test +++ b/tests/exec.test @@ -333,11 +333,11 @@ test exec-8.2 {long input and output} {exec} { test exec-9.1 {commands returning errors} {exec notValgrind} { set x [catch {exec gorp456} msg] - list $x [string tolower $msg] [string tolower $errorCode] -} {1 {couldn't execute "gorp456": no such file or directory} {posix enoent {no such file or directory}}} + list $x $msg $errorCode +} {1 {couldn't execute "gorp456": No such file or directory} {POSIX ENOENT {No such file or directory}}} test exec-9.2 {commands returning errors} {exec notValgrind} { - string tolower [list [catch {exec [interpreter] echo foo | foo123} msg] $msg $errorCode] -} {1 {couldn't execute "foo123": no such file or directory} {posix enoent {no such file or directory}}} + list [catch {exec [interpreter] echo foo | foo123} msg] $msg $errorCode +} {1 {couldn't execute "foo123": No such file or directory} {POSIX ENOENT {No such file or directory}}} test exec-9.3 {commands returning errors} -constraints {exec stdio} -body { exec [interpreter] $path(sleep) 1 | [interpreter] $path(exit) 43 | [interpreter] $path(sleep) 1 } -returnCodes error -result {child process exited abnormally} @@ -347,7 +347,7 @@ test exec-9.4 {commands returning errors} -constraints {exec stdio} -body { child process exited abnormally} test exec-9.5 {commands returning errors} -constraints {exec stdio notValgrind} -body { exec gorp456 | [interpreter] echo a b c -} -returnCodes error -result {couldn't execute "gorp456": no such file or directory} +} -returnCodes error -result {couldn't execute "gorp456": No such file or directory} test exec-9.6 {commands returning errors} -constraints {exec} -body { exec [interpreter] $path(sh) -c "\"$path(echo)\" error msg 1>&2" } -returnCodes error -result {error msg} @@ -417,13 +417,13 @@ test exec-10.14 {errors in exec invocation} -constraints {exec} -body { } -returnCodes error -result {can't specify "<@" as last word in command} test exec-10.15 {errors in exec invocation} -constraints {exec} -body { exec cat < a/b/c -} -returnCodes error -result {couldn't read file "a/b/c": no such file or directory} +} -returnCodes error -result {couldn't read file "a/b/c": No such file or directory} test exec-10.16 {errors in exec invocation} -constraints {exec} -body { exec cat << foo > a/b/c -} -returnCodes error -result {couldn't write file "a/b/c": no such file or directory} +} -returnCodes error -result {couldn't write file "a/b/c": No such file or directory} test exec-10.17 {errors in exec invocation} -constraints {exec} -body { exec cat << foo > a/b/c -} -returnCodes error -result {couldn't write file "a/b/c": no such file or directory} +} -returnCodes error -result {couldn't write file "a/b/c": No such file or directory} set f [open $path(gorp.file) w] test exec-10.18 {errors in exec invocation} -constraints {exec} -body { exec cat <@ $f @@ -511,16 +511,16 @@ test exec-12.3 {reaping background processes} {exec unix nonPortable} { # Make sure "errorCode" is set correctly. test exec-13.1 {setting errorCode variable} {exec} { - list [catch {exec [interpreter] $path(cat) < a/b/c} msg] [string tolower $errorCode] -} {1 {posix enoent {no such file or directory}}} + list [catch {exec [interpreter] $path(cat) < a/b/c} msg] $errorCode +} {1 {POSIX ENOENT {No such file or directory}}} test exec-13.2 {setting errorCode variable} {exec} { - list [catch {exec [interpreter] $path(cat) > a/b/c} msg] [string tolower $errorCode] -} {1 {posix enoent {no such file or directory}}} + list [catch {exec [interpreter] $path(cat) > a/b/c} msg] $errorCode +} {1 {POSIX ENOENT {No such file or directory}}} test exec-13.3 {setting errorCode variable} {exec notValgrind} { set x [catch {exec _weird_cmd_} msg] - list $x [string tolower $msg] [lindex $errorCode 0] \ - [string tolower [lrange $errorCode 2 end]] -} {1 {couldn't execute "_weird_cmd_": no such file or directory} POSIX {{no such file or directory}}} + list $x $msg [lindex $errorCode 0] \ + [lrange $errorCode 2 end] +} {1 {couldn't execute "_weird_cmd_": No such file or directory} POSIX {{No such file or directory}}} test exec-13.4 {extended exit result codes} -setup { set tmp [makeFile {exit 0x00000101} tmpfile.exec-13.4] } -constraints {win} -body { @@ -556,7 +556,7 @@ test exec-14.3 {unknown switch} -constraints {exec} -body { } -returnCodes error -result {bad option "-gorp": must be -ignorestderr, -keepnewline, or --} test exec-14.4 {-- switch} -constraints {exec notValgrind} -body { exec -- -gorp -} -returnCodes error -result {couldn't execute "-gorp": no such file or directory} +} -returnCodes error -result {couldn't execute "-gorp": No such file or directory} test exec-14.5 {-ignorestderr switch} {exec} { # Alas, the use of -ignorestderr is buried here :-( exec [interpreter] $path(sh2) -c [list $path(echo2) foo bar] 2>@1 diff --git a/tests/fCmd.test b/tests/fCmd.test index 22ac7b8..9c4ba21 100644 --- a/tests/fCmd.test +++ b/tests/fCmd.test @@ -246,7 +246,7 @@ test fCmd-3.4 {FileCopyRename: Tcl_TranslateFileName passes} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file copy tf1 ~ -} -result {error copying "tf1": no such file or directory} +} -result {error copying "tf1": No such file or directory} test fCmd-3.5 {FileCopyRename: target doesn't exist: stat(target) != 0} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { @@ -321,7 +321,7 @@ test fCmd-3.15 {FileCopyRename: source[0] == '\x00'} -setup { } -constraints {notRoot unixOrWin} -returnCodes error -body { file mkdir td1 file rename / td1 -} -result {error renaming "/" to "td1": file already exists} +} -result {error renaming "/" to "td1": File exists} test fCmd-3.16 {FileCopyRename: break on first error} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { @@ -332,7 +332,7 @@ test fCmd-3.16 {FileCopyRename: break on first error} -setup { file mkdir td1 createfile [file join td1 tf3] file rename tf1 tf2 tf3 tf4 td1 -} -result [subst {error renaming "tf3" to "[file join td1 tf3]": file already exists}] +} -result [subst {error renaming "tf3" to "[file join td1 tf3]": File exists}] test fCmd-4.1 {TclFileMakeDirsCmd: make each dir: 1 dir} -setup { cleanup @@ -362,7 +362,7 @@ test fCmd-4.5 {TclFileMakeDirsCmd: Tcl_SplitPath returns 0: *name == '\x00'} -se cleanup } -constraints {notRoot} -returnCodes error -body { file mkdir "" -} -result {can't create directory "": no such file or directory} +} -result {can't create directory "": No such file or directory} test fCmd-4.6 {TclFileMakeDirsCmd: one level deep} -setup { cleanup } -constraints {notRoot} -body { @@ -388,7 +388,7 @@ test fCmd-4.9 {TclFileMakeDirsCmd: exists, not dir} -setup { } -constraints {notRoot} -returnCodes error -body { createfile tf1 file mkdir tf1 -} -result [subst {can't create directory "[file join tf1]": file already exists}] +} -result [subst {can't create directory "[file join tf1]": File exists}] test fCmd-4.10 {TclFileMakeDirsCmd: exists, is dir} -setup { cleanup } -constraints {notRoot} -body { @@ -406,7 +406,7 @@ test fCmd-4.11 {TclFileMakeDirsCmd: doesn't exist: errno != ENOENT} -setup { } -cleanup { testchmod 0o755 td1/td2 cleanup -} -result {can't create directory "td1/td2/td3": permission denied} +} -result {can't create directory "td1/td2/td3": Permission denied} test fCmd-4.13 {TclFileMakeDirsCmd: doesn't exist: errno == ENOENT} -setup { cleanup } -constraints {notRoot} -body { @@ -423,7 +423,7 @@ test fCmd-4.14 {TclFileMakeDirsCmd: TclpCreateDirectory fails} -setup { file mkdir foo/tf1 } -returnCodes error -cleanup { file delete -force foo -} -result {can't create directory "foo/tf1": permission denied} +} -result {can't create directory "foo/tf1": Permission denied} test fCmd-4.16 {TclFileMakeDirsCmd: TclpCreateDirectory succeeds} -setup { cleanup } -constraints {notRoot} -body { @@ -525,7 +525,7 @@ test fCmd-6.3 {CopyRenameOneFile: lstat(source) != 0} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file rename tf1 tf2 -} -result {error renaming "tf1": no such file or directory} +} -result {error renaming "tf1": No such file or directory} test fCmd-6.4 {CopyRenameOneFile: lstat(source) == 0} -setup { cleanup } -constraints {notRoot} -body { @@ -549,7 +549,7 @@ test fCmd-6.6 {CopyRenameOneFile: errno != ENOENT} -setup { file rename tf1 td1 } -returnCodes error -cleanup { testchmod 0o755 td1 -} -result {error renaming "tf1" to "td1/tf1": permission denied} +} -result {error renaming "tf1" to "td1/tf1": Permission denied} test fCmd-6.9 {CopyRenameOneFile: errno == ENOENT} -setup { cleanup } -constraints {unix notRoot} -body { @@ -563,14 +563,14 @@ test fCmd-6.10 {CopyRenameOneFile: lstat(target) == 0} -setup { createfile tf1 createfile tf2 file rename tf1 tf2 -} -result {error renaming "tf1" to "tf2": file already exists} +} -result {error renaming "tf1" to "tf2": File exists} test fCmd-6.11 {CopyRenameOneFile: force == 0} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { createfile tf1 createfile tf2 file rename tf1 tf2 -} -result {error renaming "tf1" to "tf2": file already exists} +} -result {error renaming "tf1" to "tf2": File exists} test fCmd-6.12 {CopyRenameOneFile: force != 0} -setup { cleanup } -constraints {notRoot} -body { @@ -668,7 +668,7 @@ test fCmd-6.23 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { } -returnCodes error -cleanup { file attributes td1 -permissions 0o755 cleanup -} -match regexp -result {^error renaming "td1"( to "/tmp/tcl\d+/td1")?: permission denied$} +} -match regexp -result {^error renaming "td1"( to "/tmp/tcl\d+/td1")?: Permission denied$} test fCmd-6.24 {CopyRenameOneFile: error uses original name} -setup { cleanup } -constraints {unix notRoot} -body { @@ -679,7 +679,7 @@ test fCmd-6.24 {CopyRenameOneFile: error uses original name} -setup { } -returnCodes error -cleanup { file attributes $td1name -permissions 0o755 file delete -force ~/td1 -} -result {error copying "~/td1": permission denied} +} -result {error copying "~/td1": Permission denied} test fCmd-6.25 {CopyRenameOneFile: error uses original name} -setup { cleanup } -constraints {unix notRoot} -body { @@ -691,7 +691,7 @@ test fCmd-6.25 {CopyRenameOneFile: error uses original name} -setup { } -returnCodes error -cleanup { file attributes $td1name -permissions 0o755 file delete -force ~/td1 -} -result {error copying "td2" to "~/td1/td2": permission denied} +} -result {error copying "td2" to "~/td1/td2": Permission denied} test fCmd-6.26 {CopyRenameOneFile: doesn't use original name} -setup { cleanup } -constraints {unix notRoot} -body { @@ -702,7 +702,7 @@ test fCmd-6.26 {CopyRenameOneFile: doesn't use original name} -setup { } -returnCodes error -cleanup { file attributes $td2name -permissions 0o755 file delete -force ~/td1 -} -result "error copying \"~/td1\" to \"td1\": \"[file join $::env(HOME) td1 td2]\": permission denied" +} -result "error copying \"~/td1\" to \"td1\": \"[file join $::env(HOME) td1 td2]\": Permission denied" test fCmd-6.27 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { cleanup $tmpspace } -constraints {notRoot xdev} -returnCodes error -body { @@ -710,7 +710,7 @@ test fCmd-6.27 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { file mkdir [file join $tmpspace td1] createfile [file join $tmpspace td1 tf1] file rename -force td1 $tmpspace -} -match glob -result {error renaming "td1" to "/tmp/tcl*/td1": file already exists} +} -match glob -result {error renaming "td1" to "/tmp/tcl*/td1": File exists} test fCmd-6.28 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { cleanup $tmpspace } -constraints {notRoot xdev notWsl} -body { @@ -720,7 +720,7 @@ test fCmd-6.28 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { } -returnCodes error -cleanup { file attributes td1/td2/td3 -permissions 0o755 cleanup $tmpspace -} -match glob -result {error renaming "td1" to "/tmp/tcl*/td1": "td1/td2/td3": permission denied} +} -match glob -result {error renaming "td1" to "/tmp/tcl*/td1": "td1/td2/td3": Permission denied} test fCmd-6.29 {CopyRenameOneFile: TclpCopyDirectory passed} -setup { cleanup $tmpspace } -constraints {notRoot xdev} -body { @@ -738,7 +738,7 @@ test fCmd-6.30 {CopyRenameOneFile: TclpRemoveDirectory failed} -setup { catch {file delete [file join $tmpspace bar]} catch {file attr foo -perm 0o40777} catch {file delete -force foo} -} -match glob -result {*: permission denied} +} -match glob -result {*: Permission denied} test fCmd-6.31 {CopyRenameOneFile: TclpDeleteFile passed} -setup { cleanup $tmpspace } -constraints {notRoot xdev} -body { @@ -751,7 +751,7 @@ test fCmd-6.32 {CopyRenameOneFile: copy} -constraints {notRoot} -setup { cleanup } -returnCodes error -body { file copy tf1 tf2 -} -result {error copying "tf1": no such file or directory} +} -result {error copying "tf1": No such file or directory} test fCmd-7.1 {FileForceOption: none} -constraints {notRoot} -setup { cleanup @@ -793,7 +793,7 @@ test fCmd-8.1 {FileBasename: basename of ~user: argc == 1 && *path == ~} \ file rename ~$user td1 } -returnCodes error -cleanup { file delete -force td1 -} -result "error renaming \"~$user\" to \"td1/[file tail ~$user]\": permission denied" +} -result "error renaming \"~$user\" to \"td1/[file tail ~$user]\": Permission denied" test fCmd-8.2 {FileBasename: basename of ~user: argc == 1 && *path == ~} \ -constraints {unix notRoot} -body { string equal [file tail ~$user] ~$user @@ -801,7 +801,7 @@ test fCmd-8.2 {FileBasename: basename of ~user: argc == 1 && *path == ~} \ test fCmd-8.3 {file copy and path translation: ensure correct error} -body { file copy ~ [file join this file doesnt exist] } -returnCodes error -result [subst \ - {error copying "~" to "[file join this file doesnt exist]": no such file or directory}] + {error copying "~" to "[file join this file doesnt exist]": No such file or directory}] test fCmd-9.1 {file rename: comprehensive: EACCES} -setup { cleanup @@ -813,12 +813,12 @@ test fCmd-9.1 {file rename: comprehensive: EACCES} -setup { } -returnCodes error -cleanup { file delete -force td2 file delete -force td1 -} -result {error renaming "td1" to "td2/td1": permission denied} +} -result {error renaming "td1" to "td2/td1": Permission denied} test fCmd-9.2 {file rename: comprehensive: source doesn't exist} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file rename tf1 tf2 -} -result {error renaming "tf1": no such file or directory} +} -result {error renaming "tf1": No such file or directory} test fCmd-9.3 {file rename: comprehensive: file to new name} -setup { cleanup } -constraints {notRoot testchmod} -body { @@ -883,7 +883,7 @@ test fCmd-9.7 {file rename: comprehensive: file to existing file} -setup { file rename -force tfs3 tfd3 file rename -force tfs4 tfd4 list [lsort [glob tf*]] $msg [file writable tfd1] [file writable tfd2] [file writable tfd3] [file writable tfd4] -} -result {{tf1 tf2 tfd1 tfd2 tfd3 tfd4} {1 {error renaming "tf1" to "tf2": file already exists}} 1 1 0 0} +} -result {{tf1 tf2 tfd1 tfd2 tfd3 tfd4} {1 {error renaming "tf1" to "tf2": File exists}} 1 1 0 0} test fCmd-9.8 {file rename: comprehensive: dir to empty dir} -setup { cleanup } -constraints {notRoot testchmod notNetworkFilesystem} -body { @@ -919,7 +919,7 @@ test fCmd-9.8 {file rename: comprehensive: dir to empty dir} -setup { } list [lsort [glob td*]] $msg [file writable [file join tdd1 tds1]] \ [file writable [file join tdd2 tds2]] $w3 $w4 -} -result [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4} {1 {error renaming "td1" to "[file join td2 td1]": file already exists}} 1 1 0 0}] +} -result [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4} {1 {error renaming "td1" to "[file join td2 td1]": File exists}} 1 1 0 0}] # Test can hit EEXIST or EBUSY, depending on underlying filesystem test fCmd-9.9 {file rename: comprehensive: dir to non-empty dir} -setup { cleanup @@ -969,7 +969,7 @@ test fCmd-9.12 {file rename: comprehensive: target exists} -setup { [catch {file rename td1 td2} msg] $msg } -cleanup { testchmod 0o755 [file join td2 td1] -} -result [subst {0 1 1 {error renaming "td1" to "[file join td2 td1]": file already exists}}] +} -result [subst {0 1 1 {error renaming "td1" to "[file join td2 td1]": File exists}}] # Test can hit EEXIST or EBUSY, depending on underlying filesystem test fCmd-9.13 {file rename: comprehensive: can't overwrite target} -setup { cleanup @@ -1001,7 +1001,7 @@ test fCmd-9.14.2 {file rename: comprehensive: dir into self} -setup { file rename [file join .. td1] [file join .. td1x] } -returnCodes error -cleanup { cd $dir -} -result [subst {error renaming "[file join .. td1]" to "[file join .. td1x]": permission denied}] +} -result [subst {error renaming "[file join .. td1]" to "[file join .. td1x]": Permission denied}] test fCmd-9.14.3 {file rename: comprehensive: dir into self} -setup { cleanup set dir [pwd] @@ -1033,7 +1033,7 @@ test fCmd-10.1 {file copy: comprehensive: source doesn't exist} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file copy tf1 tf2 -} -result {error copying "tf1": no such file or directory} +} -result {error copying "tf1": No such file or directory} test fCmd-10.2 {file copy: comprehensive: file to new name} -setup { cleanup } -constraints {notRoot testchmod} -body { @@ -1106,7 +1106,7 @@ test fCmd-10.4 {file copy: comprehensive: file to existing file} -setup { file copy -force tfs3 tfd3 file copy -force tfs4 tfd4 list [lsort [glob tf*]] $msg [file writable tfd1] [file writable tfd2] [file writable tfd3] [file writable tfd4] -} -result {{tf1 tf2 tfd1 tfd2 tfd3 tfd4 tfs1 tfs2 tfs3 tfs4} {1 {error copying "tf1" to "tf2": file already exists}} 1 1 0 0} +} -result {{tf1 tf2 tfd1 tfd2 tfd3 tfd4 tfs1 tfs2 tfs3 tfs4} {1 {error copying "tf1" to "tf2": File exists}} 1 1 0 0} test fCmd-10.5 {file copy: comprehensive: dir to empty dir} -setup { cleanup } -constraints {notRoot testchmod} -body { @@ -1130,7 +1130,7 @@ test fCmd-10.5 {file copy: comprehensive: dir to empty dir} -setup { set a4 [catch {file copy -force tds3 tdd3}] set a5 [catch {file copy -force tds4 tdd4}] list [lsort [glob td*]] $a1 $a2 $a3 $a4 $a5 -} -result [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4 tds1 tds2 tds3 tds4} {1 {error copying "td1" to "[file join td2 td1]": file already exists}} {1 {error copying "tds1" to "[file join tdd1 tds1]": file already exists}} 1 1 1}] +} -result [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4 tds1 tds2 tds3 tds4} {1 {error copying "td1" to "[file join td2 td1]": File exists}} {1 {error copying "tds1" to "[file join tdd1 tds1]": File exists}} 1 1 1}] test fCmd-10.6 {file copy: comprehensive: dir to non-empty dir} -setup { cleanup } -constraints {notRoot unixOrWin testchmod notWsl} -body { @@ -1142,7 +1142,7 @@ test fCmd-10.6 {file copy: comprehensive: dir to non-empty dir} -setup { set a1 [list [catch {file copy -force tds1 tdd1} msg] $msg] set a2 [list [catch {file copy -force tds2 tdd2} msg] $msg] list [lsort [glob td*]] $a1 $a2 [file writable tds1] [file writable tds2] -} -result [subst {{tdd1 tdd2 tds1 tds2} {1 {error copying "tds1" to "[file join tdd1 tds1]": file already exists}} {1 {error copying "tds2" to "[file join tdd2 tds2]": file already exists}} 1 0}] +} -result [subst {{tdd1 tdd2 tds1 tds2} {1 {error copying "tds1" to "[file join tdd1 tds1]": File exists}} {1 {error copying "tds2" to "[file join tdd2 tds2]": File exists}} 1 0}] test fCmd-10.7 {file rename: comprehensive: file to new name and dir} -setup { cleanup } -constraints {notRoot testchmod} -body { @@ -1199,13 +1199,13 @@ test fCmd-10.11 {file copy: copy to empty file name} -setup { } -returnCodes error -body { createfile tf1 file copy tf1 "" -} -result {error copying "tf1" to "": no such file or directory} +} -result {error copying "tf1" to "": No such file or directory} test fCmd-10.12 {file rename: rename to empty file name} -setup { cleanup } -returnCodes error -body { createfile tf1 file rename tf1 "" -} -result {error renaming "tf1" to "": no such file or directory} +} -result {error renaming "tf1" to "": No such file or directory} cleanup # old tests @@ -2354,21 +2354,21 @@ test fCmd-28.5 {file link: source already exists} -setup { file link abc.dir abc2.dir } -returnCodes error -cleanup { cd [workingDirectory] -} -result {could not create new link "abc.dir": that path already exists} +} -result {could not create new link "abc.dir": File exists} test fCmd-28.6 {file link: unsupported operation} -setup { cd [temporaryDirectory] } -constraints {linkDirectory win} -body { file link -hard abc.link abc.dir } -returnCodes error -cleanup { cd [workingDirectory] -} -result {could not create new link "abc.link" pointing to "abc.dir": illegal operation on a directory} +} -result {could not create new link "abc.link" pointing to "abc.dir": Is a directory} test fCmd-28.7 {file link: source already exists} -setup { cd [temporaryDirectory] } -constraints {linkFile} -body { file link abc.file abc2.file } -returnCodes error -cleanup { cd [workingDirectory] -} -result {could not create new link "abc.file": that path already exists} +} -result {could not create new link "abc.file": File exists} # In Windows 10 developer mode, we _can_ create symbolic links to files! test fCmd-28.8 {file link} -constraints {linkFile winLessThan10} -setup { cd [temporaryDirectory] @@ -2377,7 +2377,7 @@ test fCmd-28.8 {file link} -constraints {linkFile winLessThan10} -setup { } -cleanup { file delete -force abc.link cd [workingDirectory] -} -returnCodes error -result {could not create new link "abc.link" pointing to "abc.file": invalid argument} +} -returnCodes error -result {could not create new link "abc.link" pointing to "abc.file": Invalid argument} test fCmd-28.9 {file link: success with file} -constraints {linkFile} -setup { cd [temporaryDirectory] file delete -force abc.link @@ -2416,7 +2416,7 @@ test fCmd-28.10.1 {file link: linking to nonexistent path} -setup { file link doesnt/abc.link abc.dir } -returnCodes error -cleanup { cd [workingDirectory] -} -result {could not create new link "doesnt/abc.link": no such file or directory} +} -result {could not create new link "doesnt/abc.link": No such file or directory} test fCmd-28.11 {file link: success with directory} -setup { cd [temporaryDirectory] file delete -force abc.link @@ -2463,7 +2463,7 @@ test fCmd-28.13 {file link} -constraints {linkDirectory notWine} -setup { } -returnCodes error -cleanup { file delete -force abc.link cd [workingDirectory] -} -result {could not create new link "abc.link": that path already exists} +} -result {could not create new link "abc.link": File exists} test fCmd-28.14 {file link: deletes link not dir} -setup { cd [temporaryDirectory] } -constraints {linkDirectory} -body { diff --git a/tests/fileName.test b/tests/fileName.test index 575a17f..6f8966f 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -1331,8 +1331,8 @@ unset globname catch {file attributes globTest/a1 -permissions 0} test filename-15.1 {unix specific globbing} {unix nonPortable} { - string tolower [list [catch {glob globTest/a1/*} msg] $msg $errorCode] -} {1 {couldn't read directory "globtest/a1": permission denied} {posix eacces {permission denied}}} + list [catch {glob globTest/a1/*} msg] $msg $errorCode +} {1 {couldn't read directory "globtest/a1": Permission denied} {POSIX EACCES {Permission denied}}} test filename-15.2 {unix specific no complain: no errors} {unix nonPortable} { glob -nocomplain globTest/a1/* } {} diff --git a/tests/fileSystem.test b/tests/fileSystem.test index 0b6fa1d..40746be 100644 --- a/tests/fileSystem.test +++ b/tests/fileSystem.test @@ -498,19 +498,19 @@ test filesystem-5.1 {cache and ~} -constraints testfilesystem -setup { test filesystem-6.1 {empty file name} -returnCodes error -body { open "" -} -result {couldn't open "": no such file or directory} +} -result {couldn't open "": No such file or directory} test filesystem-6.2 {empty file name} -returnCodes error -body { file stat "" arr -} -result {could not read "": no such file or directory} +} -result {could not read "": No such file or directory} test filesystem-6.3 {empty file name} -returnCodes error -body { file atime "" -} -result {could not read "": no such file or directory} +} -result {could not read "": No such file or directory} test filesystem-6.4 {empty file name} -returnCodes error -body { file attributes "" -} -result {could not read "": no such file or directory} +} -result {could not read "": No such file or directory} test filesystem-6.5 {empty file name} -returnCodes error -body { file copy "" "" -} -result {error copying "": no such file or directory} +} -result {error copying "": No such file or directory} test filesystem-6.6 {empty file name} {file delete ""} {} test filesystem-6.7 {empty file name} {file dirname ""} . test filesystem-6.8 {empty file name} {file executable ""} 0 @@ -521,19 +521,19 @@ test filesystem-6.12 {empty file name} {file isfile ""} 0 test filesystem-6.13 {empty file name} {file join ""} {} test filesystem-6.14 {empty file name} -returnCodes error -body { file link "" -} -result {could not read link "": no such file or directory} +} -result {could not read link "": No such file or directory} test filesystem-6.15 {empty file name} -returnCodes error -body { file lstat "" arr -} -result {could not read "": no such file or directory} +} -result {could not read "": No such file or directory} test filesystem-6.16 {empty file name} -returnCodes error -body { file mtime "" -} -result {could not read "": no such file or directory} +} -result {could not read "": No such file or directory} test filesystem-6.17 {empty file name} -returnCodes error -body { file mtime "" 0 -} -result {could not read "": no such file or directory} +} -result {could not read "": No such file or directory} test filesystem-6.18 {empty file name} -returnCodes error -body { file mkdir "" -} -result {can't create directory "": no such file or directory} +} -result {can't create directory "": No such file or directory} test filesystem-6.19 {empty file name} {file nativename ""} {} test filesystem-6.20 {empty file name} {file normalize ""} {} test filesystem-6.21 {empty file name} {file owned ""} 0 @@ -541,17 +541,17 @@ test filesystem-6.22 {empty file name} {file pathtype ""} relative test filesystem-6.23 {empty file name} {file readable ""} 0 test filesystem-6.24 {empty file name} -returnCodes error -body { file readlink "" -} -result {could not read link "": no such file or directory} +} -result {could not read link "": No such file or directory} test filesystem-6.25 {empty file name} -returnCodes error -body { file rename "" "" -} -result {error renaming "": no such file or directory} +} -result {error renaming "": No such file or directory} test filesystem-6.26 {empty file name} {file rootname ""} {} test filesystem-6.27 {empty file name} -returnCodes error -body { file separator "" } -result {unrecognised path} test filesystem-6.28 {empty file name} -returnCodes error -body { file size "" -} -result {could not read "": no such file or directory} +} -result {could not read "": No such file or directory} test filesystem-6.29 {empty file name} {file split ""} {} test filesystem-6.30 {empty file name} -returnCodes error -body { file system "" @@ -559,7 +559,7 @@ test filesystem-6.30 {empty file name} -returnCodes error -body { test filesystem-6.31 {empty file name} {file tail ""} {} test filesystem-6.32 {empty file name} -returnCodes error -body { file type "" -} -result {could not read "": no such file or directory} +} -result {could not read "": No such file or directory} test filesystem-6.33 {empty file name} {file writable ""} 0 test filesystem-6.34 {file name with (invalid) nul character} { list [catch "open foo\x00" msg] $msg @@ -692,7 +692,7 @@ test filesystem-7.4 {cross-filesystem file copy with -force} -setup { file delete -force simplefile file delete -force file2 cd $dir -} -result {0 {} 1 {error copying "simplefs:/simplefile" to "file2": file already exists} 0 {} 1} +} -result {0 {} 1 {error copying "simplefs:/simplefile" to "file2": File exists} 0 {} 1} test filesystem-7.5 {cross-filesystem file copy with -force} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] @@ -717,7 +717,7 @@ test filesystem-7.5 {cross-filesystem file copy with -force} -setup { file delete -force simplefile file delete -force file2 cd $dir -} -result {0 {} 1 {error copying "simplefs:/simplefile" to "file2": file already exists} 0 {} 1} +} -result {0 {} 1 {error copying "simplefs:/simplefile" to "file2": File exists} 0 {} 1} test filesystem-7.6 {cross-filesystem dir copy with -force} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] @@ -745,7 +745,7 @@ test filesystem-7.6 {cross-filesystem dir copy with -force} -setup { file delete -force simpledir file delete -force dir2 cd $dir -} -result {0 {} 1 {error copying "simplefs:/simpledir" to "dir2/simpledir": file already exists} 0 {} 1 1} +} -result {0 {} 1 {error copying "simplefs:/simpledir" to "dir2/simpledir": File exists} 0 {} 1 1} test filesystem-7.7 {cross-filesystem dir copy with -force} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] @@ -775,7 +775,7 @@ test filesystem-7.7 {cross-filesystem dir copy with -force} -setup { file delete -force simpledir file delete -force dir2 cd $dir -} -result {0 {} 1 {error copying "simplefs:/simpledir" to "dir2/simpledir": file already exists} 0 {} 1 1} +} -result {0 {} 1 {error copying "simplefs:/simpledir" to "dir2/simpledir": File exists} 0 {} 1 1} removeFile gorp.file test filesystem-7.8 {vfs cd} -setup { set dir [pwd] diff --git a/tests/http.test b/tests/http.test index 587e6e4..6e973d0 100644 --- a/tests/http.test +++ b/tests/http.test @@ -630,7 +630,7 @@ test http-4.14.$ThreadLevel {http::Event} -body { lindex [http::error $token] 0 } -cleanup { catch {http::cleanup $token} -} -result {connect failed connection refused} +} -result {Connect failed: Connection refused} # Bogus host test http-4.15.$ThreadLevel {http::Event} -body { diff --git a/tests/interp.test b/tests/interp.test index fa263e2..20fa50a 100644 --- a/tests/interp.test +++ b/tests/interp.test @@ -1214,7 +1214,7 @@ test interp-20.23 {interp hide vs safety} { lappend l $msg interp delete a set l -} {1 {permission denied: safe interpreter cannot hide commands}} +} {1 {Permission denied: safe interpreter cannot hide commands}} test interp-20.24 {interp hide vs safety} { catch {interp delete a} interp create a -safe @@ -1224,7 +1224,7 @@ test interp-20.24 {interp hide vs safety} { lappend l $msg interp delete a set l -} {1 {permission denied: safe interpreter cannot hide commands}} +} {1 {Permission denied: safe interpreter cannot hide commands}} test interp-20.25 {interp hide vs safety} { catch {interp delete a} interp create a -safe @@ -1267,7 +1267,7 @@ test interp-20.28 {interp expose vs safety} { lappend l $msg interp delete a set l -} {0 {} 1 {permission denied: safe interpreter cannot expose commands}} +} {0 {} 1 {Permission denied: safe interpreter cannot expose commands}} test interp-20.29 {interp expose vs safety} { catch {interp delete a} interp create a -safe @@ -1278,7 +1278,7 @@ test interp-20.29 {interp expose vs safety} { lappend l $msg interp delete a set l -} {0 {} 1 {permission denied: safe interpreter cannot expose commands}} +} {0 {} 1 {Permission denied: safe interpreter cannot expose commands}} test interp-20.30 {interp expose vs safety} { catch {interp delete a} interp create a -safe @@ -1290,7 +1290,7 @@ test interp-20.30 {interp expose vs safety} { lappend l $msg interp delete a set l -} {0 {} 1 {permission denied: safe interpreter cannot expose commands}} +} {0 {} 1 {Permission denied: safe interpreter cannot expose commands}} test interp-20.31 {interp expose vs safety} { catch {interp delete a} interp create a -safe @@ -1767,7 +1767,7 @@ test interp-22.5 {testing interp marktrusted} { catch {a eval {interp marktrusted b}} msg interp delete a set msg -} {permission denied: safe interpreter cannot mark trusted} +} {Permission denied: safe interpreter cannot mark trusted} test interp-22.6 {testing interp marktrusted} { catch {interp delete a} interp create a -safe @@ -1775,7 +1775,7 @@ test interp-22.6 {testing interp marktrusted} { catch {a eval {b marktrusted}} msg interp delete a set msg -} {permission denied: safe interpreter cannot mark trusted} +} {Permission denied: safe interpreter cannot mark trusted} test interp-22.7 {testing interp marktrusted} { catch {interp delete a} interp create a -safe @@ -3004,7 +3004,7 @@ test interp-29.6.8 {safe interpreter recursion limit} { set n [catch {child eval {interp recursionlimit {} 42}} msg] interp delete child list $n $msg -} {1 {permission denied: safe interpreters cannot change recursion limit}} +} {1 {Permission denied: safe interpreters cannot change recursion limit}} test interp-29.6.9 {safe interpreter recursion limit} { interp create child -safe set result [ @@ -3018,7 +3018,7 @@ test interp-29.6.9 {safe interpreter recursion limit} { ] interp delete child set result -} {1 {permission denied: safe interpreters cannot change recursion limit}} +} {1 {Permission denied: safe interpreters cannot change recursion limit}} test interp-29.6.10 {safe interpreter recursion limit} { interp create child -safe set result [ @@ -3032,7 +3032,7 @@ test interp-29.6.10 {safe interpreter recursion limit} { ] interp delete child set result -} {1 {permission denied: safe interpreters cannot change recursion limit}} +} {1 {Permission denied: safe interpreters cannot change recursion limit}} # # Deep recursion (into interps when the regular one fails): diff --git a/tests/io.test b/tests/io.test index a085976..b9426b5 100644 --- a/tests/io.test +++ b/tests/io.test @@ -2855,8 +2855,8 @@ test io-29.27 {Tcl_Flush on closed pipeline} stdio { } } regsub {".*":} $x {"":} x - string tolower $x -} {1 {error flushing "": broken pipe} {posix epipe {broken pipe}}} + set x +} {1 {error flushing "": Broken pipe} {POSIX EPIPE {Broken pipe}}} test io-29.28 {Tcl_WriteChars, lf mode} { file delete $path(test1) set f [open $path(test1) w] @@ -4211,7 +4211,7 @@ test io-32.3 {Tcl_Read, negative byte count} { set l [list [catch {read $f -1} msg] $msg] close $f set l -} {1 {expected non-negative integer but got "-1"}} +} {1 {Expected non-negative integer but got "-1"}} test io-32.4 {Tcl_Read, positive byte count} { set f [open $path(longfile) r] set x [read $f 1024] @@ -4753,8 +4753,8 @@ test io-34.8 {Tcl_Seek on pipes: not supported} stdio { set x [list [catch {seek $f1 0 current} msg] $msg] close $f1 regsub {".*":} $x {"":} x - string tolower $x -} {1 {error during seek on "": invalid argument}} + set x +} {1 {error during seek on "": Invalid argument}} test io-34.9 {Tcl_Seek, testing buffered input flushing} { file delete $path(test3) set f [open $path(test3) w] @@ -5931,11 +5931,11 @@ test io-40.10 {POSIX open access modes: RDONLY} { test io-40.11 {POSIX open access modes: RDONLY} -match regexp -body { file delete $path(test3) open $path(test3) RDONLY -} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} test io-40.12 {POSIX open access modes: WRONLY} -match regexp -body { file delete $path(test3) open $path(test3) WRONLY -} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} test io-40.13 {POSIX open access modes: WRONLY} { makeFile xyzzy test3 set f [open $path(test3) WRONLY] @@ -5951,7 +5951,7 @@ test io-40.13 {POSIX open access modes: WRONLY} { test io-40.14 {POSIX open access modes: RDWR} -match regexp -body { file delete $path(test3) open $path(test3) RDWR -} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} test io-40.15 {POSIX open access modes: RDWR} { makeFile xyzzy test3 set f [open $path(test3) RDWR] @@ -7638,7 +7638,7 @@ test io-52.20 {TclCopyChannel & encodings} -setup { } -cleanup { close $in close $out -} -returnCodes 1 -match glob -result {error reading "file*": illegal byte sequence} +} -returnCodes 1 -match glob -result {error reading "file*": Invalid or incomplete multibyte or wide character} test io-52.21 {TclCopyChannel & encodings} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf @@ -7659,7 +7659,7 @@ test io-52.21 {TclCopyChannel & encodings} -setup { } -cleanup { close $in close $out -} -returnCodes 1 -match glob -result {error writing "file*": illegal byte sequence} +} -returnCodes 1 -match glob -result {error writing "file*": Invalid or incomplete multibyte or wide character} test io-52.22 {TclCopyChannel & encodings} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf @@ -7686,7 +7686,7 @@ test io-52.22 {TclCopyChannel & encodings} -setup { close $in close $out unset ::s0 -} -match glob -result {0 {error reading "file*": illegal byte sequence}} +} -match glob -result {0 {error reading "file*": Invalid or incomplete multibyte or wide character}} test io-52.23 {TclCopyChannel & encodings} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf @@ -7713,7 +7713,7 @@ test io-52.23 {TclCopyChannel & encodings} -setup { close $in close $out unset ::s0 -} -match glob -result {0 {error writing "file*": illegal byte sequence}} +} -match glob -result {0 {error writing "file*": Invalid or incomplete multibyte or wide character}} test io-53.1 {CopyData} {fcopy} { @@ -8696,7 +8696,7 @@ test io-60.1 {writing illegal utf sequences} {fileevent testbytestring} { # cut of the remainder of the error stack, especially the filename set result [lreplace $result 3 3 [lindex [split [lindex $result 3] \n] 0]] list $x $result -} {1 {gets ABC catch {error writing "stdout": illegal byte sequence}}} +} {1 {gets ABC catch {error writing "stdout": Invalid or incomplete multibyte or wide character}}} test io-61.1 {Reset eof state after changing the eof char} -setup { set datafile [makeFile {} eofchar] @@ -9166,7 +9166,7 @@ test io-75.6 {invalid utf-8 encoding gets is not ignored (-profile strict)} -set } -cleanup { close $f removeFile io-75.6 -} -match glob -returnCodes 1 -result {error reading "*": illegal byte sequence} +} -match glob -returnCodes 1 -result {error reading "*": Invalid or incomplete multibyte or wide character} test io-75.7 {invalid utf-8 encoding gets is not ignored (-profile strict)} -setup { set fn [makeFile {} io-75.7] @@ -9182,7 +9182,7 @@ test io-75.7 {invalid utf-8 encoding gets is not ignored (-profile strict)} -set } -cleanup { close $f removeFile io-75.7 -} -match glob -returnCodes 1 -result {error reading "*": illegal byte sequence} +} -match glob -returnCodes 1 -result {error reading "*": Invalid or incomplete multibyte or wide character} test io-75.8 {invalid utf-8 encoding eof handling (-profile strict)} -setup { set fn [makeFile {} io-75.8] @@ -9216,7 +9216,7 @@ test io-75.9 {unrepresentable character write passes and is replaced by ?} -setu } -cleanup { close $f removeFile io-75.9 -} -match glob -result [list {A} {error writing "*": illegal byte sequence}] +} -match glob -result [list {A} {error writing "*": Invalid or incomplete multibyte or wide character}] # Incomplete sequence test. # This error may IMHO only be detected with the close. @@ -9260,7 +9260,7 @@ test io-75.11 {shiftjis encoding error read results in raw bytes} -setup { } -cleanup { close $f removeFile io-75.11 -} -match glob -result {41 1 {error reading "*": illegal byte sequence}} +} -match glob -result {41 1 {error reading "*": Invalid or incomplete multibyte or wide character}} test io-75.12 {invalid utf-8 encoding read is ignored} -setup { set fn [makeFile {} io-75.12] @@ -9295,7 +9295,7 @@ test io-75.13 {invalid utf-8 encoding read is not ignored (-profile strict)} -se } -cleanup { close $f removeFile io-75.13 -} -match glob -result {41 1 {error reading "*": illegal byte sequence}} +} -match glob -result {41 1 {error reading "*": Invalid or incomplete multibyte or wide character}} # ### ### ### ######### ######### ######### diff --git a/tests/ioCmd.test b/tests/ioCmd.test index 61b3bdd..6054cc9 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -138,7 +138,7 @@ test iocmd-4.8 {read command with incorrect combination of arguments} { } {1 {wrong # args: should be "read channelId ?numChars?" or "read ?-nonewline? channelId"} {TCL WRONGARGS}} test iocmd-4.9 {read command} { list [catch {read stdin foo} msg] $msg $::errorCode -} {1 {expected non-negative integer but got "foo"} {TCL VALUE NUMBER}} +} {1 {Expected non-negative integer but got "foo"} {TCL VALUE NUMBER}} test iocmd-4.10 {read command} { list [catch {read file107} msg] $msg $::errorCode } {1 {can not find channel named "file107"} {TCL LOOKUP CHANNEL file107}} @@ -156,7 +156,7 @@ test iocmd-4.12 {read command} -setup { read $f 12z } -cleanup { close $f -} -result {expected non-negative integer but got "12z"} -errorCode {TCL VALUE NUMBER} +} -result {Expected non-negative integer but got "12z"} -errorCode {TCL VALUE NUMBER} test iocmd-5.1 {seek command} -returnCodes error -body { seek @@ -439,7 +439,7 @@ test iocmd-11.3 {I/O to command pipelines} {unixOrWin unixExecs} { } {1 {can't read output from command: standard output was redirected} {TCL OPERATION EXEC BADREDIRECT}} test iocmd-11.4 {I/O to command pipelines} {notValgrind unixOrWin} { list [catch {open "| no_such_command_exists" rb} msg] $msg $::errorCode -} {1 {couldn't execute "no_such_command_exists": no such file or directory} {POSIX ENOENT {no such file or directory}}} +} {1 {couldn't execute "no_such_command_exists": No such file or directory} {POSIX ENOENT {No such file or directory}}} test iocmd-12.1 {POSIX open access modes: RDONLY} { file delete $path(test1) @@ -456,11 +456,11 @@ test iocmd-12.1 {POSIX open access modes: RDONLY} { test iocmd-12.2 {POSIX open access modes: RDONLY} -match regexp -body { file delete $path(test3) open $path(test3) RDONLY -} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} test iocmd-12.3 {POSIX open access modes: WRONLY} -match regexp -body { file delete $path(test3) open $path(test3) WRONLY -} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} # # Test 13.4 relies on assigning the same channel name twice. # @@ -486,7 +486,7 @@ test iocmd-12.4 {POSIX open access modes: WRONLY} {unix} { test iocmd-12.5 {POSIX open access modes: RDWR} -match regexp -body { file delete $path(test3) open $path(test3) RDWR -} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} test iocmd-12.6 {POSIX open access modes: errors} { concat [catch {open $path(test3) "FOO \{BAR BAZ"} msg] $msg\n$::errorInfo } "1 unmatched open brace in list @@ -545,8 +545,8 @@ test iocmd-13.5 {errors in open command} { test iocmd-13.6 {errors in open command} { set msg [list [catch {open _non_existent_} msg] $msg $::errorCode] regsub [file join {} _non_existent_] $msg "_non_existent_" msg - string tolower $msg -} {1 {couldn't open "_non_existent_": no such file or directory} {posix enoent {no such file or directory}}} + set msg +} {1 {couldn't open "_non_existent_": No such file or directory} {POSIX ENOENT {No such file or directory}}} test iocmd-13.7 {errors in open command} { list [catch {open $path(test1) b} msg] $msg } {1 {illegal access mode "b"}} @@ -884,7 +884,7 @@ test iocmd-21.22 {[close] in [read] segfaults} -setup { } -returnCodes error -cleanup { catch {close $ch} rename foo {} -} -match glob -result {*invalid argument*} +} -match glob -result {*Invalid argument*} test iocmd-21.23 {[close] in [gets] segfaults} -setup { proc foo {method chan args} { switch -- $method initialize { @@ -1743,7 +1743,7 @@ test iocmd-28.10 {chan seek, not supported by handler} -match glob -body { close $c rename foo {} set res -} -result {1 {error during seek on "rc*": invalid argument}} +} -result {1 {error during seek on "rc*": Invalid argument}} test iocmd-28.11 {chan seek, error return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code error BOOM!} @@ -3433,7 +3433,7 @@ test iocmd.tf-28.10 {chan seek, not supported by handler} -match glob -body { } c] rename foo {} set res -} -result {1 {error during seek on "rc*": invalid argument}} \ +} -result {1 {error during seek on "rc*": Invalid argument}} \ -constraints {testchannel thread} test iocmd.tf-28.11 {chan seek, error return} -match glob -body { set res {} diff --git a/tests/load.test b/tests/load.test index 005c451..32b1c3b 100644 --- a/tests/load.test +++ b/tests/load.test @@ -96,13 +96,13 @@ test load-3.1 {error in _Init procedure, same interpreter} \ [list $dll $loaded] { list [catch {load [file join $testDir pkge$ext] pkge} msg] \ $msg $::errorInfo $::errorCode -} {1 {couldn't open "non_existent": no such file or directory} {couldn't open "non_existent": no such file or directory +} {1 {couldn't open "non_existent": No such file or directory} {couldn't open "non_existent": No such file or directory while executing "open non_existent" invoked from within "if 44 {open non_existent}" invoked from within -"load [file join $testDir pkge$ext] pkge"} {POSIX ENOENT {no such file or directory}}} +"load [file join $testDir pkge$ext] pkge"} {POSIX ENOENT {No such file or directory}}} test load-3.2 {error in _Init procedure, child interpreter} \ [list $dll $loaded] { catch {interp delete x} @@ -113,13 +113,13 @@ test load-3.2 {error in _Init procedure, child interpreter} \ $msg $::errorInfo $::errorCode] interp delete x set result -} {1 {couldn't open "non_existent": no such file or directory} {couldn't open "non_existent": no such file or directory +} {1 {couldn't open "non_existent": No such file or directory} {couldn't open "non_existent": No such file or directory while executing "open non_existent" invoked from within "if 44 {open non_existent}" invoked from within -"load [file join $testDir pkge$ext] pkge x"} {POSIX ENOENT {no such file or directory}}} +"load [file join $testDir pkge$ext] pkge x"} {POSIX ENOENT {No such file or directory}}} test load-4.1 {reloading package into same interpreter} [list $dll $loaded] { list [catch {load [file join $testDir pkga$ext] pkga} msg] $msg diff --git a/tests/macOSXFCmd.test b/tests/macOSXFCmd.test index 5a62a2a..dc0eca0 100644 --- a/tests/macOSXFCmd.test +++ b/tests/macOSXFCmd.test @@ -34,7 +34,7 @@ if {[testConstraint unix] && $tcl_platform(os) eq "Darwin"} { test macOSXFCmd-1.1 {MacOSXGetFileAttribute - file not found} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} list [catch {file attributes foo.test -creator} msg] $msg -} {1 {could not read "foo.test": no such file or directory}} +} {1 {could not read "foo.test": No such file or directory}} test macOSXFCmd-1.2 {MacOSXGetFileAttribute - creator} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] @@ -63,7 +63,7 @@ test macOSXFCmd-1.5 {MacOSXGetFileAttribute - rsrclength} {macosxFileAttr notRoo test macOSXFCmd-2.1 {MacOSXSetFileAttribute - file not found} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} list [catch {file attributes foo.test -creator FOOC} msg] $msg -} {1 {could not read "foo.test": no such file or directory}} +} {1 {could not read "foo.test": No such file or directory}} test macOSXFCmd-2.2 {MacOSXSetFileAttribute - creator} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] diff --git a/tests/result.test b/tests/result.test index 5ae29b2..3a86930 100644 --- a/tests/result.test +++ b/tests/result.test @@ -62,7 +62,7 @@ test result-2.1 {Tcl_RestoreInterpResult} {testsaveresult} { test result-3.1 {Tcl_DiscardInterpResult} -constraints testsaveresult -body { testsaveresult append {cd _foobar} 1 -} -returnCodes error -result {couldn't change working directory to "_foobar": no such file or directory} +} -returnCodes error -result {couldn't change working directory to "_foobar": No such file or directory} test result-3.2 {Tcl_DiscardInterpResult} {testsaveresult} { testsaveresult free {set x 42} 1 } {42} diff --git a/tests/safe-stock.test b/tests/safe-stock.test index d23d86e..f79db4f 100644 --- a/tests/safe-stock.test +++ b/tests/safe-stock.test @@ -45,7 +45,7 @@ foreach i [interp children] { if {[string match *zipfs:/* [info library]]} { # pkgIndex.tcl is in [info library] # file to be sourced is in [info library]/opt* - set pkgOptErrMsg {permission denied} + set pkgOptErrMsg {Permission denied} } else { # pkgIndex.tcl and file to be sourced are # both in [info library]/opt* diff --git a/tests/safe.test b/tests/safe.test index f3890b7..8efed54 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -549,7 +549,7 @@ test safe-8.3 {safe source control on file} -setup { safe::interpDelete $i rename safe-test-log {} unset i log -} -result {1 {permission denied} {{ERROR for child a : ".": is a directory}}} +} -result {1 {Permission denied} {{ERROR for child a : ".": is a directory}}} test safe-8.4 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} @@ -565,7 +565,7 @@ test safe-8.4 {safe source control on file} -setup { safe::interpDelete $i rename safe-test-log {} unset i log -} -result {1 {permission denied} {{ERROR for child a : "/abc/def": not in access_path}}} +} -result {1 {Permission denied} {{ERROR for child a : "/abc/def": not in access_path}}} test safe-8.5 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} @@ -585,7 +585,7 @@ test safe-8.5 {safe source control on file} -setup { safe::interpDelete $i rename safe-test-log {} unset i log -} -result [list 1 {no such file or directory} [list "ERROR for child a : [file join [info library] blah]:no such file or directory"]] +} -result [list 1 {No such file or directory} [list "ERROR for child a : [file join [info library] blah]:No such file or directory"]] test safe-8.6 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} @@ -603,7 +603,7 @@ test safe-8.6 {safe source control on file} -setup { safe::interpDelete $i rename safe-test-log {} unset i log -} -result [list 1 {no such file or directory} [list "ERROR for child a : [file join [info library] blah.tcl]:no such file or directory"]] +} -result [list 1 {No such file or directory} [list "ERROR for child a : [file join [info library] blah.tcl]:No such file or directory"]] test safe-8.7 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} @@ -623,7 +623,7 @@ test safe-8.7 {safe source control on file} -setup { safe::interpDelete $i rename safe-test-log {} unset i log -} -result [list 1 {no such file or directory} [list "ERROR for child a : [file join [info library] xxxxxxxxxxx.tcl]:no such file or directory"]] +} -result [list 1 {No such file or directory} [list "ERROR for child a : [file join [info library] xxxxxxxxxxx.tcl]:No such file or directory"]] test safe-8.8 {safe source forbids -rsrc} emptyTest { # Disabled this test. It was only useful for long unsupported # Mac OS 9 systems. [Bug 860a9f1945] @@ -1389,14 +1389,14 @@ test safe-10.2 {testing statics loading / -nostatics} -constraints tcl::test -bo interp eval $i {load {} Safepfx1} } -returnCodes error -cleanup { safe::interpDelete $i -} -result {permission denied (static library)} +} -result {Permission denied (static library)} test safe-10.3 {testing nested statics loading / no nested by default} -setup { set i [safe::interpCreate] } -constraints tcl::test -body { interp eval $i {interp create x; load {} Safepfx1 x} } -returnCodes error -cleanup { safe::interpDelete $i -} -result {permission denied (nested load)} +} -result {Permission denied (nested load)} test safe-10.4 {testing nested statics loading / -nestedloadok} -constraints tcl::test -body { set i [safe::interpCreate -nestedloadok] interp eval $i {interp create x; load {} Safepfx1 x} @@ -1521,21 +1521,21 @@ test safe-12.1 {glob is restricted [Bug 2906841]} -setup { $i eval glob ../* } -returnCodes error -cleanup { safe::interpDelete $i -} -result "permission denied" +} -result "Permission denied" test safe-12.2 {glob is restricted [Bug 2906841]} -setup { set i [safe::interpCreate] } -body { $i eval glob -directory .. * } -returnCodes error -cleanup { safe::interpDelete $i -} -result "permission denied" +} -result "Permission denied" test safe-12.3 {glob is restricted [Bug 2906841]} -setup { set i [safe::interpCreate] } -body { $i eval glob -join .. * } -returnCodes error -cleanup { safe::interpDelete $i -} -result "permission denied" +} -result "Permission denied" test safe-12.4 {glob is restricted [Bug 2906841]} -setup { set i [safe::interpCreate] } -body { @@ -1563,7 +1563,7 @@ test safe-12.7 {glob is restricted} -setup { $i eval glob * } -returnCodes error -cleanup { safe::interpDelete $i -} -result {permission denied} +} -result {Permission denied} ### 13. More tests for Safe base glob, with patches @ Bug 2964715 ### More tests of glob in sections 12, 16. @@ -1590,7 +1590,7 @@ test safe-13.1 {glob is restricted [Bug 2964715]} -setup { $i eval glob * } -returnCodes error -cleanup { safe::interpDelete $i -} -result {permission denied} +} -result {Permission denied} test safe-13.2 {mimic the valid glob call by ::tcl::tm::UnknownHandler [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment deleteme.tm @@ -1614,7 +1614,7 @@ test safe-13.3 {cf 13.2 but test glob failure when -directory is outside access } -returnCodes error -cleanup { safe::interpDelete $i removeDirectory $testdir -} -result {permission denied} +} -result {Permission denied} test safe-13.4 {another valid glob call [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment deleteme.tm @@ -1642,7 +1642,7 @@ test safe-13.5 {as 13.4 but test glob failure when -directory is outside access } -returnCodes error -cleanup { safe::interpDelete $i removeDirectory $testdir -} -result {permission denied} +} -result {Permission denied} test safe-13.6 {as 13.4 but test silent failure when result is outside access_path [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment deleteme.tm diff --git a/tests/socket.test b/tests/socket.test index b1435be..5e6ba66 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -645,7 +645,7 @@ test socket_$af-2.9 {socket conflict} -constraints [list socket supported_$af st close $f } -returnCodes error -cleanup { close $s -} -match glob -result {couldn't open socket: address already in use*} +} -match glob -result {couldn't open socket: Address in use*} test socket_$af-2.10 {close on accept, accepted socket lives} -setup { set done 0 set timer [after 20000 "set done timed_out"] @@ -802,7 +802,7 @@ test socket_$af-3.1 {socket conflict} -constraints [list socket supported_$af st } -cleanup { puts $f bye close $f -} -returnCodes error -result {couldn't open socket: address already in use} +} -returnCodes error -result {couldn't open socket: Address in use} test socket_$af-3.2 {server with several clients} -setup { file delete $path(script) set f [open $path(script) w] @@ -1397,7 +1397,7 @@ test socket_$af-11.6 {socket conflict} -setup { list [getPort $s2] [close $s2] } -cleanup { close $s1 -} -returnCodes error -result {couldn't open socket: address already in use} +} -returnCodes error -result {couldn't open socket: Address in use} test socket_$af-11.7 {server with several clients} -setup { set port [sendCommand { set server [socket -server accept 0] @@ -2041,7 +2041,7 @@ test socket-14.1 {[socket -async] fileevent while still connecting} \ close $client unset x } -result {{} ok} -test socket-14.2 {[socket -async] fileevent connection refused} \ +test socket-14.2 {[socket -async] fileevent Connection refused} \ -constraints {socket} \ -body { set client [socket -async localhost [randport]] @@ -2054,7 +2054,7 @@ test socket-14.2 {[socket -async] fileevent connection refused} \ after cancel $after close $client unset x after client - } -result {ok {connection refused}} + } -result {ok {Connection refused}} test socket-14.3 {[socket -async] when server only listens on IPv6} \ -constraints {socket supported_inet6 localhost_v6} \ -setup { @@ -2113,7 +2113,7 @@ test socket-14.5 {[socket -async] which fails before any connect() can be made} socket -async -myaddr 192.0.2.42 127.0.0.1 [randport] } \ -returnCodes 1 \ - -result {couldn't open socket: cannot assign requested address} + -result {couldn't open socket: Cannot assign requested address} test socket-14.6.0 {[socket -async] with no event loop and server listening on IPv4} \ -constraints {socket supported_inet localhost_v4} \ -setup { @@ -2226,7 +2226,7 @@ test socket-14.7.2 {pending [socket -async] and blocking [gets], no listener} \ list $x [fconfigure $sock -error] [fconfigure $sock -error] } -cleanup { close $sock - } -match glob -result {{error reading "sock*": socket is not connected} {connection refused} {}} + } -match glob -result {{error reading "sock*": Transport endpoint is not connected} {Connection refused} {}} test socket-14.8.0 {pending [socket -async] and nonblocking [gets], server is IPv4} \ -constraints {socket supported_inet localhost_v4} \ -setup { @@ -2291,7 +2291,7 @@ test socket-14.8.2 {pending [socket -async] and nonblocking [gets], no listener} list $x [fconfigure $sock -error] [fconfigure $sock -error] } -cleanup { close $sock - } -match glob -result {{error reading "sock*": socket is not connected} {connection refused} {}} + } -match glob -result {{error reading "sock*": Transport endpoint is not connected} {Connection refused} {}} test socket-14.9.0 {pending [socket -async] and blocking [puts], server is IPv4} \ -constraints {socket supported_inet localhost_v4} \ -setup { @@ -2406,7 +2406,7 @@ test socket-14.11.0 {pending [socket -async] and nonblocking [puts], no listener } -cleanup { catch {close $sock} unset x - } -result {socket is not connected} -returnCodes 1 + } -result {Transport endpoint is not connected} -returnCodes 1 test socket-14.11.1 {pending [socket -async] and nonblocking [puts], no listener, flush} \ -constraints {socket testsocket_testflags} \ -body { @@ -2425,7 +2425,7 @@ test socket-14.11.1 {pending [socket -async] and nonblocking [puts], no listener } -cleanup { catch {close $sock} catch {unset x} - } -result {socket is not connected} -returnCodes 1 + } -result {Transport endpoint is not connected} -returnCodes 1 test socket-14.12 {[socket -async] background progress triggered by [fconfigure -error]} \ -constraints {socket} \ -body { @@ -2439,7 +2439,7 @@ test socket-14.12 {[socket -async] background progress triggered by [fconfigure } -cleanup { close $s unset x s - } -result {connection refused} + } -result {Connection refused} test socket-14.13 {testing writable event when quick failure} \ -constraints {socket win supported_inet notWine} \ @@ -2543,7 +2543,7 @@ set num 0 set x {localhost {socket} 127.0.0.1 {supported_inet} ::1 {supported_inet6}} set resultok {-result "sock*" -match glob} set resulterr { - -result {couldn't open socket: connection refused} + -result {couldn't open socket: Connection refused} -returnCodes 1 } foreach {servip sc} $x { diff --git a/tests/source.test b/tests/source.test index f5f9f0f..59a9d1a 100644 --- a/tests/source.test +++ b/tests/source.test @@ -104,8 +104,8 @@ test source-2.6 {source error conditions} -setup { removeFile _non_existent_ } -body { source $sourcefile -} -match glob -result {couldn't read file "*_non_existent_": no such file or directory} \ - -errorCode {POSIX ENOENT {no such file or directory}} +} -match glob -result {couldn't read file "*_non_existent_": No such file or directory} \ + -errorCode {POSIX ENOENT {No such file or directory}} test source-2.7 {utf-8 with BOM} -setup { set sourcefile [makeFile {} source.file] } -body { diff --git a/tests/unixFCmd.test b/tests/unixFCmd.test index e1084af..4f5d8f4 100644 --- a/tests/unixFCmd.test +++ b/tests/unixFCmd.test @@ -103,7 +103,7 @@ test unixFCmd-1.1 {TclpRenameFile: EACCES} -setup { } -returnCodes error -cleanup { file attributes td1/td2 -permissions 0o755 cleanup -} -result {error renaming "td1/td2/td3": permission denied} +} -result {error renaming "td1/td2/td3": Permission denied} test unixFCmd-1.2 {TclpRenameFile: EEXIST} -setup { cleanup } -constraints {unix notRoot} -body { @@ -112,7 +112,7 @@ test unixFCmd-1.2 {TclpRenameFile: EEXIST} -setup { file rename td2 td1 } -returnCodes error -cleanup { cleanup -} -result {error renaming "td2" to "td1/td2": file already exists} +} -result {error renaming "td2" to "td1/td2": File exists} test unixFCmd-1.3 {TclpRenameFile: EINVAL} -setup { cleanup } -constraints {unix notRoot} -body { @@ -131,7 +131,7 @@ test unixFCmd-1.5 {TclpRenameFile: ENOENT} -setup { file rename td2 td1 } -returnCodes error -cleanup { cleanup -} -result {error renaming "td2": no such file or directory} +} -result {error renaming "td2": No such file or directory} test unixFCmd-1.6 {TclpRenameFile: ENOTDIR} {emptyTest unix notRoot} { # can't make it happen } {} @@ -145,7 +145,7 @@ test unixFCmd-1.7 {TclpRenameFile: EXDEV} -setup { catch {file delete /tmp/bar} catch {file attr foo -perm 0o40777} catch {file delete -force foo} -} -match glob -result {*: permission denied} +} -match glob -result {*: Permission denied} test unixFCmd-1.8 {Checking EINTR Bug} {unix notRoot nonPortable} { testalarm after 2000 @@ -261,7 +261,7 @@ test unixFCmd-12.1 {GetGroupAttribute - file not found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -group -} -result {could not read "foo.test": no such file or directory} +} -result {could not read "foo.test": No such file or directory} test unixFCmd-12.2 {GetGroupAttribute - file found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { @@ -275,7 +275,7 @@ test unixFCmd-13.1 {GetOwnerAttribute - file not found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -group -} -result {could not read "foo.test": no such file or directory} +} -result {could not read "foo.test": No such file or directory} test unixFCmd-13.2 {GetOwnerAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { @@ -289,7 +289,7 @@ test unixFCmd-14.1 {GetPermissionsAttribute - file not found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -permissions -} -result {could not read "foo.test": no such file or directory} +} -result {could not read "foo.test": No such file or directory} test unixFCmd-14.2 {GetPermissionsAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { @@ -311,7 +311,7 @@ test unixFCmd-15.2 {SetGroupAttribute - invalid file} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot foundGroup} -returnCodes error -body { file attributes foo.test -group $group -} -result {could not set group for file "foo.test": no such file or directory} +} -result {could not set group for file "foo.test": No such file or directory} #changing owners hard to do test unixFCmd-16.1 {SetOwnerAttribute - current owner} -setup { @@ -327,7 +327,7 @@ test unixFCmd-16.2 {SetOwnerAttribute - invalid file} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -owner $user -} -result {could not set owner for file "foo.test": no such file or directory} +} -result {could not set owner for file "foo.test": No such file or directory} test unixFCmd-16.3 {SetOwnerAttribute - invalid owner} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { @@ -347,7 +347,7 @@ test unixFCmd-17.2 {SetPermissionsAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -permissions 0 -} -result {could not set permissions for file "foo.test": no such file or directory} +} -result {could not set permissions for file "foo.test": No such file or directory} test unixFCmd-17.3 {SetPermissionsAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { @@ -404,7 +404,7 @@ test unixFCmd-19.1 {GetReadOnlyAttribute - file not found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot readonlyAttr} -returnCodes error -body { file attributes foo.test -readonly -} -result {could not read "foo.test": no such file or directory} +} -result {could not read "foo.test": No such file or directory} test unixFCmd-19.2 {GetReadOnlyAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot readonlyAttr} -body { @@ -430,7 +430,7 @@ test unixFCmd-20.2 {SetReadOnlyAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot readonlyAttr} -returnCodes error -body { file attributes foo.test -readonly 1 -} -result {could not read "foo.test": no such file or directory} +} -result {could not read "foo.test": No such file or directory} # cleanup cleanup diff --git a/tests/winFCmd.test b/tests/winFCmd.test index 3be1920..6848f21 100644 --- a/tests/winFCmd.test +++ b/tests/winFCmd.test @@ -946,12 +946,12 @@ test winFCmd-10.1 {AttributesPosixError - get} -constraints {win} -setup { cleanup } -body { file attributes td1 -archive -} -returnCodes error -result {could not read "td1": no such file or directory} +} -returnCodes error -result {could not read "td1": No such file or directory} test winFCmd-10.2 {AttributesPosixError - set} -constraints {win} -setup { cleanup } -body { file attributes td1 -archive 0 -} -returnCodes error -result {could not read "td1": no such file or directory} +} -returnCodes error -result {could not read "td1": No such file or directory} test winFCmd-11.1 {GetWinFileAttributes} -constraints {win} -setup { cleanup @@ -1098,7 +1098,7 @@ test winFCmd-15.1 {SetWinFileAttributes} -constraints {win} -setup { cleanup } -body { file attributes td1 -archive 0 -} -returnCodes error -result {could not read "td1": no such file or directory} +} -returnCodes error -result {could not read "td1": No such file or directory} test winFCmd-15.2 {SetWinFileAttributes - archive} -constraints {win} -setup { cleanup } -body { @@ -1268,11 +1268,11 @@ test winFCmd-17.1 {Windows bad permissions cd} -constraints win -body { regsub ".*: " $err "" err set err } else { - set err "permission denied" + set err "Permission denied" } } -cleanup { cd $pwd -} -result "permission denied" +} -result "Permission denied" cd $pwd unset d dd pwd diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 7396258..5cd6b7db 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -380,7 +380,7 @@ TclpInitPlatform(void) } /* - * The code below causes SIGPIPE (broken pipe) errors to be ignored. This + * The code below causes SIGPIPE (Broken pipe) errors to be ignored. This * is needed so that Tcl processes don't die if they create child * processes (e.g. using "exec" or "open") that terminate prematurely. * The signal handler is only set up when the first interpreter is diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index 7f8cfd1..19411e8 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -1603,7 +1603,7 @@ ConvertFileNameFormat( if (splitPath == NULL || pathc == 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "could not read \"%s\": no such file or directory", + "could not read \"%s\": No such file or directory", Tcl_GetString(fileName))); errno = ENOENT; Tcl_PosixError(interp); -- cgit v0.12 From d2fc2aa765cea8a44d1d40502629a88c09bbfd41 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 26 Mar 2023 18:41:13 +0000 Subject: Sync all error-messages with modern Linux --- generic/tclPosixStr.c | 100 ++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 52 deletions(-) diff --git a/generic/tclPosixStr.c b/generic/tclPosixStr.c index c4647d9..d4c20fa 100644 --- a/generic/tclPosixStr.c +++ b/generic/tclPosixStr.c @@ -496,9 +496,6 @@ const char * Tcl_ErrnoMsg( int err) /* Error number (such as in errno variable). */ { -#ifndef _WIN32 - return strerror(err); -#else switch (err) { #if defined(E2BIG) && (!defined(EOVERFLOW) || (E2BIG != EOVERFLOW)) case E2BIG: return "Argument list too long"; @@ -507,28 +504,28 @@ Tcl_ErrnoMsg( case EACCES: return "Permission denied"; #endif #ifdef EADDRINUSE - case EADDRINUSE: return "Address in use"; + case EADDRINUSE: return "Address already in use"; #endif #ifdef EADDRNOTAVAIL - case EADDRNOTAVAIL: return "Address not available"; + case EADDRNOTAVAIL: return "Cannot assign requested address"; #endif #ifdef EADV case EADV: return "Advertise error"; #endif #ifdef EAFNOSUPPORT - case EAFNOSUPPORT: return "Address family not supported"; + case EAFNOSUPPORT: return "Address family not supported by protocol"; #endif #ifdef EAGAIN - case EAGAIN: return "Resource unavailable, try again"; + case EAGAIN: return "Resource temporarily unavailable"; #endif #ifdef EALIGN case EALIGN: return "EALIGN"; #endif #if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY)) - case EALREADY: return "Connection already in progress"; + case EALREADY: return "Operation already in progress"; #endif #ifdef EBADE - case EBADE: return "Bad exchange descriptor"; + case EBADE: return "Invalid exchange"; #endif #ifdef EBADF case EBADF: return "Bad file descriptor"; @@ -540,13 +537,13 @@ Tcl_ErrnoMsg( case EBADMSG: return "Bad message"; #endif #ifdef EBADR - case EBADR: return "Bad request descriptor"; + case EBADR: return "Invalid request descriptor"; #endif #ifdef EBADRPC case EBADRPC: return "RPC structure is bad"; #endif #ifdef EBADRQC - case EBADRQC: return "Bad request code"; + case EBADRQC: return "Invalid request code"; #endif #ifdef EBADSLT case EBADSLT: return "Invalid slot"; @@ -570,19 +567,19 @@ Tcl_ErrnoMsg( case ECOMM: return "Communication error on send"; #endif #ifdef ECONNABORTED - case ECONNABORTED: return "Connection aborted"; + case ECONNABORTED: return "Software caused connection abort"; #endif #ifdef ECONNREFUSED case ECONNREFUSED: return "Connection refused"; #endif #ifdef ECONNRESET - case ECONNRESET: return "Connection reset"; + case ECONNRESET: return "Connection reset by peer"; #endif #if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK)) - case EDEADLK: return "Resource deadlock would occur"; + case EDEADLK: return "Resource deadlock avoided"; #endif #if defined(EDEADLOCK) && (!defined(EDEADLK) || (EDEADLOCK != EDEADLK)) - case EDEADLOCK: return "Resource deadlock would occur"; + case EDEADLOCK: return "Resource deadlock avoided"; #endif #ifdef EDESTADDRREQ case EDESTADDRREQ: return "Destination address required"; @@ -591,10 +588,10 @@ Tcl_ErrnoMsg( case EDIRTY: return "Mounting a dirty fs w/o force"; #endif #ifdef EDOM - case EDOM: return "Mathematics argument out of domain of function"; + case EDOM: return "Numerical argument out of domain"; #endif #ifdef EDOTDOT - case EDOTDOT: return "Cross mount point"; + case EDOTDOT: return "RFS specific error"; #endif #ifdef EDQUOT case EDQUOT: return "Disk quota exceeded"; @@ -615,7 +612,7 @@ Tcl_ErrnoMsg( case EHOSTDOWN: return "Host is down"; #endif #ifdef EHOSTUNREACH - case EHOSTUNREACH: return "Host is unreachable"; + case EHOSTUNREACH: return "No route to host"; #endif #if defined(EIDRM) && (!defined(EINPROGRESS) || (EIDRM != EINPROGRESS)) case EIDRM: return "Identifier removed"; @@ -627,19 +624,19 @@ Tcl_ErrnoMsg( case EILSEQ: return "Invalid or incomplete multibyte or wide character"; #endif #ifdef EINPROGRESS - case EINPROGRESS: return "Operation in progress"; + case EINPROGRESS: return "Operation now in progress"; #endif #ifdef EINTR - case EINTR: return "Interrupted function"; + case EINTR: return "Interrupted system call"; #endif #ifdef EINVAL case EINVAL: return "Invalid argument"; #endif #ifdef EIO - case EIO: return "I/O error"; + case EIO: return "Input/output error"; #endif #ifdef EISCONN - case EISCONN: return "Socket is connected"; + case EISCONN: return "Transport endpoint is already connected"; #endif #ifdef EISDIR case EISDIR: return "Is a directory"; @@ -663,7 +660,7 @@ Tcl_ErrnoMsg( case EL3RST: return "Level 3 reset"; #endif #ifdef ELIBACC - case ELIBACC: return "Cannot access a needed shared library"; + case ELIBACC: return "Can not access a needed shared library"; #endif #ifdef ELIBBAD case ELIBBAD: return "Accessing a corrupted shared library"; @@ -673,7 +670,7 @@ Tcl_ErrnoMsg( #endif #if defined(ELIBMAX) && (!defined(ECANCELED) || (ELIBMAX != ECANCELED)) case ELIBMAX: return - "Attempting to link in more shared libraries than system limit"; + "Attempting to link in too many shared libraries"; #endif #ifdef ELIBSCN case ELIBSCN: return ".lib section in a.out corrupted"; @@ -685,22 +682,22 @@ Tcl_ErrnoMsg( case ELOOP: return "Too many levels of symbolic links"; #endif #ifdef EMFILE - case EMFILE: return "File descriptor value too large"; + case EMFILE: return "Too many open files"; #endif #ifdef EMLINK case EMLINK: return "Too many links"; #endif #ifdef EMSGSIZE - case EMSGSIZE: return "Message too large"; + case EMSGSIZE: return "Message too long"; #endif #ifdef EMULTIHOP case EMULTIHOP: return "Multihop attempted"; #endif #ifdef ENAMETOOLONG - case ENAMETOOLONG: return "Filename too long"; + case ENAMETOOLONG: return "File name too long"; #endif #ifdef ENAVAIL - case ENAVAIL: return "Not available"; + case ENAVAIL: return "No XENIX semaphores available"; #endif #ifdef ENET case ENET: return "ENET"; @@ -715,10 +712,10 @@ Tcl_ErrnoMsg( case ENETUNREACH: return "Network is unreachable"; #endif #ifdef ENFILE - case ENFILE: return "Too many files open in system"; + case ENFILE: return "Too many open files in system"; #endif #ifdef ENOANO - case ENOANO: return "Anode table overflow"; + case ENOANO: return "No anode"; #endif #if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR)) case ENOBUFS: return "No buffer space available"; @@ -736,7 +733,7 @@ Tcl_ErrnoMsg( case ENOENT: return "No such file or directory"; #endif #ifdef ENOEXEC - case ENOEXEC: return "Executable format error"; + case ENOEXEC: return "Exec format error"; #endif #ifdef ENOLCK case ENOLCK: return "No locks available"; @@ -745,7 +742,7 @@ Tcl_ErrnoMsg( case ENOLINK: return "Link has been severed"; #endif #ifdef ENOMEM - case ENOMEM: return "Not enough space"; + case ENOMEM: return "Cannot allocate memory"; #endif #ifdef ENOMSG case ENOMSG: return "No message of desired type"; @@ -763,16 +760,16 @@ Tcl_ErrnoMsg( case ENOSPC: return "No space left on device"; #endif #if defined(ENOSR) && (!defined(ENAMETOOLONG) || (ENAMETOOLONG != ENOSR)) - case ENOSR: return "No stream resources"; + case ENOSR: return "Out of streams resources"; #endif #if defined(ENOSTR) && (!defined(ENOTTY) || (ENOTTY != ENOSTR)) - case ENOSTR: return "Not a stream"; + case ENOSTR: return "Device not a stream"; #endif #ifdef ENOSYM case ENOSYM: return "Unresolved symbol name"; #endif #ifdef ENOSYS - case ENOSYS: return "Functionality not supported"; + case ENOSYS: return "Function not implemented"; #endif #ifdef ENOTBLK case ENOTBLK: return "Block device required"; @@ -784,22 +781,22 @@ Tcl_ErrnoMsg( case ENOTRECOVERABLE: return "State not recoverable"; #endif #ifdef ENOTDIR - case ENOTDIR: return "Not a directory or a symbolic link to a directory"; + case ENOTDIR: return "Not a directory"; #endif #if defined(ENOTEMPTY) && (!defined(EEXIST) || (ENOTEMPTY != EEXIST)) case ENOTEMPTY: return "Directory not empty"; #endif #ifdef ENOTNAM - case ENOTNAM: return "Not a name file"; + case ENOTNAM: return "Not a XENIX named type file"; #endif #ifdef ENOTSOCK - case ENOTSOCK: return "Not a socket"; + case ENOTSOCK: return "Socket operation on non-socket"; #endif #ifdef ENOTSUP - case ENOTSUP: return "Not supported"; + case ENOTSUP: return "Operation not supported"; #endif #ifdef ENOTTY - case ENOTTY: return "Inappropriate I/O control operation"; + case ENOTTY: return "Inappropriate ioctl for device"; #endif #ifdef ENOTUNIQ case ENOTUNIQ: return "Name not unique on network"; @@ -814,10 +811,10 @@ Tcl_ErrnoMsg( case EOTHER: return "Other error"; #endif #if defined(EOVERFLOW) && (!defined(EFBIG) || (EOVERFLOW != EFBIG)) && (!defined(EINVAL) || (EOVERFLOW != EINVAL)) - case EOVERFLOW: return "Value too large to be stored in data type"; + case EOVERFLOW: return "Value too large for defined data type"; #endif #ifdef EOWNERDEAD - case EOWNERDEAD: return "Previous owner died"; + case EOWNERDEAD: return "Owner died"; #endif #ifdef EPERM case EPERM: return "Operation not permitted"; @@ -850,7 +847,7 @@ Tcl_ErrnoMsg( case EPROTOTYPE: return "Protocol wrong type for socket"; #endif #ifdef ERANGE - case ERANGE: return "Result too large"; + case ERANGE: return "Numerical result out of range"; #endif #if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED)) case EREFUSED: return "EREFUSED"; @@ -862,10 +859,10 @@ Tcl_ErrnoMsg( case EREMDEV: return "Remote device"; #endif #ifdef EREMOTE - case EREMOTE: return "Pathname hit remote file system"; + case EREMOTE: return "Object is remote"; #endif #ifdef EREMOTEIO - case EREMOTEIO: return "Remote i/o error"; + case EREMOTEIO: return "Remote I/O error"; #endif #ifdef EREMOTERELEASE case EREMOTERELEASE: return "EREMOTERELEASE"; @@ -880,13 +877,13 @@ Tcl_ErrnoMsg( case ERREMOTE: return "Object is remote"; #endif #ifdef ESHUTDOWN - case ESHUTDOWN: return "Cannot send after socket shutdown"; + case ESHUTDOWN: return "Cannot send after transport endpoint shutdown"; #endif #ifdef ESOCKTNOSUPPORT case ESOCKTNOSUPPORT: return "Socket type not supported"; #endif #ifdef ESPIPE - case ESPIPE: return "Invalid seek"; + case ESPIPE: return "Illegal seek"; #endif #ifdef ESRCH case ESRCH: return "No such process"; @@ -895,10 +892,10 @@ Tcl_ErrnoMsg( case ESRMNT: return "Srmount error"; #endif #ifdef ESTALE - case ESTALE: return "Stale remote file handle"; + case ESTALE: return "Stale file handle"; #endif #ifdef ESUCCESS - case ESUCCESS: return "Error 0"; + case ESUCCESS: return "Success"; #endif #if defined(ETIME) && (!defined(ELOOP) || (ETIME != ELOOP)) case ETIME: return "Timer expired"; @@ -928,10 +925,10 @@ Tcl_ErrnoMsg( case EWOULDBLOCK: return "Operation would block"; #endif #ifdef EXDEV - case EXDEV: return "Cross-domain link"; + case EXDEV: return "Invalid cross-device link"; #endif #ifdef EXFULL - case EXFULL: return "Message tables full"; + case EXFULL: return "Exchange full"; #endif default: #ifdef NO_STRERROR @@ -940,7 +937,6 @@ Tcl_ErrnoMsg( return strerror(err); #endif } -#endif } /* -- cgit v0.12 From 91fa419271d52aee3aaa718839eca26fa168d494 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 27 Mar 2023 20:24:09 +0000 Subject: More text fixes --- generic/tclPosixStr.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/generic/tclPosixStr.c b/generic/tclPosixStr.c index ad3c26d..c31ab81 100644 --- a/generic/tclPosixStr.c +++ b/generic/tclPosixStr.c @@ -182,7 +182,7 @@ Tcl_ErrnoId(void) #ifdef EISDIR case EISDIR: return "EISDIR"; #endif -#ifdef EISNAME +#ifdef EISNAM case EISNAM: return "EISNAM"; #endif #ifdef EL2HLT @@ -221,6 +221,9 @@ Tcl_ErrnoId(void) #if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT)) case ELOOP: return "ELOOP"; #endif +#ifdef EMEDIUMTYPE + case EMEDIUMTYPE: return "EMEDIUMTYPE"; +#endif #ifdef EMFILE case EMFILE: return "EMFILE"; #endif @@ -413,6 +416,9 @@ Tcl_ErrnoId(void) #ifdef EREMOTERELEASE case EREMOTERELEASE: return "EREMOTERELEASE"; #endif +#ifdef ERESTART + case ERESTART: return "ERESTART"; +#endif #ifdef EROFS case EROFS: return "EROFS"; #endif @@ -653,8 +659,8 @@ Tcl_ErrnoMsg( #ifdef EISDIR case EISDIR: return "is a directory"; #endif -#ifdef EISNAME - case EISNAM: return "is a name file"; +#ifdef EISNAM + case EISNAM: return "is a named type file"; #endif #ifdef EL2HLT case EL2HLT: return "level 2 halted"; @@ -693,6 +699,9 @@ Tcl_ErrnoMsg( #if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT)) case ELOOP: return "too many levels of symbolic links"; #endif +#ifdef EMEDIUMTYPE + case EMEDIUMTYPE: return "wrong medium type"; +#endif #ifdef EMFILE case EMFILE: return "too many open files"; #endif @@ -757,7 +766,7 @@ Tcl_ErrnoMsg( case ENOMEM: return "cannot allocate memory"; #endif #ifdef ENOMEDIUM - case ENOMEDIUM: return "no medium"; + case ENOMEDIUM: return "no medium found"; #endif #ifdef ENOMSG case ENOMSG: return "no message of desired type"; @@ -885,6 +894,9 @@ Tcl_ErrnoMsg( #ifdef EREMOTERELEASE case EREMOTERELEASE: return "remote peer released connection"; #endif +#ifdef ERESTART + case ERESTART: return "interrupted system call should be restarted"; +#endif #ifdef EROFS case EROFS: return "read-only file system"; #endif -- cgit v0.12