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

Commit 712a1470 authored by David Li's avatar David Li Committed by Gerrit Code Review
Browse files

Merge "Revert "RootCanal: Fix clang-tidy warnings""

parents dba71e34 6e4f16af
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -18,18 +18,13 @@ cc_defaults {
    tidy: true,
    tidy_checks: [
        "-*",
        "readability-*",
	"-readability-function-size",
        "-readability-identifier-length",
        "-readability-implicit-bool-conversion",
        "-readability-magic-numbers",
        "-readability-use-anyofallof",
        "readability-inconsistent-declaration-parameter-name",
    ],
    tidy_checks_as_errors: [
        "readability-*",
        "readability-inconsistent-declaration-parameter-name",
    ],
    tidy_flags: [
        "--header-filter=^.*tools\\/rootcanal\\/(model|include|net|desktop)\\/(.(?!\\.pb\\.h))*$",
        "--header-filter=^((?!BluetoothGeneratedPackets_h|RootCanalGeneratedPackets_h|RootCanalBrEdrBBGeneratedPackets_h).)*$",
    ],
    defaults: [
        "fluoride_common_options",
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ int main(int argc, char** argv) {
  for (int arg = 0; arg < argc; arg++) {
    int port = (int)strtol(argv[arg], nullptr, 0);
    LOG_INFO("%d: %s (%d)", arg, argv[arg], port);
    if (port < 0 || port > UINT16_MAX) {
    if (port < 0 || port > 0xffff) {
      LOG_WARN("%s out of range", argv[arg]);
    } else {
      switch (arg) {
+5 −7
Original line number Diff line number Diff line
@@ -156,9 +156,7 @@ void TestEnvironment::SetUpLinkLayerServer() {
std::shared_ptr<Device> TestEnvironment::ConnectToRemoteServer(
    const std::string& server, int port, Phy::Type phy_type) {
  auto socket = connector_->ConnectToRemoteServer(server, port);
  if (!socket->Connected()) {
    return nullptr;
  }
  if (!socket->Connected()) return nullptr;
  return LinkLayerSocketDevice::Create(socket, phy_type);
}

@@ -170,14 +168,14 @@ void TestEnvironment::SetUpTestChannel() {
        server->StartListening();
        if (test_channel_open_) {
          LOG_WARN("Only one connection at a time is supported");
          rootcanal::TestChannelTransport::SendResponse(
              conn_fd, "The connection is broken");
          test_channel_transport_.SendResponse(conn_fd,
                                               "The connection is broken");
          return false;
        }
        test_channel_open_ = true;
        test_channel_.RegisterSendResponse(
            [conn_fd](const std::string& response) {
              rootcanal::TestChannelTransport::SendResponse(conn_fd, response);
            [this, conn_fd](const std::string& response) {
              test_channel_transport_.SendResponse(conn_fd, response);
            });

        conn_fd->WatchForNonBlockingRead([this](AsyncDataChannel* conn_fd) {
+1 −3
Original line number Diff line number Diff line
@@ -51,9 +51,7 @@ class AddressWithType final {
  /* Is this an Resolvable Private Address, that was generated from given irk ?
   */
  bool IsRpaThatMatchesIrk(const rootcanal::crypto::Octet16& irk) const {
    if (!IsRpa()) {
      return false;
    }
    if (!IsRpa()) return false;

    /* use the 3 MSB of bd address as prand */
    uint8_t prand[3];
+6 −4
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

#pragma once

#include <algorithm>
#include <cstdint>

#include "hci/hci_packets.h"
@@ -44,9 +43,12 @@ class ConnectedIsochronousGroup {
  virtual ~ConnectedIsochronousGroup() = default;

  bool HasConnectedStream() const {
    return std::any_of(
        streams_.begin(), streams_.end(),
        [&](const ConnectedIsochronousStream& s) { return s.IsConnected(); });
    for (auto& stream : streams_) {
      if (stream.IsConnected()) {
        return true;
      }
    }
    return false;
  }

  bool StreamIsConnected(uint16_t handle) const {
Loading