Levente Uzonyi uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-ul.141.mcz==================== Summary ====================
Name: CollectionsTests-ul.141
Author: ul
Time: 5 February 2010, 4:33:00.995 am
UUID: 318ef62e-f767-e645-998b-920693a6338a
Ancestors: CollectionsTests-ul.140
- bugfix
=============== Diff against CollectionsTests-ul.140 ===============
Item was changed:
----- Method: WeakRegistryTest>>testRemovingByAHighPriorityProcessDoesntLeak (in category 'as yet unclassified') -----
testRemovingByAHighPriorityProcessDoesntLeak
| w finalized block hash object executor semaphore |
w := WeakRegistry new: 1.
finalized := false.
block := [ :v | finalized := v ].
object := Object new.
executor := ObjectFinalizer new
receiver: block
selector: #value:
argument: true;
yourself.
hash := object hash.
w add: hash.
w add: object executor: executor.
semaphore := Semaphore new.
[
object := nil. "let it go"
w remove: hash.
semaphore signal ]
forkAt: WeakArray runningFinalizationProcess priority + 1.
semaphore wait.
Smalltalk garbageCollect. "finalize it"
+ self assert: w isEmpty.
- self assert: w size = 1000.
self assert: finalized!