Commit 0bc07cd0 authored by akwizgran's avatar akwizgran

Rename message length method.

parent cb302695
......@@ -50,7 +50,7 @@ public class Message {
/**
* Returns the length of the raw message in bytes.
*/
public int getLength() {
public int getRawLength() {
return raw.length;
}
......
......@@ -741,7 +741,7 @@ abstract class JdbcDatabase implements Database<Connection> {
boolean offered = removeOfferedMessage(txn, c, m.getId());
boolean seen = offered || (sender != null && c.equals(sender));
addStatus(txn, m.getId(), c, m.getGroupId(), m.getTimestamp(),
m.getLength(), state, e.getValue(), messageShared,
m.getRawLength(), state, e.getValue(), messageShared,
false, seen);
}
// Update denormalised column in messageDependencies if dependency
......
......@@ -355,11 +355,11 @@ public abstract class JdbcDatabaseTest extends BrambleTestCase {
// The message is sendable, but too large to send
Collection<MessageId> ids = db.getMessagesToSend(txn, contactId,
message.getLength() - 1);
message.getRawLength() - 1);
assertTrue(ids.isEmpty());
// The message is just the right size to send
ids = db.getMessagesToSend(txn, contactId, message.getLength());
ids = db.getMessagesToSend(txn, contactId, message.getRawLength());
assertEquals(singletonList(messageId), ids);
db.commitTransaction(txn);
......
......@@ -169,7 +169,7 @@ public class SyncIntegrationTest extends BrambleTestCase {
assertArrayEquals(m1.getGroupId().getBytes(),
m2.getGroupId().getBytes());
assertEquals(m1.getTimestamp(), m2.getTimestamp());
assertEquals(m1.getLength(), m2.getLength());
assertEquals(m1.getRawLength(), m2.getRawLength());
assertArrayEquals(m1.getRaw(), m2.getRaw());
}
}
......@@ -60,7 +60,7 @@ public class MessageSizeIntegrationTest extends BriarTestCase {
PrivateMessage message = privateMessageFactory.createPrivateMessage(
groupId, timestamp, body);
// Check the size of the serialised message
int length = message.getMessage().getLength();
int length = message.getMessage().getRawLength();
assertTrue(length > UniqueId.LENGTH + 8
+ MAX_PRIVATE_MESSAGE_BODY_LENGTH);
assertTrue(length <= MAX_RECORD_PAYLOAD_BYTES);
......@@ -83,7 +83,7 @@ public class MessageSizeIntegrationTest extends BriarTestCase {
ForumPost post = forumPostFactory.createPost(groupId,
timestamp, parent, author, body);
// Check the size of the serialised message
int length = post.getMessage().getLength();
int length = post.getMessage().getRawLength();
assertTrue(length > UniqueId.LENGTH + 8 + UniqueId.LENGTH + 4
+ MAX_AUTHOR_NAME_LENGTH + MAX_PUBLIC_KEY_LENGTH
+ MAX_FORUM_POST_BODY_LENGTH);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment