[Arakhnę-Dev] [410] * Fixing the unit tests because the function toBoundingBox() replies a copy of the box, not the object itself.

[ Thread Index | Date Index | More arakhne.org/dev Archives ]


Revision: 410
Author:   galland
Date:     2013-04-05 12:07:45 +0200 (Fri, 05 Apr 2013)
Log Message:
-----------
* Fixing the unit tests because the function toBoundingBox() replies a copy of the box, not the object itself.

Modified Paths:
--------------
    trunk/math/src/test/java/org/arakhne/afc/math/continous/object2d/Rectangle2fTest.java
    trunk/math/src/test/java/org/arakhne/afc/math/discrete/object2d/Rectangle2iTest.java

Modified: trunk/math/src/test/java/org/arakhne/afc/math/continous/object2d/Rectangle2fTest.java
===================================================================
--- trunk/math/src/test/java/org/arakhne/afc/math/continous/object2d/Rectangle2fTest.java	2013-04-05 10:06:40 UTC (rev 409)
+++ trunk/math/src/test/java/org/arakhne/afc/math/continous/object2d/Rectangle2fTest.java	2013-04-05 10:07:45 UTC (rev 410)
@@ -248,7 +248,11 @@
 	@Override
 	public void testToBoundingBox() {
 		Rectangle2f b = this.r.toBoundingBox();
-		assertSame(this.r, b);
+		assertNotSame(this.r, b);
+		assertEpsilonEquals(this.r.getMinX(), b.getMinX());
+		assertEpsilonEquals(this.r.getMinY(), b.getMinY());
+		assertEpsilonEquals(this.r.getMaxX(), b.getMaxX());
+		assertEpsilonEquals(this.r.getMaxY(), b.getMaxY());
 	}
 	
 	/**

Modified: trunk/math/src/test/java/org/arakhne/afc/math/discrete/object2d/Rectangle2iTest.java
===================================================================
--- trunk/math/src/test/java/org/arakhne/afc/math/discrete/object2d/Rectangle2iTest.java	2013-04-05 10:06:40 UTC (rev 409)
+++ trunk/math/src/test/java/org/arakhne/afc/math/discrete/object2d/Rectangle2iTest.java	2013-04-05 10:07:45 UTC (rev 410)
@@ -92,7 +92,11 @@
 	@Override
 	public void testToBoundingBox() {
 		Rectangle2i r = this.r.toBoundingBox();
-		assertSame(this.r, r);
+		assertNotSame(this.r, r);
+		assertEpsilonEquals(this.r.getMinX(), r.getMinX());
+		assertEpsilonEquals(this.r.getMinY(), r.getMinY());
+		assertEpsilonEquals(this.r.getMaxX(), r.getMaxX());
+		assertEpsilonEquals(this.r.getMaxY(), r.getMaxY());
 	}
 
 	/**


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/