Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 340afd38 authored by Tom Cherry's avatar Tom Cherry
Browse files

logd: fix bad test assumptions

SerializedLogChunk.three_logs assumes that log buffers are
zero-initialized, but they are not.  This causes test failures on
host.

Test: this test passes
Change-Id: I0dfa282bdc36eaa4e8e39d85c5227f717b45ec2a
parent 1bacb2c3
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -99,13 +99,9 @@ TEST(SerializedLogChunk, three_logs) {
            "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"                  // Timestamp
            "\x0C\x00last message";                             // msg_len + message

    for (size_t i = 0; i < chunk_size; ++i) {
        if (i < sizeof(expected_buffer_data)) {
    for (size_t i = 0; i < sizeof(expected_buffer_data); ++i) {
        EXPECT_EQ(static_cast<uint8_t>(expected_buffer_data[i]), chunk.data()[i])
                << "position: " << i;
        } else {
            EXPECT_EQ(0, chunk.data()[i]) << "position: " << i;
        }
    }
}