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

commits at source.squeak.org commits at source.squeak.org
Sun Apr 24 20:38:05 UTC 2011


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

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

Name: KernelTests-nice.187
Author: nice
Time: 24 April 2011, 10:37:49.529 pm
UUID: 2b279c2b-b144-f64c-8e6b-30650f77c928
Ancestors: KernelTests-nice.186

More tests for complex math

=============== Diff against KernelTests-nice.186 ===============

Item was changed:
  ----- 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).
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:real |
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:imag |
- 	#(-0.5 -2 -3 0.5 2 3) do: [:real |
- 	#(-0.5 -2 -3 0.5 2 3) do: [:imag |
  		c := real + imag i.
  		self assert: (c arCosh cosh real closeTo: c real).
+ 		self assert: (c arCosh cosh imaginary closeTo: c imaginary).
+ 		self deny: c arCosh real negative]]!
- 		self assert: (c arCosh cosh imaginary closeTo: c imaginary)]]!

Item was changed:
  ----- 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).
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:real |
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:imag |
- 	#(-0.5 -2 -3 0.5 2 3) do: [:real |
- 	#(-0.5 -2 -3 0.5 2 3) do: [:imag |
  		c := real + imag i.
  		self assert: (c arSinh sinh real closeTo: c real).
  		self assert: (c arSinh sinh imaginary closeTo: c imaginary)]]!

Item was changed:
  ----- 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).
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:real |
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:imag |
- 	#(-0.5 -2 -3 0.5 2 3) do: [:real |
- 	#(-0.5 -2 -3 0.5 2 3) do: [:imag |
  		c := real + imag i.
  		self assert: (c arTanh tanh real closeTo: c real).
  		self assert: (c arTanh tanh imaginary closeTo: c imaginary)]]!

Item was changed:
  ----- Method: ComplexTest>>testArcCos (in category 'tests') -----
  testArcCos
  	| c |
  	c := (0.5 + 0 i).
  	self assert: (c arcCos real closeTo: c real arcCos).
  	self assert: (c arcCos imaginary closeTo: 0).
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:real |
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:imag |
- 	#(-0.5 -2 -3 0.5 2 3) do: [:real |
- 	#(-0.5 -2 -3 0.5 2 3) do: [:imag |
  		c := real + imag i.
  		self assert: (c arcCos cos real closeTo: c real).
  		self assert: (c arcCos cos imaginary closeTo: c imaginary)]]!

Item was added:
+ ----- Method: ComplexTest>>testArcCosPlusArcSin (in category 'tests') -----
+ testArcCosPlusArcSin
+ 	| c |
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:real |
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:imag |
+ 		c := real + imag i.
+ 		self assert: ((c arcCos + c arcSin) real closeTo: Float halfPi).
+ 		self assert: ((c arcCos + c arcSin) imaginary closeTo: 0.0)]]!

Item was changed:
  ----- Method: ComplexTest>>testArcSin (in category 'tests') -----
  testArcSin
  	| c |
  	c := (0.5 + 0 i).
  	self assert: (c arcSin real closeTo: c real arcSin).
  	self assert: (c arcSin imaginary closeTo: 0).
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:real |
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:imag |
- 	#(-0.5 -2 -3 0.5 2 3) do: [:real |
- 	#(-0.5 -2 -3 0.5 2 3) do: [:imag |
  		c := real + imag i.
  		self assert: (c arcSin sin real closeTo: c real).
  		self assert: (c arcSin sin imaginary closeTo: c imaginary)]]!

Item was changed:
  ----- Method: ComplexTest>>testArcTan (in category 'tests') -----
  testArcTan
  	| c |
  	c := (0.5 + 0 i).
  	self assert: (c arcTan real closeTo: c real arcTan).
  	self assert: (c arcTan imaginary closeTo: 0).
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:real |
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:imag |
- 	#(-0.5 -2 -3 0.5 2 3) do: [:real |
- 	#(-0.5 -2 -3 0.5 2 3) do: [:imag |
  		c := real + imag i.
  		self assert: (c arcTan tan real closeTo: c real).
  		self assert: (c arcTan tan imaginary closeTo: c imaginary)]]!

Item was added:
+ ----- Method: ComplexTest>>testCos2PlusSin2 (in category 'tests') -----
+ testCos2PlusSin2
+ 	| c |
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:real |
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:imag |
+ 		c := real + imag i.
+ 		self assert: ((c cos squared + c sin squared) real closeTo: 1).
+ 		self assert: ((c cos squared + c sin squared) imaginary closeTo: 0.0)]]!

Item was added:
+ ----- Method: ComplexTest>>testCosh2MinusSinh2 (in category 'tests') -----
+ testCosh2MinusSinh2
+ 	| c |
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:real |
+ 	#(-0.5 -2 -3 0 0.5 2 3) do: [:imag |
+ 		c := real + imag i.
+ 		self assert: ((c cosh squared - c sinh squared) real closeTo: 1).
+ 		self assert: ((c cosh squared - c sinh squared) imaginary closeTo: 0.0)]]!

Item was changed:
  ----- 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.
- 	c2 := c sin squared + c cos squared.
- 	self assert: (c2 real closeTo: 1).
- 	self assert: (c2 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).!




More information about the Squeak-dev mailing list