The Trunk: KernelTests-ul.295.mcz

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

The Trunk: KernelTests-ul.295.mcz

commits-2
Levente Uzonyi uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-ul.295.mcz

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

Name: KernelTests-ul.295
Author: ul
Time: 6 May 2015, 2:35:40.628 pm
UUID: bd2d63b5-9819-4e81-b1e0-d14594c158ad
Ancestors: KernelTests-ul.294

Fix: Dictionary DNU #replace:

=============== Diff against KernelTests-ul.294 ===============

Item was changed:
  ----- Method: CompiledMethodComparisonTest>>testHash (in category 'tests') -----
  testHash
  <timeout: 120>
 
  | ai |
  ai := CompiledMethod allInstances.
  "We assume here that if two CompiledMethods are equal then they have the same size and header."
+ (ai groupBy: [ :method | { method size. method header } ]) values
+ replace: [ :each | each asArray ];
- ((ai
- groupBy: [ :method | { method size. method header } ])
- replace: [ :each | each asArray ])
  do: [ :methods |
  1 to: methods size do: [ :i |
  i to: methods size do: [ :j |
  (methods at: i) = (methods at: j) ifTrue: [
  self assert: (methods at: i) hash equals: (methods at: i) hash ] ] ] ]
  displayingProgress: 'Testing hashes'.
  self assert: (ai collect: [ :cm | cm hash ] as: Set) size * 2 >= ai asSet size!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: KernelTests-ul.295.mcz

Nicolas Cellier
Why not implement Dictionary replace:?

2015-05-06 20:11 GMT+02:00 <[hidden email]>:
Levente Uzonyi uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-ul.295.mcz

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

Name: KernelTests-ul.295
Author: ul
Time: 6 May 2015, 2:35:40.628 pm
UUID: bd2d63b5-9819-4e81-b1e0-d14594c158ad
Ancestors: KernelTests-ul.294

Fix: Dictionary DNU #replace:

=============== Diff against KernelTests-ul.294 ===============

Item was changed:
  ----- Method: CompiledMethodComparisonTest>>testHash (in category 'tests') -----
  testHash
        <timeout: 120>

        | ai |
        ai := CompiledMethod allInstances.
        "We assume here that if two CompiledMethods are equal then they have the same size and header."
+       (ai groupBy: [ :method | { method size. method header } ]) values
+               replace: [ :each | each asArray ];
-       ((ai
-               groupBy: [ :method | { method size. method header } ])
-               replace: [ :each | each asArray ])
                do: [ :methods |
                        1 to: methods size do: [ :i |
                                i to: methods size do: [ :j |
                                        (methods at: i) = (methods at: j) ifTrue: [
                                                self assert: (methods at: i) hash equals: (methods at: i) hash ] ] ] ]
                displayingProgress: 'Testing hashes'.
        self assert: (ai collect: [ :cm | cm hash ] as: Set) size * 2 >= ai asSet size!