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

commits at source.squeak.org commits at source.squeak.org
Sat Apr 2 20:49:21 UTC 2011


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

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

Name: KernelTests-nice.180
Author: nice
Time: 2 April 2011, 10:49:04.068 pm
UUID: 4c5480e9-e460-471b-9aa0-a1933ce72578
Ancestors: KernelTests-ul.179

Pick a few tests from Pharo

=============== Diff against KernelTests-ul.179 ===============

Item was added:
+ ----- Method: CompiledMethodTest>>a1:a2:a3:a4:a5:a6:a7:a8:a9:a10:a11:a12:a13:a14:a15: (in category 'tests - performing') -----
+ a1: a1 a2: a2 a3: a3 a4: a4 a5: a5 a6: a6 a7: a7 a8: a8 a9: a9 a10: a10 a11: a11 a12: a12 a13: a13 a14: a14 a15: a15
+ 	"I'm a method with the maximum size of arguments that can be executed via normal send but crash on perform :)"
+ 	
+ 	^ a1 + a2 - a2!

Item was added:
+ ----- Method: CompiledMethodTest>>testPerformCanExecutelongMethodWithTemps (in category 'tests - performing') -----
+ testPerformCanExecutelongMethodWithTemps
+ 	"self debug: #testPerformCanExecutelongMethodWithTemps"
+ 	"the perform: primitive reuses the context of the method calling it. The primitive adds performed selector arguments to the context variables list. So this means that you can execute some methods but not performed them if the calling methods defined too many temps "
+ 	
+ 	| temp1 temp2 temp3 |
+ 	temp1 := 33.
+ 	temp2 := 666.
+ 	temp3 := 42. 
+ 	self assert: (self perform: #a1:a2:a3:a4:a5:a6:a7:a8:a9:a10:a11:a12:a13:a14:a15: withArguments: #(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)) = 1.
+ 	self assert: (self class>>#testPerformCanExecutelongMethodWithTemps) frameSize = CompiledMethod smallFrameSize.
+ 	self assert: (self class>>#a1:a2:a3:a4:a5:a6:a7:a8:a9:a10:a11:a12:a13:a14:a15:) frameSize = CompiledMethod fullFrameSize.!

Item was added:
+ ----- Method: CompiledMethodTest>>testPerformInSuperclassCanExecutelongMethodWithTemps (in category 'tests - performing') -----
+ testPerformInSuperclassCanExecutelongMethodWithTemps
+ 	"self debug: #testPerformInSuperclassCanExecutelongMethodWithTemps"
+ 	"the perform: primitive reuses the context of the method calling it. The primitive adds performed selector arguments to the context variables list. So this means that you can execute some methods but not performed them if the calling methods defined too many temps "
+ 	
+ 	| temp1 temp2 temp3 |
+ 	temp1 := 33.
+ 	temp2 := 666.
+ 	temp3 := 42. 
+ 	self assert: (self perform: #a1:a2:a3:a4:a5:a6:a7:a8:a9:a10:a11:a12:a13:a14:a15: withArguments: #(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) inSuperclass: self class) = 1!

Item was added:
+ ----- Method: DependentsArrayTest>>testSize (in category 'testing') -----
+ testSize
+ 
+ 	self 
+ 		assert: (DependentsArray with: nil) size = 0;
+ 		assert: (DependentsArray with: nil with: 1 with: nil) size = 1;
+ 		assert: (DependentsArray with: 1 with: 3) size = 2;
+ 		assert: (DependentsArray with: nil with: nil with: nil) size = 0!

Item was changed:
  ----- Method: NumberTest>>testPrintShowingDecimalPlaces (in category 'tests') -----
  testPrintShowingDecimalPlaces
- 
  	self assert: (111.2 printShowingDecimalPlaces: 2) = '111.20'.
  	self assert: (111.2 printShowingDecimalPlaces: 0) = '111'.
  	self assert: (111 printShowingDecimalPlaces: 0) = '111'.
  	self assert: (111111111111111 printShowingDecimalPlaces: 2) = '111111111111111.00'.
  	self assert: (10 printShowingDecimalPlaces: 20) ='10.00000000000000000000'.
  	self assert: (0.98 printShowingDecimalPlaces: 2) = '0.98'.
  	self assert: (-0.98 printShowingDecimalPlaces: 2) = '-0.98'.
  	self assert: (2.567 printShowingDecimalPlaces: 2) = '2.57'.
  	self assert: (-2.567 printShowingDecimalPlaces: 2) = '-2.57'.
+ 	self assert: (0.01 printShowingDecimalPlaces: 2) = '0.01'.
+ 	self assert: (-0.001 printShowingDecimalPlaces: 2) = '0.00'.!
- 	"self assert: (Number categoryForSelector: #printShowingDecimalPlaces:) = 'printing'."!

Item was changed:
  ----- Method: SqNumberParserTest>>testFloatGradualUnderflow (in category 'tests - Float') -----
  testFloatGradualUnderflow
  	"Gradual underflow are tricky.
  	This is a non regression test for http://bugs.squeak.org/view.php?id=6976"
  
  	| float trueFraction str |
  	
  	"as a preamble, use a base 16 representation to avoid round off error and check that number parsing is correct"
  	trueFraction := 16r2D2593D58B4FC4 / (16 raisedTo: 256+13).
  	"Parse the number in base 16 if possible - it is impossible if lowercase letter are allowed digits due to exponent letter ambiguity."
  	float := self areLowercaseDigitsAllowed
+ 		ifFalse: [SqNumberParser parse: '16r2.D2593D58B4FC4e-256']
+ 		ifTrue: [trueFraction asFloat]..
- 		ifNil: [SqNumberParser parse: '16r2.D2593D58B4FC4e-256']
- 		ifNotNil: [trueFraction asFloat]..
  	self assert: float asTrueFraction = trueFraction.
  	self assert: float = trueFraction asFloat.
  
  	"now print in base 10"
  	str := (String new: 32) writeStream.
  	float absPrintExactlyOn: str base: 10.
  	
  	"verify if SqNumberParser can read it back"
  	self assert: (SqNumberParser parse: str contents) = float. !




More information about the Squeak-dev mailing list