Unit tests for ConnectionWindowImpl.

This commit is contained in:
akwizgran
2011-08-11 13:37:18 +01:00
parent e0b86f1232
commit ac4521152f
4 changed files with 84 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ class ConnectionWindowImpl implements ConnectionWindow {
public void setSeen(long connectionNumber) {
int offset = getOffset(connectionNumber);
int mask = 0x80000000 >>> offset;
if((bitmap & mask) != 0) throw new IllegalArgumentException();
bitmap |= mask;
// If the new connection number is above the centre, slide the window
if(connectionNumber >= centre) {

View File

@@ -1,7 +1,6 @@
package net.sf.briar.transport;
import net.sf.briar.api.transport.ConnectionWindowFactory;
import net.sf.briar.api.transport.PacketWriter;
import com.google.inject.AbstractModule;