Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e89b38472d4040cf0a3763c6cb27d1e36a90991b
Ticket: 495660ffffffffffffffffffffffffffffffffff
[{save|restore}State] useless/buggy
User & Date: dgp on 2001-12-20 23:14:32
Changes

  1. assignee changed to: "melissachawla"
  2. cmimetype changed to: "text/plain"
  3. comment changed 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].
    
  4. foundin changed to: "obsolete: 8.4a4"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dgp"
  9. subsystem changed to: "34. tcltest Package"
  10. title changed to: "[{save|restore}State] useless/buggy"
  11. type changed to: "Bug"