[squeak-dev] The Inbox: ToolsTests-btc.49.mcz

Levente Uzonyi leves at elte.hu
Mon Jul 11 20:29:31 UTC 2011


On Mon, 11 Jul 2011, commits at source.squeak.org wrote:

> A new version of ToolsTests was added to project The Inbox:
> http://source.squeak.org/inbox/ToolsTests-btc.49.mcz
>
> ==================== Summary ====================
>
> Name: ToolsTests-btc.49
> Author: btc
> Time: 12 July 2011, 12:22:10.5 am
> UUID: e31f9b65-d96b-8846-a317-25ba0bc319c4
> Ancestors: ToolsTests-fbs.48
>
> Single stepping through a debugger can observe an inconsistent state after object creation but before initiialisation.  Thus 'object size' may throw an axception for trying to do arithmetic on nil.  Modified OrderedCollectionInspector>>fieldList to call 'self objectSize' to handle this exception. This tests that fix.
>
> =============== Diff against ToolsTests-fbs.48 ===============
>
> Item was added:
> + TestCase subclass: #OrderedCollectionInspectorTest
> + 	instanceVariableNames: ''
> + 	classVariableNames: ''
> + 	poolDictionaries: ''
> + 	category: 'ToolsTests-Inspector'!
>
> Item was added:
> + ----- Method: OrderedCollectionInspectorTest>>testUninitialized (in category 'as yet unclassified') -----
> + testUninitialized
> + 	"Single stepping through a debugger can observe the object state after creation but before initiialisation."
> + 	"Thus 'object size' may throw an axception for trying to do arithmetic on nil."
> + 	"Modified OrderedCollectionInspector>>fieldList to call 'self objectSize' to handle this exception."
> + 	"Original error reproduction: [ self halt. OrderedCollectionInspector openOn: (OrderedCollection new: 5) ]     "
> +
> + 	self shouldnt:  ( (OrderedCollectionInspector openOn: OrderedCollection basicNew) delete notNil ) raise: Error.!

#shouldnt:raise: expects a block as it's first argument, otherwise it 
can't catch the exception defined by the second argument. If you run this 
test without your fix, then it will raise an error instead of just 
failing. This also means that the #notNil send is not necessary, because 
the result of the block is not used.


Levente

>
>
>



More information about the Squeak-dev mailing list