Artifacts Associated With Ticket 495660ffffffffff
Ticket change [e89b38472d] (rid 104675) by dgp on 2001-12-20 23:14:32:
- assignee initialized to: "melissachawla"
- cmimetype initialized to: "text/plain"
- comment initialized to:
[saveState] records only the list of procedure names and variable names in use, but not their definitions, so there's really no "restore" capability in [restore]. Also, [restoreState] only examines [info procs] rather than [info commands], so new commands are not cleaned up if they are not [proc]s. Also, the history kept by [saveState] is only one level deep, so a second call to [saveState] destroys the saved information from the first call. The saved state is actually stored in a Tcl list that could easily manage a stack. So, the whole deal looks pretty useless to me. The actual bugs: 1) The documentation for [saveState] and [restoreState] suggests they are useful if a test file "creates or deletes global variables or procs". However, as noted above, there is no real restore capability, so these commands can do nothing to help out when procs or global variables are deleted. Well, [restoreState] could raise an error, but it doesn't. 2) The documentation refers to "global variables", but these routines operate in the frame of their callers, so they operate on global variables only if called from level #0. They should use [info globals] instead of [info vars], to operate as documented. With the features of tcltest 2.x, it seems to me that each test should be managing its own setup and cleanup with the -setup and -cleanup options anyway. I'd suggest deprecating [{save|restore}state]. - foundin initialized to: "obsolete: 8.4a4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "34. tcltest Package"
- title initialized to: "[{save|restore}State] useless/buggy"
- type initialized to: "Bug"
Ticket change [123c8bb749] (rid 95276) by hobbs on 2002-03-23 06:06:31:
- assignee changed to: "dgp"
Ticket change [05a5afcbe7] (rid 89101) by dgp on 2002-04-16 07:48:51:
- icomment:
Logged In: YES user_id=80530 Note that {save|restore}State only pretend to operate on procs and variables. These are also the things stored in namespaces. It is simpler and more reliable for a test suite to create and destroy a namespace for the commands and variables it uses, than to attempt to call on saveState and restoreState. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [6c47aa2175] (rid 128477) by dgp on 2002-04-17 06:22:54:
- icomment:
Logged In: YES user_id=80530 This patch removes documentation of [saveState] and [restoreState] from tcltest 2. The commands themselves can stick around for the sake of compatibility support for tcltest 1, but removing them from the documentation effectively deprecates them so that new test suites will not be encouraged to use these useless and buggy commands.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [f93f6d85c8] (rid 91675) by dgp on 2002-04-17 06:22:55:
- icomment:
File Added - 21328: ttstate.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "ttstate.patch" [ef9b65c310] (rid 109024) by dgp on 2002-04-17 06:22:55.
Ticket change [e6ded7cfee] (rid 104364) by dgp on 2002-04-18 07:00:22:
- closedate changed to: "2002-04-18T00:00:22"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 committed to HEAD (8.4a5)
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"