[Newbies] Re: Deleting unopened morphs after unit tests

Jerome Peace peace_the_dreamer at yahoo.com
Fri Jun 18 23:31:11 UTC 2010



--- On Wed, 6/16/10, Sean P. DeNigris <sean at clipperadams.com> wrote:

> From: Sean P. DeNigris <sean at clipperadams.com>
> Subject: [Newbies] Re: Deleting unopened morphs after unit tests
> To: beginners at lists.squeakfoundation.org
> Date: Wednesday, June 16, 2010, 9:05 PM
> 
> 
> Jerome Peace wrote:
> > 
> > Local methods for deletion might also be removing
> those extra links.
> > 
> What do you mean by "local methods for deletion?"

Just what bert said. A method for a morph subclass that overides or extends the inherited method. I just said it in an unusual way.
> 
> 
> Jerome Peace wrote:
> > 
> > So to answer your question. In some circumstances
> deletion may not be
> > necessary. Usually it will always be sufficient.
> > 
> So as long as no one outside the test method is holding a
> reference to
> either an owner morph or any of its submorphs, there's no
> need to delete any
> of them, right?

The answer is it depends on the morph. Why are you trying to outguess the standard protocol? Any gain in speed is lost in having the test depend on the morph in question not doings anything special when deleted. Wouldn't this make the test rigid and fragile? 

When I write morph tests with examples I set up a testcases ivar with a list. In the test anything that needs deleting is added to the list.
The tear down iterates over the list deleting the morphs then nils out the ivar . 

Since I'm lazy I do this for one test class and sub class other test classes to that one when such behavior is needed.

Keep up the good work.

Yours in curiosity and service, --Jerome Peace
> 
> Thanks.
> Sean
> -- 
> View this message in context: http://forum.world.st/Deleting-unopened-morphs-after-unit-tests-tp2257950p2258091.html
> Sent from the Squeak - Beginners mailing list archive at
> Nabble.com.
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
> 


      


More information about the Beginners mailing list