Kad unit tests:

- Port KBSTest from i2p.zzz.kademlia branch
  - Fix RandomTrimmer so it always returns true, so it may be used
    as the trimmer in the unit tests
This commit is contained in:
zzz
2013-11-24 23:39:47 +00:00
parent 1d7eedd463
commit 8699c82614
2 changed files with 128 additions and 10 deletions

View File

@@ -26,6 +26,7 @@ public class RandomTrimmer<T extends SimpleDataStructure> implements KBucketTrim
if (sz < _max)
return true;
T toRemove = e.get(_ctx.random().nextInt(sz));
return kbucket.remove(toRemove);
kbucket.remove(toRemove);
return true;
}
}