[squeak-dev] The Trunk: CollectionsTests-nice.255.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Oct 31 17:39:44 UTC 2015
Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-nice.255.mcz
==================== Summary ====================
Name: CollectionsTests-nice.255
Author: nice
Time: 31 October 2015, 6:39:25.525 pm
UUID: 4f5361b3-18c8-47f1-ba59-030004683963
Ancestors: CollectionsTests-ul.254
In a 64bits spur VM, not all SmallInteger can be stored in an IntegerArray, It's time to document it.
=============== Diff against CollectionsTests-ul.254 ===============
Item was changed:
----- Method: IntegerArrayTest>>testStoreSmallInteger (in category 'tests') -----
testStoreSmallInteger
+ "Any SmallInteger may be stored in an IntegerArray in a 32bits VM.
+ Not so true for a 64bits spur VM though..."
- "Any SmallInteger may be stored in an IntegerArray."
| ia val |
ia := IntegerArray new: 1.
+ val := Smalltalk wordSize = 8
+ ifTrue: [1 << 31 - 1]
+ ifFalse: [SmallInteger maxVal].
- val := SmallInteger maxVal.
ia at: 1 put: val.
self assert: ((ia at: 1) = val).
+ val := Smalltalk wordSize = 8
+ ifTrue: [(1 << 31) negated]
+ ifFalse: [SmallInteger minVal].
- val := SmallInteger minVal.
ia at: 1 put: val.
self assert: ((ia at: 1) = val)
!
More information about the Squeak-dev
mailing list
|