commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject cvs commit: jakarta-commons/math/src/test/org/apache/commons/math/util MathUtilsTest.java
Date Mon, 12 Apr 2004 04:03:39 GMT
psteitz     2004/04/11 21:03:39

  Modified:    math/src/test/org/apache/commons/math/util
                        MathUtilsTest.java
  Log:
  Added tests for indicator functions.
  Contributed by: Christopher Schuck
  Pr #28343
  
  Revision  Changes    Path
  1.11      +39 -7     jakarta-commons/math/src/test/org/apache/commons/math/util/MathUtilsTest.java
  
  Index: MathUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/util/MathUtilsTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MathUtilsTest.java	21 Feb 2004 21:35:18 -0000	1.10
  +++ MathUtilsTest.java	12 Apr 2004 04:03:39 -0000	1.11
  @@ -276,43 +276,75 @@
           return result;
       }
   
  -
       public void testSignDouble() {
           double delta = 0.0 ;
           assertEquals( 1.0, MathUtils.indicator( 2.0 ), delta ) ;
           assertEquals( -1.0, MathUtils.indicator( -2.0 ), delta ) ;
       }
   
  -
       public void testSignFloat() {
           float delta = 0.0F ;
           assertEquals( 1.0F, MathUtils.indicator( 2.0F ), delta ) ;
           assertEquals( -1.0F, MathUtils.indicator( -2.0F ), delta ) ;
       }
   
  -
       public void testSignByte() {
           assertEquals( (byte)1, MathUtils.indicator( (byte)2 ) ) ;
           assertEquals( (byte)(-1), MathUtils.indicator( (byte)(-2) ) ) ;
       }
   
  -
       public void testSignShort() {
           assertEquals( (short)1, MathUtils.indicator( (short)2 ) ) ;
           assertEquals( (short)(-1), MathUtils.indicator( (short)(-2) ) ) ;
       }
   
  -
       public void testSignInt() {
           assertEquals( (int)1, MathUtils.indicator( (int)(2) ) ) ;
           assertEquals( (int)(-1), MathUtils.indicator( (int)(-2) ) ) ;
       }
   
  -
       public void testSignLong() {
           assertEquals( 1L, MathUtils.indicator( 2L ) ) ;
           assertEquals( -1L, MathUtils.indicator( -2L ) ) ;
       }
  +   
  +	public void testIndicatorDouble() {
  +		 double delta = 0.0 ;
  +		 assertEquals( 1.0, MathUtils.indicator( 2.0 ), delta ) ;
  +		 assertEquals( 1.0, MathUtils.indicator( 0.0 ), delta ) ;
  +		 assertEquals( -1.0, MathUtils.indicator( -2.0 ), delta ) ;
  +	 }
  +
  +	 public void testIndicatorFloat() {
  +		 float delta = 0.0F ;
  +		 assertEquals( 1.0F, MathUtils.indicator( 2.0F ), delta ) ;
  +		 assertEquals( 1.0F, MathUtils.indicator( 0.0F ), delta ) ;
  +		 assertEquals( -1.0F, MathUtils.indicator( -2.0F ), delta ) ;
  +	 }
  +
  +	 public void testIndicatorByte() {
  +		 assertEquals( (byte)1, MathUtils.indicator( (byte)2 ) ) ;
  +		 assertEquals( (byte)1, MathUtils.indicator( (byte)0 ) ) ;
  +		 assertEquals( (byte)(-1), MathUtils.indicator( (byte)(-2) ) ) ;
  +	 }
  +
  +	 public void testIndicatorShort() {
  +		 assertEquals( (short)1, MathUtils.indicator( (short)2 ) ) ;
  +		 assertEquals( (short)1, MathUtils.indicator( (short)0 ) ) ;
  +		 assertEquals( (short)(-1), MathUtils.indicator( (short)(-2) ) ) ;
  +	 }
  +
  +	 public void testIndicatorInt() {
  +		 assertEquals( (int)1, MathUtils.indicator( (int)(2) ) ) ;
  +		 assertEquals( (int)1, MathUtils.indicator( (int)(0) ) ) ;
  +		 assertEquals( (int)(-1), MathUtils.indicator( (int)(-2) ) ) ;
  +	 }
  +
  +	 public void testIndicatorLong() {
  +		 assertEquals( 1L, MathUtils.indicator( 2L ) ) ;
  +		 assertEquals( 1L, MathUtils.indicator( 0L ) ) ;
  +		 assertEquals( -1L, MathUtils.indicator( -2L ) ) ;
  +	 }
       
       public void testCosh() {
           double x = 3.0;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message