diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-12-20 09:30:02 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-12-20 09:30:02 (GMT) |
commit | 1c8b2b280f3d85688ac53e997df447281672a44a (patch) | |
tree | d84b517e050859f5635eef156f6869f152c3de2a /generic/tclTest.c | |
parent | b8271467dc712230e7eecf2818f7232c2ebda8b4 (diff) | |
parent | 43b22f924faa4963e0238f2191f56270c8d90b81 (diff) | |
download | tcl-1c8b2b280f3d85688ac53e997df447281672a44a.zip tcl-1c8b2b280f3d85688ac53e997df447281672a44a.tar.gz tcl-1c8b2b280f3d85688ac53e997df447281672a44a.tar.bz2 |
merge trunk (still has test failure in socket.test)
Diffstat (limited to 'generic/tclTest.c')
-rw-r--r-- | generic/tclTest.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c index e30c4d0..dee1fe7 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -318,6 +318,9 @@ static int TestparsevarnameObjCmd(ClientData dummy, static int TestpreferstableObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); +static int TestprintObjCmd(ClientData dummy, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); static int TestregexpObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); @@ -649,6 +652,8 @@ Tcltest_Init( NULL, NULL); Tcl_CreateObjCommand(interp, "testpreferstable", TestpreferstableObjCmd, NULL, NULL); + Tcl_CreateObjCommand(interp, "testprint", TestprintObjCmd, + NULL, NULL); Tcl_CreateObjCommand(interp, "testregexp", TestregexpObjCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testreturn", TestreturnObjCmd, @@ -3820,6 +3825,43 @@ TestpreferstableObjCmd( /* *---------------------------------------------------------------------- * + * TestprintObjCmd -- + * + * This procedure implements the "testprint" command. It is + * used for being able to test the Tcl_ObjPrintf() function. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static int +TestprintObjCmd( + ClientData clientData, /* Not used. */ + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj *const objv[]) /* The argument objects. */ +{ + Tcl_WideInt argv1 = 0; + + if (objc < 2 || objc > 3) { + Tcl_WrongNumArgs(interp, 1, objv, "format wideint"); + } + + if (objc > 1) { + Tcl_GetWideIntFromObj(interp, objv[2], &argv1); + } + Tcl_SetObjResult(interp, Tcl_ObjPrintf(Tcl_GetString(objv[1]), argv1)); + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * * TestregexpObjCmd -- * * This procedure implements the "testregexp" command. It is used to give |