diff options
author | hershey <hershey@noemail.net> | 1999-06-15 22:06:16 (GMT) |
---|---|---|
committer | hershey <hershey@noemail.net> | 1999-06-15 22:06:16 (GMT) |
commit | 830e431f288628a2ad14c6fc15c828cc2cfc39e7 (patch) | |
tree | fd497b035bc7c04b8ad71eadb4eef2f2f144244d /generic/tclTestObj.c | |
parent | 85c7fff68d05d6e477546db745d3e392f75936a1 (diff) | |
download | tcl-830e431f288628a2ad14c6fc15c828cc2cfc39e7.zip tcl-830e431f288628a2ad14c6fc15c828cc2cfc39e7.tar.gz tcl-830e431f288628a2ad14c6fc15c828cc2cfc39e7.tar.bz2 |
beefed up the string object tests
FossilOrigin-Name: 3f45ef233eaa4dbf4fcc0b9e55d62345627fc02f
Diffstat (limited to 'generic/tclTestObj.c')
-rw-r--r-- | generic/tclTestObj.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index 259fcbd..2733a8c 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -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: tclTestObj.c,v 1.5 1999/06/15 03:14:45 hershey Exp $ + * RCS: @(#) $Id: tclTestObj.c,v 1.6 1999/06/15 22:06:17 hershey Exp $ */ #include "tclInt.h" @@ -883,7 +883,7 @@ TeststringobjCmd(clientData, interp, objc, objv) TestString *strPtr; static char *options[] = { "append", "appendstrings", "get", "get2", "length", "length2", - "set", "set2", "setlength", (char *) NULL + "set", "set2", "setlength", "ualloc", (char *) NULL }; if (objc < 3) { @@ -1032,6 +1032,19 @@ TeststringobjCmd(clientData, interp, objc, objv) Tcl_SetObjLength(varPtr[varIndex], length); } break; + case 9: /* ualloc */ + if (objc != 3) { + goto wrongNumArgs; + } + if (varPtr[varIndex] != NULL) { + strPtr = (TestString *) + (varPtr[varIndex])->internalRep.otherValuePtr; + length = (int) strPtr->uallocated; + } else { + length = -1; + } + Tcl_SetIntObj(Tcl_GetObjResult(interp), length); + break; } return TCL_OK; |