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

Commit a09b2ec5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "dumpsys: Use supported printf flag %ll over %L"

parents 54a066e8 8482ed49
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1354,7 +1354,7 @@ void DumpsysNeighbor(int fd) {
  LOG_DUMPSYS(fd, "Last %zu inquiry scans:", copy.size());
  for (const auto& it : copy) {
    LOG_DUMPSYS(fd,
                "  %s - %s duration_ms:%-5Lu num_resp:%-2u"
                "  %s - %s duration_ms:%-5llu num_resp:%-2u"
                " std:%-2u rssi:%-2u ext:%-2u %12s",
                EpochMillisToString(it.entry.start_time_ms).c_str(),
                EpochMillisToString(it.timestamp).c_str(),
+23 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <fcntl.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <unistd.h>

#include <cstddef>
#include <cstdio>
@@ -782,5 +783,26 @@ TEST_F(MainShimTest, ticks_to_seconds) {

TEST_F(MainShimTest, DumpConnectionHistory) {
  auto acl = MakeAcl();
  acl->DumpConnectionHistory(1);
  acl->DumpConnectionHistory(STDOUT_FILENO);
}

void DumpsysNeighbor(int fd);
TEST_F(MainShimTest, DumpsysNeighbor) {
  btm_cb.neighbor = {};

  btm_cb.neighbor.inquiry_history_->Push({
      .status = tBTM_INQUIRY_CMPL::CANCELED,
      .num_resp = 45,
      .resp_type = {20, 30, 40},
      .start_time_ms = 0,
  });

  btm_cb.neighbor.inquiry_history_->Push({
      .status = tBTM_INQUIRY_CMPL::CANCELED,
      .num_resp = 123,
      .resp_type = {50, 60, 70},
      .start_time_ms = -1,
  });

  DumpsysNeighbor(STDOUT_FILENO);
}