Eliot Miranda uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-eem.228.mcz==================== Summary ====================
Name: KernelTests-eem.228
Author: eem
Time: 23 July 2012, 2:04:25.246 pm
UUID: b922a656-6736-4895-8c66-0928c77a5a62
Ancestors: KernelTests-dtl.227
Test method copying, checking for correct copying of pragmas.
=============== Diff against KernelTests-dtl.227 ===============
Item was changed:
----- Method: CompiledMethodComparisonTest>>testHash (in category 'tests') -----
testHash
+ <timeout: 300> "takes 90 seconds in trunk 4.3 on a 2.2GHz Intel Core i7 MacBook Pro"
| ai |
ai := CompiledMethod allInstances.
ai do:
[:a|
ai do:
[:b|
+ a = b ifTrue: [self assert: a hash = b hash]]].
+ self assert: (ai collect: [:cm| cm hash]) asSet size * 2 >= ai asSet size!
- a = b ifTrue: [self assert: a hash = b hash]]]!
Item was added:
+ ----- Method: CompiledMethodTest>>testCopy (in category 'tests - copying') -----
+ testCopy
+ <pragma: #pragma>
+ | method copy |
+ method := thisContext method.
+ self assert: method pragmas notEmpty.
+ copy := method copy.
+ self assert: (method equivalentTo: copy).
+ self assert: method = copy.
+ self assert: method ~~ copy.
+ method pragmas do:
+ [:p|
+ self assert: p method == method].
+ copy pragmas do:
+ [:p|
+ self assert: p method == copy]!
Item was added:
+ ----- Method: CompiledMethodTest>>testCopyWithTrailerBytes (in category 'tests - copying') -----
+ testCopyWithTrailerBytes
+ <pragma: #pragma>
+ | method copy |
+ method := thisContext method.
+ self assert: method pragmas notEmpty.
+ copy := method copyWithTempNames: #('m' 'c').
+ self deny: (method equivalentTo: copy). "equivalentTo: decompiles; since temps differ, equivalentTo: should be false."
+ self deny: method = copy. "copyWithTempNames: changes the length of a method so these are no longer equal."
+ self assert: method symbolic = copy symbolic. "but their bytecode should be the same"
+ self assert: method ~~ copy.
+ method pragmas do:
+ [:p|
+ self assert: p method == method].
+ copy pragmas do:
+ [:p|
+ self assert: p method == copy]!