summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2024-05-10 10:11:27 (GMT)
committersebres <sebres@users.sourceforge.net>2024-05-10 10:11:27 (GMT)
commit1f1e1694f2ffe12933b08fde4aa93acaa7ac280e (patch)
tree586404e04864dc32cd46fa8436738a12fbb7144a /generic
parent7180624f9b41ef23d847789e1970d3c57c561858 (diff)
downloadtcl-1f1e1694f2ffe12933b08fde4aa93acaa7ac280e.zip
tcl-1f1e1694f2ffe12933b08fde4aa93acaa7ac280e.tar.gz
tcl-1f1e1694f2ffe12933b08fde4aa93acaa7ac280e.tar.bz2
issue [10aa8403d064439f]: make command `testsize` platform-independent (covers constraint time64bit for unix too)
Diffstat (limited to 'generic')
-rw-r--r--generic/tclTest.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 88e5eea..21c6d65 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -273,6 +273,7 @@ static Tcl_CmdProc Testset2Cmd;
static Tcl_CmdProc TestseterrorcodeCmd;
static Tcl_ObjCmdProc TestsetobjerrorcodeCmd;
static Tcl_CmdProc TestsetplatformCmd;
+static Tcl_ObjCmdProc TestSizeCmd;
static Tcl_CmdProc TeststaticpkgCmd;
static Tcl_CmdProc TesttranslatefilenameCmd;
static Tcl_CmdProc TestupvarCmd;
@@ -594,6 +595,7 @@ Tcltest_Init(
TestFindLastCmd, NULL, NULL);
Tcl_CreateCommand(interp, "testsetplatform", TestsetplatformCmd,
NULL, NULL);
+ Tcl_CreateObjCommand(interp, "testsize", TestSizeCmd, NULL, NULL);
Tcl_CreateCommand(interp, "teststaticpkg", TeststaticpkgCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testtranslatefilename",
@@ -4441,6 +4443,27 @@ TestsetplatformCmd(
return TCL_OK;
}
+static int
+TestSizeCmd(
+ ClientData clientData, /* Unused */
+ Tcl_Interp* interp, /* Tcl interpreter */
+ int objc, /* Parameter count */
+ Tcl_Obj *const * objv) /* Parameter vector */
+{
+ if (objc != 2) {
+ goto syntax;
+ }
+ if (strcmp(Tcl_GetString(objv[1]), "st_mtime") == 0) {
+ Tcl_StatBuf *statPtr;
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(sizeof(statPtr->st_mtime)));
+ return TCL_OK;
+ }
+
+syntax:
+ Tcl_WrongNumArgs(interp, 1, objv, "st_mtime");
+ return TCL_ERROR;
+}
+
/*
*----------------------------------------------------------------------
*