summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-01-16 21:54:32 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-01-16 21:54:32 (GMT)
commit49eca9a7a4e39d17536afa4222fca7a529988b80 (patch)
treeff7af4bbc2f4ec827dccdc503d3dce088ffc0061
parent6101ed5d08da556682f4d6c8870f87180eeef50a (diff)
downloadtcl-49eca9a7a4e39d17536afa4222fca7a529988b80.zip
tcl-49eca9a7a4e39d17536afa4222fca7a529988b80.tar.gz
tcl-49eca9a7a4e39d17536afa4222fca7a529988b80.tar.bz2
test for memory leak
-rw-r--r--ChangeLog1
-rw-r--r--tests/compExpr.test21
2 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 182dede..2a0992c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
* generic/tclCompExpr.c: Fix literal leak in exprs [Bug 1869989]
* generic/tclExecute.c: (dgp)
+ * tests/compExpr.test:
* doc/proc.n: changed wording for access to non-local variables;
added mention to [namespace upvar]. Lame attempt at dealing with
diff --git a/tests/compExpr.test b/tests/compExpr.test
index 341d88a..c3e68c1 100644
--- a/tests/compExpr.test
+++ b/tests/compExpr.test
@@ -8,7 +8,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: compExpr.test,v 1.16 2007/12/13 15:26:06 dgp Exp $
+# RCS: @(#) $Id: compExpr.test,v 1.17 2008/01/16 21:54:33 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -342,6 +342,25 @@ test compExpr-7.1 {Memory Leak} -constraints memory -setup {
rename getbytes {}
} -result 0
+test compExpr-7.2 {[Bug 1869989]: expr parser memleak} -constraints memory -setup {
+ proc getbytes {} {
+ set lines [split [memory info] \n]
+ lindex $lines 3 3
+ }
+} -body {
+ set i 5
+ set end [getbytes]
+ while {[incr i -1]} {
+ expr ${i}000
+ set tmp $end
+ set end [getbytes]
+ }
+ set leakedBytes [expr {$end - $tmp}]
+} -cleanup {
+ unset end i tmp
+ rename getbytes {}
+} -result 0
+
# cleanup
catch {unset a}
catch {unset b}