summaryrefslogtreecommitdiffstats
path: root/generic/tclTest.c
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2001-04-04 17:35:24 (GMT)
committerandreas_kupries <akupries@shaw.ca>2001-04-04 17:35:24 (GMT)
commit1bc23f4977493306750102c044b833c0b2b73244 (patch)
tree73d04e6b5c7b92798ed03b19442bc0cbeedddbb2 /generic/tclTest.c
parent8d8e328b979fd600857c37ba6aedb94871872d3b (diff)
downloadtcl-1bc23f4977493306750102c044b833c0b2b73244.zip
tcl-1bc23f4977493306750102c044b833c0b2b73244.tar.gz
tcl-1bc23f4977493306750102c044b833c0b2b73244.tar.bz2
2001-04-04 Andreas Kupries <andreas_kupries@users.sourceforge.net>
* generic/tclTest.c: * tests/io.tests: TIP #10 followup correcting a problem with the original patch because of the lack of 'testthread id' for a non-threaded compilation.
Diffstat (limited to 'generic/tclTest.c')
-rw-r--r--generic/tclTest.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 320f014..8c3ae5c 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -13,7 +13,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.24 2001/03/31 01:55:37 hobbs Exp $
+ * RCS: @(#) $Id: tclTest.c,v 1.25 2001/04/04 17:35:25 andreas_kupries Exp $
*/
#define TCL_TEST
@@ -235,6 +235,8 @@ static int TestMathFunc _ANSI_ARGS_((ClientData clientData,
static int TestMathFunc2 _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, Tcl_Value *args,
Tcl_Value *resultPtr));
+static int TestmainthreadCmd _ANSI_ARGS_((ClientData dummy,
+ Tcl_Interp *interp, int argc, char **argv));
static Tcl_Channel TestOpenFileChannelProc1 _ANSI_ARGS_((Tcl_Interp *interp,
char *filename, char *modeString, int permissions));
static Tcl_Channel TestOpenFileChannelProc2 _ANSI_ARGS_((Tcl_Interp *interp,
@@ -453,6 +455,8 @@ Tcltest_Init(interp)
(ClientData) 345);
Tcl_CreateCommand(interp, "teststatproc", TeststatprocCmd, (ClientData) 0,
(Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateCommand(interp, "testmainthread", TestmainthreadCmd, (ClientData) 0,
+ (Tcl_CmdDeleteProc *) NULL);
t3ArgTypes[0] = TCL_EITHER;
t3ArgTypes[1] = TCL_EITHER;
Tcl_CreateMathFunc(interp, "T3", 2, t3ArgTypes, TestMathFunc2,
@@ -4045,6 +4049,40 @@ TestStatProc3(path, buf)
/*
*----------------------------------------------------------------------
*
+ * TestmainthreadCmd --
+ *
+ * Implements the "testmainthread" cmd that is used to test the
+ * 'Tcl_GetCurrentThread' API.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TestmainthreadCmd (dummy, interp, argc, argv)
+ ClientData dummy; /* Not used. */
+ register Tcl_Interp *interp; /* Current interpreter. */
+ int argc; /* Number of arguments. */
+ char **argv; /* Argument strings. */
+{
+ if (argc == 1) {
+ Tcl_Obj *idObj = Tcl_NewLongObj((long)Tcl_GetCurrentThread());
+ Tcl_SetObjResult(interp, idObj);
+ return TCL_OK;
+ } else {
+ Tcl_SetResult(interp, "wrong # args", TCL_STATIC);
+ return TCL_ERROR;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TestaccessprocCmd --
*
* Implements the "testTclAccessProc" cmd that is used to test the