ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r910997 - in /ant/core/trunk: WHATSNEW src/tests/junit/org/apache/tools/ant/util/VectorSetTest.java
Date Wed, 17 Feb 2010 14:39:43 GMT
Author: bodewig
Date: Wed Feb 17 14:39:42 2010
New Revision: 910997

URL: http://svn.apache.org/viewvc?rev=910997&view=rev
Log:
round out test and document the bug

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/util/VectorSetTest.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=910997&r1=910996&r2=910997&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Wed Feb 17 14:39:42 2010
@@ -25,6 +25,9 @@
    META-INF/application.xml files to be added.
    Bugzilla Report 6836.
 
+ * VectorSet#remove(Object) would fail if the size of the vector
+   equaled its capacity.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/util/VectorSetTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/util/VectorSetTest.java?rev=910997&r1=910996&r2=910997&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/util/VectorSetTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/util/VectorSetTest.java Wed Feb 17
14:39:42 2010
@@ -113,7 +113,8 @@
         v = new VectorSet(3, 1);
         Object a = new Object();
         v.add(a);
-        v.add(new Object());
+        Object b = new Object();
+        v.add(b);
         v.add(O);
         assertEquals(3, v.size());
         assertEquals(3, v.capacity());
@@ -121,6 +122,7 @@
         assertEquals(2, v.size());
         assertFalse(v.remove(O));
         assertSame(a, v.elementAt(0));
+        assertSame(b, v.elementAt(1));
     }
 
     public void testRemoveAtFrontWhenSizeEqualsCapacity() {
@@ -128,13 +130,15 @@
         v.add(O);
         Object a = new Object();
         v.add(a);
-        v.add(new Object());
+        Object b = new Object();
+        v.add(b);
         assertEquals(3, v.size());
         assertEquals(3, v.capacity());
         assertTrue(v.remove(O));
         assertEquals(2, v.size());
         assertFalse(v.remove(O));
         assertSame(a, v.elementAt(0));
+        assertSame(b, v.elementAt(1));
     }
 
     public void testRemoveInMiddleWhenSizeEqualsCapacity() {
@@ -142,13 +146,15 @@
         Object a = new Object();
         v.add(a);
         v.add(O);
-        v.add(new Object());
+        Object b = new Object();
+        v.add(b);
         assertEquals(3, v.size());
         assertEquals(3, v.capacity());
         assertTrue(v.remove(O));
         assertEquals(2, v.size());
         assertFalse(v.remove(O));
         assertSame(a, v.elementAt(0));
+        assertSame(b, v.elementAt(1));
     }
 
     public void testRemoveAll() {



Mime
View raw message