Index: generic/xotcl.c =================================================================== diff -u -rff41e1a0cb88c3aa7b96ca3b67b27043794991b0 -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- generic/xotcl.c (.../xotcl.c) (revision ff41e1a0cb88c3aa7b96ca3b67b27043794991b0) +++ generic/xotcl.c (.../xotcl.c) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -6050,7 +6050,7 @@ Tcl_Obj *tov[2]; tov[0] = objv[0]; tov[1] = XOTclGlobalObjects[XOTE_DEFAULTMETHOD]; - result = ObjectDispatch(clientData, interp, 2, tov, 0); + result = ObjectDispatch(clientData, interp, 2, tov, XOTCL_CM_NO_UNKNOWN); } return result; Index: library/lib/test.xotcl =================================================================== diff -u -r142687efa93af981936db61ecfde494d8f269b0a -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- library/lib/test.xotcl (.../test.xotcl) (revision 142687efa93af981936db61ecfde494d8f269b0a) +++ library/lib/test.xotcl (.../test.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -30,12 +30,24 @@ {namespace ::} {verbose 0} {expected 1} - {count 1000} + {count 100} msg setResult errorReport pre post } { set .count 0 + .public object method case {name} {set .case $name} + + .public object method parameter {name value:optional} { + if {[info exists value]} { + #[[self] slot $name] default $value + [self] slot $name default $value + .__invalidateobjectparameter + } else { + return [[self] slot $name default] + } + } + .public object method new args { if {[info exists .case]} { if {![info exists .ccount(${.case})]} {set .ccount(${.case}) 0} @@ -64,7 +76,7 @@ if {![info exists .msg]} {set .msg ${.cmd}} set r [.call "run" ${.cmd}] if {[info exists .setResult]} {set r [eval [set .setResult]]} - if {$r == ${.expected}} { + if {$r eq ${.expected}} { if {[info exists .count]} {set c ${.count}} {set c 1000} if {[.verbose]} { puts stderr "running test $c times" @@ -89,9 +101,18 @@ if {[info exists .post]} {.call "post" ${.post}} } - .public object method case {name} {set .case $name} } namespace export Test } +proc ? {cmd expected {msg ""}} { + if {$msg ne ""} { + set t [Test new -cmd $cmd -msg $msg] + } else { + set t [Test new -cmd $cmd] + } + $t expected $expected + $t run +} + namespace import ::xotcl::test::* Index: tests/aliastest.xotcl =================================================================== diff -u -r1c11937f4f0aea905fbedfbb9c2d1782b08833f5 -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- tests/aliastest.xotcl (.../aliastest.xotcl) (revision 1c11937f4f0aea905fbedfbb9c2d1782b08833f5) +++ tests/aliastest.xotcl (.../aliastest.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -1,30 +1,21 @@ -package require XOTcl +package require XOTcl; ::xotcl::use xotcl2 package require xotcl::test -proc ? {cmd expected {msg ""}} { - set count 10 - if {$msg ne ""} { - set t [Test new -cmd $cmd -count $count -msg $msg] - } else { - set t [Test new -cmd $cmd -count $count] - } - $t expected $expected - $t run -} +Test parameter count 10 -::xotcl::use xotcl1 -::xotcl::use xotcl2 - -# the system methods of Object are either alias or forwarders +# The system methods of Object are either alias or forwarders ? {lsort [::xotcl::Slot info methods -methodtype alias]} {assign get} ? {::xotcl::Slot info method definition get} "::xotcl::Slot alias get ::xotcl::setinstvar" +# define an alias and retrieve its definition set cmd "::xotcl2::Object alias -objscope set ::set" eval $cmd ? {Object info method definition set} $cmd -Class create Base -Base method foo {{-x 1}} {return $x} +# define an alias and retrieve its definition +Class create Base { + .method foo {{-x 1}} {return $x} +} Class create Foo ::xotcl::alias ::Foo foo ::xotcl::classes::Base::foo Index: tests/destroytest.xotcl =================================================================== diff -u -rf9807b1cea03590c9573b5a521760538d53ee90f -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- tests/destroytest.xotcl (.../destroytest.xotcl) (revision f9807b1cea03590c9573b5a521760538d53ee90f) +++ tests/destroytest.xotcl (.../destroytest.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -1,197 +1,197 @@ -package require XOTcl - -xotcl::use xotcl1 +package require XOTcl; xotcl::use xotcl2 package require xotcl::test -proc ? {cmd expected {msg ""}} { - set count 10 - if {$msg ne ""} { - set t [Test new -cmd $cmd -count $count -msg $msg] - } else { - set t [Test new -cmd $cmd -count $count] +Test parameter count 10 + +::xotcl::alias ::xotcl2::Object set -objscope ::set + +Class create O -superclass Object { + .method init {} { + set ::ObjectDestroy 0 + set ::firstDestroy 0 } - $t expected $expected - $t run + .method destroy {} { + incr ::ObjectDestroy + #[my info class] dealloc [self] + next + } } -Class O -superclass Object -O instproc init {} { - set ::ObjectDestroy 0 - set ::firstDestroy 0 -} -O instproc destroy {} { - incr ::ObjectDestroy - #[my info class] dealloc [self] - next -} # # classical simple case # set case "simple destroy (1)" -Class C -superclass O -C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} -C instproc foo {} { +Test case simple-destroy-1 +Class create C -superclass O +C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} +C method foo {} { puts stderr "==== $::case [self]" my destroy - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 ? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBBB" - ? {Object isobject c1} 1 "$::case object still exists in proc" - ? "set ::firstDestroy" 1 "$::case, firstDestroy called" - ? "set ::ObjectDestroy" 1 "$::case, ObjectDestroy called" + ? {::xotcl::is c1 object} 1 "$::case object still exists in proc" + ? "set ::firstDestroy" 1 "firstDestroy called" + ? "set ::ObjectDestroy" 1 "ObjectDestroy called" } -C c1 +C create c1 c1 foo -puts stderr ======[Object isobject c1] -? {Object isobject c1} 0 "$::case object deleted" -? "set ::firstDestroy" 1 "$::case, firstDestroy called" +puts stderr ======[::xotcl::is c1 object] +? {::xotcl::is c1 object} 0 "$::case object deleted" +? "set ::firstDestroy" 1 "firstDestroy called" # # simple case, destroy does not propagate, c1 survives # set case "simple destroy (2), destroy blocks" -Class C -superclass O -C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy block"} -C instproc foo {} { +Test case simple-destroy-2 +Class create C -superclass O +C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy block"} +C method foo {} { puts stderr "==== $::case [self]" my destroy - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 ? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBBB" - ? {Object isobject c1} 1 "$::case object still exists in proc" - ? "set ::firstDestroy" 1 "$::case, firstDestroy called" - ? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" + ? {::xotcl::is c1 object} 1 "$::case object still exists in proc" + ? "set ::firstDestroy" 1 "firstDestroy called" + ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } -C c1 +C create c1 c1 foo -puts stderr ======[Object isobject c1] -? {Object isobject c1} 1 "$::case object deleted" -? "set ::firstDestroy" 1 "$::case, firstDestroy called" -? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" +puts stderr ======[::xotcl::is c1 object] +? {::xotcl::is c1 object} 1 "$::case object deleted" +? "set ::firstDestroy" 1 "firstDestroy called" +? "set ::ObjectDestroy" 0 "ObjectDestroy called" # # simple object recreate # set case "recreate" -Class C -superclass O -C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} -C instproc foo {} { +Test case recreate +Class create C -superclass O +C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} +C method foo {} { puts stderr "==== $::case [self]" [my info class] create [self] - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 ? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBBB" - ? {Object isobject c1} 1 "$::case object still exists in proc" - ? "set ::firstDestroy" 0 "$::case, firstDestroy called" - ? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" + ? {::xotcl::is c1 object} 1 "$::case object still exists in proc" + ? "set ::firstDestroy" 0 "firstDestroy called" + ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } -C c1 +C create c1 c1 foo -puts stderr ======[Object isobject c1] -? {Object isobject c1} 1 "$::case object deleted" -? "set ::firstDestroy" 0 "$::case, firstDestroy called" +puts stderr ======[::xotcl::is c1 object] +? {::xotcl::is c1 object} 1 "$::case object deleted" +? "set ::firstDestroy" 0 "firstDestroy called" # # cmd rename to empty, xotcl provides its own rename and calls destroy # .. like simple case above # set case "cmd rename empty (1)" -Object o -Class C -superclass O -C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} -C instproc foo {} { +Test case rename-empty-1 +Object create o +Class create C -superclass O +C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} +C method foo {} { puts stderr "==== $::case [self]" rename [self] "" - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 ? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - ? {Object isobject c1} 1 "$::case object still exists in proc" - ? "set ::firstDestroy" 1 "$::case, firstDestroy called" - ? "set ::ObjectDestroy" 1 "$::case, ObjectDestroy called" + ? {::xotcl::is c1 object} 1 "$::case object still exists in proc" + ? "set ::firstDestroy" 1 "firstDestroy called" + ? "set ::ObjectDestroy" 1 "ObjectDestroy called" } -C c1 +C create c1 c1 foo -puts stderr ======[Object isobject c1] -? {Object isobject c1} 0 "$::case object still exists after proc" -? "set ::firstDestroy" 1 "$::case, firstDestroy called" -? "set ::ObjectDestroy" 1 "$::case, ObjectDestroy called" +puts stderr ======[::xotcl::is c1 object] +? {::xotcl::is c1 object} 0 "$::case object still exists after proc" +? "set ::firstDestroy" 1 "firstDestroy called" +? "set ::ObjectDestroy" 1 "ObjectDestroy called" # # cmd rename to empty, xotcl provides its own rename and calls # destroy, but destroy does not propagate, c1 survives rename, since # this is the situation like above, as long xotcl's rename is used. # set case "cmd rename empty (2)" -Class C -superclass O -C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy block"} -C instproc foo {} { +Test case rename-empty-2 +Class create C -superclass O +C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy block"} +C method foo {} { puts stderr "==== $::case [self]" rename [self] "" - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 ? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - ? {Object isobject c1} 1 "$::case object still exists in proc" - ? "set ::firstDestroy" 1 "$::case, firstDestroy called" - ? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" + ? {::xotcl::is c1 object} 1 "$::case object still exists in proc" + ? "set ::firstDestroy" 1 "firstDestroy called" + ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } -C c1 +C create c1 c1 foo -puts stderr ======[Object isobject c1] +puts stderr ======[::xotcl::is c1 object] puts stderr ======[c1 set x] -? {Object isobject c1} 1 "$::case object still exists after proc" -? "set ::firstDestroy" 1 "$::case, firstDestroy called" -? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" +? {::xotcl::is c1 object} 1 "$::case object still exists after proc" +? "set ::firstDestroy" 1 "firstDestroy called" +? "set ::ObjectDestroy" 0 "ObjectDestroy called" # # cmd rename other xotcl object to current, # xotcl's rename invokes a move # set case "cmd rename object to self" -Object o -Class C -superclass O -C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} -C instproc foo {} { +Test case rename-to-self +Object create o +Class create C -superclass O +C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} +C method foo {} { puts stderr "==== $::case [self]" rename o [self] - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 ? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - ? {Object isobject c1} 1 "$::case object still exists in proc" - ? "set ::firstDestroy" 0 "$::case, firstDestroy called" - ? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" + ? {::xotcl::is c1 object} 1 "$::case object still exists in proc" + ? "set ::firstDestroy" 0 "firstDestroy called" + ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } -C c1 +C create c1 c1 foo -puts stderr ======[Object isobject c1] -? {Object isobject c1} 1 "$::case object still exists after proc" -? "set ::firstDestroy" 0 "$::case, firstDestroy called" -? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" +puts stderr ======[::xotcl::is c1 object] +? {::xotcl::is c1 object} 1 "$::case object still exists after proc" +? "set ::firstDestroy" 0 "firstDestroy called" +? "set ::ObjectDestroy" 0 "ObjectDestroy called" # # cmd rename other proc to current object, # xotcl's rename invokes a move # set case "cmd rename proc to self" +Test case rename-proc-to-self proc o args {} -Class C -superclass O -C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} -C instproc foo {} { +Class create C -superclass O +C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} +C method foo {} { puts stderr "==== $::case [self]" set x [catch {rename o [self]}] ? "set _ $x" 1 "$::case tcl refuses to rename into an existing command" } -C c1 +C create c1 c1 foo -? {Object isobject c1} 1 "$::case object still exists after proc" -? "set ::firstDestroy" 0 "$::case, firstDestroy called" -? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" +? {::xotcl::is c1 object} 1 "$::case object still exists after proc" +? "set ::firstDestroy" 0 "firstDestroy called" +? "set ::ObjectDestroy" 0 "ObjectDestroy called" # @@ -202,34 +202,35 @@ # set case "delete parent namespace (1)" +Test case delete-parent-namespace namespace eval ::test { - Class C -superclass O - C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} - C instproc foo {} { + Class create C -superclass O + C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} + C method foo {} { puts stderr "==== $::case [self]" namespace delete ::test - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 # # If the following line is commented in, the namespace is deleted # here. Is there a bug with nsPtr->activationCount # #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - puts stderr "???? [self] exists [Object isobject [self]]" - ? "Object isobject [self]" 0 ;# WHY? - puts stderr "???? [self] exists [Object isobject [self]]" - ? "set ::firstDestroy" 0 "$::case, firstDestroy called" + puts stderr "???? [self] exists [::xotcl::is [self] object]" + ? "::xotcl::is [self] object" 0 ;# WHY? + puts stderr "???? [self] exists [::xotcl::is [self] object]" + ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "$::case destroy not yet called" } } -test::C test::c1 +test::C create test::c1 test::c1 foo -puts stderr ======[Object isobject test::c1] -? {Object isobject test::c1} 0 "$::case object still exists after proc" -? "set ::firstDestroy" 1 "$::case, firstDestroy called" -? "set ::ObjectDestroy" 1 "$::case: destroy was called when poping stack frame" -? {Object isobject ::test::C} 0 "$::case class still exists after proc" +puts stderr ======[::xotcl::is test::c1 object] +? {::xotcl::is test::c1 object} 0 "$::case object still exists after proc" +? "set ::firstDestroy" 1 "firstDestroy called" +? "set ::ObjectDestroy" 1 "destroy was called when poping stack frame" +? {::xotcl::is ::test::C object} 0 "$::case class still exists after proc" ? {namespace exists ::test::C} 0 "$::case namespace ::test::C still exists after proc" ? {namespace exists ::test} 0 "$::case parent ::test namespace still exists after proc" ? {namespace exists ::xotcl::classes::test::C} 0 "$::case namespace ::xotcl::classes::test::C still exists after proc" @@ -240,262 +241,276 @@ # propagate. # set case "delete parent namespace (2)" +Test case delete-parent-namespace-2 namespace eval ::test { ? {namespace exists test::C} 0 "exists test::C" - Class C -superclass O - C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy block"} - C instproc foo {} { + Class create C -superclass O + C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy block"} + C method foo {} { puts stderr "==== $::case [self]" namespace delete ::test - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 # # If the following line is commented in, the namespace is deleted # here. Is there a bug with nsPtr->activationCount # #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBBB" - puts stderr "???? [self] exists [Object isobject [self]]" - ? "Object isobject [self]" 0 "$::case object still exists in proc";# WHY? - puts stderr "???? [self] exists [Object isobject [self]]" - ? "set ::firstDestroy" 0 "$::case, firstDestroy called" - ? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called"; # NOT YET CALLED + puts stderr "???? [self] exists [::xotcl::is [self] object]" + ? "::xotcl::is [self] object" 0 "$::case object still exists in proc";# WHY? + puts stderr "???? [self] exists [::xotcl::is [self] object]" + ? "set ::firstDestroy" 0 "firstDestroy called" + ? "set ::ObjectDestroy" 0 "ObjectDestroy called"; # NOT YET CALLED } } -test::C test::c1 +test::C create test::c1 test::c1 foo -puts stderr ======[Object isobject test::c1] -? {Object isobject test::c1} 0 "$::case object still exists after proc" -? "set ::firstDestroy" 1 "$::case, firstDestroy called" -? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" ;# toplevel destroy was blocked +puts stderr ======[::xotcl::is test::c1 object] +? {::xotcl::is test::c1 object} 0 "$::case object still exists after proc" +? "set ::firstDestroy" 1 "firstDestroy called" +? "set ::ObjectDestroy" 0 "ObjectDestroy called" ;# toplevel destroy was blocked # # controlled namespace delete: xotcl has its own namespace cleanup, # topological order should be always ok. however, the object o::c1 is # already deleted, while a method of it is excuted # set case "delete parent object (1)" -Object o -Class C -superclass O -C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} -C instproc foo {} { +Test case delete-parent-object +Object create o +Class create C -superclass O +C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} +C method foo {} { puts stderr "==== $::case [self]" o destroy puts stderr "AAAA" # the following isobject call has a problem in Tcl_GetCommandFromObj(), # which tries to access invalid memory - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBBB" - ? {Object isobject ::o::c1} 0 "$::case object still exists in proc" - ? "set ::firstDestroy" 1 "$::case, firstDestroy called" - ? "set ::ObjectDestroy" 1 "$::case, ObjectDestroy called" + ? {::xotcl::is ::o::c1 object} 0 "$::case object still exists in proc" + ? "set ::firstDestroy" 1 "firstDestroy called" + ? "set ::ObjectDestroy" 1 "ObjectDestroy called" } -C o::c1 +C create o::c1 o::c1 foo -puts stderr ======[Object isobject ::o::c1] -? {Object isobject ::o::c1} 0 "$::case object o::c1 still exists after proc" -? {Object isobject o} 0 "$::case object o still exists after proc" -? "set ::firstDestroy" 1 "$::case, firstDestroy called" -? "set ::ObjectDestroy" 1 "$::case, ObjectDestroy called" +puts stderr ======[::xotcl::is ::o::c1 object] +? {::xotcl::is ::o::c1 object} 0 "$::case object o::c1 still exists after proc" +? {::xotcl::is o object} 0 "$::case object o still exists after proc" +? "set ::firstDestroy" 1 "firstDestroy called" +? "set ::ObjectDestroy" 1 "ObjectDestroy called" # # controlled namespace delete: xotcl has its own namespace cleanup. # destroy does not delegate, but still o::c1 does not survive, since o # is deleted. # set case "delete parent object (2)" -Object o -Class C -superclass O -C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy block"} -C instproc foo {} { +Test case delete-parent-object-2 +Object create o +Class create C -superclass O +C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy block"} +C method foo {} { puts stderr "==== $::case [self]" o destroy - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - ? {Object isobject ::o::c1} 0 "$::case object still exists in proc" - ? "set ::firstDestroy" 1 "$::case, firstDestroy called" - ? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" + ? {::xotcl::is ::o::c1 object} 0 "$::case object still exists in proc" + ? "set ::firstDestroy" 1 "firstDestroy called" + ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } -C o::c1 +C create o::c1 o::c1 foo -puts stderr ======[Object isobject ::o::c1] -? {Object isobject ::o::c1} 0 "$::case object still exists after proc" -? "set ::firstDestroy" 1 "$::case, firstDestroy called" -? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" +puts stderr ======[::xotcl::is ::o::c1 object] +? {::xotcl::is ::o::c1 object} 0 "$::case object still exists after proc" +? "set ::firstDestroy" 1 "firstDestroy called" +? "set ::ObjectDestroy" 0 "ObjectDestroy called" # # create an other cmd with the current object's name. # xotcl 1.6 crashed on this test # set case "redefined current object as proc" -Object o -Class C -superclass O -C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} -C instproc foo {} { +Test case redefined-current-object-as-proc +Object create o +Class create C -superclass O +C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} +C method foo {} { puts stderr "==== $::case [self]" proc [self] {args} {puts HELLO} - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - ? "set ::firstDestroy" 1 "$::case, firstDestroy called" - ? "set ::ObjectDestroy" 1 "$::case, ObjectDestroy called" - ? {Object isobject c1} 0 "$::case object still exists in proc" + ? "set ::firstDestroy" 1 "firstDestroy called" + ? "set ::ObjectDestroy" 1 "ObjectDestroy called" + ? {::xotcl::is c1 object} 0 "$::case object still exists in proc" } -C c1 +C create c1 c1 foo -puts stderr ======[Object isobject c1] -? {Object isobject c1} 0 "$::case object still exists after proc" -? "set ::firstDestroy" 1 "$::case, firstDestroy called" -? "set ::ObjectDestroy" 1 "$::case, ObjectDestroy called" +puts stderr ======[::xotcl::is c1 object] +? {::xotcl::is c1 object} 0 "$::case object still exists after proc" +? "set ::firstDestroy" 1 "firstDestroy called" +? "set ::ObjectDestroy" 1 "ObjectDestroy called" # # delete the active class # set case "delete active class" -Class C -superclass O -C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} -C instproc foo {} { +Test case delete-active-class +Class create C -superclass O +C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} +C method foo {} { puts stderr "==== $::case [self]" C destroy - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - #? [my info class] ::xotcl::Object "$::case, object reclassed" - ? [my info class] ::C "$::case, object reclassed?" - ? "set ::firstDestroy" 0 "$::case, firstDestroy called" - ? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" - ? {Object isobject c1} 1 "$::case: object still exists in proc" - #? {Object isclass ::C} 0 "$::case: class still exists in proc" - ? {Object isclass ::C} 1 "$::case: class still exists in proc" + #? [my info class] ::xotcl::Object "object reclassed" + ? [my info class] ::C "object reclassed?" + ? "set ::firstDestroy" 0 "firstDestroy called" + ? "set ::ObjectDestroy" 0 "ObjectDestroy called" + ? {::xotcl::is c1 object} 1 "object still exists in proc" + #? {::xotcl::is ::C class} 0 "class still exists in proc" + ? {::xotcl::is ::C class} 1 "class still exists in proc" } -C c1 +C create c1 c1 foo -puts stderr ======[Object isobject c1] -? {Object isobject c1} 1 "$::case: object still exists after proc" -? [c1 info class] ::xotcl::Object "$::case, after proc: object reclassed?" -? "set ::firstDestroy" 0 "$::case, firstDestroy called" -? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" +puts stderr ======[::xotcl::is c1 object] +? {::xotcl::is c1 object} 1 "object still exists after proc" +? [c1 info class] ::xotcl2::Object "after proc: object reclassed?" +? "set ::firstDestroy" 0 "firstDestroy called" +? "set ::ObjectDestroy" 0 "ObjectDestroy called" # # delete active object nested in class # set case "delete active object nested in class" -Class C -superclass O -C instproc destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} -C instproc foo {} { +Test case delete-active-object-nested-in-class +Class create C -superclass O +C method destroy {} {incr ::firstDestroy; puts stderr " *** [self] destroy"; next} +C method foo {} { puts stderr "==== $::case [self]" C destroy - puts stderr "AAAA [self] exists [Object isobject [self]]" + puts stderr "AAAA [self] exists [::xotcl::is [self] object]" my set x 1 #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - #? "set ::firstDestroy" 0 "$::case, firstDestroy called" - ? "set ::firstDestroy" 1 "$::case, firstDestroy called" - #? "set ::ObjectDestroy" 0 "$::case, ObjectDestroy called" - ? "set ::ObjectDestroy" 1 "$::case, ObjectDestroy called" - ? [my info class] ::C "$::case, object reclassed" - #? [my info class] ::xotcl::Object "$::case, object reclassed" - ? {Object isobject ::C::c1} 1 "$::case: object still exists in proc" - ? {Object isclass ::C} 1 "$::case: class still exists in proc" + #? "set ::firstDestroy" 0 "firstDestroy called" + ? "set ::firstDestroy" 1 "firstDestroy called" + #? "set ::ObjectDestroy" 0 "ObjectDestroy called" + ? "set ::ObjectDestroy" 1 "ObjectDestroy called" + ? [my info class] ::C "object reclassed" + #? [my info class] ::xotcl::Object "object reclassed" + ? {::xotcl::is ::C::c1 object} 1 "object still exists in proc" + ? {::xotcl::is ::C class} 1 "class still exists in proc" } C create ::C::c1 C::c1 foo -#puts stderr ======[Object isobject ::C::c1] -? {Object isobject ::C::c1} 0 "$::case: object still exists after proc" -? {Object isclass ::C} 0 "$::case: class still exists after proc" -? "set ::firstDestroy" 1 "$::case, firstDestroy called" -? "set ::ObjectDestroy" 1 "$::case, ObjectDestroy called" +#puts stderr ======[::xotcl::is ::C::c1 object] +? {::xotcl::is ::C::c1 object} 0 "object still exists after proc" +? {::xotcl::is ::C class} 0 "class still exists after proc" +? "set ::firstDestroy" 1 "firstDestroy called" +? "set ::ObjectDestroy" 1 "ObjectDestroy called" # set case "nesting destroy" -Object x -Object x::y +Test case nesting-destroy +Object create x +Object create x::y x destroy -? {Object isobject x} 0 "$case: parent object gone" -? {Object isobject x::y} 0 "$case: child object gone" +? {::xotcl::is x object} 0 "parent object gone" +? {::xotcl::is x::y object} 0 "child object gone" set case "deleting aliased object" -Object o -Object o2 +Test case deleting-aliased-object +Object create o +Object create o2 ::xotcl::alias o x o2 -? {o x} ::o2 "$case: call object via alias" -? {o x info vars} "" "$case: call info on aliased object" -? {o2 set x 10} 10 "$case: set variable on object" -? {o2 info vars} x "$case: query vars" -? {o x info vars} x "$case: query vars via alias" -? {o x set x} 10 "$case: set var via alias" +? {o x} ::o2 "call object via alias" +? {o x info vars} "" "call info on aliased object" +? {o2 set x 10} 10 "set variable on object" +? {o2 info vars} x "query vars" +? {o x info vars} x "query vars via alias" +? {o x set x} 10 "set var via alias" o2 destroy catch {o x info vars} errMsg -? {set errMsg} "Trying to dispatch deleted object via method 'x'" "$case: 1st call on deleted object" -#? {set errMsg} "::o: unable to dispatch method 'x'" "$case: 1st call on deleted object" +? {set errMsg} "Trying to dispatch deleted object via method 'x'" "1st call on deleted object" +#? {set errMsg} "::o: unable to dispatch method 'x'" "1st call on deleted object" catch {o x info vars} errMsg -? {set errMsg} "::o: unable to dispatch method 'x'" "$case: 2nd call on deleted object" +? {set errMsg} "::o: unable to dispatch method 'x'" "2nd call on deleted object" o destroy set case "deleting object with alias to object" -Object o -Object o3 +Test case deleting-object-with-aluas-to-object +Object create o +Object create o3 ::xotcl::alias o x o3 o destroy -? {Object isobject o} 0 "$case: parent object gone" -? {Object isobject o3} 1 "$case: aliased object still here" +? {::xotcl::is o object} 0 "parent object gone" +? {::xotcl::is o3 object} 1 "aliased object still here" o3 destroy -? {Object isobject o3} 0 "$case: aliased object destroyed" +? {::xotcl::is o3 object} 0 "aliased object destroyed" set case "create an alias, and delete cmd via aggregation" -Object o -Object o3 +Test case create-alias-delete-via-aggregation +Object create o +Object create o3 ::xotcl::alias o x o3 o::x destroy -? {Object isobject o3} 0 "$case: aliased object destroyed" +? {::xotcl::is o3 object} 0 "aliased object destroyed" o destroy + set case "create an alias, and recreate obj" -Object o -Object o3 +Test case create-alias-and-recreate-obj +Object create o +Object create o3 ::xotcl::alias o x o3 -Object o3 +Object create o3 o3 set a 13 -? {o x set a} 13 "$case: aliased object works after recreate" +? {o x set a} 13 "aliased object works after recreate" o destroy set case "create an alias on the class level, double aliasing, delete aliased object" -Class C -Object o -Object o3 +Test case create-alias-on-class-delete-aliased-obj +Class create C +Object create o +Object create o3 ::xotcl::alias o a o3 ::xotcl::alias C b o -C c1 -? {c1 b set B 2} 2 "$case: call 1st level" -? {c1 b a set A 3} 3 "$case: call 2nd level" -? {o set B} 2 "$case: call 1st level ok" -? {o3 set A} 3 "$case: call 2nd level ok" +C create c1 +? {c1 b set B 2} 2 "call 1st level" +? {c1 b a set A 3} 3 "call 2nd level" +? {o set B} 2 "call 1st level ok" +? {o3 set A} 3 "call 2nd level ok" o destroy catch {c1 b} errMsg -? {set errMsg} "Trying to dispatch deleted object via method 'b'" "$case: call via alias to deleted object" +? {set errMsg} "Trying to dispatch deleted object via method 'b'" "call via alias to deleted object" C destroy c1 destroy o3 destroy set case "create an alias on the class level, double aliasing, destroy class" -Class C -Object o -Object o3 +Test case create-alias-on-class-destroy-class +Class create C +Object create o +Object create o3 ::xotcl::alias o a o3 ::xotcl::alias C b o -C c1 +C create c1 C destroy -? {Object isobject o} 1 "$case: object o still here" -? {Object isobject o3} 1 "$case: object o3 still here" +? {::xotcl::is o object} 1 "object o still here" +? {::xotcl::is o3 object} 1 "object o3 still here" o destroy o3 destroy c1 destroy Index: tests/forwardtest.xotcl =================================================================== diff -u -r806b88973de6c75ab4cb2d796d0ddf382ed1ede7 -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- tests/forwardtest.xotcl (.../forwardtest.xotcl) (revision 806b88973de6c75ab4cb2d796d0ddf382ed1ede7) +++ tests/forwardtest.xotcl (.../forwardtest.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -2,12 +2,6 @@ package require XOTcl; xotcl::use xotcl1 package require xotcl::test -proc ? {cmd expected} { - set t [Test new -cmd $cmd] - $t expected $expected - $t run -} - ########################################### # trivial object delegation ########################################### Index: tests/info-method.xotcl =================================================================== diff -u -rff41e1a0cb88c3aa7b96ca3b67b27043794991b0 -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- tests/info-method.xotcl (.../info-method.xotcl) (revision ff41e1a0cb88c3aa7b96ca3b67b27043794991b0) +++ tests/info-method.xotcl (.../info-method.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -1,17 +1,6 @@ package req XOTcl package require xotcl::test -proc ? {cmd expected {msg ""}} { - set count 10 - if {$msg ne ""} { - set t [Test new -cmd $cmd -count $count -msg $msg] - } else { - set t [Test new -cmd $cmd -count $count] - } - $t expected $expected - $t run -} -#::xotcl::use xotcl1 ::xotcl::use xotcl2 Object create o { Index: tests/interceptor-slot.xotcl =================================================================== diff -u -r6b3921be54ad92034e563a09300ab2e4f49645aa -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- tests/interceptor-slot.xotcl (.../interceptor-slot.xotcl) (revision 6b3921be54ad92034e563a09300ab2e4f49645aa) +++ tests/interceptor-slot.xotcl (.../interceptor-slot.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -2,18 +2,6 @@ package require xotcl::test ::xotcl::use xotcl2 -proc ? {cmd expected {msg ""}} { - set count 10 - if {$msg ne ""} { - set t [Test new -cmd $cmd -count $count -msg $msg] - } else { - set t [Test new -cmd $cmd -count $count] - } - $t expected $expected - $t run -} - -puts stderr START Class create M { .method mfoo {} {puts [self proc]} } Index: tests/method-modifiers.xotcl =================================================================== diff -u -rd70c849219212800fa401c2227796b9a63eadcaf -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- tests/method-modifiers.xotcl (.../method-modifiers.xotcl) (revision d70c849219212800fa401c2227796b9a63eadcaf) +++ tests/method-modifiers.xotcl (.../method-modifiers.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -1,16 +1,7 @@ package require XOTcl package require xotcl::test -proc ? {cmd expected {msg ""}} { - set count 10 - if {$msg ne ""} { - set t [Test new -cmd $cmd -count $count -msg $msg] - } else { - set t [Test new -cmd $cmd -count $count] - } - $t expected $expected - $t run -} +Test parameter count 10 ::xotcl::use xotcl2 @@ -179,7 +170,6 @@ # now the same as object mixin and object mixin guard C object mixin M -puts M=[C object info mixin] C object mixinguard M {1 == 1} ? {C object info mixinguard M} "1 == 1" C object mixinguard M {} Index: tests/mixinoftest.xotcl =================================================================== diff -u -r217d826e64107056ae97176552cae3c776991b9e -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- tests/mixinoftest.xotcl (.../mixinoftest.xotcl) (revision 217d826e64107056ae97176552cae3c776991b9e) +++ tests/mixinoftest.xotcl (.../mixinoftest.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -2,12 +2,6 @@ package require XOTcl; xotcl::use xotcl1 package require xotcl::test -proc ? {cmd expected} { - set t [Test new -cmd $cmd] - $t expected $expected - $t run -} - ########################################### # testing simple per object mixins ########################################### @@ -48,6 +42,7 @@ C destroy ::o destroy ::o1 destroy + ########################################### # testing per object mixins with redefinition ########################################### Index: tests/objparametertest.xotcl =================================================================== diff -u -rd3d3eb10074ac56bbc77650c1bdd4239f0d97ca8 -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- tests/objparametertest.xotcl (.../objparametertest.xotcl) (revision d3d3eb10074ac56bbc77650c1bdd4239f0d97ca8) +++ tests/objparametertest.xotcl (.../objparametertest.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -1,22 +1,12 @@ package require XOTcl -namespace import -force xotcl::* package require xotcl::test -proc ? {cmd expected {msg ""}} { - set count 10 - if {$msg ne ""} { - set t [Test new -cmd $cmd -count $count -msg $msg] - } else { - set t [Test new -cmd $cmd -count $count] - } - $t expected $expected - $t run -} +::xotcl::use xotcl1 +Test parameter count 10 catch {::xotcl::configure cacheinterface true} set mkTypeChecker 0 -puts stderr =====START Class C -parameter {a {b:boolean} {c 1}} C c1 Index: tests/protected.xotcl =================================================================== diff -u -r2f283277aff2bb9488419a4fbe2442a5b17546e5 -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- tests/protected.xotcl (.../protected.xotcl) (revision 2f283277aff2bb9488419a4fbe2442a5b17546e5) +++ tests/protected.xotcl (.../protected.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -2,28 +2,20 @@ package require xotcl::test xotcl::use xotcl2 -set count 1 -proc ? {cmd expected {msg ""}} { - if {$msg ne ""} { - set t [Test new -cmd $cmd -count $::count -msg $msg] - } else { - set t [Test new -cmd $cmd -count $::count] +Test parameter count 1 + +Class create C { + .alias SET ::set + .method foo {} {return [self proc]} + .method bar {} {return [self proc]} + .method bar-foo {} { + c1 foo } - $t expected $expected - $t run + .method bar-SET {} { + c1 SET x 1 + } } -Class create C -::xotcl::alias C SET ::set -C method foo {} {return [self proc]} -C method bar {} {return [self proc]} -C method bar-foo {} { - c1 foo -} -C method bar-SET {} { - c1 SET x 1 -} - C create c1 C create c2 Index: tests/slottest.xotcl =================================================================== diff -u -rbf9bae94d157de9bbd4c398f6a3a9a4d93626025 -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- tests/slottest.xotcl (.../slottest.xotcl) (revision bf9bae94d157de9bbd4c398f6a3a9a4d93626025) +++ tests/slottest.xotcl (.../slottest.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -1,18 +1,8 @@ package require XOTcl; xotcl::use xotcl1 package require xotcl::test -proc ? {cmd expected} { - set t [Test new -cmd $cmd -count 100] - $t expected $expected - $t run -} +Test parameter count 1000 -proc t {cmd expected {txt ""}} { - set t [Test new -cmd $cmd -msg $txt] - $t expected $expected - $t run -} - # what's new: # - slots instances are manager objects for slot values # - generalization of slots to have different kind of domains and managers @@ -116,7 +106,7 @@ ? {O superclass} "::xotcl::Object" Class O2 -superclass O -#t {O2 superclass O} "superclass 1" +#? {O2 superclass O} "superclass 1" ? {O superclass} "::xotcl::Object" ::xotcl::Slot method slot {object name property} { @@ -178,22 +168,22 @@ Object o1 o1 set i 0 ::xotcl::alias o1 Incr -objscope ::incr -t {o1 incr i} 1 "method incr" -t {o1 Incr i} 1002 "aliased tcl incr" -t {o1 incr i} 2003 "method incr" -t {o1 Incr i} 3004 "aliased tcl incr" +? {o1 incr i} 1 "method incr" +? {o1 Incr i} 1002 "aliased tcl incr" +? {o1 incr i} 2003 "method incr" +? {o1 Incr i} 3004 "aliased tcl incr" ::xotcl::alias ::xotcl::Object Set -objscope ::set -t {o1 set i 1} 1 "method set" -t {o1 set i} 1 "method set" -t {o1 Set i 1} 1 "aliased tcl set" -t {o1 Set i} 1 "aliased tcl set" +? {o1 set i 1} 1 "method set" +? {o1 set i} 1 "method set" +? {o1 Set i 1} 1 "aliased tcl set" +? {o1 Set i} 1 "aliased tcl set" ::xotcl::alias o1 Set -objscope ::set -t {o1 Set i 1} 1 "aliased object tcl set" -t {o1 Set i} 1 "aliased object tcl set" +? {o1 Set i 1} 1 "aliased object tcl set" +? {o1 Set i} 1 "aliased object tcl set" ::xotcl::Object instforward SSet -earlybinding -objscope ::set -t {o1 SSet i 1} 1 "forward earlybinding tcl set" -t {o1 SSet i} 1 "forward earlybinding tcl set" +? {o1 SSet i 1} 1 "forward earlybinding tcl set" +? {o1 SSet i} 1 "forward earlybinding tcl set" #exit o1 set z 100 @@ -203,29 +193,29 @@ ? {o1 get z 101} 101 ? {o1 get z} "101" -t {o1 get z} 101 "get value via new parametercmd get" -t {o1 get z 124} 124 "set value via new parametercmd get" +? {o1 get z} 101 "get value via new parametercmd get" +? {o1 get z 124} 124 "set value via new parametercmd get" o1 forward zz -earlybinding ::xotcl::setinstvar %self %proc ? {o1 zz 123} 123 ? {o1 zz} 123 -t {o1 zz} 123 "parametercmd forward earlybinding setinstvar" -t {o1 zz 124} 124 "parametercmd forward earlybinding setinstvar" +? {o1 zz} 123 "parametercmd forward earlybinding setinstvar" +? {o1 zz 124} 124 "parametercmd forward earlybinding setinstvar" o1 forward z2 -earlybinding -objscope ::set %proc -t {o1 z2 111} 111 "parametercmd forward earlybinding tcl set" -t {o1 z2} 111 "parametercmd forward earlybinding tcl set" +? {o1 z2 111} 111 "parametercmd forward earlybinding tcl set" +? {o1 z2} 111 "parametercmd forward earlybinding tcl set" o1 forward z3 -objscope ::set %proc -t {o1 z3 111} 111 "parametercmd forward tcl set" -t {o1 z3} 111 "parametercmd forward tcl set" +? {o1 z3 111} 111 "parametercmd forward tcl set" +? {o1 z3} 111 "parametercmd forward tcl set" o1 set y 11 o1 parametercmd y -t {o1 y} 11 "parametercmd" -t {o1 y 1} 1 "parametercmd" +? {o1 y} 11 "parametercmd" +? {o1 y 1} 1 "parametercmd" #Class C -parameter {a {b 10} {c "Hello World"}} #C copy V @@ -282,8 +272,8 @@ ? {c2 c} "Hello World" -t {c2 a} 1 "new indirect parametercmd" -t {c2 a 1} 1 "new indirect parametercmd" +? {c2 a} 1 "new indirect parametercmd" +? {c2 a 1} 1 "new indirect parametercmd" ::xotcl::Slot mixin add ::xotcl::Slot::Optimizer @@ -298,8 +288,8 @@ ? {c3 b} 10 ? {c3 c} "Hello World" -t {c3 a} 1 "new indirect parametercmd optimized" -t {c3 a 1} 1 "new indirect parametercmd optimized" +? {c3 a} 1 "new indirect parametercmd optimized" +? {c3 a 1} 1 "new indirect parametercmd optimized" ####### nasty names Class create D -slots { @@ -526,8 +516,8 @@ o1 forward x -earlybinding ::xotcl::setinstvar %self %proc ? [list o1 x] 42 ? [list o1 x 41] 41 -t {o1 x} "get parametercmd via forward (earlybinding)" -t {o1 x 41} "set parametercmd via forward (earlybinding)" +? {o1 x} "get parametercmd via forward (earlybinding)" +? {o1 x 41} "set parametercmd via forward (earlybinding)" #obj forward Mixin -default {getter setter} mixin %1 %self o1 forward z -default {getter setter} %self @@ -536,34 +526,34 @@ o1 myfset y 102 ? {o1 myfset y} 102 -t {o1 myfset y} "get instvar value via forward" -t {o1 myfset y 122} "set instvar value via forward" +? {o1 myfset y} "get instvar value via forward" +? {o1 myfset y 122} "set instvar value via forward" o1 forward myfdset -earlybinding -objscope set o1 myfdset y 103 ? {o1 myfdset y} 103 -t {o1 myfdset y} "get instvar value via forward -earlybinding" -t {o1 myfdset y 123} "set instvar value via forward -earlybinding" +? {o1 myfdset y} "get instvar value via forward -earlybinding" +? {o1 myfdset y 123} "set instvar value via forward -earlybinding" ::xotcl::alias o1 myset -objscope ::set o1 myset x 101 ? {o1 myset x} 101 -t {o1 myset x} "get instvar value via set alias" -t {o1 myset x 123} "set instvar value via set alias" +? {o1 myset x} "get instvar value via set alias" +? {o1 myset x 123} "set instvar value via set alias" -t {p1 age} "slot read" +? {p1 age} "slot read" Class P -parameter {age {s -setter sets}} P instproc sets {var value} { my set $var $value } P create p2 -age 345 -s 567 -t {p2 age} "parametercmd read" -t {::xotcl::setinstvar p2 age} "via setinstvar" -t {p2 s} "parameter read with setter" +? {p2 age} "parametercmd read" +? {::xotcl::setinstvar p2 age} "via setinstvar" +? {p2 s} "parameter read with setter" Index: tests/speedtest.xotcl =================================================================== diff -u -rf9807b1cea03590c9573b5a521760538d53ee90f -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- tests/speedtest.xotcl (.../speedtest.xotcl) (revision f9807b1cea03590c9573b5a521760538d53ee90f) +++ tests/speedtest.xotcl (.../speedtest.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -1,9 +1,10 @@ #memory trace on # $Id: speedtest.xotcl,v 1.10 2007/08/14 16:38:27 neumann Exp $ package require XOTcl; xotcl::use xotcl1 +#lappend auto_path [file dirname [info script]]/.. -lappend auto_path [file dirname [info script]]/.. package require xotcl::test +Test parameter count 1000 @ @File {description { Regression and speed test for various ways to achieve a similar Index: tests/varresolutiontest.xotcl =================================================================== diff -u -re61fc14f5c25172a1d1f93bea03be54a772fb4b5 -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 --- tests/varresolutiontest.xotcl (.../varresolutiontest.xotcl) (revision e61fc14f5c25172a1d1f93bea03be54a772fb4b5) +++ tests/varresolutiontest.xotcl (.../varresolutiontest.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) @@ -3,16 +3,7 @@ package require XOTcl; xotcl::use xotcl2 package require xotcl::test -proc ? {cmd expected {msg ""}} { - set count 1 - if {$msg ne ""} { - set t [Test new -cmd $cmd -count $count -msg $msg] - } else { - set t [Test new -cmd $cmd -count $count] - } - $t expected $expected - $t run -} +Test parameter count 1 ::xotcl::alias ::xotcl2::Object eval -objscope ::eval ::xotcl::alias ::xotcl2::Object array -objscope ::array