[squeak-dev] ClassTraitTest pollutes system

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] ClassTraitTest pollutes system

laza
Hi!

I think in a healthy squeak system

(ProtoObject allSubclasses reject: [:each | each isMeta or: [each
environment includes: each]]) size

should be zero. This is true for a fresh trunk image. If you evaluate
above expression after running ClassTraitTest the returned number is 9
and increases by 9 every time you run the test. As an effect of this
in a browser you can't switch to the class side of ProtoObject,
because this produces an exception. The exception gets raised because
some of ProtoObjects subclasses are not known in the environment
Smalltalk.

An example why this happens is here:

setUpTrivialRequiresFixture
        self c3: (self
                                createClassNamed: #C3
                                superclass: ProtoObject
                                uses: { }).
        self c3 superclass: nil.
        self c3 compile: 'foo ^self bla' classified: #accessing

C3 is created as a subclass of ProtoObject, but then the superclass
pointer of C3 is twisted to nil . I haven't found a place where this
would be fixed by the system again. And when C3 is removed from the
system it is still in ProtoObjects subclasses.

The tests in ClassTraitTest return all green status and don't check if
the classes are still broken.

Should the test be removed or is there just something (I'm) missing?
Anyone got more infos on the whys and whats?

Alex

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] ClassTraitTest pollutes system

Adrian Lienhard
Isn't this mantis issue 7090?

You may also want to check how we fixed this over at Pharo (more than  
a year ago): http://code.google.com/p/pharo/issues/detail?id=13

HTH,
Adrian

On Oct 5, 2009, at 13:49 , Alexander Lazarević wrote:

> Hi!
>
> I think in a healthy squeak system
>
> (ProtoObject allSubclasses reject: [:each | each isMeta or: [each
> environment includes: each]]) size
>
> should be zero. This is true for a fresh trunk image. If you evaluate
> above expression after running ClassTraitTest the returned number is 9
> and increases by 9 every time you run the test. As an effect of this
> in a browser you can't switch to the class side of ProtoObject,
> because this produces an exception. The exception gets raised because
> some of ProtoObjects subclasses are not known in the environment
> Smalltalk.
>
> An example why this happens is here:
>
> setUpTrivialRequiresFixture
> self c3: (self
> createClassNamed: #C3
> superclass: ProtoObject
> uses: { }).
> self c3 superclass: nil.
> self c3 compile: 'foo ^self bla' classified: #accessing
>
> C3 is created as a subclass of ProtoObject, but then the superclass
> pointer of C3 is twisted to nil . I haven't found a place where this
> would be fixed by the system again. And when C3 is removed from the
> system it is still in ProtoObjects subclasses.
>
> The tests in ClassTraitTest return all green status and don't check if
> the classes are still broken.
>
> Should the test be removed or is there just something (I'm) missing?
> Anyone got more infos on the whys and whats?
>
> Alex
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] ClassTraitTest pollutes system

laza
Ah, yes. I included the changeset into the trunk.

Alex

On Mon, Oct 5, 2009 at 8:41 PM, Adrian Lienhard <[hidden email]> wrote:

> Isn't this mantis issue 7090?
>
> You may also want to check how we fixed this over at Pharo (more than a year
> ago): http://code.google.com/p/pharo/issues/detail?id=13
>
> HTH,
> Adrian
>
> On Oct 5, 2009, at 13:49 , Alexander Lazarević wrote:
>
>> Hi!
>>
>> I think in a healthy squeak system
>>
>> (ProtoObject allSubclasses reject: [:each | each isMeta or: [each
>> environment includes: each]]) size
>>
>> should be zero. This is true for a fresh trunk image. If you evaluate
>> above expression after running ClassTraitTest the returned number is 9
>> and increases by 9 every time you run the test. As an effect of this
>> in a browser you can't switch to the class side of ProtoObject,
>> because this produces an exception. The exception gets raised because
>> some of ProtoObjects subclasses are not known in the environment
>> Smalltalk.
>>
>> An example why this happens is here:
>>
>> setUpTrivialRequiresFixture
>>        self c3: (self
>>                                createClassNamed: #C3
>>                                superclass: ProtoObject
>>                                uses: { }).
>>        self c3 superclass: nil.
>>        self c3 compile: 'foo ^self bla' classified: #accessing
>>
>> C3 is created as a subclass of ProtoObject, but then the superclass
>> pointer of C3 is twisted to nil . I haven't found a place where this
>> would be fixed by the system again. And when C3 is removed from the
>> system it is still in ProtoObjects subclasses.
>>
>> The tests in ClassTraitTest return all green status and don't check if
>> the classes are still broken.
>>
>> Should the test be removed or is there just something (I'm) missing?
>> Anyone got more infos on the whys and whats?
>>
>> Alex
>>
>
>
>