[squeak-dev] The Trunk: KernelTests-nice.112.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Nov 27 18:46:43 UTC 2009


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

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

Name: KernelTests-nice.112
Author: nice
Time: 27 November 2009, 7:46:37 am
UUID: 9f37959a-ff43-cf46-899c-c5fc19204d66
Ancestors: KernelTests-ul.111

Grab a few tests from Pharo

=============== Diff against KernelTests-ul.111 ===============

Item was added:
+ ----- Method: UndefinedObjectTest>>testAllInstances (in category 'tests - Class Methods') -----
+ testAllInstances
+ 	self assert: UndefinedObject allInstances size = 1 description: 'There should be a single instance of UndefinedObject'.
+ 	self assert: (UndefinedObject allInstances includes: nil) description: 'nil should be an instance of UndefinedObject'.!

Item was changed:
  ----- Method: FloatTest>>testStoreBase16 (in category 'printing') -----
  testStoreBase16
  	"This bug was reported in mantis http://bugs.squeak.org/view.php?id=6695"
  
  	self
  		assert: (20.0 storeStringBase: 16) = '16r14.0'
+ 		description: 'the radix prefix should not be omitted, except in base 10'!
- 		description: 'the radix prefix should not be omitted'!

Item was added:
+ ----- Method: IntegerTest>>testLowBit (in category 'tests - bitLogic') -----
+ testLowBit
+ 	| suite |
+ 
+ 	suite := (0 to: 1024) asArray , #(16rFDFD 16rFFFF 16r1000 16r1000000 16r1000001 16r70000000 16r7AFAFAFA ) , {SmallInteger maxVal . SmallInteger maxVal+1}.
+ 	suite := suite , (suite collect: [:e | e raisedTo: 20]).
+ 	
+ 	suite do: [:anInteger |
+ 		| lowBit |
+ 		lowBit := (anInteger respondsTo: #bitAt:)
+ 			ifTrue: [(1 to: anInteger highBit) detect: [:bitIndex | (anInteger bitAt: bitIndex) ~= 0] ifNone: [0]]
+ 			ifFalse: [(1 to: anInteger highBit) detect: [:bitIndex | (anInteger bitAnd: (1 bitShift: bitIndex-1)) ~= 0] ifNone: [0]].
+ 		self assert: anInteger lowBit = lowBit.
+ 		self assert: anInteger negated lowBit = lowBit].!

Item was added:
+ ----- Method: IntegerTest>>testHighBit (in category 'tests - bitLogic') -----
+ testHighBit
+ 	| suite |
+ 
+ 	suite := (0 to: 1024) asArray , #(16rFDFD 16rFFFF 16r1000 16r1000000 16r1000001 16r70000000 16r7AFAFAFA ) , {SmallInteger maxVal . SmallInteger maxVal+1}.
+ 	suite := suite , (suite collect: [:e | e raisedTo: 20]).
+ 	
+ 	suite do: [:anInteger |
+ 		| highBit shifted |
+ 		highBit := 0.
+ 		shifted := 1.
+ 		[shifted > anInteger] whileFalse: [highBit := highBit+1. shifted := shifted bitShift: 1].
+ 		self assert: anInteger highBit = highBit].!

Item was added:
+ ----- Method: IntegerTest>>testIsPowerOfTwoM6873 (in category 'tests - basic') -----
+ testIsPowerOfTwoM6873
+ 	"This is a non regression test for http://bugs.squeak.org/view.php?id=6873"
+ 
+ 	self deny: ((1 to: 80) anySatisfy: [:n | (2 raisedTo: n) negated isPowerOfTwo])
+ 		description: 'A negative integer cannot be a power of two'.!




More information about the Squeak-dev mailing list