Lines Matching refs:chunk

29     auto chunk = SerializedLogChunk{chunk_size};  in TEST()
30 EXPECT_EQ(chunk_size + sizeof(SerializedLogChunk), chunk.PruneSize()); in TEST()
34 ASSERT_TRUE(chunk.CanLog(expected_total_len)); in TEST()
35 EXPECT_TRUE(chunk.CanLog(chunk_size)); in TEST()
36 EXPECT_FALSE(chunk.CanLog(chunk_size + 1)); in TEST()
39 auto* entry = chunk.Log(1234, time, 0, 1, 2, log_message, sizeof(log_message)); in TEST()
51 EXPECT_FALSE(chunk.CanLog(chunk_size)); in TEST()
52 EXPECT_EQ(static_cast<int>(expected_total_len), chunk.write_offset()); in TEST()
53 EXPECT_EQ(1234U, chunk.highest_sequence_number()); in TEST()
60 auto chunk = SerializedLogChunk{chunk_size}; in TEST()
61 EXPECT_EQ(chunk_size + sizeof(SerializedLogChunk), chunk.PruneSize()); in TEST()
63 ASSERT_TRUE(chunk.CanLog(individual_message_size)); in TEST()
64 EXPECT_NE(nullptr, chunk.Log(1, log_time(), 1000, 1, 1, log_message, sizeof(log_message))); in TEST()
66 ASSERT_TRUE(chunk.CanLog(individual_message_size)); in TEST()
67 EXPECT_NE(nullptr, chunk.Log(2, log_time(), 1000, 2, 1, log_message, sizeof(log_message))); in TEST()
69 ASSERT_TRUE(chunk.CanLog(individual_message_size)); in TEST()
70 EXPECT_NE(nullptr, chunk.Log(3, log_time(), 1000, 3, 1, log_message, sizeof(log_message))); in TEST()
72 EXPECT_FALSE(chunk.CanLog(1)); in TEST()
77 auto chunk = SerializedLogChunk{chunk_size}; in TEST()
79 chunk.Log(2, log_time(0x1234, 0x5678), 0x111, 0x222, 0x333, "initial message", in TEST()
81 chunk.Log(3, log_time(0x2345, 0x6789), 0x444, 0x555, 0x666, "second message", in TEST()
85 chunk.Log(uint64_t_max, log_time(uint32_t_max, uint32_t_max), uint32_t_max, uint32_t_max, in TEST()
104 EXPECT_EQ(static_cast<uint8_t>(expected_buffer_data[i]), chunk.data()[i]) in TEST()
107 EXPECT_EQ(0, chunk.data()[i]) << "position: " << i; in TEST()
115 auto chunk = SerializedLogChunk{chunk_size}; in TEST()
116 EXPECT_DEATH({ chunk.DecReaderRefCount(); }, ""); in TEST()
122 auto chunk = SerializedLogChunk{chunk_size}; in TEST()
123 chunk.IncReaderRefCount(); in TEST()
124 EXPECT_DEATH({ chunk.ClearUidLogs(1000, LOG_ID_MAIN, nullptr); }, ""); in TEST()
125 chunk.DecReaderRefCount(); in TEST()
168 auto write = [](SerializedLogChunk& chunk) { in TEST_P() argument
169 chunk.Log(1, log_time(), kOtherUid, 1, 2, msg, sizeof(msg)); in TEST_P()
172 auto check = [](SerializedLogChunk& chunk) { in TEST_P() argument
173 auto* entry = chunk.log_entry(0); in TEST_P()
183 auto write = [](SerializedLogChunk& chunk) { in TEST_P() argument
184 chunk.Log(1, log_time(), kUidToClear, 1, 2, msg, sizeof(msg)); in TEST_P()
194 auto write = [](SerializedLogChunk& chunk) { in TEST_P() argument
195 chunk.Log(2, log_time(), kUidToClear, 1, 2, msg, sizeof(msg)); in TEST_P()
196 chunk.Log(3, log_time(), kUidToClear, 1, 2, msg, sizeof(msg)); in TEST_P()
197 chunk.Log(4, log_time(), kUidToClear, 1, 2, msg, sizeof(msg)); in TEST_P()
227 auto write = [](SerializedLogChunk& chunk) { in TEST_P() argument
228 ASSERT_NE(nullptr, chunk.Log(1, log_time(), kUidToClear, 1, 2, msg1, sizeof(msg1))); in TEST_P()
229 ASSERT_NE(nullptr, chunk.Log(2, log_time(), kOtherUid, 1, 2, msg2, sizeof(msg2))); in TEST_P()
230 ASSERT_NE(nullptr, chunk.Log(3, log_time(), kUidToClear, 1, 2, msg3, sizeof(msg3))); in TEST_P()
231 ASSERT_NE(nullptr, chunk.Log(4, log_time(), kUidToClear, 1, 2, msg4, sizeof(msg4))); in TEST_P()
232 ASSERT_NE(nullptr, chunk.Log(5, log_time(), kOtherUid, 1, 2, msg5, sizeof(msg5))); in TEST_P()
233 ASSERT_NE(nullptr, chunk.Log(6, log_time(), kOtherUid, 1, 2, msg6, sizeof(msg6))); in TEST_P()
234 ASSERT_NE(nullptr, chunk.Log(7, log_time(), kUidToClear, 1, 2, msg7, sizeof(msg7))); in TEST_P()
237 auto check = [](SerializedLogChunk& chunk) { in TEST_P() argument
239 auto* entry = chunk.log_entry(read_offset); in TEST_P()
243 entry = chunk.log_entry(read_offset); in TEST_P()
247 entry = chunk.log_entry(read_offset); in TEST_P()
248 EXPECT_STREQ(msg6, entry->msg()) << MakePrintable(chunk.data(), chunk.write_offset()); in TEST_P()
251 EXPECT_EQ(static_cast<int>(read_offset), chunk.write_offset()); in TEST_P()
262 auto write = [](SerializedLogChunk& chunk) { in TEST_P() argument
263 ASSERT_NE(nullptr, chunk.Log(1, log_time(), kOtherUid, 1, 2, msg1, sizeof(msg1))); in TEST_P()
264 ASSERT_NE(nullptr, chunk.Log(2, log_time(), kUidToClear, 1, 2, msg2, sizeof(msg2))); in TEST_P()
265 ASSERT_NE(nullptr, chunk.Log(3, log_time(), kOtherUid, 1, 2, msg3, sizeof(msg3))); in TEST_P()
268 auto check = [](SerializedLogChunk& chunk) { in TEST_P() argument
270 auto* entry = chunk.log_entry(read_offset); in TEST_P()
274 entry = chunk.log_entry(read_offset); in TEST_P()
278 EXPECT_EQ(static_cast<int>(read_offset), chunk.write_offset()); in TEST_P()