The Trunk: KernelTests-nice.369.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: KernelTests-nice.369.mcz

commits-2
Nicolas Cellier uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-nice.369.mcz

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

Name: KernelTests-nice.369
Author: nice
Time: 21 August 2019, 2:58:16.866438 am
UUID: 33f5c49d-b6ed-4384-805d-fad3fa2e5159
Ancestors: KernelTests-nice.368

Provide non regression tests for https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/415

=============== Diff against KernelTests-nice.368 ===============

Item was changed:
+ ----- Method: SmallIntegerTest>>testCompareWithBoxedFloat (in category 'tests - comparing') -----
- ----- Method: SmallIntegerTest>>testCompareWithBoxedFloat (in category 'testing - Class Methods') -----
  testCompareWithBoxedFloat
  "In 64 bits, naive asFloat conversion should not be used"
 
  | bf sf si |
  Smalltalk wordSize = 8 ifFalse: [^self].
  si := 1<<(Float precision + 2)+1.
  sf := si asFloat.
  (bf := BoxedFloat64 new: 2) basicAt: 1 put: (sf basicAt: 1);basicAt: 2 put: (sf basicAt: 2).
 
  self deny: si = bf.
  self deny: bf = si.!

Item was changed:
+ ----- Method: SmallIntegerTest>>testCompareWithSmallFloat (in category 'tests - comparing') -----
- ----- Method: SmallIntegerTest>>testCompareWithSmallFloat (in category 'testing - Class Methods') -----
  testCompareWithSmallFloat
  "In 64 bits, naive asFloat conversion should not be used"
 
  | sf si |
  Smalltalk wordSize = 8 ifFalse: [^self].
  si := 1<<(Float precision + 2)+1.
  sf := si asFloat.
  self deny: sf = si.
  self deny: si = sf.!

Item was added:
+ ----- Method: SmallIntegerTest>>testDivideMayOverflow (in category 'tests - arithmetic') -----
+ testDivideMayOverflow
+ "Dividing a SmallInteger by another Integer may answer a Large Integer.
+ These cases have caused several VM bugs in the past, it's better to keep some assrtion around."
+
+ self assert: (SmallInteger minVal / -1) isLarge.
+ self assert: (SmallInteger minVal / -1) = (SmallInteger maxVal + 1).
+
+ self assert: (SmallInteger minVal quo: -1) isLarge.
+ self assert: (SmallInteger minVal quo: -1) = (SmallInteger maxVal + 1).
+
+ self assert: (SmallInteger minVal // -1) isLarge.
+ self assert: (SmallInteger minVal // -1) = (SmallInteger maxVal + 1).!