The Trunk: KernelTests-mha.100.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-mha.100.mcz

commits-2
Michael Haupt uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-mha.100.mcz

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

Name: KernelTests-mha.100
Author: mha
Time: 11 October 2009, 8:23:14 am
UUID: 2bceeeb6-b3e3-7a4e-9436-3010f8f730e7
Ancestors: KernelTests-nice.99

made MethodPropertiesTest pass

MethodPropertiesTest >> #propertyDictionaryFor: would ask the passed AdditionalMethodState instance to answer its instance variable named 'properties', which does not exist due to AdditionalMethodState's being implemented as a variable subclass of Object, and hence storing properties in immediate fields.

Also, the tests did not honour the AdditionalMethodState protocol in that they expected AdditionalMethodState >> #properties to return nil in case there were no properties; however, it returns an empty dictionary in these cases. The corresponding checks were changed from #isNil to #isEmpty.

=============== Diff against KernelTests-nice.99 ===============

Item was changed:
  ----- Method: MethodPropertiesTest>>testAt (in category 'testing') -----
  testAt
  self should: [ method properties at: #zork ] raise: Error.
+ self assert: (self propertyDictionaryFor: method) isEmpty.
- self assert: (self propertyDictionaryFor: method) isNil.
  method properties at: #zork put: 'hello'.
  self assert: (method properties at: #zork) = 'hello'.!

Item was changed:
  ----- Method: MethodPropertiesTest>>testRemoveKey (in category 'testing') -----
  testRemoveKey
  method properties at: #zork put: 'hello'.
  self should: [ method properties removeKey: #halt ] raise: Error.
  self assert: (method properties removeKey: #zork) = 'hello'.
+ self assert: (self propertyDictionaryFor: method) isEmpty.
- self assert: (self propertyDictionaryFor: method) isNil.
  self should: [ method properties removeKey: #zork ] raise: Error.
+ self assert: (self propertyDictionaryFor: method) isEmpty.!
- self assert: (self propertyDictionaryFor: method) isNil.!

Item was changed:
  ----- Method: MethodPropertiesTest>>testAtIfAbsent (in category 'testing') -----
  testAtIfAbsent
  self assert: (method properties at: #zork ifAbsent: [ 'hello' ]) = 'hello'.
+ self assert: (self propertyDictionaryFor: method) isEmpty.
- self assert: (self propertyDictionaryFor: method) isNil.
  method properties at: #zork put: 'hi'.
  self assert: (method properties at: #zork ifAbsent: [ 'hello' ]) = 'hi'.!

Item was changed:
  ----- Method: MethodPropertiesTest>>testIncludesKey (in category 'testing') -----
  testIncludesKey
  self deny: (method properties includesKey: #zork).
+ self assert: (self propertyDictionaryFor: method) isEmpty.
- self assert: (self propertyDictionaryFor: method) isNil.
  method properties at: #zork put: 123.
  self assert: (method properties includesKey: #zork).!

Item was changed:
  ----- Method: MethodPropertiesTest>>testRemoveKeyifAbsent (in category 'testing') -----
  testRemoveKeyifAbsent
  method properties at: #zork put: 'hello'.
  self assert: (method properties removeKey: #halt ifAbsent: [ 'hi' ]) = 'hi'.
  self assert: (method properties removeKey: #zork ifAbsent: [ 'hi' ]) = 'hello'.
+ self assert: (self propertyDictionaryFor: method) isEmpty.
- self assert: (self propertyDictionaryFor: method) isNil.
  self should: (method properties removeKey: #zork ifAbsent: [ 'hi' ]) = 'hi'.
+ self assert: (self propertyDictionaryFor: method) isEmpty.!
- self assert: (self propertyDictionaryFor: method) isNil.!

Item was changed:
  ----- Method: MethodPropertiesTest>>propertyDictionaryFor: (in category 'private') -----
  propertyDictionaryFor: aMethod
+ ^ aMethod properties properties!
- ^ aMethod properties instVarNamed: 'properties'.!