[squeak-dev] Sunit bug ?

Mariano Martinez Peck marianopeck at gmail.com
Wed Apr 29 19:59:50 UTC 2009


Hi folks!

Today, at work, a friend ask me about a method in TestResource because he
thought it was a bug. We look at it, and for us, it could be a bug. So, I
ask to you.

See TestResource class side isAvailable

------------------------
isAvailable
    ^self current notNil and: [self current isAvailable]
------------------------

the first part (self current notNil) ALWAYS return true because of the
implementation  of self current:

------------------------
current

    current isNil
        ifTrue: [current := self new].

    ^current
-------------------------


The second part too. Because the implementation of self available (object
side method):

-------------------------
isAvailable
    "override to provide information on the
    readiness of the resource"

    ^true
-------------------------

Ok, you can override and change this method in subclasses, however, the
first part is ALWAYS true.

Is this correct ? or isAvailable should be:

isAvailable
    ^ self current isAvailable


Thanks!

Mariano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090429/f7e4c09c/attachment.htm


More information about the Squeak-dev mailing list