On Fri, Feb 27, 2009 at 1:41 AM, Matthew Toseland
<toad at amphibian.dyndns.org> wrote:
> On Friday 20 February 2009 14:28:59 j16sdiz at freenetproject.org wrote:
>> Author: j16sdiz
>> Date: 2009-02-20 14:28:58 +0000 (Fri, 20 Feb 2009)
>> New Revision: 25747
>>
>> Modified:
>> ? ?trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java
>> ? ?trunk/freenet/test/freenet/support/DoublyLinkedListImplTest.java
>> Log:
>> Clean up DoublyLinkedListImpl internals, prepare for generic (bug 2512)
>>
>> Instead of keeping a extra "tail" and "head" objects, point to the
>> actual item. This is essential for generic, as we cannot construct
>> a generic-ified object for the "tail" and "head".
>>
>> This pass the JUnit and some insert/request test.
>>
>> Modified: trunk/freenet/test/freenet/support/DoublyLinkedListImplTest.java
>> ===================================================================
>> --- trunk/freenet/test/freenet/support/DoublyLinkedListImplTest.java
> 2009-02-20 09:30:07 UTC (rev 25746)
>> +++ trunk/freenet/test/freenet/support/DoublyLinkedListImplTest.java
> 2009-02-20 14:28:58 UTC (rev 25747)
>> @@ -388,6 +388,7 @@
>> ? ? ? ? ? ? ? ? ? ? ? fail("PromiscuousItemException");
>> ? ? ? ? ? ? ? } catch (PromiscuousItemException pie) {
>> ? ? ? ? ? ? ? }
>> +
>> ? ? ? ? ? ? ? try {
>> ? ? ? ? ? ? ? ? ? ? ? // item in other list
>> ? ? ? ? ? ? ? ? ? ? ? list2.insertPrev(l2, array[3]);
>> @@ -400,15 +401,20 @@
>> ? ? ? ? ? ? ? ? ? ? ? fail("PromiscuousItemException");
>> ? ? ? ? ? ? ? } catch (PromiscuousItemException pie) {
>> ? ? ? ? ? ? ? }
>> +
>> + ? ? ? ? ? ? T l3 = new T(9999);
>> + ? ? ? ? ? ? list2.push(l3);
>> ? ? ? ? ? ? ? try {
>> ? ? ? ? ? ? ? ? ? ? ? // VirginItemException
>> - ? ? ? ? ? ? ? ? ? ? list2.insertPrev(l2.getPrev(), new T(8888));
>> - ? ? ? ? ? ? ? ? ? ? fail("PromiscuousItemException");
>> + ? ? ? ? ? ? ? ? ? ? l3.setPrev(null); // corrupt it
>> + ? ? ? ? ? ? ? ? ? ? list2.insertPrev(l3, new T(8888));
>> + ? ? ? ? ? ? ? ? ? ? fail("VirginItemException");
>> ? ? ? ? ? ? ? } catch (VirginItemException vie) {
>> ? ? ? ? ? ? ? }
>> ? ? ? ? ? ? ? try {
>> ? ? ? ? ? ? ? ? ? ? ? // VirginItemException
>> - ? ? ? ? ? ? ? ? ? ? list2.insertNext(l2.getNext(), new T(8888));
>> + ? ? ? ? ? ? ? ? ? ? l2.setNext(null); // corrupt it
>> + ? ? ? ? ? ? ? ? ? ? list2.insertNext(l2, new T(8888));
>> ? ? ? ? ? ? ? ? ? ? ? fail("VirginItemException");
>> ? ? ? ? ? ? ? } catch (VirginItemException vie) {
>> ? ? ? ? ? ? ? }
>
> AFAICS you have taken out one valid test and put in a new one. Why not keep
> both?
>

The old test depends on the fact that the "head" and "tail" are not
valid object.
Since this patch remove the head/tail altogether, the old test no longer pass.

Reply via email to