diff options
| author | sebres <sebres@users.sourceforge.net> | 2024-05-10 10:22:58 (GMT) |
|---|---|---|
| committer | sebres <sebres@users.sourceforge.net> | 2024-05-10 10:22:58 (GMT) |
| commit | 6c043cde521979af4349beba14183e7ffe3c3440 (patch) | |
| tree | ea054c636f947ced2433baaa8557afca6dd6ec3e | |
| parent | cf8139d2afbd119b766831b951b2bf59feec8b5a (diff) | |
| parent | 0fdce62c010efc427bb4d2f560ee85035f21b343 (diff) | |
| download | tcl-6c043cde521979af4349beba14183e7ffe3c3440.zip tcl-6c043cde521979af4349beba14183e7ffe3c3440.tar.gz tcl-6c043cde521979af4349beba14183e7ffe3c3440.tar.bz2 | |
closes [10aa8403d064439f]: merge 8.7, restore time64bit constraint (all platforms now)
| -rw-r--r-- | generic/tclTest.c | 23 | ||||
| -rw-r--r-- | tests/cmdAH.test | 8 |
2 files changed, 29 insertions, 2 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c index 44f5234..b224797 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -277,6 +277,7 @@ static Tcl_CmdProc Testset2Cmd; static Tcl_CmdProc TestseterrorcodeCmd; static Tcl_ObjCmdProc TestsetobjerrorcodeCmd; static Tcl_CmdProc TestsetplatformCmd; +static Tcl_ObjCmdProc TestSizeCmd; static Tcl_CmdProc TeststaticlibraryCmd; static Tcl_CmdProc TesttranslatefilenameCmd; static Tcl_CmdProc TestupvarCmd; @@ -688,6 +689,7 @@ Tcltest_Init( TestGetIntForIndexCmd, NULL, NULL); Tcl_CreateCommand(interp, "testsetplatform", TestsetplatformCmd, NULL, NULL); + Tcl_CreateObjCommand(interp, "testsize", TestSizeCmd, NULL, NULL); Tcl_CreateCommand(interp, "testsocket", TestSocketCmd, NULL, NULL); Tcl_CreateCommand(interp, "teststaticlibrary", TeststaticlibraryCmd, @@ -4858,6 +4860,27 @@ TestsetplatformCmd( return TCL_OK; } +static int +TestSizeCmd( + TCL_UNUSED(void *), /* 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; +} + /* *---------------------------------------------------------------------- * diff --git a/tests/cmdAH.test b/tests/cmdAH.test index ad5a67d..834fd68 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -22,6 +22,10 @@ testConstraint testchmod [llength [info commands testchmod]] testConstraint testsetplatform [llength [info commands testsetplatform]] testConstraint testvolumetype [llength [info commands testvolumetype]] testConstraint testbytestring [llength [info commands testbytestring]] +testConstraint time64bit [expr { + $::tcl_platform(pointerSize) >= 8 || + [llength [info command testsize]] && [testsize st_mtime] >= 8 +}] testConstraint linkDirectory [expr { ![testConstraint win] || ($::tcl_platform(osVersion) >= 5.0 @@ -1707,7 +1711,7 @@ test cmdAH-24.14.1 { } -match regexp -result {could not (?:get modification time|read)} -returnCodes error # 3155760000 is 64-bit Unix time, Wed Jan 01 00:00:00 GMT 2070: -test cmdAH-24.20.1 {Tcl_FileObjCmd: atime 64-bit time_t, bug [4718b41c56]} -setup { +test cmdAH-24.20.1 {Tcl_FileObjCmd: atime 64-bit time_t, bug [4718b41c56]} -constraints {time64bit} -setup { set filename [makeFile "" foo.text] } -body { # This test may fail if your system does not have a 64-bit time_t. @@ -1716,7 +1720,7 @@ test cmdAH-24.20.1 {Tcl_FileObjCmd: atime 64-bit time_t, bug [4718b41c56]} -setu } -cleanup { removeFile $filename } -result {3155760000 3155760000} -test cmdAH-24.20.2 {Tcl_FileObjCmd: mtime 64-bit time_t, bug [4718b41c56]} -setup { +test cmdAH-24.20.2 {Tcl_FileObjCmd: mtime 64-bit time_t, bug [4718b41c56]} -constraints {time64bit} -setup { set filename [makeFile "" foo.text] } -body { # This test may fail if your system does not have a 64-bit time_t. |
