I thought once more about this test. I'm reluctant to have
this test removed. On the other hand is Adrien right. He
states that a lot of test classes are doing calls to methods
they created while the test runs.

One solution would be to change the test to use perform: to
invoke those methods. But that would making tests a bit 
tedious. So this is not my preferred solution.

I tweaked SystemNavigation>>allUnimplementedNonPrimitiveCalls
to

allUnimplementedNonPrimitiveCallsX
   "Answer an Array of each message that is sent by an expression in a  
   method but is not implemented by any object in the system."
   | all meth dict |
   dict := Dictionary new.
   all := self systemNavigation allImplementedMessages.
   self systemNavigation allBehaviorsDo: [:cl | 
      cl selectorsDo: [:sel | 
         meth := cl compiledMethodAt: sel.
         meth primitive = 0 ifTrue: [
            meth messages do: [:m | 
               (all includes: m) ifFalse: [
                  ((dict at: cl ifAbsentPut: [ Dictionary new ])
                     at: sel ifAbsentPut: [ OrderedCollection new])
                        add: m
               ]
            ]
         ]
      ]
   ].
   ^ dict

So the test would be like

(SystemNavigation default allUnimplementedNonPrimitiveCallsX
associationsSelect: [:a|
        (a key allSuperclasses includes: TestCase) not
]) isEmpty

Would this or something similar be useful or is this just a lot of
noise without much of a benefit?

Norbert


_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to