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

commits at source.squeak.org commits at source.squeak.org
Sat Apr 23 01:43:57 UTC 2011


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

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

Name: KernelTests-nice.184
Author: nice
Time: 23 April 2011, 3:43:37.358 am
UUID: 5c6ca14a-a551-4844-8f1f-cc83d8a91d90
Ancestors: KernelTests-cmm.183

Some tests for the new mathematical functions

=============== Diff against KernelTests-cmm.183 ===============

Item was added:
+ ----- Method: ComplexTest>>testArCosh (in category 'tests') -----
+ testArCosh
+ 	| c |
+ 	c := (2.5 + 0 i).
+ 	self assert: (c arCosh real closeTo: c real arCosh).
+ 	self assert: (c arCosh imaginary closeTo: 0).
+ 	c := 2 + 3 i.
+ 	self assert: (c arCosh cosh real closeTo: c real).
+ 	self assert: (c arCosh cosh imaginary closeTo: c imaginary).
+ 	c := -2 + 3 i.
+ 	self assert: (c arCosh cosh real closeTo: c real).
+ 	self assert: (c arCosh cosh imaginary closeTo: c imaginary).
+ 	c := -2 - 3 i.
+ 	self assert: (c arCosh cosh real closeTo: c real).
+ 	self assert: (c arCosh cosh imaginary closeTo: c imaginary).
+ 	c := 2 - 3 i.
+ 	self assert: (c arCosh cosh real closeTo: c real).
+ 	self assert: (c arCosh cosh imaginary closeTo: c imaginary).!

Item was added:
+ ----- Method: ComplexTest>>testArSinh (in category 'tests') -----
+ testArSinh
+ 	| c |
+ 	c := (2.5 + 0 i).
+ 	self assert: (c arSinh real closeTo: c real arSinh).
+ 	self assert: (c arSinh imaginary closeTo: 0).
+ 	c := 2 + 3 i.
+ 	self assert: (c arSinh sinh real closeTo: c real).
+ 	self assert: (c arSinh sinh imaginary closeTo: c imaginary).!

Item was added:
+ ----- Method: ComplexTest>>testArTanh (in category 'tests') -----
+ testArTanh
+ 	| c |
+ 	c := (0.5 + 0 i).
+ 	self assert: (c arTanh real closeTo: c real arTanh).
+ 	self assert: (c arTanh imaginary closeTo: 0).
+ 	c := 2 + 3 i.
+ 	self assert: (c arTanh tanh real closeTo: c real).
+ 	self assert: (c arTanh tanh imaginary closeTo: c imaginary).!

Item was added:
+ ----- Method: ComplexTest>>testConjugated (in category 'tests') -----
+ testConjugated
+ 	
+ 	| c cc |
+ 	c := (5 - 6 i).
+ 	cc := c conjugated.
+ 	self assert: cc real = c real.
+ 	self assert: cc imaginary = c imaginary negated.!

Item was added:
+ ----- Method: ComplexTest>>testCos (in category 'tests') -----
+ testCos
+ 	| c c2 |
+ 	c := (2 + 0 i).
+ 	self assert: (c cos real closeTo: c real cos).
+ 	self assert: (c cos imaginary closeTo: 0).
+ 	c := (2 + 3 i).
+ 	c2 := c i exp + c i negated exp / 2.
+ 	self assert: (c cos real closeTo: c2 real).
+ 	self assert: (c cos imaginary closeTo: c2 imaginary).!

Item was added:
+ ----- Method: ComplexTest>>testCosh (in category 'tests') -----
+ testCosh
+ 	| c c2 |
+ 	c := (2 + 0 i).
+ 	self assert: (c cosh real closeTo: c real cosh).
+ 	self assert: (c cosh imaginary closeTo: 0).
+ 	c := (2 + 3 i).
+ 	c2 := c exp + c negated exp / 2.
+ 	self assert: (c cosh real closeTo: c2 real).
+ 	self assert: (c cosh imaginary closeTo: c2 imaginary).
+ 	c2 := c i cos.
+ 	self assert: (c cosh real closeTo: c2 real).
+ 	self assert: (c cosh imaginary closeTo: c2 imaginary).!

Item was added:
+ ----- Method: ComplexTest>>testMultiplyByI (in category 'tests') -----
+ testMultiplyByI
+ 	
+ 	| c |
+ 	c := (5 - 6 i).
+ 	self assert: (c * 1i = c i)!

Item was added:
+ ----- Method: ComplexTest>>testRaisedTo (in category 'tests') -----
+ testRaisedTo
+ 	
+ 	| c c3 |
+ 	c := (5 - 6 i).
+ 	c3 := (c raisedTo: 0.2) raisedTo: 5.
+ 	self assert: (c3 real closeTo: c real).
+ 	self assert: (c3 imaginary closeTo: c imaginary).!

Item was added:
+ ----- Method: ComplexTest>>testRaisedToInteger (in category 'tests') -----
+ testRaisedToInteger
+ 	
+ 	| c c3 |
+ 	c := (5 - 6 i).
+ 	c3 := (c * c * c).
+ 	self assert: (c3 = (c raisedToInteger: 3)).
+ 	self assert: (c3 reciprocal = (c raisedToInteger: -3)).!

Item was added:
+ ----- Method: ComplexTest>>testSin (in category 'tests') -----
+ testSin
+ 	| c c2 |
+ 	c := (2 + 0 i).
+ 	self assert: (c sin real closeTo: c real sin).
+ 	self assert: (c sin imaginary closeTo: 0).
+ 	c := 2 + 3 i.
+ 	c := c sin squared + c cos squared.
+ 	self assert: (c real closeTo: 1).
+ 	self assert: (c imaginary closeTo: 0).
+ 	c2 := c i exp - c i negated exp / 2 i.
+ 	self assert: (c sin real closeTo: c2 real).
+ 	self assert: (c sin imaginary closeTo: c2 imaginary).!

