From ab9f916ca0322b3de7e03b26a99cdef02c9dcd84 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 29 May 2024 19:56:00 +0000 Subject: Fix [0fb337ea84]: ttk::combobox selection overruns downarrow element. Thanks to Emiliano Gavilan. --- generic/ttk/ttkEntry.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index fb76149..08fd085 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1230,10 +1230,15 @@ static void EntryDisplay(void *clientData, Drawable d) Tk_GetPixelsFromObj(NULL, tkwin, es.selBorderWidthObj, &borderWidth); if (selBorder) { - Tk_Fill3DRectangle(tkwin, d, selBorder, + int selWidth; + int textareaEnd = textarea.x + textarea.width; + if (selEndX > textareaEnd) + selEndX = textareaEnd; + selWidth = selEndX - selStartX + 2 * borderWidth; + if (selWidth > 0) + Tk_Fill3DRectangle(tkwin, d, selBorder, selStartX - borderWidth, entryPtr->entry.layoutY - borderWidth, - selEndX - selStartX + 2*borderWidth, - entryPtr->entry.layoutHeight + 2*borderWidth, + selWidth, entryPtr->entry.layoutHeight + 2*borderWidth, borderWidth, TK_RELIEF_RAISED); } } -- cgit v0.12 From b254df24915deadaf3abecc9f7d3ee4db475d8b4 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sat, 1 Jun 2024 11:16:56 +0000 Subject: Change Ttk_GetContentIndexFromObj API to take an additional parameter indicating whether end+1 indices are allowed. --- generic/ttk/ttkManager.c | 15 ++++++++++++--- generic/ttk/ttkManager.h | 2 +- generic/ttk/ttkNotebook.c | 6 +++--- generic/ttk/ttkPanedwindow.c | 6 +++--- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 6988c51..3f25ea3 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -439,12 +439,16 @@ Tcl_Size Ttk_ContentIndex(Ttk_Manager *mgr, Tk_Window window) * Content windows may be specified as an integer index or * as the name of the managed window. * + * The parameter lastOK should be non-0 if the resolved index can be equal to + * the current size (i.e. one more than the current highest index) and 0 + * otherwise. + * * Returns: * Standard Tcl completion code. Leaves an error message in case of error. */ int Ttk_GetContentIndexFromObj( - Tcl_Interp *interp, Ttk_Manager *mgr, Tcl_Obj *objPtr, Tcl_Size *indexPtr) + Tcl_Interp *interp, Ttk_Manager *mgr, Tcl_Obj *objPtr, int lastOK, Tcl_Size *indexPtr) { const char *string = Tcl_GetString(objPtr); Tcl_Size index = 0; @@ -452,8 +456,13 @@ int Ttk_GetContentIndexFromObj( /* Try interpreting as an integer first: */ - if (TkGetIntForIndex(objPtr, mgr->nContent - 1, 1, &index) == TCL_OK) { - if (index < 0 || index > mgr->nContent) { + if (TkGetIntForIndex(objPtr, mgr->nContent - 1, lastOK, &index) == TCL_OK) { + /* + * Note despite passing lastOK above, we still need to check here + * as well as TkGetIntForIndex only uses lastOK for end-relative indices, + * not integers. + */ + if (index < 0 || (index - !!lastOK) >= mgr->nContent) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Managed window index %d out of bounds", (int)index)); Tcl_SetErrorCode(interp, "TTK", "MANAGED", "INDEX", NULL); diff --git a/generic/ttk/ttkManager.h b/generic/ttk/ttkManager.h index 7b59807..78b9b0b 100644 --- a/generic/ttk/ttkManager.h +++ b/generic/ttk/ttkManager.h @@ -81,7 +81,7 @@ MODULE_SCOPE Tcl_Size Ttk_ContentIndex(Ttk_Manager *, Tk_Window); #define Ttk_GetSlaveIndexFromObj Ttk_GetContentIndexFromObj MODULE_SCOPE int Ttk_GetContentIndexFromObj( - Tcl_Interp *, Ttk_Manager *, Tcl_Obj *, Tcl_Size *indexPtr); + Tcl_Interp *, Ttk_Manager *, Tcl_Obj *, int lastOK, Tcl_Size *indexPtr); /* Accessor functions: */ diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 416ee7f..b863e55 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -863,7 +863,7 @@ static int FindTabIndex( /* ... or integer index or content window name: */ if (Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objPtr, index_rtn) == TCL_OK) + interp, nb->notebook.mgr, objPtr, 1, index_rtn) == TCL_OK) { return TCL_OK; } @@ -963,7 +963,7 @@ static int NotebookInsertCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objv[2], &destIndex)) { + interp, nb->notebook.mgr, objv[2], 1, &destIndex)) { return TCL_ERROR; } @@ -982,7 +982,7 @@ static int NotebookInsertCommand( return AddTab(interp, nb, destIndex, window, objc-4,objv+4); } } else if (Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objv[3], &srcIndex) != TCL_OK) + interp, nb->notebook.mgr, objv[3], 0, &srcIndex) != TCL_OK) { return TCL_ERROR; } else if (srcIndex >= Ttk_NumberContent(nb->notebook.mgr)) { diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index f0ed4de..5a97ca8 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -667,7 +667,7 @@ static int PanedInsertCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp,pw->paned.mgr, objv[2], &destIndex)) + interp,pw->paned.mgr, objv[2], 1, &destIndex)) { return TCL_ERROR; } @@ -702,7 +702,7 @@ static int PanedForgetCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp, pw->paned.mgr, objv[2], &paneIndex)) + interp, pw->paned.mgr, objv[2], 0, &paneIndex)) { return TCL_ERROR; } else if (paneIndex >= Ttk_NumberContent(pw->paned.mgr)) { @@ -783,7 +783,7 @@ static int PanedPaneCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp,pw->paned.mgr, objv[2], &paneIndex)) + interp,pw->paned.mgr, objv[2], 0, &paneIndex)) { return TCL_ERROR; } else if (paneIndex >= Ttk_NumberContent(pw->paned.mgr)) { -- cgit v0.12 From 739dc3042de34235282e209845d71229e3d8c6b3 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sat, 1 Jun 2024 11:30:05 +0000 Subject: Added tests --- tests/ttk/panedwindow.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test index baf6b9c..91f8e62 100644 --- a/tests/ttk/panedwindow.test +++ b/tests/ttk/panedwindow.test @@ -11,6 +11,22 @@ test panedwindow-1.0 "Setup" -body { ttk::panedwindow .pw } -result .pw +test panedwindow-1.0.1 "Make sure pane 0 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw pane 0 +} -result {Managed window index 0 out of bounds} -returnCodes error + +test panedwindow-1.0.2 "Make sure pane end command doesn't crash on empty pane - bug e6140f3404" -body { + .pw pane end +} -result {Managed window index -1 out of bounds} -returnCodes error + +test panedwindow-1.0.3 "Make sure forget 0 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw forget 0 +} -result {Managed window index 0 out of bounds} -returnCodes error + +test panedwindow-1.0.4 "Make sure forget end command doesn't crash on empty pane - bug e6140f3404" -body { + .pw forget end +} -result {Managed window index -1 out of bounds} -returnCodes error + test panedwindow-1.1 "Make sure empty panedwindow doesn't crash" -body { pack .pw -expand true -fill both update -- cgit v0.12 From cff44afba88bd2e7f36db9a384bce8768549b786 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 2 Jun 2024 10:36:14 +0000 Subject: Add missing bit of documentation. --- generic/ttk/ttkManager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 3f25ea3..30e14b1 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -434,7 +434,7 @@ Tcl_Size Ttk_ContentIndex(Ttk_Manager *mgr, Tk_Window window) return -1; } -/* ++ Ttk_GetContentIndexFromObj(interp, mgr, objPtr, indexPtr) -- +/* ++ Ttk_GetContentIndexFromObj(interp, mgr, objPtr, lastOK, indexPtr) -- * Return the index of the content window specified by objPtr. * Content windows may be specified as an integer index or * as the name of the managed window. -- cgit v0.12 From 434223fd94638ebcdff7864d2c6ee2230ef6f241 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 2 Jun 2024 13:59:08 +0000 Subject: Fix [e64820c1de]: The -justify configure option is duplicated for ttk::label --- generic/ttk/ttkButton.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index ce1f323..5ea92c4 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -260,9 +260,6 @@ static const Tk_OptionSpec LabelOptionSpecs[] = {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", "w", offsetof(Label,label.anchorObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED}, - {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - "left", offsetof(Label, label.justifyObj), TCL_INDEX_NONE, - 0,0,GEOMETRY_CHANGED }, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", NULL, offsetof(Label, label.wrapLengthObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED /*SB: SIZE_CHANGED*/ }, -- cgit v0.12 From e70c2c9988af90a2ae49b74bdd8c8e0e0d52822b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 2 Jun 2024 17:17:05 +0000 Subject: Add tests notebook-9.1 and notebook-9.2. notebook-9.1 passes in this branch (but not in current trunk). notebook-9.2 fails, even in this branch. --- tests/ttk/notebook.test | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index 3d44f89..e1d2d42 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -553,4 +553,27 @@ test notebook-8.2 "style command" -body { destroy .w } -result {customStyle.TNotebook customStyle.TNotebook TNotebook} +test notebook-9.1 "move last tab by numerical index" -body { + ::ttk::notebook .n + foreach tabs {TabA TabB TabC} { + ::ttk::entry .n.[string tolower $tabs] + .n add .n.[string tolower $tabs] -text $tabs + } + .n insert 0 2 ; # allowed: TabC moves to first tab position + .n insert 0 3 ; # not allowed: position 3 is after last tab +} -cleanup { + destroy .n +} -result {Managed window index 3 out of bounds} -returnCodes error +test notebook-9.2 "move first tab to last position by numerical index" -body { + ::ttk::notebook .n + foreach tabs {TabA TabB TabC} { + ::ttk::entry .n.[string tolower $tabs] + .n add .n.[string tolower $tabs] -text $tabs + } + .n insert 2 0 ; # allowed: TabA moves to last tab position + .n insert 3 0 ; # not allowed: position 3 is after last tab +} -cleanup { + destroy .n +} -result {Managed window index 3 out of bounds} -returnCodes error + tcltest::cleanupTests -- cgit v0.12 From 798c1ec50ac95f5a5863e947c0f087bc1969dcec Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 2 Jun 2024 19:41:55 +0000 Subject: Fix issue preventing notebook-9.2 from passing. --- generic/ttk/ttkNotebook.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index b863e55..0670427 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -962,11 +962,6 @@ static int NotebookInsertCommand( return TCL_ERROR; } - if (TCL_OK != Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objv[2], 1, &destIndex)) { - return TCL_ERROR; - } - if (Tcl_GetString(objv[3])[0] == '.') { /* Window name -- could be new or existing content window. */ @@ -979,6 +974,10 @@ static int NotebookInsertCommand( srcIndex = Ttk_ContentIndex(nb->notebook.mgr, window); if (srcIndex < 0) { /* New content window */ + if (TCL_OK != Ttk_GetContentIndexFromObj( + interp, nb->notebook.mgr, objv[2], 1, &destIndex)) { + return TCL_ERROR; + } return AddTab(interp, nb, destIndex, window, objc-4,objv+4); } } else if (Ttk_GetContentIndexFromObj( @@ -989,6 +988,11 @@ static int NotebookInsertCommand( srcIndex = Ttk_NumberContent(nb->notebook.mgr) - 1; } + if (TCL_OK != Ttk_GetContentIndexFromObj( + interp, nb->notebook.mgr, objv[2], 0, &destIndex)) { + return TCL_ERROR; + } + /* Move existing content window: */ if (ConfigureTab(interp, nb, -- cgit v0.12 From bdbfd047cdf71c798809e18044e132e6ebfc488d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Jun 2024 09:26:41 +0000 Subject: Fix [e6140f3404]: Crashes in empty ttk::panedwindowfor pane and forget commands (and a bugfix in ttk::notebook tab insert command while passing by). --- generic/ttk/ttkManager.c | 17 +++++++++++++---- generic/ttk/ttkManager.h | 2 +- generic/ttk/ttkNotebook.c | 22 +++++++++++++--------- generic/ttk/ttkPanedwindow.c | 6 +++--- tests/ttk/notebook.test | 23 +++++++++++++++++++++++ tests/ttk/panedwindow.test | 16 ++++++++++++++++ 6 files changed, 69 insertions(+), 17 deletions(-) diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 6988c51..30e14b1 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -434,17 +434,21 @@ Tcl_Size Ttk_ContentIndex(Ttk_Manager *mgr, Tk_Window window) return -1; } -/* ++ Ttk_GetContentIndexFromObj(interp, mgr, objPtr, indexPtr) -- +/* ++ Ttk_GetContentIndexFromObj(interp, mgr, objPtr, lastOK, indexPtr) -- * Return the index of the content window specified by objPtr. * Content windows may be specified as an integer index or * as the name of the managed window. * + * The parameter lastOK should be non-0 if the resolved index can be equal to + * the current size (i.e. one more than the current highest index) and 0 + * otherwise. + * * Returns: * Standard Tcl completion code. Leaves an error message in case of error. */ int Ttk_GetContentIndexFromObj( - Tcl_Interp *interp, Ttk_Manager *mgr, Tcl_Obj *objPtr, Tcl_Size *indexPtr) + Tcl_Interp *interp, Ttk_Manager *mgr, Tcl_Obj *objPtr, int lastOK, Tcl_Size *indexPtr) { const char *string = Tcl_GetString(objPtr); Tcl_Size index = 0; @@ -452,8 +456,13 @@ int Ttk_GetContentIndexFromObj( /* Try interpreting as an integer first: */ - if (TkGetIntForIndex(objPtr, mgr->nContent - 1, 1, &index) == TCL_OK) { - if (index < 0 || index > mgr->nContent) { + if (TkGetIntForIndex(objPtr, mgr->nContent - 1, lastOK, &index) == TCL_OK) { + /* + * Note despite passing lastOK above, we still need to check here + * as well as TkGetIntForIndex only uses lastOK for end-relative indices, + * not integers. + */ + if (index < 0 || (index - !!lastOK) >= mgr->nContent) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Managed window index %d out of bounds", (int)index)); Tcl_SetErrorCode(interp, "TTK", "MANAGED", "INDEX", NULL); diff --git a/generic/ttk/ttkManager.h b/generic/ttk/ttkManager.h index 7b59807..78b9b0b 100644 --- a/generic/ttk/ttkManager.h +++ b/generic/ttk/ttkManager.h @@ -81,7 +81,7 @@ MODULE_SCOPE Tcl_Size Ttk_ContentIndex(Ttk_Manager *, Tk_Window); #define Ttk_GetSlaveIndexFromObj Ttk_GetContentIndexFromObj MODULE_SCOPE int Ttk_GetContentIndexFromObj( - Tcl_Interp *, Ttk_Manager *, Tcl_Obj *, Tcl_Size *indexPtr); + Tcl_Interp *, Ttk_Manager *, Tcl_Obj *, int lastOK, Tcl_Size *indexPtr); /* Accessor functions: */ diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 11a5046..667b607 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -421,8 +421,8 @@ static int NotebookSize(void *clientData, int *widthPtr, int *heightPtr) /* Client width/height overridable by widget options: */ - Tk_GetPixelsFromObj(NULL, nbwin, nb->notebook.widthObj,&reqWidth); - Tk_GetPixelsFromObj(NULL, nbwin, nb->notebook.heightObj,&reqHeight); + Tk_GetPixelsFromObj(NULL, nbwin, nb->notebook.widthObj, &reqWidth); + Tk_GetPixelsFromObj(NULL, nbwin, nb->notebook.heightObj, &reqHeight); if (reqWidth > 0) clientWidth = reqWidth; if (reqHeight > 0) @@ -863,7 +863,7 @@ static int FindTabIndex( /* ... or integer index or content window name: */ if (Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objPtr, index_rtn) == TCL_OK) + interp, nb->notebook.mgr, objPtr, 1, index_rtn) == TCL_OK) { return TCL_OK; } @@ -962,11 +962,6 @@ static int NotebookInsertCommand( return TCL_ERROR; } - if (TCL_OK != Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objv[2], &destIndex)) { - return TCL_ERROR; - } - if (Tcl_GetString(objv[3])[0] == '.') { /* Window name -- could be new or existing content window. */ @@ -979,16 +974,25 @@ static int NotebookInsertCommand( srcIndex = Ttk_ContentIndex(nb->notebook.mgr, window); if (srcIndex < 0) { /* New content window */ + if (TCL_OK != Ttk_GetContentIndexFromObj( + interp, nb->notebook.mgr, objv[2], 1, &destIndex)) { + return TCL_ERROR; + } return AddTab(interp, nb, destIndex, window, objc-4,objv+4); } } else if (Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objv[3], &srcIndex) != TCL_OK) + interp, nb->notebook.mgr, objv[3], 0, &srcIndex) != TCL_OK) { return TCL_ERROR; } else if (srcIndex >= Ttk_NumberContent(nb->notebook.mgr)) { srcIndex = Ttk_NumberContent(nb->notebook.mgr) - 1; } + if (TCL_OK != Ttk_GetContentIndexFromObj( + interp, nb->notebook.mgr, objv[2], 0, &destIndex)) { + return TCL_ERROR; + } + /* Move existing content window: */ if (ConfigureTab(interp, nb, diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index f0ed4de..5a97ca8 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -667,7 +667,7 @@ static int PanedInsertCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp,pw->paned.mgr, objv[2], &destIndex)) + interp,pw->paned.mgr, objv[2], 1, &destIndex)) { return TCL_ERROR; } @@ -702,7 +702,7 @@ static int PanedForgetCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp, pw->paned.mgr, objv[2], &paneIndex)) + interp, pw->paned.mgr, objv[2], 0, &paneIndex)) { return TCL_ERROR; } else if (paneIndex >= Ttk_NumberContent(pw->paned.mgr)) { @@ -783,7 +783,7 @@ static int PanedPaneCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp,pw->paned.mgr, objv[2], &paneIndex)) + interp,pw->paned.mgr, objv[2], 0, &paneIndex)) { return TCL_ERROR; } else if (paneIndex >= Ttk_NumberContent(pw->paned.mgr)) { diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index 3d44f89..e1d2d42 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -553,4 +553,27 @@ test notebook-8.2 "style command" -body { destroy .w } -result {customStyle.TNotebook customStyle.TNotebook TNotebook} +test notebook-9.1 "move last tab by numerical index" -body { + ::ttk::notebook .n + foreach tabs {TabA TabB TabC} { + ::ttk::entry .n.[string tolower $tabs] + .n add .n.[string tolower $tabs] -text $tabs + } + .n insert 0 2 ; # allowed: TabC moves to first tab position + .n insert 0 3 ; # not allowed: position 3 is after last tab +} -cleanup { + destroy .n +} -result {Managed window index 3 out of bounds} -returnCodes error +test notebook-9.2 "move first tab to last position by numerical index" -body { + ::ttk::notebook .n + foreach tabs {TabA TabB TabC} { + ::ttk::entry .n.[string tolower $tabs] + .n add .n.[string tolower $tabs] -text $tabs + } + .n insert 2 0 ; # allowed: TabA moves to last tab position + .n insert 3 0 ; # not allowed: position 3 is after last tab +} -cleanup { + destroy .n +} -result {Managed window index 3 out of bounds} -returnCodes error + tcltest::cleanupTests diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test index baf6b9c..91f8e62 100644 --- a/tests/ttk/panedwindow.test +++ b/tests/ttk/panedwindow.test @@ -11,6 +11,22 @@ test panedwindow-1.0 "Setup" -body { ttk::panedwindow .pw } -result .pw +test panedwindow-1.0.1 "Make sure pane 0 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw pane 0 +} -result {Managed window index 0 out of bounds} -returnCodes error + +test panedwindow-1.0.2 "Make sure pane end command doesn't crash on empty pane - bug e6140f3404" -body { + .pw pane end +} -result {Managed window index -1 out of bounds} -returnCodes error + +test panedwindow-1.0.3 "Make sure forget 0 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw forget 0 +} -result {Managed window index 0 out of bounds} -returnCodes error + +test panedwindow-1.0.4 "Make sure forget end command doesn't crash on empty pane - bug e6140f3404" -body { + .pw forget end +} -result {Managed window index -1 out of bounds} -returnCodes error + test panedwindow-1.1 "Make sure empty panedwindow doesn't crash" -body { pack .pw -expand true -fill both update -- cgit v0.12 From c5a5c5403dee3072a654b18e3366892d316764f3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Jun 2024 13:50:58 +0000 Subject: Somewhat better error-messages (addendum to previous commit) --- generic/ttk/ttkManager.c | 2 +- generic/ttk/ttkNotebook.c | 8 +++--- generic/ttk/ttkTreeview.c | 64 +++++++++++++++++++++++----------------------- tests/ttk/notebook.test | 4 +-- tests/ttk/panedwindow.test | 8 +++--- tests/ttk/treeview.test | 4 +-- 6 files changed, 45 insertions(+), 45 deletions(-) diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 30e14b1..1ea5f54 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -464,7 +464,7 @@ int Ttk_GetContentIndexFromObj( */ if (index < 0 || (index - !!lastOK) >= mgr->nContent) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "Managed window index %d out of bounds", (int)index)); + "Managed window index \"%s\" out of bounds", Tcl_GetString(objPtr))); Tcl_SetErrorCode(interp, "TTK", "MANAGED", "INDEX", NULL); return TCL_ERROR; } diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 667b607..966f727 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -368,7 +368,7 @@ static void TabrowSize( Ttk_RebindSublayout(tabLayout, tab); Ttk_LayoutSize(tabLayout,tabState,&tab->width,&tab->height); - tab->width = MAX(tab->width, minTabWidth); + tab->width = MAX(tab->width, minTabWidth); if (orient == TTK_ORIENT_HORIZONTAL) { tabrowHeight = MAX(tabrowHeight, tab->height); @@ -890,14 +890,14 @@ static int GetTabIndex( int status = FindTabIndex(interp, nb, objPtr, index_rtn); if (status == TCL_OK && *index_rtn >= Ttk_NumberContent(nb->notebook.mgr)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "tab index %s out of bounds", Tcl_GetString(objPtr))); + "Tab index \"%s\" out of bounds", Tcl_GetString(objPtr))); Tcl_SetErrorCode(interp, "TTK", "NOTEBOOK", "INDEX", NULL); return TCL_ERROR; } if (status == TCL_OK && *index_rtn < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "tab '%s' not found", Tcl_GetString(objPtr))); + "Tab '%s' not found", Tcl_GetString(objPtr))); Tcl_SetErrorCode(interp, "TTK", "NOTEBOOK", "TAB", NULL); status = TCL_ERROR; } @@ -1072,7 +1072,7 @@ static int NotebookHideCommand( if (index == nb->notebook.currentIndex) { SelectNearestTab(nb); } else { - TtkRedisplayWidget(&nb->core); + TtkRedisplayWidget(&nb->core); } return TCL_OK; diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 5acf9c3..884c1f3 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -675,7 +675,7 @@ static TreeColumn *GetColumn( return tv->tree.columns + columnIndex; } Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "Invalid column index %s", Tcl_GetString(columnIDObj))); + "Invalid column index \"%s\"", Tcl_GetString(columnIDObj))); Tcl_SetErrorCode(interp, "TTK", "TREE", "COLUMN", NULL); return NULL; } @@ -1382,16 +1382,16 @@ TreeviewConfigure(Tcl_Interp *interp, void *recordPtr, int mask) CellSelectionClear(tv); } if (tv->tree.nTitleColumns < 0) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "\"#%" TCL_SIZE_MODIFIER "d\" is out of range", - tv->tree.nTitleColumns)); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "\"#%" TCL_SIZE_MODIFIER "d\" is out of range", + tv->tree.nTitleColumns)); Tcl_SetErrorCode(interp, "TTK", "TREE", "TITLECOLUMNS", NULL); return TCL_ERROR; } if (tv->tree.nTitleItems < 0) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "\"%" TCL_SIZE_MODIFIER "d\" is out of range", - tv->tree.nTitleItems)); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "\"%" TCL_SIZE_MODIFIER "d\" is out of range", + tv->tree.nTitleItems)); Tcl_SetErrorCode(interp, "TTK", "TREE", "TITLEITEMS", NULL); return TCL_ERROR; } @@ -1541,10 +1541,10 @@ static int ConfigureColumn( if (mask & GEOMETRY_CHANGED) { if (!Tk_IsMapped(tv->core.tkwin)) { TtkResizeWidget(&tv->core); - } else { + } else { RecomputeSlack(tv); ResizeColumns(tv, TreeWidth(tv)); - } + } } TtkRedisplayWidget(&tv->core); @@ -1974,13 +1974,13 @@ static void TreeviewDoLayout(void *clientData) last = tv->tree.yscroll.first + visibleRows - tv->tree.titleRows; total = tv->tree.totalRows - tv->tree.titleRows; if (tv->tree.treeArea.height % tv->tree.rowHeight) { - /* When the treeview height doesn't correspond to an exact number - * of rows, the last row count must be incremented to draw a - * partial row at the bottom. The total row count must also be - * incremented to be able to scroll all the way to the bottom. - */ - last++; - total++; + /* When the treeview height doesn't correspond to an exact number + * of rows, the last row count must be incremented to draw a + * partial row at the bottom. The total row count must also be + * incremented to be able to scroll all the way to the bottom. + */ + last++; + total++; } TtkScrolled(tv->tree.yscrollHandle, first, last, total); } @@ -2332,7 +2332,7 @@ static void DrawItem( displayItemUsed); } - displayItem.anchorObj = tv->tree.column0.anchorObj; + displayItem.anchorObj = tv->tree.column0.anchorObj; Tk_GetAnchorFromObj(NULL, column->anchorObj, &textAnchor); displayItemUsed->textObj = item->textObj; /* Item's image can be null, and may come from the tag */ @@ -2392,7 +2392,7 @@ static void DrawForest( Treeview *tv, TreeItem *item, Drawable d, int depth) { while (item) { - DrawSubtree(tv, item, d, depth); + DrawSubtree(tv, item, d, depth); item = item->next; } } @@ -2804,8 +2804,8 @@ static int TreeviewHorribleIdentify( BoundingBox(tv, item, NULL, &itemBox); PrepareItem(tv, item, &displayItem, state); - if (item->textObj) { displayItem.textObj = item->textObj; } - if (item->imageObj) { displayItem.imageObj = item->imageObj; } + if (item->textObj) { displayItem.textObj = item->textObj; } + if (item->imageObj) { displayItem.imageObj = item->imageObj; } Ttk_RebindSublayout(layout, &displayItem); Ttk_PlaceLayout(layout, state, itemBox); element = Ttk_IdentifyElement(layout, x, y); @@ -2862,7 +2862,7 @@ static int TreeviewIdentifyCommand( if (Tcl_GetIndexFromObjStruct(interp, objv[2], submethodStrings, sizeof(char *), "command", TCL_EXACT, &submethod) != TCL_OK - || Tk_GetPixelsFromObj(interp, tv->core.tkwin, objv[3], &x) != TCL_OK + || Tk_GetPixelsFromObj(interp, tv->core.tkwin, objv[3], &x) != TCL_OK || Tk_GetPixelsFromObj(interp, tv->core.tkwin, objv[4], &y) != TCL_OK ) { return TCL_ERROR; @@ -2932,8 +2932,8 @@ static int TreeviewIdentifyCommand( } state = ItemState(tv, item); PrepareItem(tv, item, &displayItem, state); - if (item->textObj) { displayItem.textObj = item->textObj; } - if (item->imageObj) { displayItem.imageObj = item->imageObj; } + if (item->textObj) { displayItem.textObj = item->textObj; } + if (item->imageObj) { displayItem.imageObj = item->imageObj; } Ttk_RebindSublayout(layout, &displayItem); Ttk_PlaceLayout(layout, state, bbox); element = Ttk_IdentifyElement(layout, x, y); @@ -3298,9 +3298,9 @@ static int TreeviewDeleteCommand( */ delq = 0; for (i = 0; items[i]; ++i) { - if (items[i]->state & TTK_STATE_SELECTED) { - selChange = 1; - } else if (items[i]->selObj != NULL) { + if (items[i]->state & TTK_STATE_SELECTED) { + selChange = 1; + } else if (items[i]->selObj != NULL) { Tcl_Size length; Tcl_ListObjLength(interp, items[i]->selObj, &length); if (length > 0) { @@ -3324,7 +3324,7 @@ static int TreeviewDeleteCommand( ckfree(items); if (selChange) { - Tk_SendVirtualEvent(tv->core.tkwin, "TreeviewSelect", NULL); + Tk_SendVirtualEvent(tv->core.tkwin, "TreeviewSelect", NULL); } tv->tree.rowPosNeedsUpdate = 1; TtkRedisplayWidget(&tv->core); @@ -3993,7 +3993,7 @@ static int TreeviewTagDeleteCommand( tag = Ttk_GetTagFromObj(tagTable, objv[3]); /* remove the tag from all cells and items */ while (item) { - RemoveTagFromCellsAtItem(item, tag); + RemoveTagFromCellsAtItem(item, tag); RemoveTag(item, tag); item = NextPreorder(item); } @@ -4241,9 +4241,9 @@ static void RemoveTagFromCellsAtItem(TreeItem *item, Ttk_Tag tag) Tcl_Size i; for (i = 0; i < item->nTagSets; i++) { - if (item->cellTagSets[i] != NULL) { - Ttk_TagSetRemove(item->cellTagSets[i], tag); - } + if (item->cellTagSets[i] != NULL) { + Ttk_TagSetRemove(item->cellTagSets[i], tag); + } } } @@ -4322,7 +4322,7 @@ static int TreeviewCtagRemoveCommand( } else { item = tv->tree.root; while (item) { - RemoveTagFromCellsAtItem(item, tag); + RemoveTagFromCellsAtItem(item, tag); item = NextPreorder(item); } } diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index e1d2d42..f4558bf 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -563,7 +563,7 @@ test notebook-9.1 "move last tab by numerical index" -body { .n insert 0 3 ; # not allowed: position 3 is after last tab } -cleanup { destroy .n -} -result {Managed window index 3 out of bounds} -returnCodes error +} -result {Managed window index "3" out of bounds} -returnCodes error test notebook-9.2 "move first tab to last position by numerical index" -body { ::ttk::notebook .n foreach tabs {TabA TabB TabC} { @@ -574,6 +574,6 @@ test notebook-9.2 "move first tab to last position by numerical index" -body { .n insert 3 0 ; # not allowed: position 3 is after last tab } -cleanup { destroy .n -} -result {Managed window index 3 out of bounds} -returnCodes error +} -result {Managed window index "3" out of bounds} -returnCodes error tcltest::cleanupTests diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test index 91f8e62..b11244b 100644 --- a/tests/ttk/panedwindow.test +++ b/tests/ttk/panedwindow.test @@ -13,19 +13,19 @@ test panedwindow-1.0 "Setup" -body { test panedwindow-1.0.1 "Make sure pane 0 command doesn't crash on empty pane - bug e6140f3404" -body { .pw pane 0 -} -result {Managed window index 0 out of bounds} -returnCodes error +} -result {Managed window index "0" out of bounds} -returnCodes error test panedwindow-1.0.2 "Make sure pane end command doesn't crash on empty pane - bug e6140f3404" -body { .pw pane end -} -result {Managed window index -1 out of bounds} -returnCodes error +} -result {Managed window index "end" out of bounds} -returnCodes error test panedwindow-1.0.3 "Make sure forget 0 command doesn't crash on empty pane - bug e6140f3404" -body { .pw forget 0 -} -result {Managed window index 0 out of bounds} -returnCodes error +} -result {Managed window index "0" out of bounds} -returnCodes error test panedwindow-1.0.4 "Make sure forget end command doesn't crash on empty pane - bug e6140f3404" -body { .pw forget end -} -result {Managed window index -1 out of bounds} -returnCodes error +} -result {Managed window index "end" out of bounds} -returnCodes error test panedwindow-1.1 "Make sure empty panedwindow doesn't crash" -body { pack .pw -expand true -fill both diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test index 5f2cc84..13eec44 100644 --- a/tests/ttk/treeview.test +++ b/tests/ttk/treeview.test @@ -75,7 +75,7 @@ test treeview-1.2 "Bad columns" -body { test treeview-1.3 "bad displaycolumns" -body { .tv configure -displaycolumns {a b d} -} -returnCodes error -result "Invalid column index d" +} -returnCodes error -result {Invalid column index "d"} test treeview-1.4 "more bad displaycolumns" -body { .tv configure -displaycolumns {1 2 3} @@ -857,7 +857,7 @@ test treeview-11.13 "Cellselection - error" -body { test treeview-11.14 "Cellselection - error" -body { .tv cellselection set [list "nn xx "] -} -returnCodes 1 -match glob -result {Invalid column index xx} +} -returnCodes 1 -match glob -result {Invalid column index "xx"} test treeview-11.15 "Cellselection - error" -body { .tv cellselection set "nn c" "nn d" -- cgit v0.12 From da20d6adfe8b9d1d363dc3db29569367ffce2115 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Jun 2024 19:28:06 +0000 Subject: Backport some (modified) ttk testcases from 8.7 --- tests/ttk/notebook.test | 26 +++++++++++++++++++++++++- tests/ttk/panedwindow.test | 16 ++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index 8b03314..7e92896 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -67,10 +67,11 @@ test notebook-2.4 "tab - set value" -body { } -result "Changed Foo" test notebook-2.5 "tab - get all options" -body { + .nb tab .nb.foo -underline 0 .nb tab .nb.foo } -result [list \ -padding 0 -sticky nsew \ - -state normal -text "Changed Foo" -image "" -compound {} -underline -1] + -state normal -text "Changed Foo" -image "" -compound {} -underline 0] test notebook-4.1 "Test .nb index end" -body { .nb index end @@ -538,4 +539,27 @@ test notebook-198376af5a {moving tab position to a different edge} -body { expr {[winfo y .nb.f1] < 10} } -result 1 +test notebook-9.1 "move last tab by numerical index" -body { + ::ttk::notebook .n + foreach tabs {TabA TabB TabC} { + ::ttk::entry .n.[string tolower $tabs] + .n add .n.[string tolower $tabs] -text $tabs + } + .n insert 0 2 ; # allowed: TabC moves to first tab position + .n insert 0 3 ; # not allowed: position 3 is after last tab +} -cleanup { + destroy .n +} -result {Slave index 3 out of bounds} -returnCodes error +test notebook-9.2 "move first tab to last position by numerical index" -body { + ::ttk::notebook .n + foreach tabs {TabA TabB TabC} { + ::ttk::entry .n.[string tolower $tabs] + .n add .n.[string tolower $tabs] -text $tabs + } + .n insert 2 0 ; # allowed: TabA moves to last tab position + .n insert 3 0 ; # not allowed: position 3 is after last tab +} -cleanup { + destroy .n +} -result {Slave index 3 out of bounds} -returnCodes error + tcltest::cleanupTests diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test index def0f8e..3d55f22 100644 --- a/tests/ttk/panedwindow.test +++ b/tests/ttk/panedwindow.test @@ -11,6 +11,22 @@ test panedwindow-1.0 "Setup" -body { ttk::panedwindow .pw } -result .pw +test panedwindow-1.0.1 "Make sure pane 0 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw pane 0 +} -result {Slave index 0 out of bounds} -returnCodes error + +test panedwindow-1.0.2 "Make sure pane -1 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw pane -1 +} -result {Slave index -1 out of bounds} -returnCodes error + +test panedwindow-1.0.3 "Make sure forget 0 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw forget 0 +} -result {Slave index 0 out of bounds} -returnCodes error + +test panedwindow-1.0.4 "Make sure forget -1 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw forget -1 +} -result {Slave index -1 out of bounds} -returnCodes error + test panedwindow-1.1 "Make sure empty panedwindow doesn't crash" -body { pack .pw -expand true -fill both update -- cgit v0.12 From 032d7d5958f7bf94ecb3af54ac275d1116fc2af8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 5 Jun 2024 14:10:45 +0000 Subject: Possible fix for [4d0a6f32b7]: Unique behavior of some options in the message widget in 8.7/9.0 --- generic/tkMessage.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/generic/tkMessage.c b/generic/tkMessage.c index fd36e62..07dad51 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -554,21 +554,9 @@ MessageWorldChanged( Tk_GetFontMetrics(msgPtr->tkfont, &fm); if (msgPtr->padX < 0) { msgPtr->padX = fm.ascent / 2; -#ifndef TK_NO_DEPRECATED - if (msgPtr->padXPtr) { - Tcl_DecrRefCount(msgPtr->padXPtr); - msgPtr->padXPtr = NULL; - } -#endif } - if (msgPtr->padY == -1) { + if (msgPtr->padY < 0) { msgPtr->padY = fm.ascent / 4; -#ifndef TK_NO_DEPRECATED - if (msgPtr->padYPtr) { - Tcl_DecrRefCount(msgPtr->padYPtr); - msgPtr->padYPtr = NULL; - } -#endif } /* -- cgit v0.12 From dd00d32a89426c4c9b36774dec3dbe026c069158 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Jun 2024 08:36:50 +0000 Subject: Add test imgPhoto-12.5 demonstrating bug [a0241c0e25]. --- tests/imgPhoto.test | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 1d3b6e5..c006775 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1054,6 +1054,17 @@ test imgPhoto-12.4 {Tk_ImgPhotoPutZoomedBlock, empty image} -setup { } -cleanup { imageCleanup } -result {0 0} +test imgPhoto-12.5 {Tk_ImgPhotoPutZoomedBlock, copy from area outside the image, bug [a0241c0e25]} -setup { + imageCleanup +} -body { + image create photo photo1 -width 20 -height 20 + image create photo photo2 -width 9 -height 10 + # next line used to loop for a very long time; if the bug is present + # the CI runner will time out, leading to test suite failure + photo2 copy photo1 -to 0 5 3 8 -from 21 0 +} -cleanup { + imageCleanup +} test imgPhoto-13.1 {check separation of images in different interpreters} -setup { imageCleanup -- cgit v0.12 From 9e67b3bff485409680adc5c89f47fe54adcc457b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Jun 2024 08:37:20 +0000 Subject: Fix [a0241c0e25]: photo image copy command can unexpectedly hang for 20+ seconds. --- generic/tkImgPhoto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index cadbb2d..9c5f91c 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -3173,7 +3173,7 @@ Tk_PhotoPutZoomedBlock( * Zero-sized blocks never cause any changes. [Bug 3078902] */ - if (blockPtr->height == 0 || blockPtr->width == 0) { + if (blockPtr->height <= 0 || blockPtr->width <= 0) { return TCL_OK; } -- cgit v0.12 From 249fc690380f4cb9524794298a86a314ee4d53a5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Jun 2024 08:54:50 +0000 Subject: Add explanatory comment. --- generic/tkImgPhoto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 9c5f91c..61d1c9b 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -3171,6 +3171,8 @@ Tk_PhotoPutZoomedBlock( /* * Zero-sized blocks never cause any changes. [Bug 3078902] + * Negative-size blocks happen when trying to copy from an area outside + * the source image. [Bug a0241c0e25] */ if (blockPtr->height <= 0 || blockPtr->width <= 0) { -- cgit v0.12 From 9b6c43c2c577b2b086822e8c98bb2a2b4c5b852a Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Jun 2024 09:07:18 +0000 Subject: Better fix for [a0241c0e25]. The checks for coordinates outside of the source image were incorrect. --- generic/tkImgPhoto.c | 6 ++---- tests/imgPhoto.test | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 61d1c9b..e619910 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -577,7 +577,7 @@ ImgPhotoCmd( return TCL_ERROR; } Tk_PhotoGetImage(srcHandle, &block); - if ((options.fromX2 > block.width) || (options.fromY2 > block.height) + if ((options.fromX > block.width) || (options.fromY > block.height) || (options.fromX2 > block.width) || (options.fromY2 > block.height)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( @@ -3171,11 +3171,9 @@ Tk_PhotoPutZoomedBlock( /* * Zero-sized blocks never cause any changes. [Bug 3078902] - * Negative-size blocks happen when trying to copy from an area outside - * the source image. [Bug a0241c0e25] */ - if (blockPtr->height <= 0 || blockPtr->width <= 0) { + if (blockPtr->height == 0 || blockPtr->width == 0) { return TCL_OK; } diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index c006775..865e96c 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1064,7 +1064,7 @@ test imgPhoto-12.5 {Tk_ImgPhotoPutZoomedBlock, copy from area outside the image, photo2 copy photo1 -to 0 5 3 8 -from 21 0 } -cleanup { imageCleanup -} +} -returnCodes error -result {coordinates for -from option extend outside source image} test imgPhoto-13.1 {check separation of images in different interpreters} -setup { imageCleanup -- cgit v0.12 From 6800a25eec9c9dfcd3640892d0a5a3d73e7409e7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 9 Jun 2024 22:10:05 +0000 Subject: Adapt testcases to hidden command change in Tcl --- tests/safe.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/safe.test b/tests/safe.test index eb67237..9bb1a36 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -40,7 +40,7 @@ if {[package vsatisfies [package provide Tcl] 8.6.7-]} { lappend hidden_cmds tcl:encoding:dirs } if {[package vsatisfies [package provide Tcl] 8.7-]} { - lappend hidden_cmds file tcl:encoding:system tcl:file:tempdir + lappend hidden_cmds file tcl:encoding:system tcl:file:tempdir tcl:file:home tcl:file:tildeexpand foreach cmd { cmdtype nameofexecutable } {lappend hidden_cmds tcl:info:$cmd} -- cgit v0.12