summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-12-05 15:27:21 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-12-05 15:27:21 (GMT)
commitf3af86c67e61eaba34af3d25e883ae3e9fc83099 (patch)
treee8cf4a5bf9a2ec5540f78edafe03738ae043491a /tests
parentb8fbe8c1d39d1a0f7155e88c63a43ddb977f2e59 (diff)
parent3eef9fcea1274b68161aa2c5ebfb6a975ac7143a (diff)
downloadtcl-f3af86c67e61eaba34af3d25e883ae3e9fc83099.zip
tcl-f3af86c67e61eaba34af3d25e883ae3e9fc83099.tar.gz
tcl-f3af86c67e61eaba34af3d25e883ae3e9fc83099.tar.bz2
[4f6a1ebd64] Stop crash when same value passed to the -map and -subcommands options of ensemble configuration.
Diffstat (limited to 'tests')
-rw-r--r--tests/namespace.test33
1 files changed, 32 insertions, 1 deletions
diff --git a/tests/namespace.test b/tests/namespace.test
index de7009d..ff8cd7d 100644
--- a/tests/namespace.test
+++ b/tests/namespace.test
@@ -1785,7 +1785,10 @@ test namespace-42.7 {ensembles: nested} -body {
} -cleanup {
namespace delete ns
} -result {{1 ::ns::x0::z} 1 2 3}
-test namespace-42.8 {ensembles: [Bug 1670091]} -setup {
+test namespace-42.8 {
+ ensembles: [Bug 1670091], panic due to pointer to a deallocated List
+ struct.
+} -setup {
proc demo args {}
variable target [list [namespace which demo] x]
proc trial args {variable target; string length $target}
@@ -1800,6 +1803,34 @@ test namespace-42.8 {ensembles: [Bug 1670091]} -setup {
rename foo {}
} -result {}
+test namespace-42.9 {
+ ensembles: [Bug 4f6a1ebd64], segmentation fault due to pointer to a
+ deallocated List struct.
+} -setup {
+ namespace eval n {namespace ensemble create}
+ set lst [dict create one ::two]
+ namespace ensemble configure n -subcommands $lst -map $lst
+} -body {
+ n one
+} -cleanup {
+ namespace delete n
+ unset -nocomplain lst
+} -returnCodes error -match glob -result {invalid command name*}
+
+test namespace-42.10 {
+ ensembles: [Bug 4f6a1ebd64] segmentation fault due to pointer to a
+ deallocated List struct (this time with duplicate of one in "dict").
+} -setup {
+ namespace eval n {namespace ensemble create}
+ set lst [list one ::two one ::three]
+ namespace ensemble configure n -subcommands $lst -map $lst
+} -body {
+ n one
+} -cleanup {
+ namespace delete n
+ unset -nocomplain lst
+} -returnCodes error -match glob -result {invalid command name *three*}
+
test namespace-43.1 {ensembles: dict-driven} {
namespace eval ns {
namespace export x*