[squeak-dev] The Trunk: CollectionsTests-ct.378.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jun 16 10:16:30 UTC 2022


Christoph Thiede uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-ct.378.mcz

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

Name: CollectionsTests-ct.378
Author: ct
Time: 16 June 2022, 12:16:28.609149 pm
UUID: b7cb8d55-cba2-cf44-b8a4-0812e76a3b7d
Ancestors: CollectionsTests-ct.377

Migrates from #targetClass to #classToBeTested. Complements SUnit-ct.143.

=============== Diff against CollectionsTests-ct.377 ===============

Item was changed:
  ----- Method: WeakIdentityDictionaryTest>>testIsEmpty (in category 'tests') -----
  testIsEmpty
  
  	| wid o1 o2 |
  	o1 := #o1 -> Object new.
  	o2 := #o2 -> Object new.
  
+ 	wid := self classToBeTested new.
- 	wid := self targetClass new.
  	self assert: wid isEmpty.
  
  	wid add: o1.
  	wid add: o2.
  	self deny: wid isEmpty.
  	       
  	Smalltalk garbageCollect.
  	self deny: wid isEmpty.
  
  	o1 := nil.
  	o2 := nil.
  	Smalltalk garbageCollect.
  	self assert: wid isEmpty.!

Item was changed:
  ----- Method: WeakKeyDictionaryTest>>testIsEmpty (in category 'tests') -----
  testIsEmpty
  
  	| wkd o1 o2 |
  	o1 := Object new.
  	o2 := Object new.
  
+ 	wkd := self classToBeTested new.
- 	wkd := self targetClass new.
  	self assert: wkd isEmpty.
  
  	wkd at: o1 put: #o1.
  	wkd at: o2 put: #o2.
  	self deny: wkd isEmpty.
  	       
  	Smalltalk garbageCollect.
  	wkd finalizeValues.
  	self deny: wkd isEmpty.
  
  	o1 := nil.
  	o2 := nil.
  	Smalltalk garbageCollect.
  	wkd finalizeValues.
  	self assert: wkd isEmpty.!

Item was changed:
  ----- Method: WeakKeyDictionaryTest>>testNilDoesNotInheritValueOfGarbageCollectedObject (in category 'tests') -----
  testNilDoesNotInheritValueOfGarbageCollectedObject
  	"When the keys are garbage collected, they become nil in the associations.
  	This must not mislead the dictionary to answer that nil had one of the values of these
  	associations!!"
  	| dictionary hashTable |
+ 	dictionary := self classToBeTested new.
- 	dictionary := self targetClass new.
  	"Craft a hash table where all keys were freed."
  	hashTable := dictionary array.
  	self assert: hashTable size > 0.
  	hashTable replace: [:each | WeakKeyAssociation key: nil value: 1].
  	self assert: (dictionary at: nil ifAbsent: []) isNil. "and not 1"!

Item was changed:
  ----- Method: WeakSetTest>>testIsEmpty (in category 'tests') -----
  testIsEmpty
  
  	| ws o1 o2 |
  	o1 := Object new.
  	o2 := Object new.
  
+ 	ws := self classToBeTested new.
- 	ws := self targetClass new.
  	self assert: ws isEmpty.
  
  	ws add: o1.
  	ws add: o2.
  	self deny: ws isEmpty.
  	       
  	Smalltalk garbageCollect.
  	self deny: ws isEmpty.
  
  	o1 := nil.
  	o2 := nil.
  	Smalltalk garbageCollect.
  	self assert: ws isEmpty.!



More information about the Squeak-dev mailing list