summaryrefslogtreecommitdiffstats
path: root/tests/stringObj.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2009-03-30 17:47:30 (GMT)
committerdgp <dgp@users.sourceforge.net>2009-03-30 17:47:30 (GMT)
commit2824e0640e243a0e045149cc9f44298b48c025a6 (patch)
treede2005ae858faa3138a29ad678f6e078f6610ade /tests/stringObj.test
parent3cafedec0ff906762951dbf8c5065947771aeb7f (diff)
downloadtcl-2824e0640e243a0e045149cc9f44298b48c025a6.zip
tcl-2824e0640e243a0e045149cc9f44298b48c025a6.tar.gz
tcl-2824e0640e243a0e045149cc9f44298b48c025a6.tar.bz2
* generic/tclStringObj.c: Added protections from invalid memory
* generic/tclTestObj.c: accesses when we append (some part of) * tests/stringObj.test: a Tcl_Obj to itself. Added the appendself and appendself2 subcommands to the [teststringobj] testing command and added tests to the test suite. [Bug 2603158]
Diffstat (limited to 'tests/stringObj.test')
-rw-r--r--tests/stringObj.test35
1 files changed, 34 insertions, 1 deletions
diff --git a/tests/stringObj.test b/tests/stringObj.test
index d497262..5b0349c 100644
--- a/tests/stringObj.test
+++ b/tests/stringObj.test
@@ -12,7 +12,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: stringObj.test,v 1.16.14.1 2009/03/21 02:54:23 dgp Exp $
+# RCS: @(#) $Id: stringObj.test,v 1.16.14.2 2009/03/30 17:47:30 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -434,6 +434,39 @@ test stringObj-14.1 {Tcl_SetObjLength on pure unicode object} testobj {
teststringobj get 1
} {bar}
+test stringObj-15.1 {Tcl_Append*ToObj: self appends} {
+ teststringobj set 1 foo
+ teststringobj appendself 1 0
+} foofoo
+test stringObj-15.2 {Tcl_Append*ToObj: self appends} {
+ teststringobj set 1 foo
+ teststringobj appendself 1 1
+} foooo
+test stringObj-15.3 {Tcl_Append*ToObj: self appends} {
+ teststringobj set 1 foo
+ teststringobj appendself 1 2
+} fooo
+test stringObj-15.4 {Tcl_Append*ToObj: self appends} {
+ teststringobj set 1 foo
+ teststringobj appendself 1 3
+} foo
+test stringObj-15.5 {Tcl_Append*ToObj: self appends} {
+ teststringobj set 1 foo
+ teststringobj appendself2 1 0
+} foofoo
+test stringObj-15.6 {Tcl_Append*ToObj: self appends} {
+ teststringobj set 1 foo
+ teststringobj appendself2 1 1
+} foooo
+test stringObj-15.7 {Tcl_Append*ToObj: self appends} {
+ teststringobj set 1 foo
+ teststringobj appendself2 1 2
+} fooo
+test stringObj-15.8 {Tcl_Append*ToObj: self appends} {
+ teststringobj set 1 foo
+ teststringobj appendself2 1 3
+} foo
+
if {[testConstraint testobj]} {
testobj freeallvars
}