[squeak-dev] The Inbox: Tests-ul.75.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Apr 12 23:37:37 UTC 2010


A new version of Tests was added to project The Inbox:
http://source.squeak.org/inbox/Tests-ul.75.mcz

==================== Summary ====================

Name: Tests-ul.75
Author: ul
Time: 13 April 2010, 12:23:26.245 am
UUID: 932b69c2-7924-3148-8864-ccd9649b079a
Ancestors: Tests-laza.74

- added an integrity test for HashedCollections which checks if every HashedCollection subInstance has a prime capacity (except for MethodDictionaries which capacity should be a power of two)

=============== Diff against Tests-laza.74 ===============

Item was added:
+ TestCase subclass: #HashedCollectionIntegrityTest
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'Tests-Bugs'!

Item was added:
+ ----- Method: HashedCollectionIntegrityTest>>testCapacity (in category 'as yet unclassified') -----
+ testCapacity
+ 
+ 	| inconsistentCollections |
+ 	inconsistentCollections := HashedCollection allSubInstances reject: [ :each |
+ 		each class == MethodDictionary "MethodDictionary is the only HashedCollection which doesn't have prime array size"
+ 			ifTrue: [ each capacity isPowerOfTwo ]
+ 			ifFalse: [ each capacity isPrime ] ].
+ 	self assert: inconsistentCollections isEmpty!




More information about the Squeak-dev mailing list