commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1209118 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/MathUtilsTest.java
Date Thu, 01 Dec 2011 15:22:51 GMT
Author: erans
Date: Thu Dec  1 15:22:50 2011
New Revision: 1209118

URL: http://svn.apache.org/viewvc?rev=1209118&view=rev
Log:
MATH-690
[I forgot to commit those modified tests as part of r1209100.]

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/MathUtilsTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/MathUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/MathUtilsTest.java?rev=1209118&r1=1209117&r2=1209118&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/MathUtilsTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/MathUtilsTest.java
Thu Dec  1 15:22:50 2011
@@ -209,30 +209,30 @@ public final class MathUtilsTest {
 
     @Test
     public void testSignByte() {
-        Assert.assertEquals((byte) 1, MathUtils.sign((byte) 2));
-        Assert.assertEquals((byte) 0, MathUtils.sign((byte) 0));
-        Assert.assertEquals((byte) (-1), MathUtils.sign((byte) (-2)));
+        final byte one = (byte) 1;
+        Assert.assertEquals((byte) 1, MathUtils.copySign(one, (byte) 2));
+        Assert.assertEquals((byte) (-1), MathUtils.copySign(one, (byte) (-2)));
     }
 
     @Test
     public void testSignInt() {
-        Assert.assertEquals(1, MathUtils.sign(2));
-        Assert.assertEquals(0, MathUtils.sign(0));
-        Assert.assertEquals((-1), MathUtils.sign((-2)));
+        final int one = 1;
+        Assert.assertEquals(1, MathUtils.copySign(one, 2));
+        Assert.assertEquals((-1), MathUtils.copySign(one, -2));
     }
 
     @Test
     public void testSignLong() {
-        Assert.assertEquals(1L, MathUtils.sign(2L));
-        Assert.assertEquals(0L, MathUtils.sign(0L));
-        Assert.assertEquals(-1L, MathUtils.sign(-2L));
+        final long one = 1L;
+        Assert.assertEquals(1L, MathUtils.copySign(one, 2L));
+        Assert.assertEquals(-1L, MathUtils.copySign(one, -2L));
     }
 
     @Test
     public void testSignShort() {
-        Assert.assertEquals((short) 1, MathUtils.sign((short) 2));
-        Assert.assertEquals((short) 0, MathUtils.sign((short) 0));
-        Assert.assertEquals((short) (-1), MathUtils.sign((short) (-2)));
+        final short one = (short) 1;
+        Assert.assertEquals((short) 1, MathUtils.copySign(one, (short) 2));
+        Assert.assertEquals((short) (-1), MathUtils.copySign(one, (short) (-2)));
     }
 
     @Test



Mime
View raw message