Nicolas Cellier uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-nice.154.mcz
==================== Summary ====================
Name: Tests-nice.154
Author: nice
Time: 27 July 2012, 8:14:03.431 pm
UUID: fa846130-25ce-4a75-bcee-212b658a274a
Ancestors: Tests-cwp.153
Use a workaround for testBecomeIdentityHash knowing that two objects created consecutively may share same identityHash.
=============== Diff against Tests-cwp.153 ===============
Item was changed:
----- Method: BecomeTest>>testBecomeIdentityHash (in category 'Testing') -----
testBecomeIdentityHash
| a b c d numberOfRetry newAIdentityHash newBIdentityHash oldAIdentityHash oldBIdentityHash |
numberOfRetry := 0.
[a := 'ab' copy.
+ c := IdentitySet new: 1000.
b := 'cd' copy.
+ d := IdentitySet new: 1000.
"Note: the sets are allocated with enough room to reduce probability that two different hash lead to same slot"
+ "Note2: a & b creation are interleaved with c & d, because some VM allocate the same identityHash for two consecutively created objects"
+ c add: a; add: b.
+ d add: a.
- (c := IdentitySet new: 1000) add: a; add: b.
- (d := IdentitySet new: 1000) add: a.
oldAIdentityHash := a identityHash.
oldBIdentityHash := b identityHash.
oldAIdentityHash = oldBIdentityHash and: [numberOfRetry < 10]]
whileTrue: [numberOfRetry := numberOfRetry + 1].
self assert: oldAIdentityHash ~= oldBIdentityHash description: 'The VM is spawning too many equal identityHash to be honest'.
a become: b.
newAIdentityHash := a identityHash.
newBIdentityHash := b identityHash.
self
"The set c & d can still retrieve their elements because elements did not change their expected position"
assert: (c includes: a);
assert: (c includes: b);
assert: (d includes: a);
deny: (d includes: b);
"Elements didn't change their expected position because identityHash did not change"
assert: oldAIdentityHash = newAIdentityHash;
assert: oldBIdentityHash = newBIdentityHash!
Nicolas Cellier uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-nice.154.mcz
==================== Summary ====================
Name: Tests-nice.154
Author: nice
Time: 27 July 2012, 8:14:03.431 pm
UUID: fa846130-25ce-4a75-bcee-212b658a274a
Ancestors: Tests-cwp.153
Use a workaround for testBecomeIdentityHash knowing that two objects created consecutively may share same identityHash.
=============== Diff against Tests-cwp.153 ===============
Item was changed:
----- Method: BecomeTest>>testBecomeIdentityHash (in category 'Testing') -----
testBecomeIdentityHash
| a b c d numberOfRetry newAIdentityHash newBIdentityHash oldAIdentityHash oldBIdentityHash |
numberOfRetry := 0.
[a := 'ab' copy.
+ c := IdentitySet new: 1000.
b := 'cd' copy.
+ d := IdentitySet new: 1000.
"Note: the sets are allocated with enough room to reduce probability that two different hash lead to same slot"
+ "Note2: a & b creation are interleaved with c & d, because some VM allocate the same identityHash for two consecutively created objects"
+ c add: a; add: b.
+ d add: a.
- (c := IdentitySet new: 1000) add: a; add: b.
- (d := IdentitySet new: 1000) add: a.
oldAIdentityHash := a identityHash.
oldBIdentityHash := b identityHash.
oldAIdentityHash = oldBIdentityHash and: [numberOfRetry < 10]]
whileTrue: [numberOfRetry := numberOfRetry + 1].
self assert: oldAIdentityHash ~= oldBIdentityHash description: 'The VM is spawning too many equal identityHash to be honest'.
a become: b.
newAIdentityHash := a identityHash.
newBIdentityHash := b identityHash.
self
"The set c & d can still retrieve their elements because elements did not change their expected position"
assert: (c includes: a);
assert: (c includes: b);
assert: (d includes: a);
deny: (d includes: b);
"Elements didn't change their expected position because identityHash did not change"
assert: oldAIdentityHash = newAIdentityHash;
assert: oldBIdentityHash = newBIdentityHash!
Colin Putney uploaded a new version of Environments to project The Trunk:
http://source.squeak.org/trunk/Environments-fbs.3.mcz
==================== Summary ====================
Name: Environments-fbs.3
Author: fbs
Time: 27 July 2012, 3:45:30.98 pm
UUID: f4f0bbda-663d-407b-8dbd-976eb031d247
Ancestors: Environments-cwp.2
Using a Workspace, if you misspell a classname you get a walkback because Environment doesn't understand #keysDo:. Implementing it results in the desired spelling correction prompt.
=============== Diff against Environments-cwp.2 ===============
Item was added:
+ ----- Method: Environment>>keysDo: (in category 'enumerating') -----
+ keysDo: aBlock
+ "Evaluate aBlock for each of the receiver's keys."
+
+ contents keysDo: aBlock!
Colin Putney uploaded a new version of Environments to project The Trunk:
http://source.squeak.org/trunk/Environments-fbs.3.mcz
==================== Summary ====================
Name: Environments-fbs.3
Author: fbs
Time: 27 July 2012, 3:45:30.98 pm
UUID: f4f0bbda-663d-407b-8dbd-976eb031d247
Ancestors: Environments-cwp.2
Using a Workspace, if you misspell a classname you get a walkback because Environment doesn't understand #keysDo:. Implementing it results in the desired spelling correction prompt.
=============== Diff against Environments-cwp.2 ===============
Item was added:
+ ----- Method: Environment>>keysDo: (in category 'enumerating') -----
+ keysDo: aBlock
+ "Evaluate aBlock for each of the receiver's keys."
+
+ contents keysDo: aBlock!
Colin Putney uploaded a new version of Environments to project The Trunk:
http://source.squeak.org/trunk/Environments-fbs.3.mcz
==================== Summary ====================
Name: Environments-fbs.3
Author: fbs
Time: 27 July 2012, 3:45:30.98 pm
UUID: f4f0bbda-663d-407b-8dbd-976eb031d247
Ancestors: Environments-cwp.2
Using a Workspace, if you misspell a classname you get a walkback because Environment doesn't understand #keysDo:. Implementing it results in the desired spelling correction prompt.
=============== Diff against Environments-cwp.2 ===============
Item was added:
+ ----- Method: Environment>>keysDo: (in category 'enumerating') -----
+ keysDo: aBlock
+ "Evaluate aBlock for each of the receiver's keys."
+
+ contents keysDo: aBlock!
Colin Putney uploaded a new version of Environments to project The Trunk:
http://source.squeak.org/trunk/Environments-cwp.2.mcz
==================== Summary ====================
Name: Environments-cwp.2
Author: cwp
Time: 26 July 2012, 11:39:05.616 pm
UUID: 12ac6d1f-fed7-404a-a3ff-d37329b9ce7f
Ancestors: Environments-cwp.1
Added a class initializer to install an environment in Smalltalk globals.
=============== Diff against Environments-cwp.1 ===============
Item was added:
+ ----- Method: Environment class>>initialize (in category 'as yet unclassified') -----
+ initialize
+ self install!
Colin Putney uploaded a new version of Environments to project The Trunk:
http://source.squeak.org/trunk/Environments-cwp.2.mcz
==================== Summary ====================
Name: Environments-cwp.2
Author: cwp
Time: 26 July 2012, 11:39:05.616 pm
UUID: 12ac6d1f-fed7-404a-a3ff-d37329b9ce7f
Ancestors: Environments-cwp.1
Added a class initializer to install an environment in Smalltalk globals.
=============== Diff against Environments-cwp.1 ===============
Item was added:
+ ----- Method: Environment class>>initialize (in category 'as yet unclassified') -----
+ initialize
+ self install!