summaryrefslogtreecommitdiff
path: root/logd/SerializedLogChunkTest.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2020-07-13 17:28:30 -0700
committerTom Cherry <tomcherry@google.com>2020-07-13 17:29:55 -0700
commit44e1a5d59c216e9f716965cf8e355ee82de8599c (patch)
tree958bb5be3f966e48115f41feaf3ca29636d3ed2d /logd/SerializedLogChunkTest.cpp
parentaa64d3b23fdcf22e6955154fd8524a301f19bc18 (diff)
logd: update SerializedLogChunk for new prune calcuations
A previous change included sizeof(SerializedLogChunk) to the size of a log chunk to more accurately track logd's log usage, but did not update the tests that check this value, so this change updates them appropriately. Bug: 161179582 Test: logd-unit-tests Change-Id: Ic37f07fff98c260dcf39b7cc79504c1c3fc2149d
Diffstat (limited to 'logd/SerializedLogChunkTest.cpp')
-rw-r--r--logd/SerializedLogChunkTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/logd/SerializedLogChunkTest.cpp b/logd/SerializedLogChunkTest.cpp
index 657250335..2b478a3fb 100644
--- a/logd/SerializedLogChunkTest.cpp
+++ b/logd/SerializedLogChunkTest.cpp
@@ -27,7 +27,7 @@ using android::base::StringPrintf;
TEST(SerializedLogChunk, smoke) {
size_t chunk_size = 10 * 4096;
auto chunk = SerializedLogChunk{chunk_size};
- EXPECT_EQ(chunk_size, chunk.PruneSize());
+ EXPECT_EQ(chunk_size + sizeof(SerializedLogChunk), chunk.PruneSize());
static const char log_message[] = "log message";
size_t expected_total_len = sizeof(SerializedLogEntry) + sizeof(log_message);
@@ -58,7 +58,7 @@ TEST(SerializedLogChunk, fill_log_exactly) {
size_t individual_message_size = sizeof(SerializedLogEntry) + sizeof(log_message);
size_t chunk_size = individual_message_size * 3;
auto chunk = SerializedLogChunk{chunk_size};
- EXPECT_EQ(chunk_size, chunk.PruneSize());
+ EXPECT_EQ(chunk_size + sizeof(SerializedLogChunk), chunk.PruneSize());
ASSERT_TRUE(chunk.CanLog(individual_message_size));
EXPECT_NE(nullptr, chunk.Log(1, log_time(), 1000, 1, 1, log_message, sizeof(log_message)));