home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tcl2-73c.zip / tcl7.3 / tests / dcall.test < prev    next >
Text File  |  1993-09-09  |  2KB  |  55 lines

  1. # Commands covered:  none
  2. #
  3. # This file contains a collection of tests for Tcl_CallWhenDeleted.
  4. # Sourcing this file into Tcl runs the tests and generates output for
  5. # errors.  No output means no errors were found.
  6. #
  7. # Copyright (c) 1993 The Regents of the University of California.
  8. # All rights reserved.
  9. #
  10. # Permission is hereby granted, without written agreement and without
  11. # license or royalty fees, to use, copy, modify, and distribute this
  12. # software and its documentation for any purpose, provided that the
  13. # above copyright notice and the following two paragraphs appear in
  14. # all copies of this software.
  15. #
  16. # IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
  17. # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
  18. # OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  19. # CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  20. #
  21. # THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  22. # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  23. # AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  24. # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  25. # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  26. #
  27. # $Header: /user6/ouster/tcl/tests/RCS/dcall.test,v 1.3 93/09/09 16:43:05 ouster Exp $ (Berkeley)
  28.  
  29. if {[info commands testdcall] == {}} {
  30.     puts "This application hasn't been compiled with the \"testdcall\""
  31.     puts "command, so I can't test Tcl_CallWhenDeleted."
  32.     return
  33. }
  34.  
  35. if {[string compare test [info procs test]] == 1} then {source defs}
  36.  
  37. test dcall-1.1 {deletion callbacks} {
  38.     testdcall 1 2 3
  39. } {1 2 3}
  40. test dcall-1.2 {deletion callbacks} {
  41.     testdcall
  42. } {}
  43. test dcall-1.3 {deletion callbacks} {
  44.     testdcall 20 21 22 -22
  45. } {20 21}
  46. test dcall-1.4 {deletion callbacks} {
  47.     testdcall 20 21 22 -20
  48. } {21 22}
  49. test dcall-1.5 {deletion callbacks} {
  50.     testdcall 20 21 22 -21
  51. } {20 22}
  52. test dcall-1.6 {deletion callbacks} {
  53.     testdcall 20 21 22 -21 -22 -20
  54. } {}
  55.