Changeset 1d7eedd


Ignore:
Timestamp:
Nov 24, 2013 9:58:42 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
8699c82
Parents:
796a231
Message:

Kad unit tests:

  • Move KBucketSetTest to new directory
  • Fix testSelf() as new implementation will never include myself
  • Delete KBucketImplTest, not applicable/useful now Next todo: port KBSTest from i2p.zzz.kademlia branch
Files:
1 deleted
1 moved

Legend:

Unmodified
Added
Removed
  • core/java/test/junit/net/i2p/kademlia/KBucketSetTest.java

    r796a231 r1d7eedd  
    1 package net.i2p.router.networkdb.kademlia;
     1package net.i2p.kademlia;
    22/*
    33 * free (adj.): unencumbered; not under the control of others
     
    2121public class KBucketSetTest extends TestCase{
    2222        private I2PAppContext context;
    23     private KBucketSet set;
     23        private KBucketSet<Hash> set;
     24        private static final int K = 8;
     25        private static final int B = 1;
    2426       
    2527        public void setUp(){
    2628                context = I2PAppContext.getGlobalContext();
    27         set = new KBucketSet(context, Hash.FAKE_HASH);
     29                set = new KBucketSet<Hash>(context, Hash.FAKE_HASH, K, B);
    2830        }
    2931       
     
    3739   
    3840    public void testSelf() {
    39         assertTrue(set.add(Hash.FAKE_HASH));
     41        // new implementation will never include myself
     42        assertFalse(set.add(Hash.FAKE_HASH));
    4043    }
    4144}
Note: See TracChangeset for help on using the changeset viewer.