[Pkg] The Trunk: Tests-eem.132.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Sep 27 16:00:30 UTC 2011
Eliot Miranda uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-eem.132.mcz
==================== Summary ====================
Name: Tests-eem.132
Author: eem
Time: 27 September 2011, 9:00:03.871 am
UUID: c18d487c-8d36-45e6-bddf-1be0fe43e415
Ancestors: Tests-ul.131
Use the methodForDecompile in deocmpilation tests.
=============== Diff against Tests-ul.131 ===============
Item was changed:
----- Method: DecompilerTests>>checkDecompileMethod: (in category 'utilities') -----
checkDecompileMethod: oldMethod
| cls selector oldMethodNode methodNode newMethod oldCodeString newCodeString |
cls := oldMethod methodClass.
selector := oldMethod selector.
oldMethodNode := (cls decompilerClass new withTempNames: oldMethod methodNode schematicTempNamesString)
+ decompile: selector
+ in: cls
+ method: oldMethod methodForDecompile.
- decompile: selector
- in: cls
- method: oldMethod.
[oldMethodNode properties includesKey: #warning] whileTrue:
[oldMethodNode properties removeKey: #warning].
oldCodeString := oldMethodNode decompileString.
methodNode := [cls newCompiler
compile: oldCodeString
in: cls
notifying: nil
ifFail: []]
on: SyntaxErrorNotification
do: [:ex|
ex errorMessage = 'Cannot store into' ifTrue:
[ex return: #badStore].
ex pass].
"Ignore cannot store into block arg errors; they're not our issue."
methodNode ~~ #badStore ifTrue:
[newMethod := methodNode generate.
newCodeString := ((cls decompilerClass new withTempNames: methodNode schematicTempNamesString)
+ decompile: selector
+ in: cls
+ method: newMethod methodForDecompile) decompileString.
- decompile: selector
- in: cls
- method: newMethod) decompileString.
"(StringHolder new textContents:
(TextDiffBuilder buildDisplayPatchFrom: oldCodeString to: newCodeString))
openLabel: 'Decompilation Differences for ', cls name,'>>',selector"
"(StringHolder new textContents:
(TextDiffBuilder buildDisplayPatchFrom: oldMethod abstractSymbolic to: newMethod abstractSymbolic))
openLabel: 'Bytecode Differences for ', cls name,'>>',selector"
self assert: oldCodeString = newCodeString
description: cls name asString, ' ', selector asString
resumable: true]!
More information about the Packages
mailing list