Item was added:
+ ----- Method: ComplexTest>>testSinh (in category 'tests') -----
+ testSinh
+ 	| c c2 |
+ 	c := (2 + 0 i).
+ 	self assert: (c sinh real closeTo: c real sinh).
+ 	self assert: (c sinh imaginary closeTo: 0).
+ 	c := 2 + 3 i.
+ 	c := c cosh squared - c sinh squared.
+ 	self assert: (c real closeTo: 1).
+ 	self assert: (c imaginary closeTo: 0).
+ 	c2 := c exp - c negated exp / 2.
+ 	self assert: (c sinh real closeTo: c2 real).
+ 	self assert: (c sinh imaginary closeTo: c2 imaginary).
+ 	c2 := c i sin i negated.
+ 	self assert: (c sinh real closeTo: c2 real).
+ 	self assert: (c sinh imaginary closeTo: c2 imaginary).!

Item was added:
+ ----- Method: ComplexTest>>testTan (in category 'tests') -----
+ testTan
+ 	| c c2 |
+ 	c := (2 + 0 i).
+ 	self assert: (c tan real closeTo: c real tan).
+ 	self assert: (c tan imaginary closeTo: 0).
+ 	c := 2 + 3 i.
+ 	c2 := c sin / c cos.
+ 	self assert: (c2 real closeTo: c tan real).
+ 	self assert: (c2 imaginary closeTo: c tan imaginary).!

Item was added:
+ ----- Method: ComplexTest>>testTanh (in category 'tests') -----
+ testTanh
+ 	| c c2 |
+ 	c := (2 + 0 i).
+ 	self assert: (c tanh real closeTo: c real tanh).
+ 	self assert: (c tanh imaginary closeTo: 0).
+ 	c := 2 + 3 i.
+ 	c2 := c sinh / c cosh.
+ 	self assert: (c2 real closeTo: c tanh real).
+ 	self assert: (c2 imaginary closeTo: c tanh imaginary).!

Item was added:
+ ----- Method: FloatTest>>testArCosh (in category 'test - mathematical functions') -----
+ testArCosh
+ 	self assert: 1.0 arCosh = 0.0.
+ 	self deny: Float infinity arCosh isFinite.
+ 	self assert: (2.5 arCosh cosh closeTo: 2.5).!

Item was added:
+ ----- Method: FloatTest>>testArSinh (in category 'test - mathematical functions') -----
+ testArSinh
+ 	self assert: 0.0 arSinh = 0.0.
+ 	self assert: Float negativeZero arSinh = 0.0.
+ 	self assert: Float negativeZero arSinh sign = -1.
+ 	self deny: Float infinity arSinh isFinite.
+ 	self assert: (0.5 arSinh negated closeTo: 0.5 negated arSinh).
+ 	self assert: (0.5 arSinh sinh closeTo: 0.5).
+ 	self assert: (-2.5 arSinh sinh closeTo: -2.5).!

Item was added:
+ ----- Method: FloatTest>>testArTanh (in category 'test - mathematical functions') -----
+ testArTanh
+ 	self assert: 0.0 arTanh = 0.0.
+ 	self assert: Float negativeZero arTanh = 0.0.
+ 	self assert: Float negativeZero arTanh sign = -1.
+ 	self deny: 1 arTanh isFinite.
+ 	self assert: (0.5 arTanh negated closeTo: 0.5 negated arTanh).
+ 	self assert: (0.5 arTanh tanh closeTo: 0.5).
+ 	self assert: (-0.5 arTanh tanh closeTo: -0.5).!

Item was added:
+ ----- Method: FloatTest>>testCopySign (in category 'zero behavior') -----
+ testCopySign
+ 	self assert: (0.0 copySignTo: 1) = 1.
+ 	self assert: (Float negativeZero copySignTo: 1) = -1.
+ 	self assert: (-1 copySignTo: 0.0) = 0.0.
+ 	self assert: (-1 copySignTo: 0.0) sign = -1.
+ 	self assert: (1 copySignTo: Float negativeZero) sign = 0.!

Item was added:
+ ----- Method: FloatTest>>testCosh (in category 'test - mathematical functions') -----
+ testCosh
+ 	self assert: (0.0 cosh closeTo: 1).
+ 	self deny: Float infinity cosh isFinite.
+ 	self assert: (2.0 cosh squared - 2.0 sinh squared closeTo: 1).
+ 	self assert: (2.0 cosh closeTo: 2.0 negated cosh).!

Item was added:
+ ----- Method: FloatTest>>testSinh (in category 'test - mathematical functions') -----
+ testSinh
+ 	self assert: 0.0 sinh = 0.0.
+ 	self assert: Float negativeZero sinh = 0.0.
+ 	self assert: Float negativeZero sinh sign = -1.
+ 	self deny: Float infinity sinh isFinite.
+ 	self assert: (2.0 cosh squared - 2.0 sinh squared closeTo: 1).
+ 	self assert: (2.0 sinh negated closeTo: 2.0 negated sinh).!

Item was added:
+ ----- Method: FloatTest>>testTanh (in category 'test - mathematical functions') -----
+ testTanh
+ 	self assert: 0.0 tanh = 0.0.
+ 	self assert: Float negativeZero tanh = 0.0.
+ 	self assert: Float negativeZero tanh sign = -1.
+ 	self assert: (Float infinity tanh closeTo: 1).
+ 	self assert: (2.0 cosh squared - 2.0 sinh squared closeTo: 1).
+ 	self assert: (2.0 tanh negated closeTo: 2.0 negated tanh).!




More information about the Squeak-dev mailing list