Overview
Comment: | More tests and cleaned up error handling for POSIX error codes |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
e786b9e07b62f8ed996a4c845360afcc |
User & Date: | rkeene on 2019-09-16 21:02:23 |
Other Links: | manifest | tags |
Context
2019-09-16
| ||
21:19 | More tests check-in: 3d002d6892 user: rkeene tags: trunk | |
21:02 | More tests and cleaned up error handling for POSIX error codes check-in: e786b9e07b user: rkeene tags: trunk | |
20:43 | More tests and small fixes check-in: 10f67b2ced user: rkeene tags: trunk | |
Changes
Modified example/main.tcl from [5b23a3839e] to [414972be93].
︙ | |||
69 70 71 72 73 74 75 | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | - + - - - + + + + + + + + + + + + + + + + + + + + + + | read $fd 1 read $fd 1 } -cleanup { close $fd unset fd } -result "" |
︙ | |||
186 187 188 189 190 191 192 193 194 195 196 197 198 199 | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | + + + + + + | tcltest::test xvfs-stat-basic-file "Xvfs stat Basic File Test" -body { file stat $testFile fileInfo set fileInfo(type) } -cleanup { unset -nocomplain fileInfo } -result file tcltest::test xvfs-stat-basic-file-neg "Xvfs stat Basic File Negative Test" -body { file stat $rootDir/does-not-exist fileInfo } -cleanup { unset -nocomplain fileInfo } -match glob -returnCodes error -result "*no such file or directory" tcltest::test xvfs-stat-basic-dir "Xvfs stat Basic Directory Test" -body { file stat $rootDir/lib fileInfo set fileInfo(type) } -cleanup { unset -nocomplain fileInfo } -result directory |
︙ |
Modified xvfs-core.c from [ecbc07c77d] to [20368f703a].
︙ | |||
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | + + + + + + + + + + + - + + + + + + + + + + + + | return(Tcl_ErrnoMsg(xvfs_errorToErrno(xvfs_error))); case XVFS_RV_ERR_INTERNAL: return("Internal error"); default: return("Unknown error"); } } static void xvfs_setresults_error(Tcl_Interp *interp, int xvfs_error) { if (!interp) { return; } Tcl_SetErrno(xvfs_errorToErrno(xvfs_error)); Tcl_SetResult(interp, (char *) xvfs_perror(xvfs_error), NULL); return; } /* * Xvfs Memory Channel */ struct xvfs_tclfs_channel_id { Tcl_Channel channel; struct xvfs_tclfs_instance_info *fsInstanceInfo; Tcl_Obj *path; Tcl_WideInt currentOffset; Tcl_WideInt fileSize; int eofMarked; int queuedEvents; int closed; }; struct xvfs_tclfs_channel_event { Tcl_Event tcl; struct xvfs_tclfs_channel_id *channelInstanceData; }; static Tcl_ChannelType xvfs_tclfs_channelType; |
︙ | |||
573 574 575 576 577 578 579 | 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 | - - + - - - + | XVFS_DEBUG_ENTER; XVFS_DEBUG_PRINTF("Asked to open(\"%s\", %x)...", Tcl_GetString(path), mode); if (mode & O_WRONLY) { XVFS_DEBUG_PUTS("... failed (asked to open for writing)"); |
︙ | |||
730 731 732 733 734 735 736 | 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 | - - + - - - + - | pathStr = xvfs_relativePath(path, instanceInfo); if (!pathStr) { XVFS_DEBUG_PUTS("... error (not in our VFS)"); Tcl_DecrRefCount(path); |
︙ |