mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Use longs to represent session capacity.
This commit is contained in:
@@ -350,7 +350,7 @@ public abstract class JdbcDatabaseTest extends BrambleTestCase {
|
||||
// The message is sendable, but too large to send
|
||||
assertOneMessageToSendLazily(db, txn);
|
||||
assertOneMessageToSendEagerly(db, txn);
|
||||
int capacity = RECORD_HEADER_BYTES + message.getRawLength() - 1;
|
||||
long capacity = RECORD_HEADER_BYTES + message.getRawLength() - 1;
|
||||
Collection<MessageId> ids =
|
||||
db.getMessagesToSend(txn, contactId, capacity, MAX_LATENCY);
|
||||
assertTrue(ids.isEmpty());
|
||||
|
||||
@@ -61,7 +61,7 @@ public class MailboxOutgoingSessionTest extends BrambleMockTestCase {
|
||||
Transaction noAckIdTxn = new Transaction(null, true);
|
||||
Transaction noMsgIdTxn = new Transaction(null, true);
|
||||
|
||||
int capacityForMessages = MAX_FILE_PAYLOAD_BYTES - versionRecordBytes;
|
||||
long capacityForMessages = MAX_FILE_PAYLOAD_BYTES - versionRecordBytes;
|
||||
|
||||
context.checking(new DbExpectations() {{
|
||||
// Add listener
|
||||
@@ -107,7 +107,7 @@ public class MailboxOutgoingSessionTest extends BrambleMockTestCase {
|
||||
Transaction msgTxn = new Transaction(null, true);
|
||||
|
||||
int ackRecordBytes = RECORD_HEADER_BYTES + MessageId.LENGTH;
|
||||
int capacityForMessages =
|
||||
long capacityForMessages =
|
||||
MAX_FILE_PAYLOAD_BYTES - versionRecordBytes - ackRecordBytes;
|
||||
|
||||
context.checking(new DbExpectations() {{
|
||||
@@ -164,7 +164,7 @@ public class MailboxOutgoingSessionTest extends BrambleMockTestCase {
|
||||
public void testAllCapacityUsedByAcks() throws Exception {
|
||||
// The file has enough capacity for a max-size ack record, another
|
||||
// ack record with one message ID, and a few bytes left over
|
||||
int capacity = RECORD_HEADER_BYTES + MessageId.LENGTH * MAX_MESSAGE_IDS
|
||||
long capacity = RECORD_HEADER_BYTES + MessageId.LENGTH * MAX_MESSAGE_IDS
|
||||
+ RECORD_HEADER_BYTES + MessageId.LENGTH + MessageId.LENGTH - 1;
|
||||
|
||||
MailboxOutgoingSession session = new MailboxOutgoingSession(db,
|
||||
|
||||
Reference in New Issue
Block a user