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

commits at source.squeak.org commits at source.squeak.org
Sun Jan 22 17:23:34 UTC 2012


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

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

Name: KernelTests-nice.211
Author: nice
Time: 22 January 2012, 6:23:15.639 pm
UUID: 40d1bd19-43bc-4d6c-8a70-087bcb67059e
Ancestors: KernelTests-dtl.210

add a test for bitCount

=============== Diff against KernelTests-dtl.210 ===============

Item was added:
+ ----- Method: IntegerTest>>testBitCount (in category 'tests - bitLogic') -----
+ testBitCount
+ 	self assert: 2r0 bitCount equals: 0.
+ 	self assert: 2r1 bitCount equals: 1.
+ 	self assert: 2r101 bitCount equals: 2.
+ 	self assert: 2r1010000000000000000100000000000000000000000010000000000001001 bitCount equals: 6.
+ 
+ 	1 to: 100 do: [:i |
+ 		self assert: (2r1 << i) bitCount equals: 1.
+ 		self assert: (2r101 << i) bitCount equals: 2].
+ 
+ 	self should: [-2 bitCount] raise: Error description: 'Negative integers have an infinite number of leading 1 in two complement representation'.!




More information about the Squeak-dev mailing list