From aabe9cb3ab1a8cda4350da087a5a9b40f99d1551 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 4 Oct 2023 13:53:59 +0000 Subject: test suite hygiene --- tests/zipfs.test | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/zipfs.test b/tests/zipfs.test index 046e3b5..17dcc78 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -1521,33 +1521,37 @@ namespace eval test_ns_zipfs { test zipfs-file-copy-tozip-new {Copy native file to archive} -setup { mount [zippath test.zip] } -cleanup { + removeFile $_ cleanup } -body { - file copy [makeFile "" source.tmp] [file join $defMountPt X] + file copy [set _ [makeFile "" source.tmp]] [file join $defMountPt X] } -result "error copying \"*source.tmp\" to \"[file join $defMountPt X]\": operation not supported" \ -match glob -returnCodes error test zipfs-file-copy-tozip-existing {Copy native file to archive} -setup { mount [zippath test.zip] } -cleanup { + removeFile $_ cleanup } -body { - file copy [makeFile "newtext" source.tmp] [file join $defMountPt test] + file copy [set _ [makeFile "newtext" source.tmp]] [file join $defMountPt test] } -result "error copying *: file exists" -match glob -returnCodes error test zipfs-file-copy-tozip-existing-force {Copy native file to archive} -setup { mount [zippath test.zip] } -cleanup { + removeFile $_ cleanup } -body { set to [file join $defMountPt test] - file copy -force [makeFile "newtext" source.tmp] $to + file copy -force [set _ [makeFile "newtext" source.tmp]] $to readbin $to } -result "newtext\n" test zipfs-file-copy-tozipdir {Copy native file to archive directory} -setup { mount [zippath test.zip] } -cleanup { + removeFile $_ cleanup } -body { - file copy [makeFile "" source.tmp] [file join $defMountPt testdir] + file copy [set _ [makeFile "" source.tmp]] [file join $defMountPt testdir] } -result "error copying \"*source.tmp\" to \"[file join $defMountPt testdir]/source.tmp\": operation not supported" \ -match glob -returnCodes error test zipfs-file-copydir-tozipdir {Copy native dir to archive directory} -setup { @@ -1768,7 +1772,7 @@ namespace eval test_ns_zipfs { testzipfsenotsup mtime-set-mount [list mtime $targetMount $t] testzipfsenotsup mtime-set-mezzo [list mtime $targetMountParent $t] testzipfsenotsup mtime-set-root [list mtime [zipfs root] $t] - testzipfsfile mtime-set-enoent [list mtime $targetEnoent $t] \ + testzipfsfile mtime-set-enoent-1 [list mtime $targetEnoent $t] \ "could not read \"$targetEnoent\": no such file or directory" -returnCodes error # -- cgit v0.12 From 1081ce3d811ca2df171d764f1611eb89d8a891b3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 4 Oct 2023 15:17:50 +0000 Subject: Move some (internal) stub entries to lower numbers --- generic/tclInt.decls | 28 ++++++++++++++------------ generic/tclIntDecls.h | 55 +++++++++++++++++++++++++++------------------------ generic/tclStubInit.c | 12 +++++------ 3 files changed, 50 insertions(+), 45 deletions(-) diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 637ab3f..15d2cfa 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -530,8 +530,22 @@ declare 217 { declare 218 { void TclPopStackFrame(Tcl_Interp *interp) } +# TIP 431: temporary directory creation function +declare 219 { + Tcl_Obj *TclpCreateTemporaryDirectory(Tcl_Obj *dirObj, + Tcl_Obj *basenameObj) +} # for use in tclTest.c + +# TIP 625: for unit testing - create list objects with span +declare 221 { + Tcl_Obj *TclListTestObj(size_t length, size_t leadingSpace, size_t endSpace) +} +# TIP 625: for unit testing - check list invariants +declare 222 { + void TclListObjValidate(Tcl_Interp *interp, Tcl_Obj *listObj) +} declare 224 { TclPlatformType *TclGetPlatform(void) } @@ -679,20 +693,8 @@ declare 257 { Tcl_LibraryInitProc *initProc, Tcl_LibraryInitProc *safeInitProc) } -# TIP 431: temporary directory creation function -declare 258 { - Tcl_Obj *TclpCreateTemporaryDirectory(Tcl_Obj *dirObj, - Tcl_Obj *basenameObj) -} - -# TIP 625: for unit testing - create list objects with span -declare 260 { - Tcl_Obj *TclListTestObj(size_t length, size_t leadingSpace, size_t endSpace) -} - -# TIP 625: for unit testing - check list invariants declare 261 { - void TclListObjValidate(Tcl_Interp *interp, Tcl_Obj *listObj) + void TclUnusedStubEntry(void) } ############################################################################## diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index 78ee5e6..d8f3af8 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -542,10 +542,16 @@ EXTERN int TclPushStackFrame(Tcl_Interp *interp, int isProcCallFrame); /* 218 */ EXTERN void TclPopStackFrame(Tcl_Interp *interp); -/* Slot 219 is reserved */ +/* 219 */ +EXTERN Tcl_Obj * TclpCreateTemporaryDirectory(Tcl_Obj *dirObj, + Tcl_Obj *basenameObj); /* Slot 220 is reserved */ -/* Slot 221 is reserved */ -/* Slot 222 is reserved */ +/* 221 */ +EXTERN Tcl_Obj * TclListTestObj(size_t length, size_t leadingSpace, + size_t endSpace); +/* 222 */ +EXTERN void TclListObjValidate(Tcl_Interp *interp, + Tcl_Obj *listObj); /* Slot 223 is reserved */ /* 224 */ EXTERN TclPlatformType * TclGetPlatform(void); @@ -656,16 +662,11 @@ EXTERN void TclStaticLibrary(Tcl_Interp *interp, const char *prefix, Tcl_LibraryInitProc *initProc, Tcl_LibraryInitProc *safeInitProc); -/* 258 */ -EXTERN Tcl_Obj * TclpCreateTemporaryDirectory(Tcl_Obj *dirObj, - Tcl_Obj *basenameObj); +/* Slot 258 is reserved */ /* Slot 259 is reserved */ -/* 260 */ -EXTERN Tcl_Obj * TclListTestObj(size_t length, size_t leadingSpace, - size_t endSpace); +/* Slot 260 is reserved */ /* 261 */ -EXTERN void TclListObjValidate(Tcl_Interp *interp, - Tcl_Obj *listObj); +EXTERN void TclUnusedStubEntry(void); typedef struct TclIntStubs { int magic; @@ -890,10 +891,10 @@ typedef struct TclIntStubs { void (*tclStackFree) (Tcl_Interp *interp, void *freePtr); /* 216 */ int (*tclPushStackFrame) (Tcl_Interp *interp, Tcl_CallFrame **framePtrPtr, Tcl_Namespace *namespacePtr, int isProcCallFrame); /* 217 */ void (*tclPopStackFrame) (Tcl_Interp *interp); /* 218 */ - void (*reserved219)(void); + Tcl_Obj * (*tclpCreateTemporaryDirectory) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj); /* 219 */ void (*reserved220)(void); - void (*reserved221)(void); - void (*reserved222)(void); + Tcl_Obj * (*tclListTestObj) (size_t length, size_t leadingSpace, size_t endSpace); /* 221 */ + void (*tclListObjValidate) (Tcl_Interp *interp, Tcl_Obj *listObj); /* 222 */ void (*reserved223)(void); TclPlatformType * (*tclGetPlatform) (void); /* 224 */ Tcl_Obj * (*tclTraceDictPath) (Tcl_Interp *interp, Tcl_Obj *rootPtr, Tcl_Size keyc, Tcl_Obj *const keyv[], int flags); /* 225 */ @@ -929,10 +930,10 @@ typedef struct TclIntStubs { int (*tclPtrObjMakeUpvar) (Tcl_Interp *interp, Tcl_Var otherPtr, Tcl_Obj *myNamePtr, int myFlags); /* 255 */ int (*tclPtrUnsetVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags); /* 256 */ void (*tclStaticLibrary) (Tcl_Interp *interp, const char *prefix, Tcl_LibraryInitProc *initProc, Tcl_LibraryInitProc *safeInitProc); /* 257 */ - Tcl_Obj * (*tclpCreateTemporaryDirectory) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj); /* 258 */ + void (*reserved258)(void); void (*reserved259)(void); - Tcl_Obj * (*tclListTestObj) (size_t length, size_t leadingSpace, size_t endSpace); /* 260 */ - void (*tclListObjValidate) (Tcl_Interp *interp, Tcl_Obj *listObj); /* 261 */ + void (*reserved260)(void); + void (*tclUnusedStubEntry) (void); /* 261 */ } TclIntStubs; extern const TclIntStubs *tclIntStubsPtr; @@ -1304,10 +1305,13 @@ extern const TclIntStubs *tclIntStubsPtr; (tclIntStubsPtr->tclPushStackFrame) /* 217 */ #define TclPopStackFrame \ (tclIntStubsPtr->tclPopStackFrame) /* 218 */ -/* Slot 219 is reserved */ +#define TclpCreateTemporaryDirectory \ + (tclIntStubsPtr->tclpCreateTemporaryDirectory) /* 219 */ /* Slot 220 is reserved */ -/* Slot 221 is reserved */ -/* Slot 222 is reserved */ +#define TclListTestObj \ + (tclIntStubsPtr->tclListTestObj) /* 221 */ +#define TclListObjValidate \ + (tclIntStubsPtr->tclListObjValidate) /* 222 */ /* Slot 223 is reserved */ #define TclGetPlatform \ (tclIntStubsPtr->tclGetPlatform) /* 224 */ @@ -1376,13 +1380,11 @@ extern const TclIntStubs *tclIntStubsPtr; (tclIntStubsPtr->tclPtrUnsetVar) /* 256 */ #define TclStaticLibrary \ (tclIntStubsPtr->tclStaticLibrary) /* 257 */ -#define TclpCreateTemporaryDirectory \ - (tclIntStubsPtr->tclpCreateTemporaryDirectory) /* 258 */ +/* Slot 258 is reserved */ /* Slot 259 is reserved */ -#define TclListTestObj \ - (tclIntStubsPtr->tclListTestObj) /* 260 */ -#define TclListObjValidate \ - (tclIntStubsPtr->tclListObjValidate) /* 261 */ +/* Slot 260 is reserved */ +#define TclUnusedStubEntry \ + (tclIntStubsPtr->tclUnusedStubEntry) /* 261 */ #endif /* defined(USE_TCL_STUBS) */ @@ -1418,6 +1420,7 @@ extern const TclIntStubs *tclIntStubsPtr; # define Tcl_StaticLibrary (tclIntStubsPtr->tclStaticLibrary) #endif +#undef TclUnusedStubEntry #undef TclGuessPackageName #undef TclSetPreInitScript #undef TclObjInterpProc diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 059ae76..dfe25c5 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -999,10 +999,10 @@ static const TclIntStubs tclIntStubs = { TclStackFree, /* 216 */ TclPushStackFrame, /* 217 */ TclPopStackFrame, /* 218 */ - 0, /* 219 */ + TclpCreateTemporaryDirectory, /* 219 */ 0, /* 220 */ - 0, /* 221 */ - 0, /* 222 */ + TclListTestObj, /* 221 */ + TclListObjValidate, /* 222 */ 0, /* 223 */ TclGetPlatform, /* 224 */ TclTraceDictPath, /* 225 */ @@ -1038,10 +1038,10 @@ static const TclIntStubs tclIntStubs = { TclPtrObjMakeUpvar, /* 255 */ TclPtrUnsetVar, /* 256 */ TclStaticLibrary, /* 257 */ - TclpCreateTemporaryDirectory, /* 258 */ + 0, /* 258 */ 0, /* 259 */ - TclListTestObj, /* 260 */ - TclListObjValidate, /* 261 */ + 0, /* 260 */ + TclUnusedStubEntry, /* 261 */ }; static const TclIntPlatStubs tclIntPlatStubs = { -- cgit v0.12