summaryrefslogtreecommitdiffstats
path: root/generic/tclTest.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-06-27 18:21:52 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-06-27 18:21:52 (GMT)
commitf0da4e55104381d0a8bf98a2c3dfc4848efc1b3d (patch)
treeab1c0c3edd37a49f30dbb627b0eac08a8d9cebce /generic/tclTest.c
parent1b530b0a0e25372430b74d7be4881caa02529f3d (diff)
downloadtcl-f0da4e55104381d0a8bf98a2c3dfc4848efc1b3d.zip
tcl-f0da4e55104381d0a8bf98a2c3dfc4848efc1b3d.tar.gz
tcl-f0da4e55104381d0a8bf98a2c3dfc4848efc1b3d.tar.bz2
* generic/tclTrace.c: Corrected broken trace reversal logic in
* generic/tclTest.c: TclCheckInterpTraces that led to infinite loop * tests/trace.test: when multiple Tcl_CreateTrace traces were set and one of them did not fire due to level restrictions. [Bug 1743931].
Diffstat (limited to 'generic/tclTest.c')
-rw-r--r--generic/tclTest.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 4cf57ce..e7be33f 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTest.c,v 1.110 2007/05/02 20:50:26 kennykb Exp $
+ * RCS: @(#) $Id: tclTest.c,v 1.111 2007/06/27 18:21:52 dgp Exp $
*/
#define TCL_TEST
@@ -1213,9 +1213,25 @@ TestcmdtraceCmd(
} else {
return result;
}
+ } else if ( strcmp(argv[1], "doubletest" ) == 0 ) {
+ Tcl_Trace t1, t2;
+
+ Tcl_DStringInit(&buffer);
+ t1 = Tcl_CreateTrace(interp, 1,
+ (Tcl_CmdTraceProc *) CmdTraceProc, (ClientData) &buffer);
+ t2 = Tcl_CreateTrace(interp, 50000,
+ (Tcl_CmdTraceProc *) CmdTraceProc, (ClientData) &buffer);
+ result = Tcl_Eval(interp, argv[2]);
+ if (result == TCL_OK) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), NULL);
+ }
+ Tcl_DeleteTrace(interp, t2);
+ Tcl_DeleteTrace(interp, t1);
+ Tcl_DStringFree(&buffer);
} else {
Tcl_AppendResult(interp, "bad option \"", argv[1],
- "\": must be tracetest, deletetest or resulttest", NULL);
+ "\": must be tracetest, deletetest, doubletest or resulttest", NULL);
return TCL_ERROR;
}
return TCL_OK;